2015-03-12 18:46:59 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
; Let's start a little library for naming parts of memory in the NES
|
|
|
|
;
|
|
|
|
; Including this file will not emit any instructions or data into your binary
|
|
|
|
; It only defines symbols in the symbol table to name memory addresses
|
|
|
|
;
|
|
|
|
; Author: Saf Allen 2015
|
2015-03-14 12:01:27 +00:00
|
|
|
; I picked up some extra register names for mappers etc here:
|
|
|
|
; http://wiki.nesdev.com/w/index.php/Registers
|
2015-03-12 18:46:59 +00:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
.org $0000
|
|
|
|
.scope nes
|
|
|
|
.scope ppu
|
|
|
|
.org $2000
|
2015-03-14 12:01:27 +00:00
|
|
|
.space control1 1 ; $2000
|
|
|
|
.space control2 1 ; $2001
|
|
|
|
.space status 1 ; $2002
|
2015-03-15 10:47:48 +00:00
|
|
|
.org $2005
|
|
|
|
.space scroll 1 ; $2005
|
2015-03-14 12:01:27 +00:00
|
|
|
.
|
2015-03-15 10:47:48 +00:00
|
|
|
.org $2003
|
2015-03-14 12:01:27 +00:00
|
|
|
.scope sprite
|
|
|
|
.space address 1 ; $2003
|
|
|
|
.space io 1 ; $2004
|
2015-03-12 18:46:59 +00:00
|
|
|
.org $4014
|
2015-03-14 12:01:27 +00:00
|
|
|
.space dma 1 ; $4014
|
|
|
|
.
|
2015-03-15 10:47:48 +00:00
|
|
|
.org $2006
|
2015-03-14 12:01:27 +00:00
|
|
|
.scope vram
|
2015-03-15 10:47:48 +00:00
|
|
|
.space address 1 ; $2006
|
2015-03-14 12:01:27 +00:00
|
|
|
.space io 1 ; $2007
|
2015-03-12 18:46:59 +00:00
|
|
|
.
|
|
|
|
|
2015-03-14 12:01:27 +00:00
|
|
|
; Now let's do the APU registers
|
2015-03-12 18:46:59 +00:00
|
|
|
.org $4000
|
|
|
|
.scope apu
|
2015-03-14 12:01:27 +00:00
|
|
|
.scope pulse1
|
|
|
|
.space control 1 ; $4000
|
|
|
|
.space ramp_control 1 ; $4001
|
|
|
|
.space ft 1 ; $4002
|
|
|
|
.space ct 1 ; $4003
|
2015-03-12 18:46:59 +00:00
|
|
|
.
|
2015-03-14 12:01:27 +00:00
|
|
|
.scope pulse2
|
|
|
|
.space control 1 ; $4004
|
|
|
|
.space ramp_control 1 ; $4005
|
|
|
|
.space ft 1 ; $4006
|
|
|
|
.space ct 1 ; $4007
|
2015-03-12 18:46:59 +00:00
|
|
|
.
|
2015-03-14 12:01:27 +00:00
|
|
|
.scope triangle
|
|
|
|
.space control1 1 ; $4008
|
|
|
|
.space control2 1 ; $4009
|
|
|
|
.space freq1 1 ; $400A
|
|
|
|
.space freq2 1 ; $400B
|
2015-03-12 18:46:59 +00:00
|
|
|
.
|
2015-03-14 12:01:27 +00:00
|
|
|
.scope noise
|
|
|
|
.space control1 1 ; $400C
|
|
|
|
.space control2 1 ; $400D
|
|
|
|
.space freq1 1 ; $400E
|
|
|
|
.space freq2 1 ; $400F
|
2015-03-12 18:46:59 +00:00
|
|
|
.
|
2015-03-14 12:01:27 +00:00
|
|
|
.scope dmc
|
|
|
|
.space control 1 ; $4010
|
|
|
|
.space da 1 ; $4011
|
|
|
|
.space address 1 ; $4012
|
|
|
|
.space dl 1 ; $4013
|
2015-03-12 18:46:59 +00:00
|
|
|
.
|
|
|
|
.org $4015
|
2015-03-14 12:01:27 +00:00
|
|
|
.space channel_enable 1 ; $4015
|
2015-03-12 18:46:59 +00:00
|
|
|
.
|
|
|
|
.org $4016
|
2015-03-14 12:01:27 +00:00
|
|
|
.space controller1 1 ; $4016
|
|
|
|
.space controller2 1 ; $4017
|
|
|
|
.scope mapper
|
|
|
|
.org $8000
|
|
|
|
.space unrom 1
|
|
|
|
.org $8000
|
|
|
|
.space cnrom 1
|
|
|
|
.org $8000
|
|
|
|
.space mmc1_control 1
|
|
|
|
.org $A000
|
|
|
|
.space mmc1_vrom_low 1
|
|
|
|
.org $C000
|
|
|
|
.space mmc1_vrom_high 1
|
|
|
|
.org $E000
|
|
|
|
.space mmc1_prog 1
|
|
|
|
.org $8000
|
|
|
|
.space mmc3_command 1
|
|
|
|
.space mmc3_page 1
|
|
|
|
.org $A000
|
|
|
|
.space mmc3_mirror 1
|
|
|
|
.space mmc3_sram 1
|
|
|
|
.org $C000
|
|
|
|
.space mmc3_clock 1
|
|
|
|
.space mmc3_latch 1
|
|
|
|
.org $E000
|
|
|
|
.space mmc3_clock_off 1
|
|
|
|
.space mmc3_clock_on 1
|
|
|
|
.
|
2015-03-12 18:46:59 +00:00
|
|
|
.
|
2015-03-14 12:01:27 +00:00
|
|
|
|
|
|
|
; Let's put PC back somewhere sane
|
|
|
|
.org $0000
|