Mercurial > repos > simple16
comparison simple_console.txt @ 3:08b69e3f9f17
Fleshed out the video hardware design somewhat
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 25 Mar 2016 09:06:29 -0700 |
parents | 6204c81e2933 |
children | 8170d60f188b |
comparison
equal
deleted
inserted
replaced
2:6204c81e2933 | 3:08b69e3f9f17 |
---|---|
81 r0 - r12 : general purpose | 81 r0 - r12 : general purpose |
82 r13 : technically general purpose, but canonically the stack register | 82 r13 : technically general purpose, but canonically the stack register |
83 r14 : PC | 83 r14 : PC |
84 r15 : status register | 84 r15 : status register |
85 | 85 |
86 Special Registers | |
87 epc - Exception PC - Stores PC value to resume to when entering an exception handler | |
88 esr - Exception SR - same as above, but for SR | |
89 eur - Exceptuion User Reg - reg for temporary storage of a reg in a handler, intended to be used for the stack pointer | |
90 enum - Exception Number - holds the number of the most recent exception | |
91 | |
86 IO: Ports | 92 IO: Ports |
87 | 93 |
88 0: Controller 1 | 94 0: Controller 1 |
89 1: Controller 2 | 95 1: Controller 2 |
90 2: Controller 3 | 96 2: Controller 3 |
103 9: Channel C/D Vol | 109 9: Channel C/D Vol |
104 | 110 |
105 A: Timer Freq | 111 A: Timer Freq |
106 B: "Serial" Debug Port | 112 B: "Serial" Debug Port |
107 | 113 |
108 D: Write Pallette Address : Read Vertical Position | 114 C: Write Vertical Scroll : Read Vertical Position |
109 E: Write Name Table Address : Read Horizontal Position | 115 MMMM MCCC CCCC CFFF |
110 F: Write Sprite Table Address : Read Status? | 116 C = coarse scroll bit |
117 F = fine scroll bit | |
118 M = mask bit | |
119 controls which bits come directly from register | |
120 and which bits come from the sum of the register | |
121 and the current line number | |
122 | |
123 D: Write Horizontal Scroll : Read Horizontal Position | |
124 xxxx xxxC CCCC CFFF | |
125 C = coarse scroll bit | |
126 F = fine scroll bit | |
127 x = unused | |
128 E: Write Dest Address : Read Status | |
129 F: Write Data : Read Data | |
130 | |
131 | |
132 Name Table Start Address: | |
133 0VVV VVVV VHHH HHH0 | |
134 | |
135 V = Coarse scroll bit from vertical scroll value | |
136 H = Coarse scroll bit from horizontal scroll value | |
137 | |
138 VDP Memory Map | |
139 0000 - 7FFF = Pattern/Name Table RAM | |
140 8000 - FDFF = unused, returns $FFFF | |
141 FE00 - FEFF = Sprite RAM | |
142 FF00 - FF7F = Palette RAM | |
143 FF80 - FFFF = Palette RAM (mirror) | |
144 | |
145 Another View - | |
146 MSB determines whether destination is main RAM | |
147 For MSB 1 | |
148 Next 7 MSB determines which special RAM is the destination | |
149 Only values of 7E and 7F are valid for these bits at present | |
150 8 LSB determine offset (1 LSB ignored) | |
151 | |
152 Writing to Data port puts word into FIFO | |
153 Offset within memory type is increment when word is pulled from FIFO | |
154 | |
155 Pattern Format: | |
156 4bpp in an 8x8 tile arrangement | |
157 | |
158 | |
159 Sprite Table Entry: | |
160 | |
161 XXXXXXXX YYYYYYYY | |
162 IXPVHSNN NNNNNNNN | |
163 | |
164 S: size -- 0 = 8x8, 1 = 16x16 | |
165 P: Palette selector | |
166 H: Horizontal flip | |
167 V: Vertical flip | |
168 I: Priority | |
169 N: Name | |
170 X: X position (left of screen = 16, right of screen = ?) | |
171 Y: Y position (top of screen = 16, bottom of screen = 240) | |
172 | |
173 | |
174 Name Table Entry: | |
175 | |
176 IPPVHxNN NNNNNNNN | |
177 | |
178 P: Palette selector | |
179 H: Horizontal flip | |
180 V: Vertical flip | |
181 I: Priority | |
182 N: Name | |
183 x: Unused, should be set to 0 | |
184 | |
185 26.112 MHZ Clock | |
186 Dot Clock Divider 4 | |
187 CPU Clock Divider 20 (assuming 1 cycle/instruction, 5 for 4 cycles/instruction) | |
188 Audio Timer Divider 34 | |
189 Audio Output Divider 544 | |
190 | |
191 Alternatively 13.056 Mhz clock and cut the dividers in half | |
111 | 192 |
112 | 193 |
113 | 194 |
114 | 195 H-Counter goes from 0-415 and then wraps back to zero |
115 | 196 V-Counter goes from 0-261 and then wraps back to zero |
197 V-Counter increments when H-Counter wraps |