Page 2 of 4
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 6:46 pm
by svenvandevelde
7 minutes ago, svenvandevelde said:
The problem is deeper. Try to show me these instructions in a direct screenshot of the monitor where the PC is in this routine: (the routine is the ROM routine). I can also display the routine, but I want to walk the routine step by step in the ROM.
And before you consider, want to say thank you you're spending your time on this with me ... it may help other people later ...
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 6:48 pm
by JimmyDansbo
I am not sure I understand the problem. I have made a short video where I follow the call the FFD5. Let me know what it is I am not seeing.
https://streamable.com/knpl04
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 8:29 pm
by svenvandevelde
1 hour ago, JimmyDansbo said:
I am not sure I understand the problem. I have made a short video where I follow the call the FFD5. Let me know what it is I am not seeing.
https://streamable.com/knpl04
This is what we should see when walking the code ...
This is the routine in the rom of the load.s cbm code, modifed by michael steil to also support loading files into the vera etc.
And this code is in bank 0! Because the kernal code is in bank 0. Bank 4 contains the Visual Basic code, and that is not what i meant here.
The C procedure directly calls FFD5, and then it's impossible to see this code in the monitor.
Try to go to bank 0 with d 0d949 ... And you'll see the above. This is the right code.
When you type B ROM 0 (so BKO becomes 00, then when jumping to D949 nothing happens but the code seems to execute directly to the rts.
But i remember something ... The monitor of the x16 seems to be derived from the monitor that was created in the final cardridge...
I remember when I was like 16 years old or so, my friend had this cardridge (I envied that ...), that the ROM was not disassembled due to copyright restrictions.
Could it be that this piece of restriction is still in the monitor? (That would be amazing).
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 8:49 pm
by JimmyDansbo
The debugger and the monitor is NOT the same. Debugger is what we have been looking at so far, but you have a monitor in the emulator as well that can be invoked by typing MON in BASIC.
The Monitor in X16 is derived from the monitor in final cartridge, but the debugger is not the same.
If you change RAM or ROM bank during execution of code, you can not expect things to work correctly.
If you follow the call to FFD5 all the way through, you will find that BASIC seems to do some stuff before it changes the ROM bank to 0 and calls FFD5... just keep stepping through the code and you will eventually get to the point you want 00:D949
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 8:53 pm
by svenvandevelde
6 minutes ago, JimmyDansbo said:
The debugger and the monitor is NOT the same. Debugger is what we have been looking at so far, but you have a monitor in the emulator as well that can be invoked by typing MON in BASIC.
The Monitor in X16 is derived from the monitor in final cartridge, but the debugger is not the same.
If you change RAM or ROM bank during execution of code, you can not expect things to work correctly.
If you follow the call to FFD5 all the way through, you will find that BASIC seems to do some stuff before it changes the ROM bank to 0 and calls FFD5... just keep stepping through the code and you will eventually get to the point you want 00:D949
ohh! didn't realize that! so you're saying that the debugger should be able to disassemble the 00:D949 ... well, I am unable and I really don't know what i'm doing wrong.
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 9:02 pm
by JimmyDansbo
Here is a new video where I step all the way through to the code you want.
All I do is press F11 and ensure the debugger shows me the correct code if it jumps to banked ROM address
https://streamable.com/fxj3dr
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 9:03 pm
by svenvandevelde
13 minutes ago, JimmyDansbo said:
The debugger and the monitor is NOT the same. Debugger is what we have been looking at so far, but you have a monitor in the emulator as well that can be invoked by typing MON in BASIC.
The Monitor in X16 is derived from the monitor in final cartridge, but the debugger is not the same.
If you change RAM or ROM bank during execution of code, you can not expect things to work correctly.
If you follow the call to FFD5 all the way through, you will find that BASIC seems to do some stuff before it changes the ROM bank to 0 and calls FFD5... just keep stepping through the code and you will eventually get to the point you want 00:D949
I had a thorough look again at your video. Your video is not showing the code at 00:D949 ... Are you able to debug
into that code fragment starting at 00:D949?
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 9:06 pm
by svenvandevelde
3 minutes ago, JimmyDansbo said:
Here is a new video where I step all the way through to the code you want.
All I do is press F11 and ensure the debugger shows me the correct code if it jumps to banked ROM address
https://streamable.com/fxj3dr
aha! now i see it! indeed! after a while it goes into 00:D949 ... I need to check myself. Could it be that what we see first is the routines they wrote for what we call a "far" jmp?
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 9:06 pm
by JimmyDansbo
It is very possibly a far jump, I have not looked into the code in BASIC ROM to see what it actually does.
Problems with FFD5 CBM LOAD API in X16
Posted: Sat Feb 06, 2021 9:19 pm
by svenvandevelde
10 minutes ago, JimmyDansbo said:
It is very possibly a far jump, I have not looked into the code in BASIC ROM to see what it actually does.
Still having issue, i just cannot get this 00:d949 displayed, but you are showing it in your video ...
What key are you using here

at second 1:01 in your video, to do this jump to

?