source: vital-to8-sdk/samples/modplayer/player.asm @ 1

Last change on this file since 1 was 1, checked in by svn, 5 years ago

Import initial

File size: 1.4 KB
Line 
1****************************************************************
2****************************************************************
3(main)player.asm
4
5        ORG     $9000
6
7        PSHS    U,X,DP,B,A,CC
8
9        ORCC    #$50
10        LDA     #$FB
11        ANDA    $E7CF
12        STA     $E7CF
13        LDA     #$3F
14        STA     $E7CD
15        LDA     #$04
16        ORA     $E7CF
17        STA     $E7CF
18        LDX     #$A000
19        STX     pos_song
20        BRA     loop
21
22        PULS    U,X,DP,B,A,CC
23        RTS
24
25fine    fcb     0
26pos_song fcb    $A0,$00
27
28
29
30
31****************************************************************
32*
33*
34*       bank 5
35*       read pattern info
36*       switch to bank
37*       read pattern data
38*       output to DAC
39*       advance in pattern
40*       if necessary, advance in song
41*       try to be less than 64, fixed timing
42*
43****************************************************************
44
45loop
46        LDB     #05
47        STB     $E7E5
48        LDX     pos_song
49        LDB     ,x+
50        LDA     ,x+
51        TFR     x,y
52* switch to pattern bank
53        STB     $E7E5
54        CLRB
55        ADDA    #$A0
56        TFR     D,X
57        LDB     fine
58        ABX     
59        LDA     ,x
60        STA     $E7CD
61        INCB   
62        CMPB    #160
63        BEQ     end_chunk
64        STB     fine
65        BRA     wait1
66wait1   BRA     wait2
67wait2   BRA     end
68end_chunk
69        CLR     fine
70        STY     pos_song       
71       
72end
73*  85 cycles for now ... wait 43
74        MUL
75        MUL     
76        MUL
77        NOP
78        NOP
79        BRA     pre_end
80pre_end BRA     loop
81
82
83
84****************************************************************
85*
86*       Attente de la VBL       
87*
88****************************************************************
89VSYNC
90VSYNC_1
91        TST     $E7E7
92        BPL     VSYNC_1
93VSYNC_2
94        TST     $E7E7
95        BMI     VSYNC_2
96
97        RTS
98
99
Note: See TracBrowser for help on using the repository browser.