Repository navigation
PSX3DS v0.2.4 — Fix 480i VSync(0) Logo Freeze, FMV MDEC DMA1 Pacing & 3DS HOME->Close Hang
PSX3DS v0.2.4 — Fix 480i Interlaced VSync(0) Freeze, FMV MDEC DMA1 Pacing, PICA200 TexPage Wrap/Readback Stripes, and 3DS HOME -> Close Hang
v0.2.4 fixes real-hardware issues reported on New 3DS XL (SCPH5500.BIN + World Soccer Jikkyou Winning Eleven 3 - Final Ver. SLPM_861.62): freezing on the 480i interlaced logo screen (VSync(0)), FMV MDEC_in_sync timeout stalls, PICA200 hardware-backend right-column texture stripes on tp_x = 960 8bpp pages, and hanging on "Closing software..." when closing the emulator from the 3DS HOME Menu.
English Release Notes
1. Fix 480i Interlaced GPUSTAT Bit 31 / Bit 13 Freeze in Psy-Q VSync(0) (src/gpu/gpu.c, src/core/timers.c)
- Root Cause:
sys->gpu.framewas incremented twice per frame — once ingpu_on_vblank()at scanline 240 and a second time intimers_hblank_cb()at scanline 0 — leaving(gpu.frame & 1)permanently even (0) during active video (!in_vblank) while VBlank cleared bit 31 to0. Consequently, in 480i interlaced mode (GP1(0x08)bit 22 + bit 19),GPUSTATbit 31 never toggled, hanging Sony Psy-QVSync(0)forever after initial logo mode switches (e.g. Winning Eleven 3 around frame 560). - Fix:
sys->gpu.framenow increments strictly once per frame ingpu_on_vblank(), andgpu_refresh_scanline_bits()latches the new field parity intoGPUSTATbits 13 & 31 beforeIRQ0(IRQ_VBLANK) is raised. Also removed duplicatesys->stats.frames++from the standalonetimers_vblank_default_cbfallback.
2. Fix FMV MDEC_in_sync timeout When DecDCTout (DMA1) Is Armed Before DecDCTin (DMA0) (src/core/dma.c, src/periph/mdec.c)
- Root Cause: Standard Psy-Q FMV pipelines call
DecDCTout()(DMA1,SyncMode 1) beforeDecDCTin()(DMA0). Previously,DMA1executed immediately against an empty MDEC Data-Out FIFO (writing zeros into slice 0 and stranding the final decoded slice withMDEC_STATbit 29Command Busy = 1), causing the next frame'sDecDCTinSync(0)to spin out withMDEC_in_sync timeout. - Fix:
DMA1(PSX_DMA_CH_MDEC_OUT,SyncMode 1) now stays armed untilmdec_dma_out_blocks_ready()reports decoded blocks available, transfers only decoded blocks, and wakes immediately viadma_request_wakeup()when MDEC produces output.MDEC_STATbit 29 (Command Busy) clears cleanly once decoding finishes andDMA1is idle.
3. Fix PICA200 citro3d Right-Column Stripes (tp_x = 960 Wrap & Dirty-Cell Readback/Upload Coherence) (src/gpu_hw/gpu_citro3d.c, src/gpu_hw/gpu_texcache.c, src/gpu_hw/gpu_morton.c)
- Root Cause: On 8bpp texture pages at
tp_x = 960(128words wide),960 + 128 = 1088wrapped ontoX = 0..63(the active framebuffer), triggeringhw_sync_to_shadow(960, 0, 128, 256)on every frame and copying back non-dirty cells atX = 960..1023whose opaqueRGBA5551upload had forced PSX bit 15 (0x8000) to1— adding+128to every odd 8bpp texel column. - Fix: Clamped
TexPagecoherence/invalidation width atX = 1023(gpu_texpage_coherence_width()), restrictedhw_sync_to_shadowto GPU-dirty16x16cells only (gpu_morton_readback_cells), replaced bounding-box CPU uploads with exact8x8dirty-tile runs (gpu_morton_upload_tiles), and addedsync_cells_around_rect()on partial CPU overwrites (gpu_tex_hit_pctimproved to99.8%with zero stripes).
4. Fix 3DS HOME Menu -> "Close" Console Hang (src/gpu_hw/gpu_citro3d.c, src/platform/3ds/threads_3ds.c)
- Root Cause:
- Pressing HOME triggers
citro3d'sAPTHOOK_ONSUSPENDcallback, disabling GSP VBlank callbacks and releasing GPU rights to the Home Menu. Tapping Close sendsAPTCMD_EXITwithoutAPTHOOK_ONRESTORE, so callingC3D_FrameEnd(0)/C3D_FrameSync()unconditionally inhw_destroy()deadlocked forever insidegspWaitForAnyEvent(). spu_core1_workerran on Core 1 (SysCore, shared with Horizon OS Home Menu/APT/GSP/DSP applets) atmain_prio - 1(0x2F, higher priority than main0x30), and worker threads were not parked during APT suspend/sleep/exit transitions.
- Pressing HOME triggers
- Fix:
gpu_citro3dregistershw_apt_hook(called beforecitro3d's own hook) to cleanly flush andC3D_FrameEnd(0)any open frame onAPTHOOK_ONSUSPEND, and guardshw_present()/hw_destroy()behindaptIsActive() && !aptShouldClose().spu_core1_workeron Core 1 (SysCore) now runs cooperatively atmain_prio + 1(0x31), andthreads_apt_hookparks both Core 1 (SPU) and Core 2 (CD readahead) workers in 10 ms sleeps without touching NDSP, DSP cache, or SDMC acrossAPTHOOK_ONSUSPEND/ONSLEEP/ONEXIT.
中文更新说明 (v0.2.4)
- 修复 480i 隔行扫描模式下卡在 Logo 画面的问题(如《实况足球 3 最终版》):
- 修复了
sys->gpu.frame在每帧 VBlank 起点(扫描线 240)和扫描线 0 被重复递增两次的 Bug。现在场奇偶计数每帧严格递增一次,且在触发IRQ_VBLANK前预先锁存GPUSTAT第 13/31 位奇偶场标志,使 Psy-QVSync(0)正常翻转退出,顺利通过 480i JFA/Konami Logo 进入片头 FMV 动画与标题菜单。
- 修复了
- 修复片头 FMV 视频播放期间
MDEC_in_sync timeout卡顿:- 当游戏按 Psy-Q 惯例先挂载
DecDCTout(DMA1,SyncMode 1)再启动DecDCTin(DMA0)时,DMA1现会等待 MDEC 输出 FIFO 产生解码宏块后再由dma_request_wakeup()唤醒搬运,彻底消除空读全零切片与MDEC_in_sync timeout超时。
- 当游戏按 Psy-Q 惯例先挂载
- 修复 PICA200 硬件渲染器在
tp_x = 9608bpp 纹理页上的右侧竖条纹花屏:- 限制纹理页一致性检测宽度不跨过
X = 1023回绕至主帧缓冲,将 VRAM 回读严格限定于 GPU 脏16x16区块,并将 CPU 上传改为精确8x8脏瓦片区间提交,标题画面全部 368 列完整清晰无条纹(纹理缓存命中率提升至99.8%)。
- 限制纹理页一致性检测宽度不跨过
- 修复按下 3DS HOME 键在主界面关闭软件时卡在“正在关闭软件…”的死锁:
gpu_citro3d新增APTHOOK_ONSUSPEND钩子在挂起前提交未闭合帧,并在!aptIsActive() || aptShouldClose()时跳过C3D_FrameBegin/C3D_FrameEnd/C3D_FrameSync,避免在失去 GSP 权限后永久阻塞于gspWaitForAnyEvent()。- Core 1(
SysCore)上的 SPU 音频线程优先级调整为协作式main_prio + 1,并在 HOME 挂起/休眠/退出期间自动挂起双核工作线程(不触碰 NDSP / DSP 缓存 / SD 卡),确保退回主界面与关闭游戏秒退不卡死。