HPMANLe 25/08/2017 à 21:16
Write an asm sub in a .s file (then add to project makefile etc):
.globl CDDA_command
CDDA_command:
move.w 6(a7), d0
movem.l d2-d7/a2-a6, -(a7)
jsr 0xc0056a
movem.l (a7)+, d2-d7/a2-a6
rts
Declare it somewhere in a .h file:
void CDDA_command(ushort cmd);
I'm not sure if the bios call scraps the registers, registers push/pop around the call might be unnecessary.
Staying in C, it should be something looking like:
__asm__ (
"move.l %0, %%d0 \n"
"movem.l %%d2-%%d7/%%a2-%%a6, -(%%a7) \n"
"jsr 0xc0056a \n"
"movem.l (%%a7)+, %%d2-%%d7/%%a2-%%a6 \n"
:
:"r"(/*CDDA code expression*/)
:"d0", "d1", "a0", "a1", "cc"
);
I hardly ever use this method tho, so it might need some corrections.