mirror of
https://github.com/pevans/erc-c.git
synced 2024-10-31 13:07:14 +00:00
146 lines
2.9 KiB
NASM
146 lines
2.9 KiB
NASM
GBASL EQU $26
|
|
GBASH EQU $27
|
|
BAS2H EQU $2B
|
|
A1L EQU $3C
|
|
A1H EQU $3D
|
|
A3L EQU $40
|
|
A3H EQU $41
|
|
STACK EQU $0100
|
|
OFFPH0 EQU $C080
|
|
ONPH0 EQU $C081
|
|
TURNON EQU $C089
|
|
SLCTD1 EQU $C08A
|
|
READ EQU $C08C
|
|
SETRD EQU $C08E
|
|
WAIT EQU $FCA8
|
|
IMMRTS EQU $FF58
|
|
00:A2 20 LDX #$20
|
|
02:A0 00 LDY #$00
|
|
04:A2 03 LDX #$03
|
|
06:86 3C SAVTMP STX A1L
|
|
08:8A TXA
|
|
09:0A ASL A
|
|
0A:24 3C BIT A1L
|
|
0C:F0 10 BEQ INCX
|
|
0E:05 3C ORA A1L
|
|
10:49 FF ADC #$FF
|
|
12:29 7E AND #$7E
|
|
14:B0 08 HASCRY BCS INCX
|
|
16:4A LSR A
|
|
17:D0 FB BNE HASCRY
|
|
19:98 TYA
|
|
1A:9D 56 03 STA $0356,X
|
|
1D:C8 INY
|
|
1E:E8 INCX INX
|
|
1F:10 E5 BPL SAVTMP
|
|
21:20 58 FF JSR IMMRTS
|
|
24:BA TSX
|
|
25:BD 00 01 LDA STACK,X
|
|
28:0A ASL
|
|
29:0A ASL
|
|
2A:0A ASL
|
|
2B:0A ASL
|
|
2C:85 2B STA $2B
|
|
2E:AA TAX
|
|
2F:BD 8E C0 LDA SETRD,X
|
|
32:BD 8C C0 LDA READ,X
|
|
35:BD 8A C0 LDA SLCTD1,X
|
|
38:BD 89 C0 LDA TURNON,X
|
|
3B:A0 50 LDY #$50
|
|
3D:BD 80 C0 LDA OFFPH0,X
|
|
40:98 TYA
|
|
41:29 03 AND #$03
|
|
43:0A ASL
|
|
44:05 2B ORA $2B
|
|
46:AA TAX
|
|
47:BD 81 C0 LDA ONPH0,X
|
|
4A:A9 56 LDA #$56
|
|
4C:20 A8 FC JSR WAIT
|
|
4F:88 DEY
|
|
50:10 EB BPL [3d]
|
|
52:85 26 STA GBASL
|
|
54:85 3D STA A1H
|
|
56:85 41 STA A3H
|
|
58:A9 08 LDA #$08
|
|
5A:85 27 STA GBASH
|
|
5C:18 CLC
|
|
5D:08 PHP
|
|
5E:BD 8C C0 LDA READ,X
|
|
61:10 FB BPL [5e]
|
|
63:49 D5 EOR #$D5
|
|
65:D0 F7 BNE [5e]
|
|
67:BD 8C C0 LDA READ,X
|
|
6A:10 FB BPL [67]
|
|
6C:C9 AA CMP #$AA
|
|
6E:D0 F3 BNE [63]
|
|
70:EA NOP
|
|
71:BD 8C C0 LDA READ,X
|
|
74:10 FB BPL [71]
|
|
76:C9 96 CMP #$96
|
|
78:F0 09 BEQ [83]
|
|
7A:28 PLP
|
|
7B:90 DF BCC [5c]
|
|
7D:49 AD EOR #$AD
|
|
7F:F0 25 BEQ [a6]
|
|
81:D0 D9 BNE [5c]
|
|
|
|
83:A0 03 LDY #$03
|
|
85:85 40 STA A3L
|
|
87:BD 8C C0 LDA READ,X
|
|
8A:10 FB BPL [87]
|
|
8C:2A ROL A
|
|
8D:85 3C STA A1L
|
|
8F:BD 8C C0 LDA READ,X
|
|
92:10 FB BPL [8f]
|
|
94:25 3C AND A1L
|
|
96:88 DEY
|
|
97:D0 EC BNE [85]
|
|
99:28 PLP
|
|
9A:C5 3D CMP A1H
|
|
9C:D0 BE BNE [5c]
|
|
9E:A5 40 LDA A3L
|
|
A0:C5 41 CMP A3H
|
|
A2:D0 B8 BNE [5c]
|
|
A4:B0 B7 BCS [5d] ;; weird
|
|
|
|
A6:A0 56 LDY #$56
|
|
A8:84 3C STY A1L
|
|
AA:BC 8C C0 LDY READ,X
|
|
AD:10 FB BPL [aa]
|
|
AF:59 D6 02 EOR $02D6,X
|
|
B2:A4 3C LDY A1L
|
|
B4:88 DEY
|
|
B5:99 00 03 STA $0300,Y
|
|
B8:D0 EE BNE [a8]
|
|
BA:84 3C STY A1L
|
|
BC:BC 8C C0 LDY READ,X
|
|
BF:10 FB BPL [bc]
|
|
C1:59 D6 02 EOR $02D6,X
|
|
C4:A4 3C LDY A1L
|
|
C6:91 26 STA (GBASL),Y
|
|
C8:C8 INY
|
|
C9:D0 EF BNE [ba]
|
|
CB:BC 8C C0 LDY READ,X
|
|
CE:10 FB BPL [cb]
|
|
D0:59 D6 02 EOR $02D6,X
|
|
D3:D0 87 BNE [5c]
|
|
D5:A0 00 LDY #$00
|
|
D7:A2 56 LDX #$56
|
|
D9:CA DEX
|
|
DA:30 FB BMI [d7]
|
|
DC:B1 26 LDA (GBASL),Y
|
|
DE:5E 00 03 LSR $0300,X
|
|
E1:2A ROL A
|
|
E2:5E 00 03 STA (GBASL),Y
|
|
E5:2A ROL A
|
|
E6:91 26 STA (GBASL),Y
|
|
E8:C8 INY
|
|
E9:D0 EE BNE [d9]
|
|
EB:E6 27 INC GBASH
|
|
ED:E6 3D INC A1H
|
|
EF:A5 3D LDA A1H
|
|
F1:CD 00 08 CMP $0800
|
|
F4:A6 2B LDX $2B
|
|
F6:90 DB BCC [d3]
|
|
F8:4C 01 08 JMP $0801
|