Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
;We must inform compiler that we are going to use Raster Music Tracker (rmt).
use rmt
;Declare the module to use.
const musmod:array = file "delta.rmt"
;Initialize the music engine (specify, which module to use)
music'init musmod
;It is necessary to call the music'play routine every 1/50 of second.
;We will call it from VBI, here we prepare the appropriate routine.
;It is of course possible to add other functionality to VBI, if necessary.
play:vbi =
music'play
;Start playing (set the vbi to our routine).
;We cannot set the music'play routine directly to VBI, because it is normal
;subroutine, not interrupt routine.
on'vbi play
"Done."
void main(void)
{
unsigned char index;
index=0x25;
}
; unsigned char index;
;
jsr decsp1
;
; index=0x25;
;
lda #$25
ldy #$00
sta (sp),y
;
; } leave function
;
jsr incsp1
rts
L0003:
.res 1,$00
;
; index=0x25;
;
lda #$25
sta L0003
;
; }
;
rts
void fun_a()
{
unsigned char index;
index=0x12;
}
void fun_b()
{
unsigned char index;
index=0x24;
}
void main(void)
{
fun_a();
fun_b();
}
.segment "CODE"
.proc _fun_a: near
.segment "BSS"
L0003:
.res 1,$00
.segment "CODE"
; index=0x12;
lda #$12
sta L0003
rts
.endproc
;
.proc _fun_b: near
.segment "BSS"
L0007:
.res 1,$00
.segment "CODE"
; index=0x24;
lda #$24
sta L0007
rts
.endproc
.proc _main: near
jsr _fun_a
jmp _fun_b
.endproc
unsigned char index_a;
unsigned char index_b;
unsigned char map[5];
void test_function_1()
{
unsigned char position alias index_a;
unsigned char loop alias index_b;
for(loop=0;loop<5;++loop)
{
map[position]=loop;
}
}
void test_function_2()
{
unsigned char temp_value alias index_a;
temp_value=map[0];
map[0]=map[1];
map[1]=temp_value;
}