NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: Register name conventions / standards  
Posted byHappy_Dude
Posted on9/12/03 10:39 AM
From IP203.7.134.73  



Well I decided to roll my own ;)

Tell me what you think.
Could some of the names be a little clearer ?
and do you have any suggestions ?






; NES.h
; 2003 Cye Freeman
;
; 12/9/03 - Coming from the Stella comunity the VCS.h file was
; a huge help in allowing me and other newbies to understand
; what registers did. I'v recently been trying my hand at NES
; development So I asked about a NES.h file at NESdev.
; There wasn't one, but I got some PPU names (that where pretty
; close to ones I already came up with) there and made up some
; more for the rest of the registers.
;
; Puting this together has taught me a lot about how the NES
; handles addresses and talks to the PPU and SPR-RAM.

; NOTE : I use DASM for everything but this could easily be converted
; to your compiler of choice.



; R E G I S T E R S


; P P U
; Picture Processing Unit

PPUControl0 = $2000 ; PPU Control Register #0
PPUControl1 = $2001 ; PPU Control Register #1
PPUStatus = $2002 ; PPU Status Register
OAMAddress = $2003 ; SPR-RAM Address Register
OAMIOReg = $2004 ; SPR-RAM I/O Register
PPUScroll = $2005 ; VRAM Address Register #0
PPUAddress = $2006 ; VRAM Address Register #1
PPUIO = $2007 ; VRAM I/O Register


; p A P U
; pseuedo-Audio Processing Unit

;P U L S E 0
P0CR = $4000 ; Control Register
P0RC = $4001 ; Ramp Control Register
P0FT = $4002 ; Fine Tune Register
P0CT = $4003 ; Coarse Tune Register
; P U L S E 1
P1CR = $4004 ; Control Register
P1RC = $4005 ; Ramp Control Register
P1FT = $4006 ; Fine Tune Register
P1CT = $4007 ; Coarse Tune Register
; T R I A N G L E
T0CR = $4008 ; Triangle Control Register #0
T1CR = $4009 ; Triangle Control Register #1
T0FRQ = $400A ; Triangle Frequency Register #0
T1FRQ = $400B ; Triangle Frequency Register #1
; N O I S E
NCR0 = $400C ; Noise Control Register #0
;UNUSED = $400D
NFR0 = $400E ; Noise Frequency Register #0
NFR1 = $400F ; Noise Frequency Register #1
; D E L T A M O D U L A T I O N
; The channel of the APU which handles digital data.
; Commonly referred to as the PCM (Pulse Code Modulation) channel.
DMCR = $4010 ; Delta Modulation Control Register (W)
DMDA = $4011 ; Delta Modulation D/A Register (W)
DMAR = $4012 ; Delta Modulation Address Register (W)
DMLENGTH = $4013 ; Delta Modulation Data Length Register (W)
SPRDMA = $4014 ; Sprite DMA Register
ChCtrl = $4015 ; Channel Control (w) Sound/Vertical Clock Signal Register (R)
; J O Y P A D S
PAD0 = $4016
PAD1 = $4017


; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .



; V R A M A D D R E S S E S

PTable0 = $0000 ; Pattern Table 0 (256x2x8, may be VROM)
PTable1 = $1000 ; Pattern Table 1 (256x2x8, may be VROM)
NameTable0 = $2000 ; Name Table 0 (32x25 tiles)
AttribTable0 = $23C0 ; Attribute Table 0
NameTable1 = $2400 ; Name Table 1 (32x25 tiles)
AttribTable1 = $27C0 ; Attribute Table 1
NameTable2 = $2800 ; Name Table 2 (32x25 tiles)
AttribTable2 = $2BC0 ; Attribute Table 2
NameTable3 = $2C00 ; Name Table 3 (32x25 tiles)
AttribTable4 = $2FC0 ; Attribute Table 3
IPalette = $3F00 ; Image Palette
SPalette = $3F10 ; Sprite Palette
Mirror2 = $4000 ; Mirror of $0000-3FFF


; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .








-
Entire Thread
Subject  Posted byPosted On
*Register name conventions / standards  Happy_Dude9/11/03 5:27 PM
.*Re: Register name conventions / standards  Memblers9/11/03 10:31 PM
..*Re: Register name conventions / standards  Memblers9/12/03 04:17 AM
....Re: Register name conventions / standards  Happy_Dude9/12/03 10:39 AM
....*Re: Register name conventions / standards  quietust9/12/03 2:33 PM
.....*Re: Register name conventions / standards  Big Time9/13/03 5:12 PM
......*Re: Register name conventions / standards  Memblers9/13/03 7:58 PM
.......*Re: Register name conventions / standards  Happy_Dude9/14/03 4:51 PM
.....*Re: Register name conventions / standards  Happy_Dude9/12/03 3:39 PM
......*Re: Register name conventions / standards  koitsu9/12/03 10:25 PM
..*Re: Register name conventions / standards  <_Hyde_>9/12/03 00:56 AM
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo