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 »



6 minutes ago, JimmyDansbo said:




Ok, that seems to work just fine ?



 



breakfast, i'll come back to this later today, ok?

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 »



10 minutes ago, svenvandevelde said:




breakfast, i'll come back to this later today, ok?



No worries, I will not have any time to look at it before tonight anyway.

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 »



2 hours ago, JimmyDansbo said:




No worries, I will not have any time to look at it before tonight anyway.



OK... Breakfast done and this is the result ... It all seems to work now.

Note that I've now properly dealt with the 2 byte header in each file, maybe that was the root cause why the API returned with an error.

Also, the load file (space.ld), I had accidentally commented the .file line of the program itself, so that could also have been the reason!

It all works now ...

This peace of code implements the smooth scroll reset. It's neat. Once a tile segment has been smoothly scrolled, move the remaining segments one row up, and reset the scroll.


if(vscroll>(64)*2-1) {



            memcpy_in_vram(1, <VRAM_TILEMAP, VERA_INC_1, 1, (<VRAM_TILEMAP)+64*16, VERA_INC_1, 64*16*4);



            for(byte r=4;r<5;r+=1) {



                for(byte c=0;c<5;c+=1) {



                    byte rnd = (byte)modr16u(rand(),2,0);



                    vera_tile_element0, c, r, 3TileDB[rnd]);



                }



            }



            vscroll=0;



        } 


Sven

 

Smooth scroll.gif

TILES ENEMY2 PALETTES PLAYER Space.asm Space.c space.ld Space.prg SQUAREMETAL TILEMETAL

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 »

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 »


Glad to hear you got the issue solved. Your graphics looks pretty cool ?

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
Ed Minchau
Posts: 503
Joined: Sat Jul 11, 2020 3:30 pm

Problems with FFD5 CBM LOAD API in X16

Post by Ed Minchau »



10 hours ago, svenvandevelde said:




So in summary, it is impossible to show the code at 00:D949?



No, it is possible.  I use the META/L editor 


 

I made a quick video to show how to look at the code in ROM.  There's no stepping function in the META/L editor, but you can add labels and comments to code as you're looking through it.





 

SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

Problems with FFD5 CBM LOAD API in X16

Post by SlithyMatt »



12 hours ago, svenvandevelde said:




So in summary, it is impossible to show the code at 00:D949?



You can see the code, you just won't actually be stepping to it. The emulator traps out if you are using the host file system and does a native fopen/fread of the data and then dumps you back at the end of the LOAD subroutine. If you want to see the code, you can type D0D949 and you will see it in the debugger, but if you try to set a breakpoint, it probably won't work unless that code is actually getting executed. If you want to really go through that code, you need to use an SD card image.

ZeroByte
Posts: 714
Joined: Wed Feb 10, 2021 2:40 pm

Problems with FFD5 CBM LOAD API in X16

Post by ZeroByte »


Out of curiosity, why are you scrolling like C64 where you scroll by one tile's worth of pixels and then cascading them down?

So long as your tilemap is large enough to have rows that are off-screen, then you can write the new row of tiles directly into the tilemap and just keep incrementing/decrementing the scroll register. It will run much faster to do it that way. Obviously there're plenty of reasons why you may be doing it that way - just curious what the thought process was.

Post Reply