Repository navigation
Releases
PSX3DS v0.2.8 — Smooth Real-3DS Audio Fix (Zero Silence Splices, Core 2 SPU Worker, NDSP Rate Matching & Phase-Locked CD Clock)
PSX3DS v0.2.8 — Smooth Real-3DS Audio Fix (Zero Silence-Padding Splices, Core 2 Dedicated 804 MHz SPU Worker, NDSP Hardware Rate Matching, Phase-Locked CD-ROM Sector Clock & Division-Free Reverb/XA)
v0.2.8 resolves the real New 3DS audio stuttering/choppiness reported on v0.2.7 ("画面流畅, 声音卡顿" — video runs smoothly at 60 FPS and sound plays on real hardware, but audio chopped/stuttered), eliminating all premature silence-padding wavebuf splices, Core 1 SysCore quota freezes, CD-ROM INT1 acknowledge XA drift, dropped SPU_CMD_REG_ADVANCE audio batches, and ~727,000 software divisions/sec on ARM11v6K.
English Release Notes
1. Smooth Real-3DS NDSP Audio Pipeline (src/platform/3ds/audio_ndsp.c, src/platform/3ds/threads_3ds.c, src/platform/3ds/ui_bottom.c)
- Eliminated Premature
active_wbufs <= 1Silence-Padding Splices & Synchronous SPU Drain:- Root Cause: In
v0.2.7,CTR_NDSP_PRIME_FRAMESwas2 x 735(33.3 ms). Wheneverwb[0]retired during Core 0'spacer_wait()frame sleep (active_wbufsdropping from2to1whileavail < 735),audio_pump_locked()hit theactive_wbufs <= 1branch and padded the remaining ~700 frames (~16 ms) of a 735-frame wavebuf with an exponential fade-to-zero ramp (WBinflated to3,610in 3,200 frames of KOF '97 = ~8 silence holes/sec). In addition, atrylockmiss against the SPU worker left part of the emulated frame'sSpuCmdqueue unrendered incmd_ring. - Fix: Removed the
active_wbufs <= 1silence-padding branch so Core 0 submits full 735-frame wavebufs only while NDSP is playing; expanded the NDSP ring to8 x 735frames (133.3 ms) with a3 x 735(50.0 ms) prime (CTR_SPU_HIGH_WATER = 6 x 735 = 100.0 ms,250 msstall watchdog); and addedspu_drain_all_cmds_sync(sys)wheneverqueued < CTR_NDSP_PRIME_FRAMESso 100% of Core-0-emulated audio is rendered intoout_ringbefore checking availability.
- Root Cause: In
- New 3DS Dedicated Core 2 (
804 MHz, Unthrottled AppCore) SPU Worker Placement:- Root Cause: On real New 3DS hardware, Core 1 (
SysCore) is throttled by the Horizon OS Kernel11APT_SetAppCpuTimeLimit(30)quota (4.8 msCPU budget per16.67 mswindow, freezing Core 1 app threads for ~11.2 ms) and shared withdsp::DSP,gsp::Gpu, andfs::USER. Meanwhile, Core 2 is a dedicated804 MHzAppCore with 100% unthrottled CPU time and zero OS services. - Fix: On New 3DS (
hw->is_n3ds),g_spu_workernow runs on Core 2 at priority0x2F(main_prio - 1), whileg_cd_worker(bursty CHD readahead) moves to Core 1 at0x2F/0x30(never0x31, avoiding starvation below the0x30SysCore quota thread), with clean fallback chains for Old 3DS / restricted.3dsxlaunchers.2:HUDnow displaysSPU:C2/SPU:C1/SPU:SYNalongsideCD [CHD]: Core <N>.
- Root Cause: On real New 3DS hardware, Core 1 (
- TeakLite II NDSP Hardware Resampler Rate Matching with Hysteresis:
- Because the
60.00 HzNTSC pacer runs native PS1 (59.8261 Hz,737.13SPU frames/vblank) at44,228 Hz(50.00 HzPAL at44,312 Hz),ndspChnSetRatenow runs at44,228 HzNTSC (44,312 HzPAL) and steers smoothly with hysteresis (44,100/44,228/44,360 HzNTSC;44,180/44,312/44,440 HzPAL) around ~3 queued wavebufs without step-resampling pitch jumps or queue drift.
- Because the
2. Phase-Locked CD-ROM Sector Clock & XA Gap Decay (src/periph/cdrom.c, src/periph/spu.c)
- Zero Guest
INT1Acknowledge Drift on XA / FMV Streams:- Root Cause: At 2x speed, 8 CD sectors (
7video +1XA 37.8 kHz stereo sector) take8 x 225,792 = 1,806,336cycles (2,352.000SPU samples) and produce2,352XA samples.v0.2.7scheduled the next sector after the guest acknowledgedCD_INT1_DATARDY(+t_irq_ack≈15,000cycles/sector), stretching every 8 sectors to~2,490SPU samples and starvingxa_ringevery ~53 ms. - Fix: Added wrap-safe
u32next_sector_cycle+sector_clock_armedphase-locked sector scheduling (cd_schedule_next_sector), schedulingEV_CDROMimmediately onINT1delivery as well as on guest acknowledge so 8 sectors take8 x 225,792 = 1,806,336cycles regardless of guest IRQ latency. Briefxa_ringtransitions now smoothly decaylast_cd_l/r(* 252 / 256toward0) instead of stepping full-scale to0. Covered bytest_cdrom_sector_clock_no_ack_driftandtest_spu_xa_gap_decay.
- Root Cause: At 2x speed, 8 CD sectors (
3. Zero Dropped SPU_CMD_REG_ADVANCE Audio & ARM11v6K Division Elimination (src/periph/spu.c, src/periph/spu_reverb.c, src/periph/spu_xa.c)
- Render Queued
ADVANCEBatches on Drain & Before SPU DMA:spu_drain_all_cmdsnow renders all queuedSPU_CMD_REG_ADVANCEtime intoout_ring(with deferred IRQ9 delivery) instead of discarding up to a full frame (736samples) whenSPUCNTtogglesIRQ9(0x8040) or on savestate, and drainscmd_ringbeforespu_dma_write_wordsoverwrites SPU sample RAM. Covered bytest_spu_drain_renders_queued_advance.
- Eliminated ~727,000 Software Divisions/sec on ARM11v6K:
- Replaced
s64 %inspu_reverb.c(rev_calc_addr+rev_next_pos, called 29 times per 22.05 kHz tick =639,450calls/sec to__aeabi_ldivmod) with single add/subtract wrap-around plus a muted-reverb fast path (vLOUT == 0 && vROUT == 0 && (SPUCNT & 0x00C0) == 0), and replaced per-sample/ 44100inspu_xa.cwith exactUMULLreciprocal multiplication ((p * 1595663134ULL) >> 32for all0 <= p < 44100).
- Replaced
中文更新说明 (v0.2.8)
- 彻底消除 New 3DS 实机声音卡顿/断续(修复
v0.2.7“画面流畅,声音卡顿”):- 移除过早静音拼接并同步排空 SPU 命令队列:修复
v0.2.7在pacer_wait帧间休眠时当活跃缓冲降至 1 块(active_wbufs <= 1)即向 735 帧 wavebuf 强行填充约 700 帧渐隐静音(导致《拳皇 '97》每秒混入约 8 次 16 ms 静音断口、WB虚高膨胀)的问题;现扩展为8 x 735帧(133.3 ms)环形缓冲与3块(50.0 ms)预充水位,播放期间仅提交完整 735 帧音频块,并在低水位时通过spu_drain_all_cmds_sync同步渲染当帧全部 SPU 采样(WB与帧数严格保持~1.0x)。 - New 3DS 独占
Core 2(804 MHz无配额限制核心) 运行 SPU 音频线程:实机上Core 1(SysCore) 受 Horizon OSAPT_SetAppCpuTimeLimit(30)限制(每16.67 ms窗口仅4.8 ms配额、其余约11.2 ms被内核冻结)且与dsp/gsp/fs系统服务共享;现将 New 3DS 的 SPU 渲染线程移至拥有 100% 算力、零系统服务抢占 的独立应用核Core 2(优先级0x2F),并将突发式 CHD 预读线程移至Core 1(优先级0x2F/0x30,避免落入0x31被配额线程饿死)。下屏2:HUD现精确显示SPU:C2与CD [CHD]: Core 1。 - 3DS NDSP 硬件重采样器自适应锁相调速(带迟滞防抖):针对
60.00 HzNTSC 限速器下 PS1 实际采样率(44,228 Hz,PAL 为44,312 Hz),利用 3DS TeakLite II DSP 硬件线性重采样器围绕 3 块缓冲水位平滑微调(±0.3%带迟滞区间),无需跳变重采样即可长期稳态不空载、不溢出。
- 移除过早静音拼接并同步排空 SPU 命令队列:修复
- CD-ROM 锁相扇区时钟与 XA 音频无缝衔接(消除 FMV / XA 周期性断音):
- 修复
v0.2.7在游戏确认CD_INT1_DATARDY后才调度下一扇区导致的累计确认延迟漂移(每 8 扇区多消耗约 138 个采样,每 ~53 ms 抽空一次xa_ring);现改为INT1触发即按精确扇区周期锁相调度(8 个 2x 扇区严格耗时1,806,336周期 =2,352采样),并对扇区间极短间隙做平滑衰减避免爆音。
- 修复
- 零丢帧 SPU 队列排空与 ARM11v6K 零软除法优化:
spu_drain_all_cmds(含切换SPUCNTIRQ9 与 SPU DMA 写入前)现完整渲染队列中的ADVANCE时间片,不再丢弃未渲染音频;- 消除
spu_reverb.c与spu_xa.c在无硬件除法指令的 ARM11v6K 上每秒约 72.7 万次__aeabi_ldivmod/__aeabi_idiv软件除法开销,大幅降低 SPU 混响与 XA 解码 CPU 占用。
PSX3DS v0.2.7 — Real-3DS NDSP Hardware Audio Fix & Winning Eleven 4 Anti-Modchip Fix
PSX3DS v0.2.7 — Real-3DS NDSP Hardware Audio Fix (ndspChnWaveBufClear Stop-Race Re-Arm, Core 0 Exclusive WaveBuf Owner & svcFlushProcessDataCache, Async SPU Readback Coherency) & Winning Eleven 4 Anti-Modchip Fix
v0.2.7 resolves the remaining real New 3DS hardware missing-audio issue reported on v0.2.6 ("1. 还是没声音", while "帧数没问题" confirmed the 60.0 FPS pacer works cleanly on real hardware) and fixes the anti-modchip lockout in World Soccer Jikkyou Winning Eleven 4 (Japan) (SLPM_862.91), verified across The King of Fighters '97, Winning Eleven 3 Final Ver., Winning Eleven 4, and Winning Eleven 2002.
English Release Notes
1. Real-3DS Hardware Audio Fix (src/platform/3ds/audio_ndsp.c, src/platform/3ds/threads_3ds.c, src/platform/3ds/main_3ds.c, src/periph/spu.c)
libctrundspiReadChnState/ndspiUpdateChnStop-Race Fix (ndspChnWaveBufClearRe-Arm & Zero Menu Dummy Buffers):- Root Cause: ELF disassembly of
libctru'sndspiReadChnState(0x001ccf88..0x001cd07c) revealed that when the final wavebuf in NDSP finishes (wavebuf_seq == 0,flags == 0x0100),libctrusetschn->wavebuf_queued_count = 0while leavingchn->playing = 1. Queuing dummy silence buffers in the ROM menu (or draining during BIOS boot) and later callingndspChnWaveBufAddwithoutndspChnWaveBufClearcausedndspiUpdateChn(dirty_playing == 0) to mark wavebufsNDSP_WBUF_PLAYINGwithout restarting the stopped DSP hardware channel or incrementingchn->sync_count, deadlockingg_wbufsinPLAYINGon a stopped DSP channel forever. - Fix:
ctr_audio_initno longer queues silence buffers in the ROM menu;ctr_audio_bind_systemresets the channel cleanly on every game boot; and whenever NDSP drains (active_wbufs == 0) or triggers the150 ms/35 ms-stopped stall watchdog,ndspChnWaveBufClear(CTR_NDSP_CH)is called before pre-priming2 x 735frames (33.3 ms) to bumpchn->sync_countand cleanly restart the DSP channel. When down to the final active wavebuf (active_wbufs <= 1), partial frames smoothly decay toward0instead of letting the DSP channel stop mid-stream.
- Root Cause: ELF disassembly of
- Core 1 Render / Core 0 NDSP Ownership Split & Kernel11
svcFlushProcessDataCache:- Root Cause:
DSP_FlushDataCacheinvokessvcSendSyncRequest(dspHandle)without a lock, racingndspThreadMain(priority0x18on Core 0) on every 5 ms DSP interrupt, and calling it on Core 1 could not clean Core 0's private 16 KiB ARM11 L1 D-cache. - Fix: Core 1 (
spu_core1_worker) now exclusively callsctr_audio_render_core1(sys)(rendering queuedSpuCmdbatches intosys->spu.out_ringwithout touchingg_linear_pcmorndsp*). Core 0 exclusively owns wavebuf refill and submission (ctr_audio_step_core1/ctr_audio_pump_core0, pumped every frame and every<= 4 msslice insidepacer_wait), flushing wavebuf PCM directly from Core 0's L1/L2 cache to FCRAM via Kernel11svcFlushProcessDataCache(CUR_PROCESS_HANDLE, ...)+GSPGPU_FlushDataCache.
- Root Cause:
- Core 0 / Core 1 Async SPU Register Readback Coherency (
src/periph/spu.c):- Made all
spu->endxupdates/reads atomic across Core 0 and Core 1, updated Core-0-readable voice shadow state (start_addr,repeat_addr,adsr_vol, andKONclearingendx+ zeroingadsr_vol) immediately on MMIO write beforecmd_ringdrain, and prevented Core 1cmd_ringreplay (spu_apply_queued_reg16) from overwriting newer Core 0spu->regs[]mirrors. Covered bytest_spu_async_readback_coherency.
- Made all
- Live Audio Diagnostics on
2:HUD&4:LOG(src/platform/3ds/ui_bottom.c):2:HUDnow displays live wavebuf submission/in-flight counts and PCM peak amplitude (SPU:C1 NDSP:OK WB:<sub/act> Pk:<peak>), and4:LOGhighlights[audio_ndsp]activation lines in green (COL_OK).
2. Winning Eleven 4 (SLPM_862.91) Anti-Modchip Lockout Fix (src/periph/cdrom.c)
- Root Cause: At boot (
LBA ~52875..53125), Winning Eleven 4 starts muted CD-DA playback, resets SCEx counters (0x19 0x04), and queriesGetSCExCounters(0x19 0x05). Returning{ stat, 0x01, 0x01 }outside the Lead-In (LBA < 150) mimicked an old non-stealth modchip continuously injecting SCEx strings and triggered"強制終了しました。本体が改造されているおそれがあります。". - Fix:
CDL_TEST 0x05now returns{ stat, 0x01, 0x01 }only when idle in the Lead-In (cur_lba < 150and not playing/reading), and{ stat, 0x00, 0x00 }wheneverplaying,reading, orcur_lba >= 150. Covered bytest_cdrom_scex_counters.
中文更新说明 (v0.2.7)
- 彻底修复 New 3DS 实机无声音问题(
libctruNDSP 停止态死锁与跨核缓存一致性):- 修复
libctruNDSP 通道耗尽后无法重启的固件交互 Bug:反汇编psx3ds.elf中libctru的ndspiReadChnState/ndspiUpdateChn发现,当最后一个音频缓冲区播放完毕时,libctru将队列计数清零但保留chn->playing = 1;此前在 ROM 菜单预先入队的静音缓冲在 67 ms 内耗尽后,后续ndspChnWaveBufAdd未先调用ndspChnWaveBufClear重置同步计数与播放标志,导致新缓冲永久卡在已停止的 DSP 硬件通道上静音死锁。现移除菜单空转静音缓冲,每次启动游戏及缓冲重充前均通过ndspChnWaveBufClear重新武装通道,并加入150 ms/35 ms停滞看门狗与尾帧平滑衰减保护。 - Core 1 渲染 / Core 0 提交职责分离与
svcFlushProcessDataCache直刷:Core 1 线程仅负责异步渲染 SPU 采样至out_ring;所有 NDSP 缓冲区填充、Kernel11svcFlushProcessDataCache(零dspHandleIPC 竞争、直刷 Core 0 私有 16 KiB L1 D-Cache 至 FCRAM)及ndspChnWaveBufAdd均由 Core 0 独占执行(含pacer_wait帧限速休眠期间每<= 4 ms切片自动泵送)。 - 异步 SPU 寄存器回读一致性与 HUD 实时音频监控:原子化
ENDX状态并在 Core 0 写入KON/repeat_addr/adsr_vol时即时同步可读镜像;下屏2:HUD新增SPU:C1 NDSP:OK WB:<已提交/活跃> Pk:<峰值>实时音频指标,4:LOG高亮显示[audio_ndsp] audio active日志。
- 修复
- 修复《实况足球 4》(Winning Eleven 4,
SLPM_862.91) 反改机检测锁死:- 修正
CD-ROM Test 0x19 0x05(GetSCExCounters):仅在光头静止于导入区(LBA < 150)时返回0x01, 0x01;在数据/音轨区(LBA >= 150)或播放 CD-DA / 读取数据时返回真机一致的0x00, 0x00,顺利通过反改机校验进入 JOC 授权画面、片头动画与标题界面。
- 修正
- 多游戏实测通过:《拳皇 '97》(
SLPM_860.84)、《实况足球 3 最终版》(SLPM_861.62)、《实况足球 4》(SLPM_862.91)、《实况足球 2002》(SLPM_870.56) 均验证正常启动、音频输出饱满且帧率稳定锁定60.0 FPS。
PSX3DS v0.2.6 — Real-3DS Audio Fix & Steady 60.0 FPS Lock
PSX3DS v0.2.6 — Real-Hardware Audio Fix (SysCore Priority 0x2F, Core 0 NDSP Backstop, 4x735 Full-Buffer FIFO Feeder) & Steady 60.0 FPS Frame Pacer
v0.2.6 resolves the two issues reported on real New 3DS hardware running World Soccer Jikkyou Winning Eleven 3 - Final Ver. (Japan) (SLPM_861.62 + SCPH5500.BIN) on v0.2.5: missing audio output ("另外没有声音") and 30–80 FPS framerate fluctuation ("帧数不稳定, 在30-80之间跳动. 希望能锁定最高60帧稳定运行").
English Release Notes
1. Fix Real-3DS Missing Audio (src/platform/3ds/threads_3ds.c, src/platform/3ds/audio_ndsp.c, src/platform/3ds/main_3ds.c, src/periph/spu.c)
- SysCore (
Core 1) SPU Worker Priority Ladder (0x2F):- Root Cause: In
v0.2.4/v0.2.5,spu_core1_workerwas spawned on Core 1 atmain_prio + 1(0x31), numerically lower priority than Horizon OS's0x30APT_SetAppCpuTimeLimitSysCore quota thread (or fell back to Core 0 at0x30wheremain()never yields), starving the audio worker 100% of the time while still displayingCore1 SPU: ASYNCon the HUD. - Fix:
spu_core1_workernow launches on Core 1 atmain_prio - 1(0x2F) with a Core 1 retry ladder (0x2F -> 0x30 -> 0x31) and a sleeping-worker-safe Core 0 fallback (0x2F). Because the worker sleeps500 usper step and parks10 msonAPTHOOK_ONSUSPEND,0x2Fnever blocks HOME Menu transitions.spu_core1_activenow checksactual_core == 1and logsspu_core=%d.
- Root Cause: In
- Dual-Core Trylock-Guarded NDSP Feeder & Core 0 Frame-End Backstop:
ctr_audio_step_core1(sys)is now guarded by an atomic trylock (g_step_lock) and pumped at the end of every emulated frame on Core 0 in addition to Core 1's500 usworker. When Core 1 keeps up, Core 0 returns in< 1 us; if SysCore ever throttles Core 1, Core 0 seamlessly renders queuedSpuCmdbatches and feeds NDSP wavebufs.
- 4x735 Full-Buffer FIFO NDSP Ring, 2-Buffer (
33.3 ms) Re-Prime & Bounded Drift Resampler:- Root Cause: Previously, waking every
500 uspopped partial48..64-frame SPU batches into735-frame NDSP wavebufs and padded the remaining93.5%–100%with flat DC (g_last_l/g_last_r), locking NDSP into50 msof flat silence and inflatingspu_underrunsat2 kHz. - Fix: Expanded NDSP ring to
4 x 735stereo frames (66.7 ms), submitted via a strict FIFO cursor (g_wbuf_next) only when a full735-frame buffer of real audio is ready. After cold start or a full NDSP drain, playback pre-primes2 x 735frames (33.33 ms, one full 30 HzVSync(2)Even+Odd pair) so heavy~22 ms3D frames never underrun NDSP, counting exactly one atomicspu_underrunstransition per genuine stream drain (0underruns inwe3_f2000/we3_f3100). Above high water, a gentle<= 1.1%linear resampler bounds latency under the60.00 Hzlock.
- Root Cause: Previously, waking every
- Savestate Async SPU Regression Test (
tests/unit/test_periph_spu.c):- Added
test_spu_async_savestate_and_ringverifying that loading a sync (async_mode = false) savestate into an async (cfg.spu_async = true) 3DS system preservesasync_mode == trueand renders contiguous non-zero stereo audio across queuedSpuCmdbatches without drops.
- Added
2. Steady 60.0 FPS Wall-Clock Pacer & 32-Frame Rolling HUD Telemetry (src/gpu_hw/gpu_citro3d.c, src/platform/3ds/main_3ds.c, src/platform/3ds/ui_bottom.c)
- Eliminate Extra VBlank Stalls on Empty
VSync(2)Odd Frames:hw_presentnow callsbegin_frame(st, 0)instead ofC3D_FRAME_SYNCDRAWwhen!st->in_frame, preventing empty Odd frames of 30 HzVSync(2)games (~22 msEven +~6 msOdd =~28 ms < 33.33 ms) from stalling an extra hardware VBlank.
- Drift-Free
60.00 HzNTSC /50.00 HzPAL Deadline Pacer:- Added
CtrFramePacer(16667 / 16667 / 16666 us= exact50,000 usper 3 NTSC frames;20,000 usPAL) with a 2-frame (33,334 us) catch-up window so 30 HzVSync(2)Even+Odd pairs lock cleanly to60.0 FPSwhile capping menus at60.0 FPS(instead of running uncapped at80+ FPS), without fast-forwarding after CD seeks or state loads.
- Added
- 32-Frame Rolling HUD Average & Odd Redraw Cadence (
15frames =4.0 Hz):- Replaced single-frame unpaced
1000000.0 / us_frameHUD readouts and the even-parity16-frame redraw divisor (which aliased onto either heavy Even frames ~35 FPS or light Odd frames ~80 FPS) with a 32-frame rolling average of paced frame/CPU/GPU times, clamped cleanly at60.0 FPS(16.67 ms) with an odd15-frame idle redraw cadence.
- Replaced single-frame unpaced
中文更新说明 (v0.2.6)
- 彻底修复 New 3DS 实机无声音问题:
- 修复 Core 1 (
SysCore) SPU 音频线程饥饿:v0.2.4/v0.2.5将 SPU 异步线程优先级设为0x31(低于 Horizon OS 在 Core 1 上运行的0x30系统配额线程,或静默回退至主循环从不让出 CPU 的 Core 0),导致音频线程完全饥饿。现改为0x2F(main_prio - 1)并配备优先级回退梯队与每帧末尾 Core 0 原子无锁(trylock)兜底泵送,确保任何情况下音频持续输出,且不影响 HOME 键挂起/退出。 - 修复 NDSP 半满缓冲静音拼接与 FIFO 乱序:NDSP 环形缓冲扩容至
4 x 735立体声采样帧(66.7 ms),严格按 FIFO 顺序仅在攒满735帧真实音频采样时提交(不再将未满缓冲区的93%+填平为直流静音);启动或缓冲耗尽后自动预充2 x 735帧(33.3 ms,覆盖完整 30 Hz 奇偶帧周期),并通过<= 1.1%线性自适应重采样消除60.00 Hz锁帧下的长期音频延迟累积。
- 修复 Core 1 (
- 修复 30–80 帧跳动,稳定锁定最高 60.0 FPS:
- 消除 30 Hz 游戏空奇帧额外垂直同步停顿:移除
hw_present在无绘制奇帧上的C3D_FRAME_SYNCDRAW,使《实况足球 3》比赛画面(偶帧~22 ms+ 奇帧~6 ms=28 ms < 33.33 ms)不再多等一次硬件 VBlank。 - 零漂移
60.00 Hz(NTSC)/50.00 Hz(PAL)硬件时钟限帧器:带 2 帧(33.33 ms)追赶窗口,菜单与比赛最高稳定锁死60.0 FPS(不再冲上 80+ FPS,也不会在光盘寻道后快进)。 - HUD 32 帧滑动平均与奇分频(每 15 帧)刷新:消除旧版每 16 帧(偶数分频)采样奇偶帧导致的帧数显示跳变,稳定显示真实平滑帧率(最高钳位
60.0 FPS)。
- 消除 30 Hz 游戏空奇帧额外垂直同步停顿:移除
PSX3DS v0.2.5 — Real-HW Performance Boost & Texel-Exact PICA200 Sampling
PSX3DS v0.2.5 — Real-Hardware Performance Boost (Eliminate PICA200 Readback/Sync Stalls, Early Scissor Culling, 128-Slot Stale-First TexCache) & Texel-Exact Hardware Sampling
v0.2.5 resolves the two issues reported on real New 3DS hardware running World Soccer Jikkyou Winning Eleven 3 - Final Ver. (Japan) (SLPM_861.62 + SCPH5500.BIN): ~20 FPS real-hardware framerate bottlenecks and display/texture sampling glitches (broken menu text, dotted player shadows, and off-by-one/wrapped polygon texel rows).
English Release Notes
1. Eliminate Per-Frame PICA200 Readback & Re-Upload Stalls on No-Op GP0(0x80) (src/gpu/gpu.c, src/gpu_hw/gpu_citro3d.c)
- Root Cause: Winning Eleven 3 issues an unmasked self-copy
GP0(0x80)(0, 0) -> (0, 0)of2 x 512at the end of every frame. Previously this forcedhw_sync_to_shadow(C3D_FrameEnd(0)+ synchronousC3D_SyncTextureCopyDMA readback + D-cache invalidation + CPU Morton un-swizzle) followed by a CPU tile upload and a second GPU stall on the next frame — two full PICA200 pipeline stalls per frame. - Fix:
gpu_vram_copy_is_noop()short-circuits unmasked self-copies (sx == dxmod 1024,sy == dymod 512,check_mask == 0,set_mask == 0) while preserving cycle-accurate command scheduling and full execution when mask bits are active. MaskedGP0(0xA0)CPU->VRAM loads now also synchronize destination shadow VRAM before testing mask bit 15.
2. Early Scissor Bounding-Box Culling & Reduced GSPGPU / PICA200 Sync Overhead (src/gpu_hw/gpu_citro3d.c)
- Early Scissor Culling: Primitives completely outside the active drawing area (
~39%of draw calls in Winning Eleven 3 3D matches, including flashing off-screen stadium billboard CLUTs) are now culled at the top ofhw_draw()before texture-page decoding, CLUT hashing, or batch breaks.flush_cpu_dirty_if_needed()now tests only the scissor-clipped primitive bounding box. - Single Vertex D-Cache Flush per Submission: Vertex ring buffers (
expanded to 8192 vertices x 2) now callGSPGPU_FlushDataCacheonce perC3D_FrameEnd()submission instead of once per batch (eliminating ~360 GSPGPU IPC syscalls per match frame on real 3DS hardware). - Stall-Free
upload_texUpdates:flush_cpu_dirty_if_needed()now stalls the open GPU frame only ifupload_texwas already sampled in that open frame, and flushes D-cache only for the dirty 8-pixel tile-row span instead of the full 1 MiB texture.
3. 128-Slot Lazy TexCache & clut_dirty Victim Priority (src/gpu_hw/gpu_texcache.c, include/psx3ds/gpu_hw.h)
- Root Cause: Animated palettes rewritten every frame left stale
clut_dirtyslots in the cache until all slots filled and began evicting clean, active 3D match textures. - Fix: Victim selection now recycles free allocated slots,
texel_dirtyslots, and staleclut_dirtyslots before evicting any clean active texture (while keepingA <-> Bpalette toggles zero-redecode when capacity permits). Capacity is expanded to 128 lazily allocated slots on New 3DS (capped at a 24 MiB LINEAR RAM budget) and 32 slots on Old 3DS (small_mem).
4. Coalesced ARM11 L1 I-Cache Invalidation & Idle Bottom-Screen UI Throttling (src/jit/arm_jit.c, src/platform/3ds/jit_mem_3ds.c, src/platform/3ds/main_3ds.c)
- Coalesced
svc 0x94:jit_compile_at_pc()now cleans D-cache per block (jit_mem_commit_dcache) and executes a single ARM11 L1 I-cache + BTB invalidation (jit_mem_flush_icache) after the entire eager compilation pass (up to 33 blocks) finishes, before returning to native execution. - Bottom-Screen UI Throttling: During active gameplay with no new button/touch input, the software-rendered bottom status UI now redraws every 16th frame (~3.75 Hz) instead of every 4th frame, redrawing immediately on any input.
5. Texel-Exact PS1 Hardware Polygon & Sprite Sampling (src/gpu_hw/gpu_citro3d.c)
- Root Cause: PICA200 samples fragment centers in bottom-up
t = 1.0 - v / Htexture coordinates underGPU_REPEAT. Polygon vertices (PRIM_TRI/PRIM_QUAD) lacked the PS1+0.5texel offset and integer pixel sample alignment, causingv = 0edges to wrap to row255, constant/decreasingvto sample rowv - 1(corrupting"Europe Zone"->"Europe Zore"), and minified polygons to turn player shadows into dotted lines. - Fix: Vertex UVs now use
1/16-texel fixed point (HW_UV_SHIFT = 4), the VRAM render-target projection shifts geometry by+7/16pixel to align PICA200 pixel centers with PS1 integer sample points,set_uv_transformapplies a1/64-texel floor nudge across the flippedtaxis, andtri_uv_to_hwappliesfloor(u + 0.5)with per-triangle(du/dx + du/dy) / 16gradient compensation. Menus/dialogs now matchgpu_softpixel-for-pixel (0.00%diff) and 3D match scenes match within0.05%(Gouraud rounding only).
中文更新说明 (v0.2.5)
- 大幅优化 New 3DS 实机帧率(消除每帧 GPU 回读停顿与高频同步开销):
- 跳过无掩码自拷贝
GP0(0x80):《实况足球 3 最终版》在每一帧末尾都会发送(0,0) -> (0,0)2x512的自拷贝指令,旧版会触发整帧 PICA200 同步回读与次帧重传(每帧 2 次 GPU 管线停顿)。现已通过gpu_vram_copy_is_noop()直接短路跳过,比赛与菜单实测readbacks = 0、stalls = 0、ring_wraps = 0。 - 提前视口裁剪(Early Scissor Culling):在解码纹理页前提前剔除完全落在绘图裁剪区外的图元(剔除《实况足球 3》比赛画面约
39%的场外无效绘制与场边闪烁广告牌调色板)。 - 合并顶点缓冲 D-Cache 刷新与
upload_tex按需同步:每帧提交(C3D_FrameEnd)仅执行 1 次顶点 D-Cache 刷新(消除每帧约 360 次GSPGPU_FlushDataCache系统调用),顶点环扩容至8192;CPU 脏瓦片上传仅在当前未闭合帧已采样过upload_tex时才等待同步,且仅刷新脏瓦片所在行区间。 - 128 槽位纹理缓存与动态调色板优先回收:优先回收已失效的动态调色板(
clut_dirty)与脏纹素槽位,绝不驱逐活跃干净纹理(比赛纹理缓存命中率达99.94%);New 3DS 扩容至128槽位(24 MiB 线性内存上限按需分配),Old 3DS 扩容至32槽位。 - 合并 JIT L1 指令缓存刷新与下屏 UI 降频:
jit_compile_at_pc预编译整批代码块后仅执行一次svc 0x94全量 I-Cache 刷新;游戏无按键/触控输入时下屏软件 UI 降频至每 16 帧刷新一次。
- 跳过无掩码自拷贝
- 彻底修复多边形与 UI 贴图采样显示错误:
- 引入
1/16纹素定点 UV、VRAM 投影+7/16像素对齐、翻转t轴1/64纹素向下取整偏置,以及三角形梯度补偿tri_uv_to_hw,精确还原 PS1 硬件整数像素采样与floor(u + 0.5)纹素寻址。 - 彻底修复了菜单文字错位断裂(如
"Europe Zone"误显示为"Europe Zore")、v = 0贴图边缘回绕至第 255 行、球员脚下阴影变成断续黑点线、以及带掩码GP0(0xA0)写入未先行同步目标区域等问题。
- 引入
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 卡),确保退回主界面与关闭游戏秒退不卡死。
PSX3DS v0.2.3 — Real New 3DS ARM11 L1 I-Cache Fix & Dedicated SD Scan Folders
PSX3DS v0.2.3 — Real New 3DS ARM11 L1 I-Cache Invalidation, VIPT & 32B JIT Alignment, SP Guard, and Dedicated SD Scan Folders
v0.2.3 fixes a real-hardware New 3DS XL (Luma3DS) prefetch abort (Permission - Section) crash during JIT execution (PC = 0x08067E70, LR = 0x001378D8) and restricts SD card ROM/BIOS scanning to dedicated PS1 folders instead of scanning the SD root.
English Release Notes
Root Cause Fixed from Real-Hardware v0.2.2 Crash Dump (PC = 0x08067E70, SP = 0x0803DEA0)
- On real ARM11 MPCore hardware,
svcFlushProcessDataCacheonly cleans the L1 D-Cache out to FCRAM without invalidating the separate 32 KiB 4-way (8 KiB/way) VIPT L1 Instruction Cache or branch target buffer. - Inside a newly compiled JIT block,
emit_callexecutedpush {r12, lr}(SP: 0x0803DE80 -> 0x0803DE78) and then crossed a 32-byte ARM11 L1 I-Cache line boundary into a cache line that still held stale0x00000000(andeq r0, r0, r0=NOP) words cached by earlier instruction prefetching across 4-byte-packed blocks. - Executing
blx r12andpop {r12, lr}asNOPs leftLR = 0x001378D8(psx_run_frame + 0x778) untouched andSPshifted by-8bytes atjit_exit, causingpop {r4-r12, pc}to popsaved_r11 = 0x08067E70(sys + 0xb000, non-executable heap data) intoPCwhile leaving[0x0803DEA0] = 0x08931D30(saved_r12) and[0x0803DEA4] = 0x001378D8(saved_lr) at[SP].
What's New in v0.2.3
- ARM11 L1 I-Cache & Branch Predictor Invalidation on Every JIT Commit (
jit_mem_commit):- Flushes 32-byte aligned D-Cache lines for both the
m->rwview andm->rxmirror, invalidates the ARM11 L1 I-Cache + BTB via Luma3DSsvc 0x94(svcInvalidateEntireInstructionCache, withr0-r3, r12clobbers; or the 128 KiB NOP eviction sled on non-Luma hardware), and executes EL0-safeDSB(c7, c10, 4) +ISB(c7, c5, 4).
- Flushes 32-byte aligned D-Cache lines for both the
- 16 KiB VIPT Cache-Color Alignment & 32-Byte JIT Block Alignment:
jit_mem_alloc()now allocatesm->rwviamemalign(0x4000, size)(16 KiB >= 8 KiB/way) to match the 1 MiB-alignedm->rxmirror across all ARM11 VIPT cache colors (VA bits[13:12]).arm_jitnow aligns and zero-pads every emitted native block to a 32-byte ARM11 cache-line boundary (((uintptr_t)entry & 31) == 0).
- Hardware
SPGuard Acrossjit_enter/jit_exit*(jit_thunks.S):jit_entersaves the exact host stack pointer atcpu->jit_saved_sp([r11, #0x270]), and all 4 exit paths (jit_exit,jit_exit_step_one,jit_exit_with_reason,jit_raise_exception_exit) restoreldr sp, [r11, #0x270]immediately beforepop {r4-r12, pc}.
- Dedicated SD Card ROM & BIOS Scan Folders (No Full SD Root Scan):
1:ROMSnow scans onlysdmc:/psx3ds/roms,sdmc:/roms/psx, andsdmc:/psx(sdmc:/root is never scanned).- External BIOS auto-detection scans only
sdmc:/psx3ds/bios,sdmc:/bios, and those three PS1 ROM folders.
中文更新说明 (v0.2.3)
- 修复 New 3DS 实机 ARM11 L1 指令缓存(I-Cache)未失效导致的
PC = 0x08067E70崩溃:- 每次编译提交 JIT 代码块(
jit_mem_commit)时,同步刷写m->rw与m->rx的数据缓存(D-Cache),并通过 Luma3DSsvc 0x94使 ARM11 L1 指令缓存与分支预测器(BTB)失效,随后执行DSB + ISB内存与指令屏障。 - JIT 读写缓冲区升级为 16 KiB 对齐(
memalign(0x4000, size)),消除 ARM11 32 KiB 4-way(8 KiB/way)VIPT 缓存颜色别名;所有 JIT 代码块统一按 32 字节缓存行边界对齐与填充。 jit_enter/jit_exit*新增硬件栈指针保护([r11, #0x270]保存与恢复SP),确保pop {r4-r12, pc}永不错位。
- 每次编译提交 JIT 代码块(
- 精简 SD 卡扫描目录(不再扫描 SD 卡根目录):
1:ROMS游戏列表现仅扫描sdmc:/psx3ds/roms、sdmc:/roms/psx与sdmc:/psx(外置 BIOS 仅扫描sdmc:/psx3ds/bios、sdmc:/bios及上述游戏目录),大幅加快大肚量 SD 卡启动与刷新速度。
PSX3DS v0.2.2 — Built-in OpenBIOS, ISO9660 .chd CD-ROM Boot & 4:LOG UI
PSX3DS v0.2.2 — Zero-Setup Embedded OpenBIOS, ISO9660 .chd/CD-ROM Boot, and On-Screen 4:LOG Diagnostics
v0.2.2 fixes the black top-screen issue when booting .chd / .cue / .bin / .iso CD-ROM games without an external SCPH1001.BIN BIOS file on the SD card, and adds live bottom-screen boot/runtime logging (4:LOG).
English Release Notes
Root Causes Fixed from Real-Hardware v0.2.1 Report ([HLE BIOS] + JIT: 6 blks + CD Miss 0 + Prims: 0)
openbios.binwas not embedded into.cia/.3dsx/.cci:v0.2.1looked forromfs:/openbios.binwithout a packaged RomFS, and SD BIOS scanning only checked exactSCPH1001.BIN/openbios.binfilenames. WithoutSCPH1001.BINon the SD card,psx3dsfell back to[HLE BIOS].[HLE BIOS]lacked ISO9660 CD-ROM bootstrap: Previously, HLE mode only injected standalone.exehomebrew (psx_load_exe), not ISO9660SYSTEM.CNFboot executables from mounted CD-ROMs (psx_load_cd), causing the CPU to spin in the0x800300006-block idle loop with0CD sector reads and0GPU primitives.
What's New in v0.2.2
- Built-In 512 KiB
OPENBIOSEmbedded in Every Build (src/sys/openbios_blob.S):- Works out of the box with zero external BIOS setup required (
[OPENBIOS]green badge on startup). - Case-insensitively auto-detects any external 512 KiB retail BIOS (
SCPH*.BIN,PSXONPSP*.BIN,BIOS*.BIN,openbios.bin) placed insdmc:/psx3ds/bios/,sdmc:/psx/,sdmc:/roms/psx/,sdmc:/bios/, orsdmc:/and prefers it automatically.
- Works out of the box with zero external BIOS setup required (
- Full ISO9660
SYSTEM.CNF/PS-X EXECD-ROM Boot (src/sys/cdboot.c,src/sys/hle_bios.c):- Native BIOS CD boot under
OPENBIOS/ retailSCPH*.BIN(skips the BIOS shell at0x80030000and bootsSYSTEM.CNF -> BOOT = cdrom:\...through the emulated CD-ROM controller + DMA3, with automatic0x80030000sideload fallback and optionalCD Boot: Fastmode in3:CTRL). - Direct ISO9660
SYSTEM.CNF/PS-X EXEextraction +cdrom:HLE file I/O (open/read/lseek/close/Load/LoadExec) +B0:15pad driver support in[HLE BIOS]mode.
- Native BIOS CD boot under
- On-Screen
4:LOGTab, LivePC / CD Rd / IRQ / DispHUD Diagnostics & SD Log File:- Bottom screen now features 4 tabs:
1:ROMS | 2:HUD | 3:CTRL | 4:LOG. 2:HUDdisplays livePC, cumulativeCD Rdsector count,IRQflags/mask, andDispresolution/VRAM coordinates.4:LOGdisplays real-time[bios],[cdboot],[hle], and guest BIOS[tty]output with Up/Down scrolling,Dump Log, andClear, while mirroring boot logs tosdmc:/psx3ds/psx3ds.log.3:CTRLadds toggles forBIOS: Auto/OpenBIOS <-> HLE DirectandCD Boot: Native <-> Fast.
- Bottom screen now features 4 tabs:
中文更新说明(修复 .chd / 光盘镜像启动黑屏 + 内置 OpenBIOS 免配置启动 + 新增 4:LOG 调试日志页)
问题根因解析(对应实机照片 [HLE BIOS] + JIT: 6 blks + Miss 0 + Prims: 0)
v0.2.1未将openbios.bin内嵌进.cia/.3dsx:当 SD 卡中没有放置SCPH1001.BIN时,程序回退到了[HLE BIOS]模式(顶栏橙色标记)。[HLE BIOS]此前仅支持直接加载独立.exe自制程序(psx_load_exe),尚未实现从.chd/.bin光盘镜像解析 ISO9660SYSTEM.CNF启动文件(psx_load_cd),导致 CPU 跳到0x80030000后停留在 6 个基本块的空循环中,未读取任何光盘扇区(Miss 0),也未绘制任何多边形(Prims: 0)。
v0.2.2 核心更新与新功能
- 直接内嵌 512 KiB
OPENBIOS到.cia/.3dsx(零配置开箱即用):- 无需拷贝任何外部 BIOS 文件即可直接启动
.chd/.cue/.bin/.iso游戏(顶栏显示绿色[OPENBIOS])。 - 同时扩展了外部 BIOS 自动扫描:若你在
sdmc:/psx3ds/bios/、sdmc:/psx/、sdmc:/roms/psx/或sdmc:/bios/放入任意 512 KiB 原版 BIOS(如SCPH1001.BIN、SCPH5501.BIN、SCPH7001.BIN、PSXONPSP660.BIN,不区分大小写),会自动优先加载外部原版 BIOS。
- 无需拷贝任何外部 BIOS 文件即可直接启动
- 完整支持 ISO9660
SYSTEM.CNF/PS-X EXE光盘引导(兼容OPENBIOS原生引导、快速引导与HLE BIOS):- 在
OPENBIOS/ 原版 BIOS 下支持通过模拟光驱控制器原生读取SYSTEM.CNF与主程序 EXE,并在3:CTRL页提供CD Boot: Native / Fast(原生引导 / 瞬间直载)与BIOS: Auto/OpenBIOS / HLE Direct切换开关。 - 在
HLE BIOS模式下同样补齐了 ISO9660 主程序自动解析注入、cdrom:文件读取(open/read/lseek/close)及手柄驱动 HLE 接口。
- 在
- 新增下屏
4:LOG实时日志标签页、2:HUD实时PC / CD Rd状态行与 SD 卡日志文件:- 采纳你的建议,在下屏新增
4:LOG标签页(支持上下翻页、Dump Log导出与Clear清空),并同步写入sdmc:/psx3ds/psx3ds.log,直观展示[bios]、[cdboot] SYSTEM.CNF -> BOOT=...及 BIOS 内核[tty]输出。 - 在
2:HUD新增实时PC、CD Rd(累计读取光盘扇区数)、IRQ与Disp显示状态行,一眼即可确认光盘读取与渲染进度。
- 采纳你的建议,在下屏新增
安装/升级方法
.cia桌面安装版(推荐):下载psx3ds.cia(或解压psx3ds-v0.2.2-3ds.zip到 SD 卡根目录),使用 FBI 直接覆盖安装即可(相同TitleID 000400000F853D00,无需任何额外设置即可直接运行.chd游戏)。.3dsx自制系统启动版:下载psx3ds.3dsx与psx3ds.smdh覆盖sdmc:/3ds/psx3ds/目录后从 Homebrew Launcher 启动。
PSX3DS v0.2.1 — Fix New 3DS Startup Crash (svcBreak in __system_allocateHeaps)
PSX3DS v0.2.1 — Fix New 3DS Startup Crash (svcBreak in __system_allocateHeaps)
v0.2.1 is a critical hotfix for all real New Nintendo 3DS / New 3DS XL / New 2DS XL consoles running Luma3DS (both .cia and .3dsx builds).
English Release Notes
Bug Fixed: Immediate Startup Crash (prefetch abort / Debug event) on Real New 3DS Hardware
- Symptom in
v0.2.0: Launchingpsx3ds.cia(orpsx3ds.3dsxwith>= 124 MiBcommit limit) on a real New 3DS running Luma3DS immediately crashed beforemain()with a Luma3DS exception screen:Exception type: prefetch abort(Fault status: Debug event—svcBreak(USERBREAK_PANIC))PC = 0x001CB108(svcBreak),LR = 0x001CABF4(__system_allocateHeaps + 0x1bc)R3 = 0x06694000(102.58 MiB) with New 3DSRESLIMIT_COMMIT = 0x07C00000(124 MiB)
- Root Cause:
- To fit
26 MiB PsxArena + 6 MiB JITon64 MiBOld 3DS.ciainstalls,v0.2.0setu32 __ctru_linear_heap_size = 20 MiBwhile leaving__ctru_heap_size = 0. - In
libctru's__system_allocateHeaps, setting a non-zero__ctru_linear_heap_sizewith__ctru_heap_size == 0bypasseslibctru's default32 MiBlinear-heap branch and takes an uncapped branch:__ctru_heap_size = remaining - __ctru_linear_heap_size. - On a real New 3DS (
124 MiBRESLIMIT_COMMIT,~122.58 MiBremaining),__ctru_heap_sizebecame102.58 MiB(0x06694000). WhensvcControlMemory(MEMOP_ALLOC)attempted to map0x08000000 .. 0x0E694000, it overflowed Horizon OS Kernel11's96 MiB([0x08000000, 0x0E000000)) application heap virtual address ceiling (OS_HEAP_AREA_END), failing and triggeringsvcBreak(USERBREAK_PANIC)beforemain(). (Azahar's HLE kernel permits a 128 MiB heap window, masking this bug in emulator-only tests.)
- To fit
- Fix in
v0.2.1:- Custom
__system_allocateHeapsOverride (src/platform/3ds/main_3ds.c+include/psx3ds/ctr_heap.h): Computesnormal_heap = min(remaining - 20 MiB, 80 MiB)and assigns the remaining commit budget to the linear heap:- New 3DS (
124 MiB.cia/.cci/.3dsx):80.00 MiB(0x05000000) normal heap (0x08000000 .. 0x0D000000, leaving a full16 MiBVA safety margin below0x0E000000) +~42.58 MiBlinear heap. - New 3DS (
178 MiBextended.3dsx):80.00 MiBnormal heap +~96.58 MiBlinear heap. - Old 3DS (
64 MiB.cia/.cci/.3dsx):~42.58 MiBnormal heap +20.00 MiBlinear heap (unchanged).
- New 3DS (
- Resilient Kernel Fallback: If
svcControlMemoryever rejects a requested heap or contiguous linear-heap allocation (e.g. fragmented FCRAM under.3dsxlaunchers),__system_allocateHeapsshrinks in8 MiBsteps and retries instead of panicking. - Accurate Old 3DS
small_memAuto-Detection:psx_system_init()now inspectsenvGetHeapSize() < 64 MiB(__ctru_heap_size) instead ofosGetMemRegionFree(MEMREGION_APPLICATION)(which reads~0after startup commitsRESLIMIT_COMMIT), ensuring New 3DS.ciaand.3dsxalways run the full16 MiBJIT +64-slotRGBA8 texture cache +8-slotCHD cache profile while Old 3DS usessmall_mem. - Startup Heap Regression Suite (
tests/unit/test_ctr_heap.c): Verifies36 MiB <= heap_size <= 80 MiB < 96 MiBacross O3DS64/80/96 MiB, N3DS124/178 MiB, the exact crash dump registers, and a1..256 MiBsweep across all 3 CI/test tiers.
- Custom
Quick Start (SD Card Installation)
- Download
psx3ds.cia(or extractpsx3ds-v0.2.1-3ds.zipto the root of your 3DS SD cardsdmc:/). - Recommended (
.cia): Open FBI →SD→ installpsx3ds.cia(overwritesv0.2.0cleanly underTitleID 000400000F853D00), then launch PSX3DS from the Home Menu. - Alternative (
.3dsx): Placepsx3ds.3dsxandpsx3ds.smdhinsdmc:/3ds/psx3ds/and launch from Homebrew Launcher. - Put PS1 BIOS (
SCPH1001.BINor includedopenbios.bin) insdmc:/psx3ds/bios/and games (.chd,.cue/.bin,.iso,.exe) insdmc:/psx3ds/roms/.
中文更新说明(修复 New 3DS 实机打开即崩溃问题)
修复核心问题:New 3DS / New 3DS XL / New 2DS XL(Luma3DS)启动即报 prefetch abort (svcBreak) 崩溃
- 问题原因(
v0.2.0):v0.2.0为了兼容老三(Old 3DS64 MiB)的内存预算,设置了__ctru_linear_heap_size = 20 MiB且保留__ctru_heap_size = 0。- 在
libctru的__system_allocateHeaps中,当仅指定线性堆大小而未指定普通堆上限时,会跳过默认的32 MiB线性堆分支,直接按remaining - 20 MiB无上限计算普通堆。 - 在 New 3DS(
RESLIMIT_COMMIT = 124 MiB,剩余约122.58 MiB)实机上,普通堆请求大小变成了102.58 MiB(R3 = 0x06694000),映射范围0x08000000 .. 0x0E694000超出了 3DS Kernel11 应用普通堆的96 MiB虚拟地址上限[0x08000000, 0x0E000000),导致svcControlMemory失败并在进入main()前触发svcBreak(USERBREAK_PANIC)(Luma3DS 显示prefetch abort / Debug event)。
v0.2.1修复方案:- 接管并重写
__system_allocateHeaps:通过psx_ctr_compute_heap_split()精确划分普通堆与线性堆:普通堆上限严格封顶为80 MiB(0x05000000,最高至0x0D000000),彻底杜绝越过0x0E000000内核虚拟地址边界:- New 3DS (
124 MiB.cia/.3dsx):80.00 MiB普通堆 +42.58 MiB线性堆(完整启用16 MiBARM11 W^X JIT 缓存、64 槽位硬件纹理缓存与 8 槽位 CHD 缓存)。 - Old 3DS (
64 MiB.cia/.3dsx):42.58 MiB普通堆 +20.00 MiB线性堆(自动启用small_mem配置)。
- New 3DS (
- 内核分配自适应退避重试:若在内存碎片化的自制软件启动器环境下单次分配被内核拒绝,自动按
8 MiB步进收缩重试,避免直接崩溃。 - 修复
small_mem自动识别逻辑:改用envGetHeapSize() < 64 MiB判定老三/新三内存配置,并新增test_ctr_heap单元测试覆盖全部机型内存布局。
- 接管并重写
安装/升级方法
.cia桌面安装版(推荐):下载psx3ds.cia(或解压psx3ds-v0.2.1-3ds.zip到 SD 卡根目录),使用 FBI 直接覆盖安装即可(相同TitleID 000400000F853D00,存档与记忆卡完全保留)。.3dsx自制系统启动版:下载psx3ds.3dsx(及psx3ds.smdh)覆盖sdmc:/3ds/psx3ds/目录后从 Homebrew Launcher 启动。- 所有发布文件均可通过
SHA256SUMS.txt校验完整性。
PSX3DS v0.2.0 — ARM11v6K Dynarec, PICA200 Hardware GPU, CHD Support & Installable CIA
PSX3DS v0.2.0 — ARM11v6K Dynarec, PICA200 Hardware GPU, CHD v5 & Installable CIA
PSX3DS is a PlayStation 1 (PSX) emulator built from scratch in C11 and ARMv6K assembly specifically for the Nintendo 3DS (ARM11 MPCore + VFPv2 + PICA200 GPU + 4-core multi-threading).
v0.2.0 adds full CHD v1–v5 compressed disc streaming (cdzl / cdlz / cdzs / cdfl + multi-hunk LRU cache + Core 2 async offload) and an installable universal .cia package unlocking native Horizon OS SVC 0x70 hardware W^X dual-mapped JIT on Luma3DS across both New 3DS and Old 3DS.
English Highlights
- Installable Universal
.cia(psx3ds.cia,789 KiB):- Install directly via FBI onto the 3DS Home Menu (
TitleID 000400000F853D00, custom 3D banner, icon & boot chime). - Grants native
SVC 0x70(ControlProcessMemory) for hardware W^X dual-mapped RW+RX JIT (JIT_MEM_MIRROR_RWRX) on Luma3DS,804 MHzARM11 +2 MiBL2 +124 MiBFCRAM + Core 2 +ir:rst/qtm:sC-Stick & ZL/ZR on New 3DS / New 2DS XL. - Automatically adapts to Old 3DS / Old 2DS (
64 MiBFCRAM,268 MHz) via thesmall_memprofile (20 MiBlinear heap +42.6 MiBnormal heap,26 MiBarena,6 MiBJIT cache, 20-slotRGBA5551texture cache, 4-slot CHD cache).
- Install directly via FBI onto the 3DS Home Menu (
- Full CHD v1–v5 Compressed Disc Streaming (
libchdrv0.3.0):- Supports all four CHD v5 CD codecs —
cdzl(Deflate),cdlz(LZMA),cdzs(Zstandard), andcdfl(FLAC 16-bit CD-DA + Subcode) — plus legacy CHD v1–v4, shrinking PS1 multi-bin dumps by 40–60% into single.chdfiles (chdman createcd -i game.cue -o game.chd). - Exact
CD_TRACK_PADDING = 4multi-track frame remapping, synthesized Q-subchannel BCD MSF addresses, and ARMv6K two-sample-per-wordREV16big-to-little-endian CD-DA swap. - 8-slot LRU hunk cache (
87.5%sequential cold hit rate;1,531 MB/swarm on ARM11v6K) + lock-serialized Core 2 async decompression, running 64×–138× faster than PS1 2× CD-ROM (22.4–48.3 MB/scold decode on ARM11v6K).
- Supports all four CHD v5 CD codecs —
arm_jitMIPS R3000A → ARM11v6K Dynamic Recompiler & 100% Inline GTE:71.0×faster than interpreter on compute loops; all 22 GTE (COP2) commands emitted inline using ARMv6SMLAD/SMLALD(1,150 / 1,150gte-test-all,00000101psxtest_cpu).- Sub-page 64-byte SMC bitmask eliminates display-list/BSS false invalidations (
69/frame → 0/framesteady-state recompiles;788.8 FPSCube,512.7 FPSPSXNICCCon ARM11v6K harness).
- Batched PICA200 Hardware GPU (
gpu_citro3d) + Multi-Core SPU (ndsp):- 2-stage TEV textured/untextured/
FillRectbatch fusion + Morton texture cache with per-8×8-tile STP semi-transparency masks (2.5×–3.5×faster than ARMv6 SIMD software rasterizer) + Core 144.1 kHzstereo SPU worker (92–97%fewer audio underruns).
- 2-stage TEV textured/untextured/
Quick Start (SD Card Installation)
- Extract
psx3ds-v0.2.0-3ds.zipdirectly to the root of your 3DS SD card (sdmc:/), or grab standalonepsx3ds.cia/psx3ds.3dsx. - Recommended (
.cia): Open FBI →SD→cia→psx3ds.cia→ Install and delete CIA, then launch PSX3DS from the Home Menu.
(Homebrew Launcher users can launchsdmc:/3ds/psx3ds/psx3ds.3dsxdirectly.) - Place your legally dumped PS1 BIOS (
SCPH1001.BIN) insdmc:/psx3ds/bios/(MIT-licensedopenbios.binis pre-included for homebrew / PS-EXE titles; retail CD/CHD games require a console BIOS) and drop.chd/.cue+.bin/.iso/.exetitles intosdmc:/psx3ds/roms/. Ensuresdmc:/3ds/dspfirm.cdcis dumped for hardwarendspaudio.
中文更新说明(v0.2.0 亮点)
- 原生可安装
.cia安装包(支持 FBI 安装,通吃新三 / 老三):- 使用 Luma3DS 上的 FBI 安装
psx3ds.cia(自带专属 3DS 桌面图标、横幅动画与启动音效),直接从桌面启动。 - 原生解锁 Horizon OS
SVC 0x70硬件级 W^X 双映射动态重编译(JIT_MEM_MIRROR_RWRX);在 New 3DS / New 2DS XL 上自动开启804 MHz超频 +2 MiBL2 缓存 +124 MiB大内存 + Core 2 独立光驱核 + C-Stick 右摇杆与 ZL/ZR(ir:rst/qtm:s);在 Old 3DS / 2DS(64 MiB/268 MHz) 上自动切换small_mem精简内存池并保持满速 ARM11 JIT!
- 使用 Luma3DS 上的 FBI 安装
- 完整支持 CHD v1–v5 无损压缩光盘镜像(单文件省空间 40%–60%):
- 内置
libchdr v0.3.0+ 3DS 硬件浮点解码库,完整支持cdzl(Deflate)、cdlz(LZMA)、cdzs(Zstd)、cdfl(FLAC 无损音轨 + ARMv6KREV16字节序加速) 四大 CHD v5 编码与多轨 4 扇区对齐重映射(可通过chdman createcd -i game.cue -o game.chd一键转换)。 - 配备 8 槽位 LRU Hunk 缓存(顺序读取命中率
87.5%,ARM11 缓存命中带宽1,531 MB/s,冷解码吞吐达 PS1 双倍速光驱的 64–138 倍)以及 Core 2 后台异步预读解压,UI 列表自动显示[CHD]标识与实时缓存命中率。
- 内置
- 专为 3DS ARM11 + PICA200 深度定制的极速内核:
arm_jit动态重编译器 + 100% 内联 ARMv6K GTE 几何引擎(全部 22 条 GTE 指令采用SMLAD/SMLALD内联发射,零函数调用开销,通过psxtest_cpu与gte-test-all1150/1150 严苛测试)+ 64 字节子页级 SMC 脏行掩码(稳态每帧重编译降至0)。- PICA200
citro3d硬件加速渲染(2 阶段 TEV 批次融合 + Morton 纹理缓存 + 8×8 图块半透明 STP 精准分类)+ Core 1 独立 SPU44.1 kHz混音线程。
安装与目录结构
将 psx3ds-v0.2.0-3ds.zip 解压到内存卡根目录:
sdmc:/cia/psx3ds.cia— 推荐通过 FBI 安装至桌面(解锁完整SVC 0x70W^X JIT 权限)sdmc:/3ds/psx3ds/{psx3ds.3dsx, psx3ds.smdh}— Homebrew Launcher 自制系统启动版sdmc:/psx3ds/bios/— 放入自备主机提取的SCPH1001.BIN(压缩包内亦附带开源 MIT 协议openbios.bin)sdmc:/psx3ds/roms/— 放入.chd(推荐)、.cue/.bin、.iso或.exe游戏镜像
Benchmark & Verification Snapshot (v0.2.0)
| Metric | Measured Result |
|---|---|
Unit & Sanitizer Gates (ctest) |
19 / 19 PASS on x86_64 ASan+UBSan (-Werror, 0 leaks/UB) & 19 / 19 PASS on qemu-arm -cpu arm11mpcore (0 warnings, 0 SIGILL) |
PS1 CPU & GTE Accuracy (arm_jit) |
psxtest_cpu.exe 00000101 PASS; gte-test-all.exe 1,150 / 1,150 PASS (100% inline ARMv6K GTE) |
| CHD v5 Throughput (ARM11v6K / x86_64) | Zstd 48.3 / 206.9 MB/s, Deflate 28.7 / 163.0 MB/s, LZMA 27.6 / 108.3 MB/s, FLAC 22.4 / 118.2 MB/s; 8-slot LRU warm 1,531 / 28,356 MB/s |
3DS .cia/.cci & .3dsx (azahar-headless) |
Cube.exe 120.7 FPS (N3DS) / 120.2 FPS (O3DS 64 MiB small_mem); PSXNICCC.exe 117.9 FPS; cube_v5.chd bit-identical vs ISO |
See docs/BENCHMARKS.md and docs/ARCHITECTURE.md for full architecture and telemetry details. Verify release downloads against SHA256SUMS.txt.