Difference between revisions of "Sega Mega Drive/VDP registers"
From Sega Retro
Ccawley2011 (talk | contribs) |
GerbilSoft (talk | contribs) (Color Mode isn't an intentional feature.) |
||
Line 4: | Line 4: | ||
| <span id="00">00</span> | | <span id="00">00</span> | ||
| Mode Register 1 | | Mode Register 1 | ||
− | | {{bitfield|0|0|L|IE1|0| | + | | {{bitfield|0|0|L|IE1|0|M4|M3|DE}} |
* '''L:''' 1 = leftmost 8 pixels are blanked to [[Sega Mega Drive/Palettes and CRAM#Background colour|background colour]]. | * '''L:''' 1 = leftmost 8 pixels are blanked to [[Sega Mega Drive/Palettes and CRAM#Background colour|background colour]]. | ||
* '''IE1:''' 1 = enable [[Sega Mega Drive/Interrupts#HBlank and horizontal interrupt|horizontal interrupts]]. | * '''IE1:''' 1 = enable [[Sega Mega Drive/Interrupts#HBlank and horizontal interrupt|horizontal interrupts]]. | ||
− | * ''' | + | * '''M4:''' 1 = normal operation; 0 = [[Sega Mega Drive/Palettes and CRAM#Low colour mode|masks high bits of color entries]] (this bit controls Mode 4 in SMS mode). |
* '''M3:''' 1 = freeze [[Sega Mega Drive/VDP general usage#H/V counter|H/V counter]] on level 2 interrupt; 0 = enable H/V counter. | * '''M3:''' 1 = freeze [[Sega Mega Drive/VDP general usage#H/V counter|H/V counter]] on level 2 interrupt; 0 = enable H/V counter. | ||
* '''DE:''' 1 = disable display. | * '''DE:''' 1 = disable display. |
Revision as of 13:54, 21 November 2020
Reg. | Name | Bits | Code |
---|---|---|---|
00 | Mode Register 1 | 7 6 5 4 3 2 1 0 0 0 L IE1 0 M4 M3 DE
|
move.w #$80xx,($c00004).l |
01 | Mode Register 2 | 7 6 5 4 3 2 1 0 VR DE IE0 M1 M2 M5 0 0
|
move.w #$81xx,($c00004).l |
02 | Plane A Name Table Location | 7 6 5 4 3 2 1 0 0 PA6 PA5-PA3 0 0 0
|
move.w #$8200+($xxxx>>10),($c00004).l |
03 | Window Name Table Location | 7 6 5 4 3 2 1 0 0 W6 W5-W1 0
|
move.w #$8300+($xxxx>>10),($c00004).l |
04 | Plane B Name Table Location | 7 6 5 4 3 2 1 0 0 0 0 0 PB3 PB2-PB0
|
move.w #$8400+($xxxx>>13),($c00004).l |
05 | Sprite Table Location | 7 6 5 4 3 2 1 0 ST7 ST6-ST0
|
move.w #$8500+($xxxx>>9),($c00004).l |
06 | 7 6 5 4 3 2 1 0 0 0 SP5 0 0 0 0 0
|
move.w #$8600+($xxxxxx>>11),($c00004).l | |
07 | Background Colour | 7 6 5 4 3 2 1 0 0 0 PL1-PL0 C3-C0
|
move.w #$8500+(xx<<4)+yy,($c00004).l |
08 | Unused | Master System horizontal scroll register | |
09 | Unused | Master System vertical scroll register | |
0A | Horizontal Interrupt Counter | 7 6 5 4 3 2 1 0 H
|
move.w #$8Axx,($c00004).l |
0B | Mode Register 3 | 7 6 5 4 3 2 1 0 0 0 0 0 IE2 VS HS1-HS2
|
move.w #$8Bxx,($c00004).l |
0C | Mode Register 4 | 7 6 5 4 3 2 1 0 RS1 VS HS EP SH LS1-LS0 RS0
|
move.w #$8Cxx,($c00004).l |
0D | Horizontal Scroll Data Location | 7 6 5 4 3 2 1 0 0 HS6 HS5-HS0
|
move.w #$8D00+($xxxx>>10),($c00004).l |
0E | 7 6 5 4 3 2 1 0 0 0 0 PB4 0 0 0 PA0
|
move.w #$8E00+(($xxxxxx&$10000)>>12)+($yyyyyy>>16),($c00004).l | |
0F | Auto-Increment Value | 7 6 5 4 3 2 1 0 INC7-INC0
|
move.w #$8Fxx,($c00004).l |
10 | Plane Size | 7 6 5 4 3 2 1 0 0 0 H1-H0 0 0 W1-W0
|
move.w #$90xx,($c00004).l |
11 | Window Plane Horizontal Position | 7 6 5 4 3 2 1 0 R 0 0 HP4-HP0
|
move.w #$91xx,($c00004).l |
12 | Window Plane Vertical Position | 7 6 5 4 3 2 1 0 D 0 0 VP4-VP0
|
move.w #$92xx,($c00004).l |
13-14 | DMA Length | 7 6 5 4 3 2 1 0 L7-L0 7 6 5 4 3 2 1 0 H7-H0
|
move.w #$9300+(($xxxx>>1)&$FF),($c00004).l move.w #$9400+((($xxxx>>1)&$FF00)>>8),($c00004).l |
15-17 | DMA Source | 7 6 5 4 3 2 1 0 L7-L0 7 6 5 4 3 2 1 0 M7-M0 7 6 5 4 3 2 1 0 T1 T0 H5-H0
|
move.w #$9500+(($xxxxxx>>1)&$FF),($c00004).l move.w #$9600+((($xxxxxx>>1)&$FF00)>>8),($c00004).l move.w #$9700+((($xxxxxx>>1)&$7F0000)>>16),($c00004).l |
Status Register | 7 6 5 4 3 2 1 0 0 0 1 1 0 1 E F 7 6 5 4 3 2 1 0 VI SO SC OD VB HB DMA PAL
|
move.w ($c00004).l,d0 |