Problems with FFD5 CBM LOAD API in X16

Get technical support from the community & developers with specific X16 programs if you can't find the solution elsewhere
(for general non-support related chat about programs please comment directly under the program in the software library)
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Problems with FFD5 CBM LOAD API in X16

Post 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.



 



 



image.png.5327c28266eab518c1fb629ee09bc72c.png



image.png.5a311fcd133f5c3d3a03fa53595b43df.png



And before you consider, want to say thank you you're spending your time on this with me ... it may help other people later ...

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Problems with FFD5 CBM LOAD API in X16

Post 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

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Problems with FFD5 CBM LOAD API in X16

Post 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 ...

image.png.0de4fe111be0b8dc405fdebcddaea5a8.png

 

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).

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Problems with FFD5 CBM LOAD API in X16

Post 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

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Problems with FFD5 CBM LOAD API in X16

Post 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.

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Problems with FFD5 CBM LOAD API in X16

Post 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

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Problems with FFD5 CBM LOAD API in X16

Post 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?

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Problems with FFD5 CBM LOAD API in X16

Post 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?

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Problems with FFD5 CBM LOAD API in X16

Post 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.

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Problems with FFD5 CBM LOAD API in X16

Post 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 image.png.b766947392332e8a31c9baf1961be94b.png at second 1:01 in your video, to do this jump to image.png.cf4ee5e80d39f1e2230b2b8ed71110f6.png ?

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
Post Reply