-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathwrapper.s
More file actions
80 lines (72 loc) · 1.07 KB
/
wrapper.s
File metadata and controls
80 lines (72 loc) · 1.07 KB
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
.import Main
.segment "HEADER"
.byte $4E, $45, $53, $1A ; iNES header identifier
.byte 2 ; 2x 16KB PRG-ROM Banks
.byte 1 ; 1x 8KB CHR-ROM
.byte $01, $00 ; mapper 0, vertical mirroring
.segment "VECTORS"
.addr nmi
.addr reset
.addr 0
.segment "STARTUP"
.segment "CHARS"
.segment "CODE"
.proc nmi
bit $2002
lda #0
sta $2006
sta $2006
rti
.endproc
.proc ResetPalettes
bit $2002
lda #$3f
sta $2006
lda #$00
sta $2006
lda #$0F
ldx #$20
@paletteLoadLoop:
sta $2007
dex
bne @paletteLoadLoop
rts
.endproc
.proc reset
sei
cld
ldx #%01000000
stx $4017
ldx #$ff
txs
ldx #0
stx $2000
stx $2001
stx $4010
bit $2002
@vblankWait1:
bit $2002
bpl @vblankWait1
@clearMemory:
lda #$00
sta $0000, x
sta $0100, x
sta $0200, x
sta $0300, x
sta $0400, x
sta $0500, x
sta $0600, x
sta $0700, x
inx
bne @clearMemory
@vblankWait2:
bit $2002
bpl @vblankWait2
jsr ResetPalettes
main:
jsr Main
lda #%00001000
sta $2001
endlessLoop:
jmp endlessLoop
.endproc