commanderx16 / x16-emulator

Emulator for the Commander X16 8-bit computer
384 stars 60 forks source link

Load kernel call doesn't load into the currently set RAM bank #33

Closed mist64 closed 5 years ago

mist64 commented 5 years ago

load-page-issue-emu-29.zip

Program to demonstrate loading issue into page $A000. It appears as though the load kernel call doesn't load into the currently set ram bank.

This program loads demo data into page 0 and 1, prints it out, then loads a file (while bank $1 is active), after the load the bank data is printed out.

1) Copy loadpage.prg and page1.dat to the emulator directry 2) Cold boot emulator 29 3) Load the example program LOAD "loadpage.prg",1,1 4) Run the program SYS 4096 *) Loadpage produces the following output

    PAGE 0 BEFORE LOAD: PAGE0
    PAGE 1 BEFORE LOAD: PAGE1
    -------------------------------------
    LOADING PAGE1.DAT
    CURRENT BANK IS: 1
    -------------------------------------
    PAGE 0 AFTER LOAD : DATA FILE DATA FILE DATA FILE
    PAGE 1 AFTER LOAD : PAGE 1

*) The string "DATA FILE", etal, should be in bank 1 and page 0 should display "PAGE 0"

Bonus behavior 5) Run test program again SYS 4096

*) The first line now displays PAGE 0 AFTER LOAD : DATA FILE DATA FILE DATA FILE (it should have displayed : PAGE0)

It almost looks like writes to bank 0 were ignored.

SDCARD test 6) Modify device number in loadpage.a to 8 (in SETLFS) 7) Re-assemble loadpage.prg 8) Copy loadpage.prg and page1.dat to sd card 9) Cold boot emulator 10) Load program LOAD "LOADPAGE.PRG",8,1 11) Run SYS 4096 *) Same output behavior as previously noted on device 1 and Bonus output.

indigodarkwolf commented 5 years ago

Thanks for accepting my fix!

mist64 commented 5 years ago

Thanks for fixing! :D

mist64 commented 5 years ago

The SD card code has the same problem, but with a very different root cause. Fixed in https://github.com/commanderx16/x16-rom/commit/006146cc870260a06af5a3f6e3aafcb9d463519f