-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.asm
48 lines (40 loc) · 866 Bytes
/
init.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
RESET:
SEI ; disable IRQs
CLD ; disable decimal
LDX #$40
STX $4017 ; disable APU frame IRQ
LDX #$FF
TXS ; Set up stack
INX ; now X = 0
STX PPUCTRL ; disable NMI
STX PPUMASK ; disable rendering
STX APU_MODCTRL ; disable DMC IRQs
JSR VBlankWait
JSR ConfigWrite
LDA #$00
STA sourceBank
JSR PRGBankWrite ; do switch Bank switch to enable WRAM
clrmem:
LDA #$00
STA $0000, x
STA $0100, x
STA $0300, x
STA $0400, x
STA $0500, x
STA $0600, x
STA $0700, x
STA $6000, x
STA $6100, x
STA $6200, x
STA $6300, x
STA $6400, x
LDA #$FE
STA $0200, x
INX
BNE clrmem
JSR VBlankWait
;; Load graphics information
LDA #$00
STA palleteID
JSR LoadCHRAM
JSR LoadPalettes