-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.asm
80 lines (64 loc) · 1.41 KB
/
main.asm
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
.export __STARTUP__ : absolute=1
.import _main
.import __STACK_START__, __STACK_SIZE__
.include "zeropage.inc"
.import initlib, copydata
.pushseg
.segment "ZEROPAGE"
.popseg
.pushseg
.segment "HEADER"
; iNES header
; see http://wiki.nesdev.com/w/index.php/INES
.byte $4E, $45, $53, $1A ; "NES" EOF
.byte $01 ; PRG ROM size (16 KiB units)
.byte $01 ; CHR ROM size (8 KiB units)
.byte $00 ; horizontal mirroring
.byte $00 ; mapper 0000 (NROM)
.byte $00 ; PRG RAM size (8 KiB units)
.byte $00 ; NTSC
.byte $00 ; unused
.res 5, $00 ; zero-fill
.popseg
.pushseg
.segment "VECTORS"
.word nmi ;$FFFA NMI
.word start ;$FFFC Reset
.word irq ;$FFFE IRQ
.popseg
.pushseg
.segment "STARTUP"
start:
jmp _main
; no handlers for nmi or irq
nmi:
irq:
rti
.popseg
.pushseg
.segment "MUSIC"
.export _music
_music:
;.incbin "starwars.nsf", $80 ;just need the data not the header
;.incbin "Z2.nsf", $80 ;just need the data not the header
.incbin "test.nsf"
.popseg
.export _pMusicInit
_pMusicInit:
jmp _music + $80 ;$8080
rts
.export _pMusicPlay
_pMusicPlay:
lda #0
ldx #0
jmp _music + $84 ;$8084
rts
.pushseg
.segment "SPRITES"
.popseg
.pushseg
.segment "ONCE"
.popseg
.pushseg
.segment "CHARS"
.popseg