Open totologic opened 3 years ago
Oh I never tried that, let me keep that open as a future feature. I never tried it, but I think ideally from C, you should run something like:
__asm__ __volatile__ ("jsr 0xc00468" : : :
"d0","d1","d2","d3","d4","d5","d6","d7",
"a0","a1","a2","a3","a4","a5","a6");
I'm not sure of the calling convention so here the example request gcc to save all registers. I'll add a dedicated header with the appropriate macros to call all the BIOS functions.
No problem, I am going to try today.
Excellent ! It works. Quickly, I retrieved with success the user name of the memcard.
`
char data[8]; char msg[4];
BIOS_CARD_START = (u32)data; BIOS_CARD_COMMAND = 7; asm volatile ("jsr 0xc00468" : : : "d0","d1","d2","d3","d4","d5","d6","d7", "a0","a1","a2","a3","a4","a5","a6");
display(1, 2, data); // display user name data string on fx layer snprintf(msg, 4, "%2d", *BIOS_CARD_ANSWER); display(1, 3, msg);// display error code `
Great!
For what it's worth, latest ngdevkit master provides additional headers/helpers that allow you to access the data in the BIOS's memory as if they were regular C variables:
#include <ngdevkit/bios-ram.h>
[...]
bios_card_start = (u32)data;
bios_card_command = 7;
Maybe that can be of interest for you.
Also I am able to load/save data.
After experimenting, I want to raise 2 issues:
*BIOS_CARD_FCB = 0x83;
Hi.
Actually not really an issue. I am just interested in reading/saving datas on the memory card and I have no idea how to perform it.
I understand well the principles of the variables involved by the CARD system, as decribed in the wiki: https://wiki.neogeodev.org/index.php?title=CARD
But how to make a bios call to CARD ($C00468) ?