Files
psxrecomp/runtime/include/dma.h
T
Matthew Stanley 70e7e7aea2 fix: enable DMA completion IRQ + DICR byte access + 5 VBlank seeds
Root cause of VSync counter stuck at 0: DMA completion IRQs were
deliberately suppressed in dma.c, preventing the shell's chain-E004
handler (func_1FC40628) from ever seeing I_STAT bit 3.  The handler
gates all VBlank callback processing on DMA interrupt presence.

Changes:
- dma.c: directly assert i_stat bit 3 on DMA ch2/ch6 completion
  (bypass DICR edge detection which gets stuck because the shell
  handler only acknowledges ch3 in DICR, not ch2/ch6)
- dma.c: expose dma_get_dicr()/dma_get_dpcr() for debug server
- memory.c: add DMA register range (0x1F801080-0x1F8010FF) to
  mmio_read8/write8/read16/write16 — fixes crash on DICR byte read
- debug_server.c: add DPCR/DICR to irq_state command
- seeds: add 0xBFC42BA0 (shell_vblank_dispatch), 0xBFC38AF0 (shell
  hot function, 178 misses), 0xBFC137D0 (kernel RAM), 0xBFC42BE0
  (shell_vblank_process), 0xBFC4226C (mid-function callback loop)
- regen: 1051 dispatch entries (was 1046)

Verified: chain-E004 handler + verify now dispatch.  VSync counter
still 0 because the VBlank callback loop inside func_1FC42160 is
gated by an init-done flag and the mid-function entry mechanism is
not yet resolved.  New EvCB crash at BFC12A84 exposed by DMA IRQ —
next session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-21 20:06:15 -07:00

37 lines
798 B
C

/* dma.h — PS1 DMA controller simulation (Phase 3).
*
* 7 DMA channels:
* Ch0: MDEC in 0x1F801080
* Ch1: MDEC out 0x1F801090
* Ch2: GPU 0x1F8010A0
* Ch3: CDROM 0x1F8010B0
* Ch4: SPU 0x1F8010C0
* Ch5: PIO 0x1F8010D0
* Ch6: OTC 0x1F8010E0
*
* Global:
* DPCR: 0x1F8010F0 (DMA control — enable bits per channel)
* DICR: 0x1F8010F4 (DMA interrupt control)
*/
#ifndef PSXRECOMP_V4_DMA_H
#define PSXRECOMP_V4_DMA_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
void dma_init(void);
uint32_t dma_read(uint32_t addr);
void dma_write(uint32_t addr, uint32_t val);
uint32_t dma_get_dicr(void);
uint32_t dma_get_dpcr(void);
#ifdef __cplusplus
}
#endif
#endif /* PSXRECOMP_V4_DMA_H */