Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Community Answers

  1. JimmyDansbo's post in Current cursor physical line number R38 was marked as the answer   
    Yes, that is also possible however it requires that you set the carry flag before calling it to get it to return the actual coordinates.
    Something like this one-liner should work
    Address 780-783 are the CPU registers and flags just as the Commodore 64, see https://www.c64-wiki.com/wiki/SYS
    $FFF0 is the kernal PLOT routine, see https://cx16.dk/c64-kernal-routines/plot.html
    You do not have to switch ROM as the BASIC ROM does indeed have stubs to forward calls to the Kernal ROM just as @Scott Robison mentioned.
    Above line will of course use more CPU cycles than a simple peek of a memory address, but you should be fairly certain that the addresses do not change.
  2. JimmyDansbo's post in Current cursor physical line number R38 was marked as the answer   
    A lot have moved around in the X16 kernal, but you are on the right track.
    A quick search of tblx in the .sym files of R38 shows that $0383 should indeed be the location of tblx and when trying it out, it works just fine and returns the current line of the cursor.
  3. JimmyDansbo's post in C64 Kernal Clear Screen Line = ? was marked as the answer   
    59903 = $E9FF
    Looking at https://www.pagetable.com/c64ref/c64disasm/ I found that address to be the start of a function called CLRLN (Clear Line).
    Then I looked through the X16 source code to find the CLRLN function, but it does not exist instead I found the screen_clear_line function and looking at the .sym files I found the entry address of $C88E
    Unfortunately BASIC lives in ROM bank 4 and the screen_clear_line function is in ROM bank 0 so it is not possible to call it directly without switching banks. I tried switching banks in BASIC by poking the VIA, but as soon as the bank is switched, BASIC is no longer able to run and the emulator hangs (of course).
    I have written a small program that actually calls the screen_clear_line functions and ensures that the ROM banks selection is correct, but it might be just as easy to just clear the line through ordinary BASIC code.
    Line 10 is actually a small machine language program that sets the ROM bank to 0, calls the screen_clear_line function and sets the ROM bank back to 4 before returning.
    Line 20 Writes the machine language program to RAM address $400 (golden RAM)
    Line 30 Sets the line that should be cleared and calls the machine language function.
    This is the disassembly of the machine language program in line 10:
    Note that when R39 of the ROM is released, this code will no longer work as the bank switching is moved down to zero-page.
  4. JimmyDansbo's post in Can someone post... was marked as the answer   
    Let me know when you have them, I will take them down again.
  5. JimmyDansbo's post in Viewing banks with emu debugger / MON command was marked as the answer   
    In the debugger, you just do: DbankADDR so something like D4A000 will show code at address $A000 in bank 4. 
    M4A000 would show the memory contents of $A000 in bank 4
  6. JimmyDansbo's post in What's wrong with this line here? was marked as the answer   
    That is from Release 37 of the ROM
  7. JimmyDansbo's post in GETIN que was marked as the answer   
    You could ensure that you empty the que every time you have read a character.
  8. JimmyDansbo's post in How to display sprites? was marked as the answer   
    wow, Hugo is pretty demanding 😉
    Dusan, do you have a tutorial on loading .bin files as well?
    Otherwise, Hugo, have a look at this, it might help explain the missing part:
    Be sure to follow the link to the example: https://gist.github.com/JimmyDansbo/f955378ee4f1087c2c286fcd6956e223 and read the comment I added
  9. JimmyDansbo's post in glibc 2.29 required was marked as the answer   
    I have done the following:
    After that x16emu -sound shows:
    I can then run x16emu -sound "Dummy, Dummy PCM"
  10. JimmyDansbo's post in Loading a file into VRAM (Assembly) was marked as the answer   
    You can actually use the LOAD KERNAL API ($FFD5) call
    Have a look at this example: https://gist.github.com/JimmyDansbo/f955378ee4f1087c2c286fcd6956e223
    It is written for ROM version r36 and VERA pre 0.9, but if you start at line 61 you see the setup to actually load a file directly into VERA memory.
  • Create New...

Important Information

Please review our Terms of Use