OSCA Hardware Registers
Created by: phil, Last modification: Mon 02 of Jan, 2012 (21:43 UTC)
Write Only Hardware Registers:
Palette
| $000-$1FF | 256 16bit Words, For each colour: $0RGB | |
Video Control Registers
- The system memory "underneath" these registers ($200-$6ff) can be written by setting bit 7 of the port sys_alt_write_page
| Address | Name | Description |
| $200 | vreg_xhws | Horizontal hardware scrolling |
| $201 | vreg_vidctrl | General video control |
| $202 | vreg_window | Size / position of display |
| $203 | vreg_yhws_bplcount | Vertical hardware scrolling (also bitplane count / pixel size) |
| $204 | vreg_rasthi | MSB of raster IRQ etc |
| $205 | vreg_rastlo | LSB of raster IRQ |
| $206 | vreg_vidpage | Selects which 8KB video page CPU sees |
| $207 | vreg_sprctrl | Sprite control |
| $208 | mult_write | Multiplier (16 bit) |
| $20a | mult_index | Multipicand selector |
| $20b | linedraw_colour | Line draw colour index |
| $20c | vreg_ext_vidctrl | More video controls |
| $20d | vreg_linecop_lo | Line Cop Program address LSB |
| $20e | vreg_linecop_hi | Line Cop Program address MSB |
| $20f | vreg_palette_ctrl | Double buffer Palette control |
Blitter
| Address | Name | Description |
| $210 | blit_src_loc | Source address in VRAM (15:0) |
| $212 | blit_dst_loc | Destination address in VRAM (15:0) |
| $214 | blit_src_mod | Source modulo (7:0) |
| $215 | blit_dst_mod | Destination modulo (7:0) |
| $216 | blit_height | Lines in blit operation less one |
| $217 | blit_width | Horizontal bytes in blit operation less one, and Start Blit |
| $218 | blit_misc | Modulo MSBs / Source MSB (16) / Dest MSB (16) |
| $219 | blit_src_msb | Source MSBs (19:16) |
| $21a | blit_dst_msb | Destination MSBs (19:16) |
Line Draw
| Address | Name | Description |
| $220 | linedraw_reg0 | Bresenham Decision Register 0 |
| $222 | linedraw_reg1 | Breshenham Decision Register 1 |
| $224 | linedraw_reg2 | Line Start Address (15:0) |
| $226 | linedraw_reg3 | Octant code and Start Line Draw |
| $228 | linedraw_reg4 | Same function as reg0, 2nd register set |
| $22a | linedraw_reg5 | Same function as reg1, 2nd register set |
| $22c | linedraw_reg6 | Same function as reg2, 2nd register set |
| $22e | linedraw_reg7 | Same function as reg3, 2nd register set |
| $230 | linedraw_lut0 | Look up table: Write with (65536-Window width)+1 |
| $232 | linedraw_lut1 | Look up table: Write with (65536-Window width)-1 |
| $234 | linedraw_lut2 | Look up table: Write with Window width + 1 |
| $236 | linedraw_lut3 | Look up table: Write with Window width - 1 |
| $238 | linedraw_lut4 | Look up table: Write with 1 |
| $23a | linedraw_lut5 | Look up table: Write with 65535 |
| $23c | linedraw_lut6 | Look up table: Write with (65536 - Window width) |
| $23e | linedraw_lut7 | Look up table: Write with Window width |
Bitplane Locations
| Address | Name | Description |
| $240 | bitplane0a_loc | Location of Bitplane 0 |
| $244 | bitplane1a_loc | Location of Bitplane 1 |
| $248 | bitplane2a_loc | Location of Bitplane 2 |
| $24c | bitplane3a_loc | Location of Bitplane 3 |
| $250 | bitplane4a_loc | Location of Bitplane 4 |
| $254 | bitplane5a_loc | Location of Bitplane 5 |
| $258 | bitplane6a_loc | Location of Bitplane 6 |
| $25c | bitplane7a_loc | Location of Bitplane 7 |
| $260 | bitplane0b_loc | Location of Bitplane 0 - register set B |
| $264 | bitplane1b_loc | Location of Bitplane 0 - register set B |
| $268 | bitplane2b_loc | Location of Bitplane 0 - register set B |
| $26c | bitplane3b_loc | Location of Bitplane 0 - register set B |
| $270 | bitplane4b_loc | Location of Bitplane 0 - register set B |
| $274 | bitplane5b_loc | Location of Bitplane 0 - register set B |
| $278 | bitplane6b_loc | Location of Bitplane 0 - register set B |
| $27c | bitplane7b_loc | Location of Bitplane 0 - register set B |
| $243 | bitplane_reset | Clear the internal video fetch offset counter |
| $247 | bitplane_modulo | words to skip at right edge of window. 0 = reuse same line. |
Sprite Priority Registers
| Address | Description | |
| $280 | Bit 0: bgnd colours 00-0F mask level 0, Bit 1: bgnd colours 00-0F mask level 1 | |
| $281 | Bit 0: bgnd colours 10-1F mask level 0, Bit 1: bgnd colours 10-1F mask level 1 | |
| $282 | Bit 0: bgnd colours 20-2F mask level 0, Bit 1: bgnd colours 20-2F mask level 1 | |
| $283 | Bit 0: bgnd colours 30-3F mask level 0, Bit 1: bgnd colours 30-3F mask level 1 | |
| $284 | Bit 0: bgnd colours 40-4F mask level 0, Bit 1: bgnd colours 40-4F mask level 1 | |
| $285 | Bit 0: bgnd colours 50-5F mask level 0, Bit 1: bgnd colours 50-5F mask level 1 | |
| $286 | Bit 0: bgnd colours 60-6F mask level 0, Bit 1: bgnd colours 60-6F mask level 1 | |
| $287 | Bit 0: bgnd colours 70-7F mask level 0, Bit 1: bgnd colours 70-7F mask level 1 | |
| $288 | Bit 0: bgnd colours 80-8F mask level 0, Bit 1: bgnd colours 80-8F mask level 1 | |
| $289 | Bit 0: bgnd colours 90-9F mask level 0, Bit 1: bgnd colours 90-9F mask level 1 | |
| $28A | Bit 0: bgnd colours A0-AF mask level 0, Bit 1: bgnd colours A0-AF mask level 1 | |
| $28B | Bit 0: bgnd colours B0-BF mask level 0, Bit 1: bgnd colours B0-BF mask level 1 | |
| $28C | Bit 0: bgnd colours C0-CF mask level 0, Bit 1: bgnd colours C0-CF mask level 1 | |
| $28D | Bit 0: bgnd colours D0-DF mask level 0, Bit 1: bgnd colours D0-DF mask level 1 | |
| $28E | Bit 0: bgnd colours E0-EF mask level 0, Bit 1: bgnd colours E0-EF mask level 1 | |
| $28F | Bit 0: bgnd colours F0-FF mask level 0, Bit 1: bgnd colours F0-FF mask level 1 | |
Sprite Registers
$400-$5Fb - 127 x 4-byte sprite registers when double buffering is disabled (default)
or, when double buffer mode is enabled:
$400-$4Fb - First set of 63 Sprite Registers
$500-$5fb - Second set of 63 Sprite Registers
For each sprite:
| Offset | Description | |
| $00 | X coordinate LSB | |
| $01 | Bits 7:4 = Height, 3=Mirror, 2 = Def MSB, 1 = Y MSB, 0 = X MSB | |
| $02 | Y coordinate LSB | |
| $03 | Definition LSB | |
Multiplication Table:
| $600-$7FF | 256 Words (signed) | |
Read Only Video Registers
| Location | Name | Description |
| $700 | vreg_read | Video status bits (byte) |
| $704 | mult_read | Result of multiplication (word) |