PS1DRV

From PS2 Developer wiki
Revision as of 11:15, 18 September 2023 by Kozarovv (talk | contribs) (→‎Config values explanation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

HW Registers[edit | edit source]

PS1 emulation specific registers used by PS1DRV.

PS1DRV 1.1.0[edit | edit source]

Address Name Description
0x1000F240 SIF_CR Sif control register, used by PS1DRV to?
0x1000F300 STAT PS1 GPUSTAT.
0x1000F310 GP0_E2_reg* Store response for GP1 (0x10000002) cmd.
0x1000F320 GP0_E3_reg* Store response for GP1 (0x10000003) cmd.
0x1000F330 GP0_E4_reg* Store response for GP1 (0x10000004) cmd.
0x1000F340 GP0_E5_reg* Store response for GP1 (0x10000005) cmd.
0x1000F380 PGIF PGIF status register.
0x1000F3C0 sfifo Read from here return GP1 command from PS1 GPU fifo, fifo size is 8 words.
0x1000F3E0 gfifo Read from here return GP0 command from PS1 GPU fifo, fifo size is 32 words.

Note: Beside this specific set, PS1DRV use standard VIF/GIF/TIMER/ETC. registers for transfers to GS, and other tasks.
( * ) are made up names.

GP1 commands handling[edit | edit source]

PS1DRV 1.1.0 handle GP1 (0x00,0x01,0x03,0x05-0x08) on software side, while commands 0x02, 0x04, and 0x10 are completely ignored by PS1DRV. This imply some kind of hardware behavior on PGIF side that take care of mentioned CMDs. GP1 parser function is at 0x201D1C, a0 is command from buffer (0x70000060) which is previously read from sfifo.
Function which read GP1 from sfifo is located at 0x204F08, and is set as pgif handler using syscall 114. Function additionally check if command is 0/1, if yes then flag indicating gp0 fifo flush in near future is set. This shorten time where pgif wait for gfifo, and eventually give up since flush is in the plan anyway.

Hardcoded Settings[edit | edit source]

Overview[edit | edit source]

Compatibility flags for PS1DRV, mostly PS1 GPU emulation related.

Config values explanation[edit | edit source]

Name (PS1DRV) Name (Deckard) Description
poly Render Polygon Delay by X multiplier.
sprt Render Rectangle Delay by X multiplier.
mecha Write values to 0x1F402014.
null PARAM_CPU_DELAY GP0 Increased Sync: Makes the emulator spend more time polling the GP0 FIFO directly,

allowing it to respond faster to incoming data. On Deckard model value is added to 0x79E and send as PARAM_CPU_DELAY)

vblank Adds extra scanlines to emulated frame time, making emulated VBLANK interrupts take more time to occur.
hl Delay Command GP0 0xA0 transfer.
pgpu Makes the emulator not do anything until timer 0's counter is equal to or greater than this value plus 4.
special See table below

Special[edit | edit source]

Bit 2 and higher are unavailable/unused in non Deckard models.

Name (Deckard) Hex Bit Description
0x01 0 Skip VRAM->VRAM transfers command, and flush GP0 fifo, if command is not 0x80000000.
0x02 1 When set, "poly" only apply if the polygon is textured.
PARAM_GPU_DMA_WAIT_LIMIT 0x04 2 if set 0x5000 is stored on 0x1CB40420, else 0
PARAM_SPU_DMA_WAIT_LIMIT 0x08 3 Converted to 0x20, and stored at 0x1CB4041C
PARAM_MDEC_DELAY_CYCLE 0x10 4 store 0x3E8 on 0c1CB40400
PARAM_MDEC_DELAY_CYCLE 0x20 5 store 0x12C0 on 0x1CB40400
PARAM_MDEC_DELAY_CYCLE 0x30 4+5 store 0x5DC on 0x1CB40400
PARAM_MDEC_DELAY_CYCLE else store 0x1F4 on 0x1CB40400
PARAM_TIMER_LOAD_DELAY 0x40 6 if set, 0x6 is stored on 1CB40430, else 0
PARAM_MIPS_DCACHE_ON 0x80 7 store 1 on 1CB40440

Mecha[edit | edit source]

Name Hex Description
0x11 Delay every PS1 drive cmd by 79 units
0x12 Allow Stop command even if disc is not valid CD media.
0x14 Delay Getstat command by 79 units
0x17 Some kind of timing for Pause command (70 units), same as 0x1A
0x18 Some kind of timing for ReadS command (400 units)
0x19 Skip seeking status check on cmd Pause
0x1A Some kind of timing for Pause command (70 units), same as 0x17
0x1B Some kind of timing for Pause command (100 units)
0x1C Delay every PS1 drive cmd by 53 units
0x1D Some kind of timing for SeekL/SeekP command (50 units)
0x1E Change speed immediately if cdda is playing during Setmode, and new value differ from old.
0x1F Some kind of timing for Pause command (40 units), combined with 0x1C setting
0xFE Fast CD

Note: Some commands are missing from the list. "Unit" seems to be ms, but this need more work. Generally this table need more work, and should be considered as w.i.p.

PS1DRV 1.1.0[edit | edit source]

From 2.00-2.10 ROMS, latest available for non Deckard models.
Values are decimal, that's how PS2 read them. Also please don't edit game IDs if is written in small letters, etc. This is also how emu search for them.

NTSC-J[edit | edit source]

NTSC-U[edit | edit source]

PAL[edit | edit source]

PS1DRV 1.3.0 (Deckard model)[edit | edit source]

Values from ROM 2.50, so latest available model (TV).
Values are hexdecimal, that's how new PS2 read them. Also please don't edit game IDs if is written in small letters, etc. This is also how emu search for them.

NTSC-J[edit | edit source]

NTSC-U[edit | edit source]

PAL[edit | edit source]