Page 4 of 4

Problems with FFD5 CBM LOAD API in X16

Posted: Sun Feb 07, 2021 8:35 am
by svenvandevelde


6 minutes ago, JimmyDansbo said:




Ok, that seems to work just fine ?



 



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


Problems with FFD5 CBM LOAD API in X16

Posted: Sun Feb 07, 2021 8:46 am
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.


Problems with FFD5 CBM LOAD API in X16

Posted: Sun Feb 07, 2021 11:02 am
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


Problems with FFD5 CBM LOAD API in X16

Posted: Sun Feb 07, 2021 11:24 am
by svenvandevelde

Problems with FFD5 CBM LOAD API in X16

Posted: Sun Feb 07, 2021 5:29 pm
by JimmyDansbo

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


Problems with FFD5 CBM LOAD API in X16

Posted: Sun Feb 07, 2021 5:53 pm
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.





 


Problems with FFD5 CBM LOAD API in X16

Posted: Sun Feb 07, 2021 7:54 pm
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.


Problems with FFD5 CBM LOAD API in X16

Posted: Wed Mar 03, 2021 11:24 pm
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.