-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.s
126 lines (101 loc) · 1.96 KB
/
main.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
; Radboy program
; CC-BY-NC furrtek 2017
.ROMDMG
.NAME "RADBOY1"
.CARTRIDGETYPE 0 ; ROM only
.RAMSIZE 0
.COMPUTEGBCHECKSUM
.COMPUTEGBCOMPLEMENTCHECK
.LICENSEECODENEW "00"
.EMPTYFILL $00
.MEMORYMAP
SLOTSIZE $4000
DEFAULTSLOT 0
SLOT 0 $0000
.ENDME
.ROMBANKSIZE $4000
.ROMBANKS 2
.BANK 0 SLOT 0
.INCLUDE "ram.asm"
.ORG $0000 ; rst $00: A=(HL+A)
add l
jr nc,+
inc h
+:
ld l,a
ld a,(hl)
ret
.ORG $0010 ; rst $18: DE=(HL)
ld e,(hl)
inc hl
ld d,(hl)
ret
.ORG $0018 ; rst $10: (HL)=DE
ld (hl),e
inc hl
ld (hl),d
ret
.ORG $0030 ; rst $30: Jumptable HL index A
sla a
rst 0
inc hl
ld h,(hl)
ld l,a
call do_jump
ret
.ORG $0040
jp irq_vblank
.ORG $0048
jp irq_stat
.ORG $0050
reti
.ORG $0058
reti
.ORG $0100
nop
jp Start ; Entry point
.ORG $0104 ; Nintendo logo
.DB $CE,$ED,$66,$66,$CC,$0D,$00,$0B,$03,$73,$00,$83,$00,$0C
.DB $00,$0D,$00,$08,$11,$1F,$88,$89,$00,$0E,$DC,$CC,$6E,$E6
.DB $DD,$DD,$D9,$99,$BB,$BB,$67,$63,$6E,$0E,$EC,$CC,$DD,$DC
.DB $99,$9F,$BB,$B9,$33,$3E
.ORG $014A
.DB 1 ; Non-Japanese
.ORG $0200
Start:
di
ld sp,$FFF4 ; SP in HRAM
call init
-: ; Main loop
ld a,(VBL_FLAG)
or a
jr z,-
xor a
ld (VBL_FLAG),a
call vblank
jr -
.INCLUDE "util.asm"
.INCLUDE "inputs.asm"
.INCLUDE "interrupts.asm"
.INCLUDE "gfxutil.asm"
.INCLUDE "init.asm"
.INCLUDE "vblank.asm"
.INCLUDE "draw.asm"
.INCLUDE "graph.asm"
.INCLUDE "cpm.asm"
.INCLUDE "sound.asm"
.INCLUDE "digits.asm"
tiles_font:
.INCBIN "gfx\font.bin"
tiles_cpm:
.INCBIN "gfx\cpm.bin"
tiles_hv:
.INCBIN "gfx\hv.bin"
tiles_on:
.INCBIN "gfx\on.bin"
tiles_off:
.INCBIN "gfx\off.bin"
tiles_abg:
.INCBIN "gfx\abg.bin"
tiles_title:
.INCBIN "gfx\radboy.bin"