Last active
August 29, 2015 14:23
-
-
Save reidrac/c8c788873806c38dcd62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Esto es, por ejemplo, del Ninjajar. | |
En lugar de usar una variable para acceder a los parámetros, | |
podéis usar __CALLEE__ call convention de Z88DK. | |
(esto es de memoria, pero igual hasta va!) | |
*/ | |
void peta_el_beeper (unsigned char n) { | |
// Cargar en A el valor de n | |
asm_int [0] = n; | |
#asm | |
ld a, (_asm_int) | |
call playsfx | |
#endasm | |
} | |
void __CALLEE__ peta_el_beeper(unsigned char n) { | |
#asm | |
; uso de y hl porque playsfx machacan su contenido | |
pop de ; dir retorno | |
pop hl ; parametro | |
push de ; restaura retorno | |
ld a, l ; carga el en A el valor del parametro (n) | |
call playsfx | |
#endasm | |
} | |
void __FASTCALL__ peta_el_beeper(unsigned char n) { | |
#asm | |
ld a, l ; carga el en A el valor del parametro (n) | |
call playsfx | |
#endasm | |
} | |
/* o incluso, sin peta_el_beeper! renombrando playsfx a _playsfx */ | |
extern __FASTCALL__ playsfx(unsigned char n); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment