I can see that playerZ88dk.asm uses the code_user section but has a bunch of defw variables at the end of the file which are written to. Since it's a code section it will be located in ROM and they won't be modifiable. I temporarily changed it to data_user to get it into RAM.
The parameters for ply_akg_init are being handled incorrectly:
Code: Select all
-extern void ply_akg_init( void *song, unsigned int subsong ) __z88dk_callee;
+extern void ply_akg_init( void *song, unsigned int subsong ) __z88dk_callee __smallc;
;;
;; void ply_akg_init( void *song, uint8_t subsong ) __z88dk_callee __smallc;
-;; (params pushed on the stack right to left, all 16-bit)
+;; (params pushed on the stack left to right, all 16-bit)
;;
_ply_akg_init:
pop bc ; BC = retaddr
+ pop de ; E = subsong number
pop hl ; HL = song address
- pop af ; A = subsong number
push bc ; restore retaddr
+ ld a,e
jp PLY_AKG_INIT
Code: Select all
- setup_int();
+// setup_int();
printf("After\n");
while ( 1 ) {
- /*(*(uint8_t *)0x4000)++;
-
+ printf(".");
intrinsic_di();
ply_akg_play();
intrinsic_ei();
- intrinsic_halt();*/
+ printf("/");
+ intrinsic_halt();
}
Which means the player is getting stuck again.