-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.asm
80 lines (65 loc) · 2.03 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
;-------------------------------------------------------------------------------
; Godzilla: Monster of Monsters (USA, NES) disassembly
; made by JustMe using DISASM6, FCEUX and Mesen
;
; Godzilla (C) Toho
; G:MoM (C) Compile
; Nintendo Entertainment System (NES) (C) Nintendo
;-------------------------------------------------------------------------------
Debug = 1
; Useful macros and constants
.include "macros.asm"
.include "constants.asm"
; Variables
.include "variables.asm"
; Text encodings
.include "encodings.asm"
; TODO: fix all Goto_CrossBankJump and CrossBankJump using CBJR, same for Main_SwitchBank
; TODO: document palettes and make the use of their ids in the code
CBJR .macro
.for arg in \@
bank .var arg&7
lbl .var bits($8000+((arg>>2)*1.5)+3)
.warn "Cross bank jump reverse: bank-",repr(bank)," label-",repr(lbl)
.endfor
.endm
; TODO: Fix all DrawTexts tables
aa .function a
y = (a-$2020)/$20
x = (a-$2020)-(y*$20)
.warn bytes(x)
.warn bytes(y)
.endf
; iNES Header
.text "NES"
.byte $1A ; Header
.byte PRGBankCount ; 16k PRG banks
.byte CHRBankCount/2 ; 8k CHR banks
.byte %00010000 ; Mirroring: Horizontal
; SRAM: Not used
; 512k Trainer: Not used
; 4 Screen VRAM: Not used
; Mapper: 1
.byte %00000000 ; RomType: NES
.byte $00, $00, $00, $00 ; iNES Tail
.byte $00, $00, $00, $00
; TODO: Bank constants
;-------------------------------------------------------------------------------
; PRG
;-------------------------------------------------------------------------------
.include "sounddriver.asm"
.include "bank1.asm"
.include "bank2.asm"
.include "bank3.asm"
.include "bank4.asm"
.include "bank5.asm"
.include "bank6.asm"
; Main bank has to be last
.fill (PRGBankCount-LastBank-1)*PRGBankSize
.include "mainbank.asm"
;-------------------------------------------------------------------------------
; CHR
;-------------------------------------------------------------------------------
.include "chr.asm"
.end
; End of ROM