Nugget
Bare-metal libraries and examples for the original PlayStation
Loading...
Searching...
No Matches
Functions | Variables
genjob Namespace Reference

Functions

 build (arm)
 

Variables

list STD
 
dict RESET_MODE = {'R1': 1, 'R2': 2, 'R3': 3, 'R4': 4}
 
str JOB_FILE = 'mdec-in.bin'
 
int ARM_FIELD = 12
 
int OUT_BYTES = 16 * 16 * 3
 
int MAX_RL_WORDS = 4096
 
 ARMS = frozenset(.split())
 
 blob = open(sys.argv[2], 'rb').read()
 
 ver
 
 payload
 
 capArm = blob[8:8 + ARM_FIELD].rstrip(b'\0').decode('ascii', 'replace')
 
 emu
 
 mdec
 
 biosSum
 
 jobSum
 
 biosId = blob[24 + ARM_FIELD:56 + ARM_FIELD].decode('ascii', 'replace')
 
 zeroedId = not blob[24 + ARM_FIELD:56 + ARM_FIELD].strip(b'\0')
 
 arm = sys.argv[1]
 
dict reset = RESET_MODE.get(arm, 0)
 
 upload
 
 st
 
 rl
 
 quant
 

Detailed Description

Emit mdec-in.bin, the job file the MDEC roundtrip rig reads over pcdrv.

The job used to be baked into the executable as a generated job.h. That started
as a workaround for PCopen returning -1 on the farm while PCcreat succeeded, and
THAT DIAGNOSIS WAS WRONG: PCDRV is complete and the protocol is fine; the
runner-agent had no references to input_fileset, so assets attached with --asset
were resolved, digest-pinned, shipped and then dropped. Fixed in the farm's
f9d1c4f, and the read half has since been probed from a console.

So the bake is gone and the guest binary no longer changes per arm: one build,
one job file per arm, and selecting an arm stops dirtying the tree. The layout is
documented at the top of mdec-roundtrip.c and the guest validates it.

COEFFICIENTS ARE PER BLOCK. The six blocks are Cr, Cb, Y1, Y2, Y3, Y4 in that
order; Cr and Cb are one low-resolution 8x8 each covering the whole macroblock,
Y1..Y4 are the four 8x8 luma quadrants. So a sweep that wants to compare
quadrants against each other must leave BOTH chroma blocks empty - chroma with
any AC content lands differently on each quadrant and destroys the comparison.
With chroma flat, the four luma quadrants of one capture are four independent
readings of one run, which is what turns an 8-second console run into a sweep.

Function Documentation

◆ build()

genjob.build (   arm)

Variable Documentation

◆ arm

genjob.arm = sys.argv[1]

◆ ARM_FIELD

int genjob.ARM_FIELD = 12

◆ ARMS

genjob.ARMS = frozenset(.split())

◆ biosId

genjob.biosId = blob[24 + ARM_FIELD:56 + ARM_FIELD].decode('ascii', 'replace')

◆ biosSum

genjob.biosSum

◆ blob

str genjob.blob = open(sys.argv[2], 'rb').read()

◆ capArm

genjob.capArm = blob[8:8 + ARM_FIELD].rstrip(b'\0').decode('ascii', 'replace')

◆ emu

genjob.emu

◆ JOB_FILE

str genjob.JOB_FILE = 'mdec-in.bin'

◆ jobSum

genjob.jobSum

◆ MAX_RL_WORDS

int genjob.MAX_RL_WORDS = 4096

◆ mdec

genjob.mdec

◆ OUT_BYTES

int genjob.OUT_BYTES = 16 * 16 * 3

◆ payload

genjob.payload

◆ quant

genjob.quant

◆ reset

dict genjob.reset = RESET_MODE.get(arm, 0)

◆ RESET_MODE

dict genjob.RESET_MODE = {'R1': 1, 'R2': 2, 'R3': 3, 'R4': 4}

◆ rl

genjob.rl

◆ st

genjob.st

◆ STD

list genjob.STD
Initial value:
1= [0x5A82]*8 + [0x7D8A,0x6A6D,0x471C,0x18F8,0xE707,0xB8E3,0x9592,0x8275] \
2 + [0x7641,0x30FB,0xCF04,0x89BE,0x89BE,0xCF04,0x30FB,0x7641] \
3 + [0x6A6D,0xE707,0x8275,0xB8E3,0x471C,0x7D8A,0x18F8,0x9592] \
4 + [0x5A82,0xA57D,0xA57D,0x5A82,0x5A82,0xA57D,0xA57D,0x5A82] \
5 + [0x471C,0x8275,0x18F8,0x6A6D,0x9592,0xE707,0x7D8A,0xB8E3] \
6 + [0x30FB,0x89BE,0x7641,0xCF04,0xCF04,0x7641,0x89BE,0x30FB] \
7 + [0x18F8,0xB8E3,0x6A6D,0x8275,0x7D8A,0x9592,0x471C,0xE707]

◆ upload

genjob.upload ( void  )

◆ ver

genjob.ver

◆ zeroedId

genjob.zeroedId = not blob[24 + ARM_FIELD:56 + ARM_FIELD].strip(b'\0')