X16Community / x16-rom

Other
43 stars 27 forks source link

KERNAL: Regression in `load` in ROM v47 breaks RALLYSPEEDWAY when loading via IEC #367

Open tmcintos opened 2 weeks ago

tmcintos commented 2 weeks ago

Please review my comments here:

https://github.com/X16Community/x16-rom/commit/f629cff8cdacc4b5dba8a86068833d57b99a5d83#r147340847

Copied here for reference:

ld81    lda verck
    dec
    beq ld64        ; loading to VRAM

Isn't this test wrong in the case that >1 VRAM bank is being loaded? In that case, verck may be >1 before it is decremented, as I understand from the comments above.

I identified a regression here between ROM v46 and v47/v48 with RALLYSPEEDWAY when loading TRAFFIC.BIN into VRAM. v47/v48 go through this path to send a premature UNTALK command after reading something like 492 bytes from the file. Similar errors occur with subsequently-loaded files and the game errors out before reaching the title screen. With ROM v46 the game is able to launch as expected.

I observe this with my custom emulator that emulates a CX16 with disk attached via IEC (no kernel intercepts or other shortcuts).

I'm unable to reproduce the problem with the official x16emu, since I can't successfully boot to the prompt when supplying the -serial command line option to x16emu_macos_m1-r48 (running on macOS 15.1 beta, if it's relevant). If the -serial option worked, I expect we'd see the same thing there. I'd also expect to see the problem on a real CX16 with IEC-attached drive, but I don't have one to test with.

The problem does not occur on x16emu_macos_m1-r48 when running without -serial or with the -sdcard option, which I presume will bypass this path.

tmcintos commented 2 weeks ago

maybe this will help

Looks like spam/malware