src/mess/video/isa_cga.c
| r0 | r14208 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Color Graphics Adapter (CGA) section |
| 4 | |
| 5 | |
| 6 | Notes on Port 3D8 |
| 7 | (http://www.clipx.net/ng/interrupts_and_ports/ng2d045.php) |
| 8 | |
| 9 | Port 3D8 - Color/VGA Mode control register |
| 10 | |
| 11 | xx1x xxxx Attribute bit 7. 0=blink, 1=Intesity |
| 12 | xxx1 xxxx 640x200 mode |
| 13 | xxxx 1xxx Enable video signal |
| 14 | xxxx x1xx Select B/W mode |
| 15 | xxxx xx1x Select graphics |
| 16 | xxxx xxx1 80x25 text |
| 17 | |
| 18 | |
| 19 | The usage of the above control register for various modes is: |
| 20 | xx10 1100 40x25 alpha B/W |
| 21 | xx10 1000 40x25 alpha color |
| 22 | xx10 1101 80x25 alpha B/W |
| 23 | xx10 1001 80x25 alpha color |
| 24 | xxx0 1110 320x200 graph B/W |
| 25 | xxx0 1010 320x200 graph color |
| 26 | xxx1 1110 640x200 graph B/W |
| 27 | |
| 28 | |
| 29 | PC1512 display notes |
| 30 | |
| 31 | The PC1512 built-in display adaptor is an emulation of IBM's CGA. Unlike a |
| 32 | real CGA, it is not built around a real MC6845 controller, and so attempts |
| 33 | to get custom video modes out of it may not work as expected. Its 640x200 |
| 34 | CGA mode can be set up to be a 16-color mode rather than mono. |
| 35 | |
| 36 | If you program it with BIOS calls, the PC1512 behaves just like a real CGA, |
| 37 | except: |
| 38 | |
| 39 | - The 'greyscale' text modes (0 and 2) behave just like the 'color' |
| 40 | ones (1 and 3). On a color monitor both are in color; on a mono |
| 41 | monitor both are in greyscale. |
| 42 | - Mode 5 (the 'greyscale' graphics mode) displays in color, using |
| 43 | an alternative color palette: Cyan, Red and White. |
| 44 | - The undocumented 160x100x16 "graphics" mode works correctly. |
| 45 | |
| 46 | (source John Elliott http://www.seasip.info/AmstradXT/pc1512disp.html) |
| 47 | |
| 48 | |
| 49 | Cursor signal handling: |
| 50 | |
| 51 | The alpha dots signal is set when a character pixel should be set. This signal is |
| 52 | also set when the cursor should be displayed. The following formula for alpha |
| 53 | dots is derived from the schematics: |
| 54 | ALPHA DOTS = ( ( CURSOR DLY ) AND ( CURSOR BLINK ) ) OR ( ( ( NOT AT7 ) OR CURSOR DLY OR -BLINK OR NOT ENABLE BLINK ) AND ( CHG DOTS ) ) |
| 55 | |
| 56 | -CURSOR BLINK = VSYNC DLY (LS393) (changes every 8 vsyncs) |
| 57 | -BLINK = -CURSOR BLINK (LS393) (changes every 16 vsyncs) |
| 58 | -CURSOR DLY = -CURSOR signal from mc6845 and LS174 |
| 59 | CHG DOTS = character pixel (from character rom) |
| 60 | |
| 61 | For non-blinking modes this formula reduces to: |
| 62 | ALPHA DOTS = ( ( CURSOR DLY ) AND ( CURSOR BLINK ) ) OR ( CHG DOTS ) |
| 63 | |
| 64 | This means the cursor switches on/off state every 8 vsyncs. |
| 65 | |
| 66 | |
| 67 | For blinking modes this formula reduces to: |
| 68 | ALPHA DOTS = ( ( CURSOR DLY ) AND ( CURSOR BLINK ) ) OR ( ( ( NOT AT7 ) OR CURSOR DLY OR -BLINK ) AND ( CHG DOTS ) ) |
| 69 | |
| 70 | So, at the cursor location the attribute blinking is ignored and only regular |
| 71 | cursor blinking takes place (state switches every 8 vsyncs). On non-cursor |
| 72 | locations with the highest attribute bits set the character will switch |
| 73 | on/off every 16 vsyncs. In all other cases the character is displayed as |
| 74 | usual. |
| 75 | |
| 76 | |
| 77 | TODO: |
| 78 | - Update more drivers in MESS and MAME and unify with src/emu/video/pc_cga.c |
| 79 | - Separate out more cards/implementations |
| 80 | |
| 81 | ***************************************************************************/ |
| 82 | |
| 83 | #include "emu.h" |
| 84 | #include "video/mc6845.h" |
| 85 | #include "video/isa_cga.h" |
| 86 | #include "memconv.h" |
| 87 | |
| 88 | #define VERBOSE_CGA 0 /* CGA (Color Graphics Adapter) */ |
| 89 | |
| 90 | #define CGA_PALETTE_SETS 83 /* one for colour, one for mono, |
| 91 | * 81 for colour composite */ |
| 92 | |
| 93 | #define CGA_SCREEN_NAME "screen" |
| 94 | #define CGA_MC6845_NAME "mc6845_cga" |
| 95 | |
| 96 | #define CGA_LOG(N,M,A) \ |
| 97 | do { \ |
| 98 | if(VERBOSE_CGA>=N) \ |
| 99 | { \ |
| 100 | if( M ) \ |
| 101 | logerror("%11.6f: %-24s",machine.time().as_double(),(char*)M ); \ |
| 102 | logerror A; \ |
| 103 | } \ |
| 104 | } while (0) |
| 105 | |
| 106 | /*************************************************************************** |
| 107 | |
| 108 | Static declarations |
| 109 | |
| 110 | ***************************************************************************/ |
| 111 | |
| 112 | static INPUT_PORTS_START( cga ) |
| 113 | PORT_START( "cga_config" ) |
| 114 | PORT_CONFNAME( 0x03, 0x00, "CGA character set") |
| 115 | PORT_CONFSETTING(0x00, DEF_STR( Normal )) |
| 116 | PORT_CONFSETTING(0x01, "Alternative") |
| 117 | PORT_CONFNAME( 0x1C, 0x00, "CGA monitor type") |
| 118 | PORT_CONFSETTING(0x00, "Colour RGB") |
| 119 | PORT_CONFSETTING(0x04, "Mono RGB") |
| 120 | PORT_CONFSETTING(0x08, "Colour composite") |
| 121 | PORT_CONFSETTING(0x0C, "Television") |
| 122 | PORT_CONFSETTING(0x10, "LCD") |
| 123 | PORT_CONFNAME( 0xE0, 0x00, "CGA chipset") |
| 124 | PORT_CONFSETTING(0x00, "IBM") |
| 125 | PORT_CONFSETTING(0x20, "Amstrad PC1512") |
| 126 | PORT_CONFSETTING(0x40, "Amstrad PPC512") |
| 127 | PORT_CONFSETTING(0x60, "ATI") |
| 128 | PORT_CONFSETTING(0x80, "Paradise") |
| 129 | INPUT_PORTS_END |
| 130 | |
| 131 | |
| 132 | static INPUT_PORTS_START( pc1512 ) |
| 133 | PORT_START( "cga_config" ) |
| 134 | PORT_CONFNAME( 0x03, 0x03, "CGA character set") |
| 135 | PORT_CONFSETTING(0x00, "Greek") |
| 136 | PORT_CONFSETTING(0x01, "Danish 2") |
| 137 | PORT_CONFSETTING(0x02, "Danish 1") |
| 138 | PORT_CONFSETTING(0x03, "Default") |
| 139 | PORT_CONFNAME( 0x1C, 0x00, "CGA monitor type") |
| 140 | PORT_CONFSETTING(0x00, "Colour RGB") |
| 141 | PORT_CONFSETTING(0x04, "Mono RGB") |
| 142 | PORT_BIT ( 0xE0, 0x20, IPT_UNUSED ) /* Chipset is always PC1512 */ |
| 143 | INPUT_PORTS_END |
| 144 | |
| 145 | |
| 146 | /* Dipswitch for font selection */ |
| 147 | #define CGA_FONT (input_port_read(*this, "cga_config") & m_font_selection_mask) |
| 148 | |
| 149 | /* Dipswitch for monitor selection */ |
| 150 | #define CGA_MONITOR (input_port_read(*this, "cga_config")&0x1C) |
| 151 | #define CGA_MONITOR_RGB 0x00 /* Colour RGB */ |
| 152 | #define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */ |
| 153 | #define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */ |
| 154 | #define CGA_MONITOR_TELEVISION 0x0C /* Television */ |
| 155 | #define CGA_MONITOR_LCD 0x10 /* LCD, eg PPC512 */ |
| 156 | |
| 157 | |
| 158 | /* Dipswitch for chipset selection */ |
| 159 | /* TODO: Get rid of this; these should be handled by separate classes */ |
| 160 | #define CGA_CHIPSET (input_port_read(*this, "cga_config") & 0xE0) |
| 161 | #define CGA_CHIPSET_IBM 0x00 /* Original IBM CGA */ |
| 162 | #define CGA_CHIPSET_PC1512 0x20 /* PC1512 CGA subset */ |
| 163 | #define CGA_CHIPSET_PC200 0x40 /* PC200 in CGA mode */ |
| 164 | #define CGA_CHIPSET_ATI 0x60 /* ATI (supports Plantronics) */ |
| 165 | #define CGA_CHIPSET_PARADISE 0x80 /* Paradise (used in PC1640) */ |
| 166 | |
| 167 | |
| 168 | /* CGA palettes |
| 169 | * |
| 170 | * The first 16 are for RGB monitors |
| 171 | * The next 16 are for greyscale modes |
| 172 | * The next 16 are for text modes on colour composite |
| 173 | * The next 16*16 are Mode 6 (colour composite) } |
| 174 | * The next 64*16 are Mode 4 (colour composite) } both indexed by the CGA colour select register 0x3D9 |
| 175 | * |
| 176 | */ |
| 177 | |
| 178 | const unsigned char cga_palette[16 * CGA_PALETTE_SETS][3] = |
| 179 | { |
| 180 | /* RGB colours */ |
| 181 | { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0xaa }, { 0x00, 0xaa, 0x00 }, { 0x00, 0xaa, 0xaa }, |
| 182 | { 0xaa, 0x00, 0x00 }, { 0xaa, 0x00, 0xaa }, { 0xaa, 0x55, 0x00 }, { 0xaa, 0xaa, 0xaa }, |
| 183 | { 0x55, 0x55, 0x55 }, { 0x55, 0x55, 0xff }, { 0x55, 0xff, 0x55 }, { 0x55, 0xff, 0xff }, |
| 184 | { 0xff, 0x55, 0x55 }, { 0xff, 0x55, 0xff }, { 0xff, 0xff, 0x55 }, { 0xff, 0xff, 0xff }, |
| 185 | /* Greyscale */ |
| 186 | { 0x00, 0x00, 0x00 }, { 0x11, 0x11, 0x11 }, { 0x44, 0x44, 0x44 }, { 0x55, 0x55, 0x55 }, |
| 187 | { 0x22, 0x22, 0x22 }, { 0x33, 0x33, 0x33 }, { 0x66, 0x66, 0x66 }, { 0x77, 0x77, 0x77 }, |
| 188 | { 0x88, 0x88, 0x88 }, { 0x99, 0x99, 0x99 }, { 0xCC, 0xCC, 0xCC }, { 0xDD, 0xDD, 0xDD }, |
| 189 | { 0xAA, 0xAA, 0xAA }, { 0xBB, 0xBB, 0xBB }, { 0xEE, 0xEE, 0xEE }, { 0xFF, 0xFF, 0xFF }, |
| 190 | /* Text mode, composite monitor */ |
| 191 | { 0x00, 0x00, 0x00 }, { 0x0E, 0x00, 0x7A }, { 0x07, 0x55, 0x00 }, { 0x02, 0x65, 0x39 }, |
| 192 | { 0x51, 0x00, 0x1A }, { 0x54, 0x00, 0x76 }, { 0x48, 0x63, 0x00 }, { 0x8c, 0x8c, 0x8c }, |
| 193 | { 0x38, 0x38, 0x38 }, { 0x58, 0x49, 0xD5 }, { 0x5F, 0xAD, 0x26 }, { 0x5B, 0xB9, 0xAC }, |
| 194 | { 0xAA, 0x4A, 0x5E }, { 0xA7, 0x55, 0xD2 }, { 0xA2, 0xB9, 0x31 }, { 0xE2, 0xE2, 0xE2 }, |
| 195 | /* Composite hi-res, colour reg = 0 */ |
| 196 | { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, |
| 197 | { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, |
| 198 | { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, |
| 199 | { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x00 }, |
| 200 | /* Composite hi-res, colour reg = 1 */ |
| 201 | { 0x00, 0x00, 0x00 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x00, 0x61 }, { 0x00, 0x00, 0x6b }, |
| 202 | { 0x25, 0x00, 0x1E }, { 0x15, 0x00, 0x23 }, { 0x18, 0x00, 0x87 }, { 0x06, 0x00, 0x91 }, |
| 203 | { 0x00, 0x00, 0x00 }, { 0x00, 0x0b, 0x00 }, { 0x00, 0x00, 0x4C }, { 0x00, 0x02, 0x52 }, |
| 204 | { 0x24, 0x00, 0x08 }, { 0x0E, 0x00, 0x0D }, { 0x18, 0x00, 0x6f }, { 0x07, 0x00, 0x7C }, |
| 205 | /* Composite hi-res, colour reg = 2 */ |
| 206 | { 0x00, 0x00, 0x00 }, { 0x00, 0x28, 0x00 }, { 0x01, 0x00, 0x46 }, { 0x00, 0x21, 0x36 }, |
| 207 | { 0x22, 0x00, 0x01 }, { 0x00, 0x21, 0x00 }, { 0x1b, 0x00, 0x43 }, { 0x00, 0x22, 0x33 }, |
| 208 | { 0x07, 0x0D, 0x00 }, { 0x00, 0x4B, 0x00 }, { 0x04, 0x0E, 0x00 }, { 0x00, 0x57, 0x00 }, |
| 209 | { 0x25, 0x02, 0x00 }, { 0x01, 0x46, 0x00 }, { 0x30, 0x04, 0x00 }, { 0x04, 0x53, 0x00 }, |
| 210 | /* Composite hi-res, colour reg = 3 */ |
| 211 | { 0x00, 0x00, 0x00 }, { 0x00, 0x30, 0x00 }, { 0x00, 0x00, 0x8E }, { 0x00, 0x38, 0x87 }, |
| 212 | { 0x2E, 0x00, 0x01 }, { 0x00, 0x21, 0x00 }, { 0x22, 0x00, 0x8C }, { 0x00, 0x35, 0x95 }, |
| 213 | { 0x00, 0x0F, 0x00 }, { 0x00, 0x4F, 0x00 }, { 0x00, 0x0B, 0x3F }, { 0x00, 0x62, 0x45 }, |
| 214 | { 0x29, 0x00, 0x00 }, { 0x00, 0x4E, 0x00 }, { 0x35, 0x04, 0x48 }, { 0x01, 0x62, 0x49 }, |
| 215 | /* Composite hi-res, colour reg = 4 */ |
| 216 | { 0x00, 0x00, 0x00 }, { 0x00, 0x06, 0x02 }, { 0x01, 0x00, 0x1f }, { 0x00, 0x00, 0x24 }, |
| 217 | { 0x54, 0x00, 0x38 }, { 0x25, 0x00, 0x23 }, { 0x3A, 0x00, 0x4f }, { 0x29, 0x00, 0x56 }, |
| 218 | { 0x10, 0x03, 0x00 }, { 0x06, 0x08, 0x00 }, { 0x15, 0x00, 0x00 }, { 0x02, 0x03, 0x00 }, |
| 219 | { 0x82, 0x00, 0x00 }, { 0x49, 0x00, 0x00 }, { 0x5B, 0x00, 0x0b }, { 0x52, 0x00, 0x0c }, |
| 220 | /* Composite hi-res, colour reg = 5 */ |
| 221 | { 0x00, 0x00, 0x00 }, { 0x00, 0x2c, 0x00 }, { 0x06, 0x01, 0x57 }, { 0x00, 0x22, 0x42 }, |
| 222 | { 0x33, 0x00, 0x01 }, { 0x00, 0x26, 0x00 }, { 0x3a, 0x00, 0x54 }, { 0x08, 0x1D, 0x54 }, |
| 223 | { 0x13, 0x17, 0x00 }, { 0x00, 0x64, 0x00 }, { 0x29, 0x15, 0x00 }, { 0x00, 0x64, 0x00 }, |
| 224 | { 0x59, 0x0A, 0x00 }, { 0x30, 0x61, 0x00 }, { 0x7A, 0x06, 0x00 }, { 0x4A, 0x64, 0x00 }, |
| 225 | /* Composite hi-res, colour reg = 6 */ |
| 226 | { 0x00, 0x00, 0x00 }, { 0x00, 0x33, 0x00 }, { 0x06, 0x00, 0x5E }, { 0x00, 0x22, 0x45 }, |
| 227 | { 0x34, 0x00, 0x04 }, { 0x00, 0x1e, 0x00 }, { 0x3d, 0x00, 0x4c }, { 0x0c, 0x22, 0x58 }, |
| 228 | { 0x18, 0x19, 0x00 }, { 0x00, 0x62, 0x00 }, { 0x2b, 0x14, 0x00 }, { 0x01, 0x64, 0x00 }, |
| 229 | { 0x57, 0x0f, 0x00 }, { 0x29, 0x63, 0x00 }, { 0x78, 0x09, 0x00 }, { 0x51, 0x61, 0x00 }, |
| 230 | /* Composite hi-res, colour reg = 7 */ |
| 231 | { 0x00, 0x00, 0x00 }, { 0x00, 0x3C, 0x01 }, { 0x04, 0x00, 0xC5 }, { 0x00, 0x4C, 0xC7 }, |
| 232 | { 0x6A, 0x00, 0x15 }, { 0x28, 0x28, 0x24 }, { 0x8A, 0x00, 0xF8 }, { 0x70, 0x61, 0xFF }, |
| 233 | { 0x20, 0x33, 0x00 }, { 0x00, 0x85, 0x00 }, { 0x2E, 0x25, 0x28 }, { 0x00, 0x98, 0x3B }, |
| 234 | { 0xb1, 0x11, 0x00 }, { 0x6A, 0x75, 0x00 }, { 0xcc, 0x16, 0x81 }, { 0x91, 0x8e, 0x91 }, |
| 235 | /* Composite hi-res, colour reg = 8 */ |
| 236 | { 0x00, 0x00, 0x00 }, { 0x00, 0x12, 0x0F }, { 0x04, 0x00, 0x5F }, { 0x00, 0x02, 0x67 }, |
| 237 | { 0x31, 0x00, 0x01 }, { 0x04, 0x01, 0x04 }, { 0x37, 0x00, 0x52 }, { 0x17, 0x00, 0x6d }, |
| 238 | { 0x00, 0x10, 0x00 }, { 0x00, 0x29, 0x00 }, { 0x04, 0x03, 0x04 }, { 0x00, 0x24, 0x16 }, |
| 239 | { 0x2f, 0x00, 0x00 }, { 0x07, 0x23, 0x00 }, { 0x43, 0x00, 0x08 }, { 0x25, 0x23, 0x24 }, |
| 240 | /* Composite hi-res, colour reg = 9 */ |
| 241 | { 0x00, 0x00, 0x00 }, { 0x00, 0x19, 0x14 }, { 0x00, 0x00, 0xc2 }, { 0x00, 0x1c, 0xed }, |
| 242 | { 0x5e, 0x00, 0x13 }, { 0x2c, 0x03, 0x3a }, { 0x78, 0x00, 0xfa }, { 0x49, 0x11, 0xff }, |
| 243 | { 0x00, 0x15, 0x00 }, { 0x00, 0x40, 0x00 }, { 0x0d, 0x11, 0x68 }, { 0x00, 0x4f, 0x9c }, |
| 244 | { 0x67, 0x00, 0x00 }, { 0x39, 0x36, 0x00 }, { 0x91, 0x05, 0xa6 }, { 0x62, 0x45, 0xdc }, |
| 245 | /* Composite hi-res, colour reg = A */ |
| 246 | { 0x00, 0x00, 0x00 }, { 0x00, 0x4B, 0x08 }, { 0x05, 0x00, 0xAA }, { 0x00, 0x50, 0xc7 }, |
| 247 | { 0x58, 0x00, 0x06 }, { 0x05, 0x44, 0x06 }, { 0x75, 0x00, 0xb0 }, { 0x2e, 0x4f, 0xdc }, |
| 248 | { 0x0c, 0x2f, 0x00 }, { 0x00, 0xa7, 0x00 }, { 0x26, 0x2e, 0x03 }, { 0x00, 0xb4, 0x24 }, |
| 249 | { 0x84, 0x1b, 0x00 }, { 0x2d, 0xa5, 0x00 }, { 0xa5, 0x2a, 0x16 }, { 0x5f, 0xb2, 0x2a }, |
| 250 | /* Composite hi-res, colour reg = B */ |
| 251 | { 0x00, 0x00, 0x00 }, { 0x00, 0x59, 0x07 }, { 0x00, 0x08, 0xf0 }, { 0x00, 0x06, 0xfd }, |
| 252 | { 0x69, 0x00, 0x09 }, { 0x0d, 0x4c, 0x10 }, { 0x8f, 0x00, 0xf4 }, { 0x38, 0x66, 0xff }, |
| 253 | { 0x02, 0x27, 0x00 }, { 0x00, 0xac, 0x00 }, { 0x19, 0x2f, 0x6d }, { 0x00, 0xc5, 0x82 }, |
| 254 | { 0x7b, 0x18, 0x00 }, { 0x30, 0xa7, 0x00 }, { 0xac, 0x2b, 0x81 }, { 0x5b, 0xc0, 0xa4 }, |
| 255 | /* Composite hi-res, colour reg = C */ |
| 256 | { 0x00, 0x00, 0x00 }, { 0x00, 0x1C, 0x0C }, { 0x0a, 0x00, 0x7c }, { 0x00, 0x0d, 0x8f }, |
| 257 | { 0x6e, 0x00, 0x18 }, { 0x48, 0x02, 0x4a }, { 0x95, 0x00, 0xc3 }, { 0x68, 0x01, 0xef }, |
| 258 | { 0x12, 0x1d, 0x00 }, { 0x00, 0x53, 0x00 }, { 0x33, 0x21, 0x00 }, { 0x05, 0x52, 0x13 }, |
| 259 | { 0xb4, 0x09, 0x00 }, { 0x87, 0x41, 0x00 }, { 0xd8, 0x07, 0x3a }, { 0xb0, 0x49, 0x63 }, |
| 260 | /* Composite hi-res, colour reg = D */ |
| 261 | { 0x00, 0x00, 0x00 }, { 0x00, 0x1d, 0x17 }, { 0x00, 0x08, 0xcf }, { 0x00, 0x1b, 0xf2 }, |
| 262 | { 0x83, 0x00, 0x30 }, { 0x4c, 0x08, 0x53 }, { 0xae, 0x00, 0xfa }, { 0x85, 0x0b, 0xff }, |
| 263 | { 0x09, 0x19, 0x00 }, { 0x00, 0x57, 0x00 }, { 0x21, 0x15, 0x4f }, { 0x00, 0x5e, 0x89 }, |
| 264 | { 0xb0, 0x04, 0x00 }, { 0x76, 0x4e, 0x00 }, { 0xe2, 0x0a, 0xa9 }, { 0xae, 0x56, 0xe1 }, |
| 265 | /* Composite hi-res, colour reg = E */ |
| 266 | { 0x00, 0x00, 0x00 }, { 0x00, 0x57, 0x06 }, { 0x17, 0x00, 0xc3 }, { 0x00, 0x55, 0xd9 }, |
| 267 | { 0x6f, 0x00, 0x06 }, { 0x18, 0x49, 0x0d }, { 0xa4, 0x00, 0xcd }, { 0x4e, 0x4c, 0xf7 }, |
| 268 | { 0x1c, 0x3f, 0x00 }, { 0x00, 0xbf, 0x00 }, { 0x51, 0x35, 0x00 }, { 0x06, 0xc4, 0x1b }, |
| 269 | { 0xb6, 0x2d, 0x00 }, { 0x73, 0xb2, 0x00 }, { 0xf5, 0x30, 0x21 }, { 0xaa, 0xbf, 0x2f }, |
| 270 | /* Composite hi-res, colour reg = F */ |
| 271 | { 0x00, 0x00, 0x00 }, { 0x00, 0x68, 0x10 }, { 0x10, 0x00, 0xff }, { 0x00, 0x7c, 0xFF }, |
| 272 | { 0xb3, 0x00, 0x2A }, { 0x53, 0x55, 0x51 }, { 0xf0, 0x00, 0xff }, { 0x95, 0x72, 0xff }, |
| 273 | { 0x25, 0x3e, 0x00 }, { 0x00, 0xda, 0x00 }, { 0x58, 0x52, 0x56 }, { 0x00, 0xf8, 0x7f }, |
| 274 | { 0xf8, 0x2c, 0x00 }, { 0xa8, 0xcf, 0x00 }, { 0xff, 0x41, 0xb8 }, { 0xed, 0xea, 0xed }, |
| 275 | /* Composite lo-res, colour reg = 0 */ |
| 276 | { 0x00, 0x00, 0x00 }, { 0x00, 0x26, 0x34 }, { 0x00, 0x00, 0x24 }, { 0x00, 0x25, 0x46 }, |
| 277 | { 0x29, 0x03, 0x00 }, { 0x04, 0x55, 0x00 }, { 0x1f, 0x0c, 0x00 }, { 0x0e, 0x53, 0x03 }, |
| 278 | { 0x50, 0x00, 0x00 }, { 0x33, 0x36, 0x2b }, { 0x51, 0x00, 0x0b }, { 0x43, 0x37, 0x44 }, |
| 279 | { 0x60, 0x07, 0x00 }, { 0x3c, 0x61, 0x00 }, { 0x59, 0x1c, 0x00 }, { 0x4a, 0x64, 0x00 }, |
| 280 | /* Composite lo-res, colour reg = 1 */ |
| 281 | { 0x07, 0x00, 0x7d }, { 0x00, 0x21, 0x4e }, { 0x15, 0x00, 0x36 }, { 0x04, 0x19, 0x77 }, |
| 282 | { 0x16, 0x1a, 0x00 }, { 0x04, 0x55, 0x00 }, { 0x23, 0x0b, 0x00 }, { 0x13, 0x51, 0x03 }, |
| 283 | { 0x41, 0x02, 0x3e }, { 0x2e, 0x33, 0x24 }, { 0x51, 0x00, 0x14 }, { 0x41, 0x33, 0x46 }, |
| 284 | { 0x51, 0x2b, 0x00 }, { 0x3f, 0x60, 0x00 }, { 0x60, 0x17, 0x00 }, { 0x4d, 0x61, 0x00 }, |
| 285 | /* Composite lo-res, colour reg = 2 */ |
| 286 | { 0x03, 0x55, 0x00 }, { 0x03, 0x55, 0x00 }, { 0x21, 0x0c, 0x00 }, { 0x11, 0x51, 0x03 }, |
| 287 | { 0x03, 0x55, 0x00 }, { 0x03, 0x55, 0x00 }, { 0x21, 0x0c, 0x00 }, { 0x11, 0x51, 0x03 }, |
| 288 | { 0x31, 0x37, 0x29 }, { 0x30, 0x36, 0x2a }, { 0x51, 0x00, 0x11 }, { 0x41, 0x34, 0x46 }, |
| 289 | { 0x3c, 0x63, 0x00 }, { 0x3d, 0x63, 0x00 }, { 0x5f, 0x17, 0x00 }, { 0x4d, 0x61, 0x00 }, |
| 290 | /* Composite lo-res, colour reg = 3 */ |
| 291 | { 0x04, 0x61, 0x4e }, { 0x05, 0x49, 0x02 }, { 0x1f, 0x04, 0x00 }, { 0x12, 0x47, 0x13 }, |
| 292 | { 0x03, 0x68, 0x2f }, { 0x05, 0x54, 0x00 }, { 0x1e, 0x0e, 0x00 }, { 0x0f, 0x51, 0x01 }, |
| 293 | { 0x26, 0x46, 0x73 }, { 0x2f, 0x34, 0x27 }, { 0x50, 0x00, 0x0b }, { 0x48, 0x31, 0x47 }, |
| 294 | { 0x3e, 0x70, 0x1e }, { 0x40, 0x5f, 0x00 }, { 0x57, 0x1d, 0x00 }, { 0x4a, 0x62, 0x00 }, |
| 295 | /* Composite lo-res, colour reg = 4 */ |
| 296 | { 0x52, 0x00, 0x14 }, { 0x2e, 0x32, 0x25 }, { 0x52, 0x00, 0x14 }, { 0x46, 0x2f, 0x47 }, |
| 297 | { 0x1f, 0x09, 0x00 }, { 0x04, 0x55, 0x00 }, { 0x21, 0x0e, 0x00 }, { 0x11, 0x50, 0x02 }, |
| 298 | { 0x52, 0x00, 0x14 }, { 0x2d, 0x33, 0x25 }, { 0x52, 0x00, 0x14 }, { 0x40, 0x36, 0x3f }, |
| 299 | { 0x5c, 0x18, 0x00 }, { 0x40, 0x5f, 0x00 }, { 0x5e, 0x19, 0x00 }, { 0x4b, 0x62, 0x00 }, |
| 300 | /* Composite lo-res, colour reg = 5 */ |
| 301 | { 0x51, 0x00, 0x81 }, { 0x2a, 0x2a, 0x3f }, { 0x4f, 0x00, 0x1c }, { 0x3b, 0x2b, 0x5c }, |
| 302 | { 0x22, 0x1b, 0x13 }, { 0x04, 0x55, 0x00 }, { 0x21, 0x0e, 0x00 }, { 0x0e, 0x52, 0x04 }, |
| 303 | { 0x4c, 0x03, 0x59 }, { 0x2e, 0x32, 0x25 }, { 0x51, 0x00, 0x0b }, { 0x3e, 0x37, 0x3d }, |
| 304 | { 0x5d, 0x2a, 0x03 }, { 0x3d, 0x60, 0x00 }, { 0x5d, 0x19, 0x00 }, { 0x4a, 0x63, 0x00 }, |
| 305 | /* Composite lo-res, colour reg = 6 */ |
| 306 | { 0x4b, 0x60, 0x00 }, { 0x41, 0x5f, 0x00 }, { 0x5b, 0x1a, 0x00 }, { 0x4b, 0x60, 0x00 }, |
| 307 | { 0x0e, 0x51, 0x03 }, { 0x03, 0x55, 0x00 }, { 0x22, 0x0b, 0x00 }, { 0x12, 0x51, 0x03 }, |
| 308 | { 0x41, 0x34, 0x47 }, { 0x31, 0x37, 0x29 }, { 0x50, 0x00, 0x10 }, { 0x3f, 0x32, 0x43 }, |
| 309 | { 0x4b, 0x60, 0x00 }, { 0x3d, 0x61, 0x00 }, { 0x62, 0x16, 0x00 }, { 0x4b, 0x60, 0x00 }, |
| 310 | /* Composite lo-res, colour reg = 7 */ |
| 311 | { 0x8b, 0x8b, 0x8b }, { 0x83, 0x5b, 0x00 }, { 0xa4, 0x1b, 0x00 }, { 0x92, 0x5a, 0x09 }, |
| 312 | { 0x07, 0x79, 0x6f }, { 0x06, 0x55, 0x00 }, { 0x1f, 0x0d, 0x00 }, { 0x10, 0x52, 0x01 }, |
| 313 | { 0x23, 0x62, 0xa4 }, { 0x2b, 0x33, 0x29 }, { 0x51, 0x00, 0x11 }, { 0x40, 0x36, 0x42 }, |
| 314 | { 0x46, 0x86, 0x63 }, { 0x42, 0x5e, 0x00 }, { 0x5e, 0x17, 0x00 }, { 0x4a, 0x62, 0x00 }, |
| 315 | /* Composite lo-res, colour reg = 8 */ |
| 316 | { 0x26, 0x26, 0x26 }, { 0x0a, 0x49, 0x00 }, { 0x25, 0x07, 0x00 }, { 0x16, 0x4c, 0x0e }, |
| 317 | { 0x1c, 0x29, 0x12 }, { 0x06, 0x55, 0x00 }, { 0x21, 0x0c, 0x00 }, { 0x11, 0x51, 0x02 }, |
| 318 | { 0x4d, 0x10, 0x5f }, { 0x2c, 0x33, 0x26 }, { 0x51, 0x00, 0x0f }, { 0x41, 0x35, 0x47 }, |
| 319 | { 0x5a, 0x35, 0x00 }, { 0x43, 0x5f, 0x00 }, { 0x5f, 0x15, 0x00 }, { 0x4d, 0x62, 0x00 }, |
| 320 | /* Composite lo-res, colour reg = 9 */ |
| 321 | { 0x92, 0x47, 0xd3 }, { 0x47, 0x47, 0x1b }, { 0x66, 0x00, 0x09 }, { 0x54, 0x44, 0x37 }, |
| 322 | { 0x15, 0x4b, 0x8a }, { 0x05, 0x55, 0x00 }, { 0x00, 0x10, 0x00 }, { 0x10, 0x52, 0x02 }, |
| 323 | { 0x40, 0x33, 0xd4 }, { 0x2f, 0x33, 0x26 }, { 0x51, 0x00, 0x0d }, { 0x3e, 0x37, 0x3e }, |
| 324 | { 0x51, 0x59, 0x75 }, { 0x3b, 0x63, 0x00 }, { 0x5b, 0x1a, 0x00 }, { 0x49, 0x64, 0x00 }, |
| 325 | /* Composite lo-res, colour reg = A */ |
| 326 | { 0x57, 0xac, 0x33 }, { 0x54, 0x7f, 0x00 }, { 0x7f, 0x2e, 0x00 }, { 0x6a, 0x77, 0x00 }, |
| 327 | { 0x05, 0x80, 0x70 }, { 0x03, 0x54, 0x00 }, { 0x22, 0x0c, 0x00 }, { 0x13, 0x52, 0x00 }, |
| 328 | { 0x31, 0x64, 0xbe }, { 0x30, 0x35, 0x2a }, { 0x52, 0x00, 0x12 }, { 0x41, 0x33, 0x46 }, |
| 329 | { 0x3c, 0x91, 0x50 }, { 0x3c, 0x62, 0x00 }, { 0x60, 0x15, 0x00 }, { 0x4f, 0x61, 0x00 }, |
| 330 | /* Composite lo-res, colour reg = B */ |
| 331 | { 0x5b, 0xb9, 0xa7 }, { 0x5b, 0x6d, 0x00 }, { 0x7f, 0x29, 0x00 }, { 0x6c, 0x6e, 0x00 }, |
| 332 | { 0x05, 0x95, 0xcb }, { 0x04, 0x54, 0x00 }, { 0x23, 0x0a, 0x00 }, { 0x12, 0x51, 0x02 }, |
| 333 | { 0x28, 0x77, 0xfb }, { 0x32, 0x37, 0x2f }, { 0x52, 0x00, 0x12 }, { 0x3e, 0x34, 0x40 }, |
| 334 | { 0x3a, 0xa3, 0xaf }, { 0x3c, 0x63, 0x00 }, { 0x60, 0x15, 0x00 }, { 0x50, 0x61, 0x00 }, |
| 335 | /* Composite lo-res, colour reg = C */ |
| 336 | { 0xaa, 0x45, 0x6a }, { 0x8c, 0x59, 0x00 }, { 0xa8, 0x1a, 0x00 }, { 0x96, 0x60, 0x05 }, |
| 337 | { 0x20, 0x35, 0x41 }, { 0x03, 0x55, 0x00 }, { 0x22, 0x0b, 0x00 }, { 0x10, 0x52, 0x02 }, |
| 338 | { 0x4f, 0x1e, 0xa2 }, { 0x2e, 0x34, 0x25 }, { 0x50, 0x00, 0x10 }, { 0x42, 0x36, 0x45 }, |
| 339 | { 0x56, 0x48, 0x2a }, { 0x41, 0x5e, 0x00 }, { 0x5d, 0x19, 0x00 }, { 0x49, 0x64, 0x00 }, |
| 340 | /* Composite lo-res, colour reg = D */ |
| 341 | { 0xa9, 0x54, 0xd6 }, { 0x85, 0x52, 0x09 }, { 0xa5, 0x17, 0x00 }, { 0x96, 0x52, 0x23 }, |
| 342 | { 0x1e, 0x48, 0x9f }, { 0x06, 0x55, 0x00 }, { 0x1f, 0x0c, 0x00 }, { 0x0f, 0x52, 0x01 }, |
| 343 | { 0x46, 0x35, 0xe1 }, { 0x2b, 0x32, 0x26 }, { 0x51, 0x00, 0x0e }, { 0x3e, 0x39, 0x3e }, |
| 344 | { 0x5d, 0x58, 0x88 }, { 0x41, 0x60, 0x00 }, { 0x57, 0x1c, 0x00 }, { 0x4a, 0x62, 0x00 }, |
| 345 | /* Composite lo-res, colour reg = E */ |
| 346 | { 0xa4, 0xbb, 0x30 }, { 0x9d, 0x84, 0x00 }, { 0xb6, 0x3f, 0x00 }, { 0xa1, 0x8c, 0x00 }, |
| 347 | { 0x14, 0x7b, 0x8a }, { 0x06, 0x55, 0x00 }, { 0x21, 0x0b, 0x00 }, { 0x13, 0x51, 0x02 }, |
| 348 | { 0x3f, 0x67, 0xd5 }, { 0x2d, 0x36, 0x29 }, { 0x52, 0x00, 0x11 }, { 0x41, 0x33, 0x46 }, |
| 349 | { 0x4c, 0x8e, 0x6e }, { 0x3e, 0x61, 0x00 }, { 0x5f, 0x16, 0x00 }, { 0x4c, 0x61, 0x00 }, |
| 350 | /* Composite lo-res, colour reg = F */ |
| 351 | { 0xe3, 0xe3, 0xe3 }, { 0xdb, 0x82, 0x00 }, { 0xf5, 0x43, 0x00 }, { 0xee, 0x83, 0x00 }, |
| 352 | { 0x08, 0xa6, 0xf5 }, { 0x04, 0x53, 0x00 }, { 0x1c, 0x0d, 0x00 }, { 0x13, 0x52, 0x00 }, |
| 353 | { 0x25, 0x91, 0xfc }, { 0x2c, 0x35, 0x30 }, { 0x51, 0x00, 0x0e }, { 0x3b, 0x36, 0x38 }, |
| 354 | { 0x43, 0xb5, 0xf7 }, { 0x3b, 0x62, 0x00 }, { 0x56, 0x1c, 0x00 }, { 0x4d, 0x61, 0x00 }, |
| 355 | /* Composite lo-res, colour reg = 10 */ |
| 356 | { 0x00, 0x00, 0x00 }, { 0x00, 0x58, 0xb9 }, { 0x00, 0x11, 0x8a }, { 0x00, 0x4a, 0xe1 }, |
| 357 | { 0x73, 0x22, 0x00 }, { 0x5a, 0xad, 0x2e }, { 0x78, 0x61, 0x0d }, { 0x6a, 0xa9, 0x4c }, |
| 358 | { 0xac, 0x0a, 0x00 }, { 0x87, 0x8d, 0x80 }, { 0xab, 0x46, 0x6c }, { 0x95, 0x8b, 0x97 }, |
| 359 | { 0xac, 0x30, 0x00 }, { 0x91, 0xbc, 0x16 }, { 0xb8, 0x6d, 0x07 }, { 0xa7, 0xb9, 0x2d }, |
| 360 | /* Composite lo-res, colour reg = 11 */ |
| 361 | { 0x60, 0x00, 0x7c }, { 0x01, 0x54, 0xdb }, { 0x09, 0x11, 0xb9 }, { 0x07, 0x47, 0xf8 }, |
| 362 | { 0x76, 0x46, 0x02 }, { 0x5a, 0xae, 0x2e }, { 0x78, 0x62, 0x0c }, { 0x68, 0xa9, 0x4b }, |
| 363 | { 0x99, 0x2a, 0x09 }, { 0x87, 0x8d, 0x80 }, { 0xab, 0x46, 0x6b }, { 0x93, 0x89, 0x95 }, |
| 364 | { 0xa4, 0x54, 0x00 }, { 0x93, 0xbb, 0x16 }, { 0xb9, 0x6b, 0x04 }, { 0xa4, 0xb9, 0x30 }, |
| 365 | /* Composite lo-res, colour reg = 12 */ |
| 366 | { 0x07, 0x55, 0x00 }, { 0x03, 0x83, 0x70 }, { 0x1c, 0x3a, 0x42 }, { 0x0e, 0x81, 0x82 }, |
| 367 | { 0x58, 0x7e, 0x00 }, { 0x5b, 0xad, 0x2f }, { 0x77, 0x60, 0x0f }, { 0x67, 0xac, 0x49 }, |
| 368 | { 0x87, 0x5a, 0x00 }, { 0x89, 0x8c, 0x81 }, { 0xa9, 0x49, 0x5e }, { 0x9b, 0x8a, 0x96 }, |
| 369 | { 0x9f, 0x83, 0x00 }, { 0x94, 0xb9, 0x19 }, { 0xb0, 0x72, 0x03 }, { 0xa5, 0xbb, 0x30 }, |
| 370 | /* Composite lo-res, colour reg = 13 */ |
| 371 | { 0x03, 0x63, 0x48 }, { 0x04, 0x76, 0x8c }, { 0x1d, 0x34, 0x5a }, { 0x0d, 0x7a, 0x9c }, |
| 372 | { 0x5a, 0x8e, 0x03 }, { 0x58, 0xac, 0x33 }, { 0x76, 0x60, 0x0b }, { 0x68, 0xaa, 0x4b }, |
| 373 | { 0x7e, 0x6e, 0x3b }, { 0x88, 0x8c, 0x80 }, { 0xaa, 0x48, 0x64 }, { 0x94, 0x91, 0x92 }, |
| 374 | { 0x94, 0x9b, 0x00 }, { 0x96, 0xb9, 0x16 }, { 0xb0, 0x73, 0x01 }, { 0xa7, 0xb8, 0x2e }, |
| 375 | /* Composite lo-res, colour reg = 14 */ |
| 376 | { 0x52, 0x00, 0x13 }, { 0x29, 0x61, 0xb6 }, { 0x52, 0x1e, 0xa1 }, { 0x41, 0x63, 0xdb }, |
| 377 | { 0x7b, 0x2f, 0x00 }, { 0x5d, 0xac, 0x2c }, { 0x77, 0x63, 0x0a }, { 0x67, 0xa9, 0x51 }, |
| 378 | { 0xaf, 0x18, 0x00 }, { 0x83, 0x8a, 0x7d }, { 0xa9, 0x46, 0x66 }, { 0x9a, 0x8c, 0xa0 }, |
| 379 | { 0xb1, 0x43, 0x00 }, { 0x9a, 0xb7, 0x19 }, { 0xb7, 0x6e, 0x05 }, { 0xa4, 0xb9, 0x2f }, |
| 380 | /* Composite lo-res, colour reg = 15 */ |
| 381 | { 0x52, 0x00, 0x7a }, { 0x2e, 0x55, 0xdc }, { 0x4e, 0x1b, 0xb1 }, { 0x3c, 0x55, 0xec }, |
| 382 | { 0x80, 0x3f, 0x00 }, { 0x5b, 0xad, 0x2e }, { 0x73, 0x61, 0x0a }, { 0x66, 0xaa, 0x50 }, |
| 383 | { 0xa7, 0x29, 0x29 }, { 0x86, 0x8a, 0x7d }, { 0xa8, 0x48, 0x60 }, { 0x98, 0x8e, 0x9b }, |
| 384 | { 0xc0, 0x4a, 0x00 }, { 0x9a, 0xb5, 0x18 }, { 0xb3, 0x72, 0x06 }, { 0xa2, 0xba, 0x31 }, |
| 385 | /* Composite lo-res, colour reg = 16 */ |
| 386 | { 0x4d, 0x61, 0x00 }, { 0x3b, 0x91, 0x53 }, { 0x59, 0x46, 0x2c }, { 0x48, 0x95, 0x63 }, |
| 387 | { 0x6c, 0x77, 0x00 }, { 0x5a, 0xac, 0x31 }, { 0x75, 0x63, 0x09 }, { 0x66, 0xa9, 0x4e }, |
| 388 | { 0x8e, 0x6a, 0x0f }, { 0x87, 0x8b, 0x7f }, { 0xa9, 0x47, 0x66 }, { 0x9b, 0x8c, 0x9f }, |
| 389 | { 0xab, 0x86, 0x00 }, { 0x9a, 0xb6, 0x18 }, { 0xae, 0x74, 0x01 }, { 0xa2, 0xba, 0x2f }, |
| 390 | /* Composite lo-res, colour reg = 17 */ |
| 391 | { 0x8b, 0x8b, 0x8b }, { 0x7f, 0x89, 0x79 }, { 0xa4, 0x4a, 0x5c }, { 0x96, 0x8a, 0x95 }, |
| 392 | { 0x5c, 0xa1, 0x36 }, { 0x5d, 0xad, 0x2b }, { 0x77, 0x62, 0x0a }, { 0x68, 0xa8, 0x4f }, |
| 393 | { 0x83, 0x88, 0x6f }, { 0x85, 0x8d, 0x81 }, { 0xa9, 0x46, 0x69 }, { 0x99, 0x8b, 0x9f }, |
| 394 | { 0x97, 0xb1, 0x22 }, { 0x99, 0xb7, 0x18 }, { 0xb8, 0x6c, 0x04 }, { 0xa2, 0xba, 0x2e }, |
| 395 | /* Composite lo-res, colour reg = 18 */ |
| 396 | { 0x25, 0x25, 0x25 }, { 0x0b, 0x78, 0x8b }, { 0x25, 0x34, 0x5a }, { 0x14, 0x7d, 0x9d }, |
| 397 | { 0x76, 0x4f, 0x00 }, { 0x5a, 0xac, 0x2e }, { 0x74, 0x64, 0x07 }, { 0x66, 0xaa, 0x49 }, |
| 398 | { 0xa7, 0x37, 0x25 }, { 0x87, 0x8b, 0x80 }, { 0xa8, 0x48, 0x64 }, { 0x9a, 0x8f, 0x9a }, |
| 399 | { 0xb6, 0x5a, 0x00 }, { 0x96, 0xba, 0x17 }, { 0xae, 0x73, 0x01 }, { 0xa2, 0xba, 0x30 }, |
| 400 | /* Composite lo-res, colour reg = 19 */ |
| 401 | { 0x5d, 0x48, 0xd5 }, { 0x4a, 0x77, 0xb3 }, { 0x65, 0x35, 0x86 }, { 0x4d, 0x77, 0xc2 }, |
| 402 | { 0x6f, 0x72, 0x53 }, { 0x5a, 0xac, 0x30 }, { 0x75, 0x62, 0x09 }, { 0x68, 0xa9, 0x48 }, |
| 403 | { 0x9c, 0x57, 0xa1 }, { 0x87, 0x8b, 0x80 }, { 0xa7, 0x49, 0x62 }, { 0x92, 0x90, 0x92 }, |
| 404 | { 0xab, 0x7d, 0x3a }, { 0x97, 0xb8, 0x17 }, { 0xb0, 0x74, 0x03 }, { 0xa2, 0xba, 0x2e }, |
| 405 | /* Composite lo-res, colour reg = 1A */ |
| 406 | { 0x59, 0xad, 0x2e }, { 0x59, 0xad, 0x2e }, { 0x75, 0x64, 0x08 }, { 0x69, 0xa7, 0x4d }, |
| 407 | { 0x59, 0xad, 0x2e }, { 0x59, 0xad, 0x2e }, { 0x75, 0x64, 0x08 }, { 0x69, 0xa7, 0x4d }, |
| 408 | { 0x87, 0x8d, 0x82 }, { 0x85, 0x8b, 0x7d }, { 0xa9, 0x47, 0x67 }, { 0x99, 0x8c, 0x9d }, |
| 409 | { 0x94, 0xba, 0x17 }, { 0x94, 0xba, 0x17 }, { 0xb6, 0x6e, 0x06 }, { 0xa2, 0xbb, 0x30 }, |
| 410 | /* Composite lo-res, colour reg = 1B */ |
| 411 | { 0x5b, 0xb9, 0xa6 }, { 0x5c, 0xa2, 0x4a }, { 0x7a, 0x5c, 0x24 }, { 0x6a, 0x9a, 0x6c }, |
| 412 | { 0x56, 0xbf, 0x8e }, { 0x59, 0xae, 0x31 }, { 0x78, 0x60, 0x0d }, { 0x68, 0xa9, 0x4f }, |
| 413 | { 0x7f, 0xa3, 0xcd }, { 0x85, 0x8c, 0x80 }, { 0xaa, 0x47, 0x6a }, { 0x98, 0x8b, 0x9c }, |
| 414 | { 0x93, 0xcd, 0x72 }, { 0x92, 0xbd, 0x14 }, { 0xb8, 0x6c, 0x06 }, { 0xa4, 0xb9, 0x2f }, |
| 415 | /* Composite lo-res, colour reg = 1C */ |
| 416 | { 0xa9, 0x44, 0x63 }, { 0x85, 0x8a, 0x7f }, { 0xa9, 0x44, 0x63 }, { 0x99, 0x8e, 0x9d }, |
| 417 | { 0x74, 0x5f, 0x0d }, { 0x5c, 0xad, 0x2c }, { 0x77, 0x63, 0x0a }, { 0x68, 0xa8, 0x4e }, |
| 418 | { 0xa9, 0x44, 0x63 }, { 0x84, 0x8b, 0x7e }, { 0xa9, 0x44, 0x63 }, { 0x99, 0x8c, 0x9e }, |
| 419 | { 0xad, 0x72, 0x01 }, { 0x9b, 0xb6, 0x1a }, { 0xb3, 0x6e, 0x05 }, { 0xa4, 0xb9, 0x2f }, |
| 420 | /* Composite lo-res, colour reg = 1D */ |
| 421 | { 0xaa, 0x55, 0xd4 }, { 0x83, 0x81, 0x9b }, { 0xa6, 0x43, 0x7b }, { 0x95, 0x80, 0xbd }, |
| 422 | { 0x76, 0x72, 0x66 }, { 0x5a, 0xad, 0x2c }, { 0x7b, 0x61, 0x0c }, { 0x68, 0xa9, 0x50 }, |
| 423 | { 0xa5, 0x59, 0xaa }, { 0x87, 0x8e, 0x7f }, { 0xa9, 0x45, 0x6a }, { 0x97, 0x8b, 0x98 }, |
| 424 | { 0xb2, 0x82, 0x48 }, { 0x93, 0xbb, 0x16 }, { 0xb9, 0x6d, 0x05 }, { 0xa4, 0xb9, 0x2f }, |
| 425 | /* Composite lo-res, colour reg = 1E */ |
| 426 | { 0xa5, 0xb8, 0x2d }, { 0xa5, 0xb8, 0x2d }, { 0xb4, 0x70, 0x05 }, { 0xa5, 0xb8, 0x2d }, |
| 427 | { 0x64, 0xaa, 0x4e }, { 0x5b, 0xad, 0x2c }, { 0x77, 0x63, 0x0b }, { 0x68, 0xa8, 0x4f }, |
| 428 | { 0x94, 0x91, 0x95 }, { 0x83, 0x8a, 0x7b }, { 0xa9, 0x47, 0x67 }, { 0x98, 0x8a, 0x9e }, |
| 429 | { 0xa5, 0xb8, 0x2d }, { 0x9a, 0xb6, 0x1a }, { 0xb2, 0x70, 0x05 }, { 0xa5, 0xb8, 0x2d }, |
| 430 | /* Composite lo-res, colour reg = 1F */ |
| 431 | { 0xe3, 0xe3, 0xe3 }, { 0xde, 0xb1, 0x45 }, { 0xf8, 0x71, 0x3e }, { 0xeb, 0xb3, 0x5e }, |
| 432 | { 0x58, 0xd3, 0xc4 }, { 0x5b, 0xad, 0x2d }, { 0x78, 0x63, 0x0b }, { 0x68, 0xa8, 0x4f }, |
| 433 | { 0x7f, 0xb7, 0xf4 }, { 0x86, 0x8b, 0x7d }, { 0xa8, 0x46, 0x69 }, { 0x9a, 0x8c, 0x9f }, |
| 434 | { 0x99, 0xe0, 0xbc }, { 0x99, 0xb6, 0x1a }, { 0xb8, 0x6d, 0x07 }, { 0xa5, 0xb8, 0x30 }, |
| 435 | /* Composite lo-res, colour reg = 20 */ |
| 436 | { 0x00, 0x00, 0x00 }, { 0x00, 0x3a, 0x85 }, { 0x00, 0x00, 0x6c }, { 0x00, 0x46, 0xce }, |
| 437 | { 0x26, 0x01, 0x00 }, { 0x03, 0x61, 0x4a }, { 0x24, 0x16, 0x2a }, { 0x09, 0x72, 0x8d }, |
| 438 | { 0x4d, 0x00, 0x00 }, { 0x2d, 0x45, 0x9c }, { 0x51, 0x00, 0x7c }, { 0x30, 0x58, 0xe1 }, |
| 439 | { 0x9e, 0x0f, 0x00 }, { 0x86, 0x7b, 0x45 }, { 0xab, 0x29, 0x2c }, { 0x8b, 0x89, 0x88 }, |
| 440 | /* Composite lo-res, colour reg = 21 */ |
| 441 | { 0x06, 0x00, 0x7C }, { 0x00, 0x3B, 0xA0 }, { 0x14, 0x00, 0x93 }, { 0x00, 0x49, 0xF7 }, |
| 442 | { 0x19, 0x12, 0x13 }, { 0x02, 0x63, 0x3f }, { 0x25, 0x16, 0x2b }, { 0x09, 0x71, 0x93 }, |
| 443 | { 0x46, 0x00, 0x65 }, { 0x28, 0x45, 0x93 }, { 0x50, 0x00, 0x80 }, { 0x32, 0x55, 0xe6 }, |
| 444 | { 0x9c, 0x2d, 0x0c }, { 0x86, 0x78, 0x44 }, { 0xaa, 0x29, 0x33 }, { 0x92, 0x84, 0x84 }, |
| 445 | /* Composite lo-res, colour reg = 22 */ |
| 446 | { 0x05, 0x56, 0x00 }, { 0x04, 0x69, 0x32 }, { 0x21, 0x1d, 0x13 }, { 0x07, 0x76, 0x7e }, |
| 447 | { 0x05, 0x48, 0x03 }, { 0x03, 0x64, 0x43 }, { 0x24, 0x16, 0x28 }, { 0x08, 0x70, 0x92 }, |
| 448 | { 0x45, 0x41, 0x74 }, { 0x27, 0x44, 0x92 }, { 0x4f, 0x00, 0x7f }, { 0x36, 0x58, 0xe8 }, |
| 449 | { 0x85, 0x57, 0x02 }, { 0x87, 0x77, 0x45 }, { 0xa6, 0x2c, 0x2c }, { 0x8b, 0x8b, 0x8b }, |
| 450 | /* Composite lo-res, colour reg = 23 */ |
| 451 | { 0x02, 0x61, 0x49 }, { 0x02, 0x61, 0x49 }, { 0x24, 0x15, 0x27 }, { 0x05, 0x73, 0x84 }, |
| 452 | { 0x02, 0x61, 0x49 }, { 0x02, 0x61, 0x49 }, { 0x24, 0x15, 0x27 }, { 0x05, 0x73, 0x84 }, |
| 453 | { 0x2a, 0x43, 0x96 }, { 0x2a, 0x43, 0x96 }, { 0x51, 0x00, 0x7d }, { 0x31, 0x5a, 0xdc }, |
| 454 | { 0x86, 0x79, 0x3d }, { 0x86, 0x79, 0x3d }, { 0xa8, 0x2a, 0x21 }, { 0x8a, 0x8a, 0x8a }, |
| 455 | /* Composite lo-res, colour reg = 24 */ |
| 456 | { 0x51, 0x00, 0x0e }, { 0x2b, 0x49, 0x76 }, { 0x4c, 0x04, 0x53 }, { 0x23, 0x5a, 0xf5 }, |
| 457 | { 0x22, 0x05, 0x00 }, { 0x04, 0x06, 0x4b }, { 0x22, 0x13, 0x22 }, { 0x03, 0x74, 0x82 }, |
| 458 | { 0x4e, 0x00, 0x25 }, { 0x2d, 0x46, 0x9d }, { 0x52, 0x00, 0x7c }, { 0x34, 0x59, 0xe3 }, |
| 459 | { 0xaa, 0x17, 0x00 }, { 0x85, 0x79, 0x3d }, { 0xa7, 0x2e, 0x24 }, { 0x8b, 0x8b, 0x8b }, |
| 460 | /* Composite lo-res, colour reg = 25 */ |
| 461 | { 0x50, 0x00, 0x7e }, { 0x2d, 0x45, 0x9d }, { 0x50, 0x00, 0x7e }, { 0x30, 0x57, 0xde }, |
| 462 | { 0x23, 0x16, 0x29 }, { 0x05, 0x61, 0x49 }, { 0x23, 0x13, 0x26 }, { 0x04, 0x75, 0x87 }, |
| 463 | { 0x50, 0x00, 0x7e }, { 0x28, 0x44, 0x96 }, { 0x50, 0x00, 0x7e }, { 0x31, 0x59, 0xdf }, |
| 464 | { 0xac, 0x28, 0x33 }, { 0x85, 0x79, 0x3c }, { 0xa7, 0x2d, 0x23 }, { 0x8b, 0x8b, 0x8b }, |
| 465 | /* Composite lo-res, colour reg = 26 */ |
| 466 | { 0x4f, 0x62, 0x00 }, { 0x3d, 0x71, 0x1f }, { 0x60, 0x2a, 0x07 }, { 0x43, 0x88, 0x69 }, |
| 467 | { 0x13, 0x42, 0x19 }, { 0x05, 0x63, 0x46 }, { 0x24, 0x16, 0x27 }, { 0x07, 0x72, 0x91 }, |
| 468 | { 0x3c, 0x2b, 0x5f }, { 0x2a, 0x45, 0x92 }, { 0x4f, 0x00, 0x82 }, { 0x36, 0x57, 0xe9 }, |
| 469 | { 0x92, 0x5a, 0x0b }, { 0x87, 0x78, 0x45 }, { 0xa7, 0x2c, 0x2a }, { 0x8b, 0x8b, 0x8c }, |
| 470 | /* Composite lo-res, colour reg = 27 */ |
| 471 | { 0x8b, 0x8b, 0x8b }, { 0x89, 0x78, 0x47 }, { 0xa8, 0x2a, 0x2d }, { 0x8b, 0x8b, 0x8b }, |
| 472 | { 0x08, 0x71, 0x93 }, { 0x02, 0x62, 0x4a }, { 0x26, 0x16, 0x2a }, { 0x06, 0x73, 0x87 }, |
| 473 | { 0x35, 0x58, 0xe6 }, { 0x2f, 0x45, 0x9e }, { 0x50, 0x00, 0x78 }, { 0x2f, 0x59, 0xe0 }, |
| 474 | { 0x8b, 0x8b, 0x8b }, { 0x87, 0x7a, 0x46 }, { 0xaa, 0x29, 0x30 }, { 0x8b, 0x8b, 0x8b }, |
| 475 | /* Composite lo-res, colour reg = 28 */ |
| 476 | { 0x25, 0x25, 0x25 }, { 0x08, 0x5f, 0x4b }, { 0x2b, 0x15, 0x25 }, { 0x09, 0x71, 0x88 }, |
| 477 | { 0x1e, 0x23, 0x26 }, { 0x04, 0x62, 0x47 }, { 0x21, 0x19, 0x28 }, { 0x06, 0x74, 0x88 }, |
| 478 | { 0x48, 0x0b, 0x70 }, { 0x26, 0x42, 0x95 }, { 0x52, 0x00, 0x7c }, { 0x34, 0x58, 0xe6 }, |
| 479 | { 0xa1, 0x37, 0x1c }, { 0x85, 0x78, 0x3e }, { 0xa6, 0x2e, 0x23 }, { 0x8b, 0x8b, 0x8b }, |
| 480 | /* Composite lo-res, colour reg = 29 */ |
| 481 | { 0x5e, 0x44, 0xd3 }, { 0x45, 0x61, 0x73 }, { 0x6c, 0x18, 0x53 }, { 0x4c, 0x72, 0xbf }, |
| 482 | { 0x14, 0x45, 0xa3 }, { 0x04, 0x61, 0x49 }, { 0x22, 0x15, 0x25 }, { 0x06, 0x72, 0x8d }, |
| 483 | { 0x41, 0x2d, 0xf6 }, { 0x27, 0x43, 0x96 }, { 0x51, 0x00, 0x7c }, { 0x34, 0x58, 0xe4 }, |
| 484 | { 0x9b, 0x5a, 0xa5 }, { 0x85, 0x78, 0x3d }, { 0xa6, 0x2e, 0x23 }, { 0x8c, 0x8c, 0x8c }, |
| 485 | /* Composite lo-res, colour reg = 2A */ |
| 486 | { 0x5c, 0xae, 0x2a }, { 0x58, 0x91, 0x00 }, { 0x7b, 0x41, 0x00 }, { 0x5e, 0xa0, 0x36 }, |
| 487 | { 0x06, 0x78, 0x86 }, { 0x03, 0x62, 0x49 }, { 0x25, 0x14, 0x28 }, { 0x03, 0x74, 0x82 }, |
| 488 | { 0x25, 0x5b, 0xcc }, { 0x2a, 0x43, 0x97 }, { 0x52, 0x00, 0x79 }, { 0x31, 0x5b, 0xe0 }, |
| 489 | { 0x7e, 0x88, 0x7b }, { 0x86, 0x7b, 0x3e }, { 0xa7, 0x2c, 0x22 }, { 0x89, 0x89, 0x89 }, |
| 490 | /* Composite lo-res, colour reg = 2B */ |
| 491 | { 0x58, 0xbb, 0x98 }, { 0x5a, 0x8c, 0x0a }, { 0x7f, 0x3b, 0x02 }, { 0x60, 0x9a, 0x4b }, |
| 492 | { 0x03, 0x96, 0xce }, { 0x04, 0x61, 0x4a }, { 0x23, 0x14, 0x24 }, { 0x04, 0x75, 0x86 }, |
| 493 | { 0x23, 0x76, 0xfe }, { 0x28, 0x43, 0x95 }, { 0x51, 0x00, 0x7b }, { 0x30, 0x59, 0xdb }, |
| 494 | { 0x80, 0xab, 0xd2 }, { 0x85, 0x7a, 0x3d }, { 0xa8, 0x2e, 0x26 }, { 0x8b, 0x8b, 0x8b }, |
| 495 | /* Composite lo-res, colour reg = 2C */ |
| 496 | { 0xa9, 0x46, 0x66 }, { 0x7f, 0x6f, 0x37 }, { 0xa9, 0x27, 0x27 }, { 0x87, 0x82, 0x7f }, |
| 497 | { 0x1e, 0x31, 0x5c }, { 0x04, 0x63, 0x44 }, { 0x23, 0x16, 0x2a }, { 0x08, 0x71, 0x92 }, |
| 498 | { 0x4e, 0x1a, 0xb0 }, { 0x27, 0x46, 0x92 }, { 0x50, 0x00, 0x80 }, { 0x33, 0x56, 0xe7 }, |
| 499 | { 0xa3, 0x4a, 0x58 }, { 0x87, 0x78, 0x46 }, { 0xab, 0x29, 0x34 }, { 0x8b, 0x8b, 0x8b }, |
| 500 | /* Composite lo-res, colour reg = 2D */ |
| 501 | { 0xa8, 0x53, 0xd8 }, { 0x82, 0x6c, 0x5f }, { 0xac, 0x25, 0x3f }, { 0x8d, 0x7f, 0xa8 }, |
| 502 | { 0x21, 0x46, 0xb9 }, { 0x04, 0x61, 0x4d }, { 0x24, 0x13, 0x23 }, { 0x04, 0x75, 0x87 }, |
| 503 | { 0x4c, 0x2e, 0xfe }, { 0x2a, 0x45, 0x99 }, { 0x52, 0x00, 0x78 }, { 0x32, 0x5a, 0xde }, |
| 504 | { 0xa8, 0x53, 0xd8 }, { 0x84, 0x7c, 0x3d }, { 0xa7, 0x2d, 0x22 }, { 0x8b, 0x8b, 0x8b }, |
| 505 | /* Composite lo-res, colour reg = 2E */ |
| 506 | { 0xa4, 0xba, 0x2e }, { 0x8e, 0x9f, 0x00 }, { 0xbf, 0x4e, 0x00 }, { 0xa5, 0xae, 0x2d }, |
| 507 | { 0x13, 0x71, 0xa6 }, { 0x03, 0x62, 0x4a }, { 0x24, 0x14, 0x28 }, { 0x05, 0x74, 0x83 }, |
| 508 | { 0x32, 0x5d, 0xe0 }, { 0x2e, 0x46, 0x9c }, { 0x51, 0x00, 0x7c }, { 0x2f, 0x59, 0xe0 }, |
| 509 | { 0x8a, 0x8d, 0x94 }, { 0x86, 0x7b, 0x40 }, { 0xa8, 0x2c, 0x22 }, { 0x8a, 0x8a, 0x8a }, |
| 510 | /* Composite lo-res, colour reg = 2F */ |
| 511 | { 0xe4, 0xe4, 0xe4 }, { 0xdd, 0xa6, 0x0a }, { 0xf9, 0x53, 0x04 }, { 0xea, 0xae, 0x54 }, |
| 512 | { 0x08, 0xa2, 0xfc }, { 0x03, 0x62, 0x48 }, { 0x24, 0x14, 0x28 }, { 0x05, 0x74, 0x84 }, |
| 513 | { 0x27, 0x90, 0xff }, { 0x2a, 0x43, 0x95 }, { 0x52, 0x00, 0x79 }, { 0x34, 0x5a, 0xe3 }, |
| 514 | { 0x85, 0xbb, 0xff }, { 0x85, 0x7a, 0x3d }, { 0xa7, 0x2c, 0x23 }, { 0x8a, 0x8a, 0x8a }, |
| 515 | /* Composite lo-res, colour reg = 30 */ |
| 516 | { 0x00, 0x00, 0x00 }, { 0x00, 0x63, 0xfe }, { 0x00, 0x1d, 0xe9 }, { 0x00, 0x81, 0xff }, |
| 517 | { 0x7e, 0x16, 0x00 }, { 0x5b, 0xb9, 0xa5 }, { 0x79, 0x6a, 0x79 }, { 0x59, 0xce, 0xdc }, |
| 518 | { 0xa8, 0x05, 0x00 }, { 0x84, 0x9e, 0xf3 }, { 0xaa, 0x54, 0xd3 }, { 0x8c, 0xb1, 0xff }, |
| 519 | { 0xfb, 0x28, 0x00 }, { 0xde, 0xd2, 0x94 }, { 0xfc, 0x85, 0x7b }, { 0xe4, 0xe4, 0xe4 }, |
| 520 | /* Composite lo-res, colour reg = 31 */ |
| 521 | { 0x07, 0x00, 0x7c }, { 0x00, 0x70, 0xfe }, { 0x0d, 0x20, 0xff }, { 0x04, 0x7f, 0xff }, |
| 522 | { 0x6f, 0x3b, 0x00 }, { 0x59, 0xbb, 0x9b }, { 0x79, 0x6c, 0x81 }, { 0x5d, 0xcb, 0xe4 }, |
| 523 | { 0x99, 0x26, 0x29 }, { 0x83, 0x9d, 0xf2 }, { 0xaa, 0x54, 0xd4 }, { 0x88, 0xb0, 0xff }, |
| 524 | { 0xf4, 0x57, 0x00 }, { 0xdf, 0xd3, 0x9a }, { 0xfe, 0x81, 0x7f }, { 0xe4, 0xe4, 0xe4 }, |
| 525 | /* Composite lo-res, colour reg = 32 */ |
| 526 | { 0x06, 0x55, 0x00 }, { 0x03, 0x99, 0xbe }, { 0x22, 0x46, 0xa4 }, { 0x09, 0xa4, 0xfa }, |
| 527 | { 0x62, 0x6d, 0x00 }, { 0x59, 0xbb, 0x9b }, { 0x7a, 0x6d, 0x7e }, { 0x5c, 0xc8, 0xe7 }, |
| 528 | { 0x8a, 0x4f, 0x11 }, { 0x80, 0x9b, 0xea }, { 0xa7, 0x55, 0xda }, { 0x8c, 0xad, 0xff }, |
| 529 | { 0xdf, 0x7f, 0x00 }, { 0xe2, 0xd1, 0x9c }, { 0xfd, 0x81, 0x87 }, { 0xe4, 0xe4, 0xe4 }, |
| 530 | /* Composite lo-res, colour reg = 33 */ |
| 531 | { 0x03, 0x63, 0x47 }, { 0x06, 0x91, 0xda }, { 0x23, 0x41, 0xbc }, { 0x06, 0xa5, 0xfa }, |
| 532 | { 0x5d, 0x8a, 0x07 }, { 0x59, 0xbb, 0x9b }, { 0x7c, 0x6e, 0x80 }, { 0x5d, 0xc9, 0xe8 }, |
| 533 | { 0x86, 0x6b, 0x60 }, { 0x81, 0x9d, 0xea }, { 0xa8, 0x55, 0xd8 }, { 0x8e, 0xae, 0xff }, |
| 534 | { 0xdf, 0xa4, 0x0c }, { 0xe1, 0xd0, 0x9e }, { 0xfd, 0x81, 0x85 }, { 0xe4, 0xe4, 0xe4 }, |
| 535 | /* Composite lo-res, colour reg = 34 */ |
| 536 | { 0x52, 0x00, 0x14 }, { 0x20, 0x7b, 0xf7 }, { 0x4e, 0x2f, 0xed }, { 0x22, 0x91, 0xff }, |
| 537 | { 0x7f, 0x28, 0x00 }, { 0x5a, 0xbb, 0x9a }, { 0x79, 0x6d, 0x7f }, { 0x5e, 0xc8, 0xeb }, |
| 538 | { 0xac, 0x13, 0x02 }, { 0x7e, 0x9c, 0xea }, { 0xa8, 0x54, 0xd6 }, { 0x8e, 0xae, 0xff }, |
| 539 | { 0xf5, 0x43, 0x00 }, { 0xdf, 0xcf, 0x9d }, { 0xfd, 0x81, 0x88 }, { 0xe4, 0xe4, 0xe4 }, |
| 540 | /* Composite lo-res, colour reg = 35 */ |
| 541 | { 0x50, 0x00, 0x7b }, { 0x22, 0x76, 0xfe }, { 0x4c, 0x2f, 0xff }, { 0x36, 0x85, 0xff }, |
| 542 | { 0x7b, 0x3d, 0x00 }, { 0x5b, 0xbc, 0xa1 }, { 0x7b, 0x6c, 0x7f }, { 0x5d, 0xca, 0xe8 }, |
| 543 | { 0xa9, 0x26, 0x3c }, { 0x81, 0x9c, 0xec }, { 0xa7, 0x54, 0xdc }, { 0x8b, 0xad, 0xff }, |
| 544 | { 0xf8, 0x57, 0x03 }, { 0xe1, 0xd4, 0x9e }, { 0xfd, 0x80, 0x82 }, { 0xe4, 0xe4, 0xe4 }, |
| 545 | /* Composite lo-res, colour reg = 36 */ |
| 546 | { 0x4c, 0x61, 0x00 }, { 0x39, 0xa2, 0xaf }, { 0x5b, 0x5a, 0x8c }, { 0x42, 0xb6, 0xf4 }, |
| 547 | { 0x66, 0x6b, 0x00 }, { 0x5b, 0xba, 0xa4 }, { 0x7a, 0x6c, 0x7e }, { 0x5e, 0xca, 0xe8 }, |
| 548 | { 0x91, 0x51, 0x1f }, { 0x85, 0x9d, 0xf4 }, { 0xaa, 0x55, 0xd7 }, { 0x88, 0xaf, 0xff }, |
| 549 | { 0xea, 0x87, 0x00 }, { 0xde, 0xd4, 0x98 }, { 0xfd, 0x7f, 0x81 }, { 0xe4, 0xe4, 0xe4 }, |
| 550 | /* Composite lo-res, colour reg = 37 */ |
| 551 | { 0x8b, 0x8b, 0x8b }, { 0x86, 0xa7, 0xde }, { 0xa6, 0x5a, 0xbf }, { 0x85, 0xbb, 0xff }, |
| 552 | { 0x5f, 0x9b, 0x51 }, { 0x5a, 0xb9, 0xa7 }, { 0x78, 0x6a, 0x7b }, { 0x5b, 0xce, 0xdb }, |
| 553 | { 0x8b, 0x7c, 0xae }, { 0x82, 0x9c, 0xf2 }, { 0xaa, 0x54, 0xd3 }, { 0x87, 0xb2, 0xff }, |
| 554 | { 0xe7, 0xb0, 0x54 }, { 0xdc, 0xd2, 0x95 }, { 0xfc, 0x84, 0x77 }, { 0xe3, 0xe3, 0xe3 }, |
| 555 | /* Composite lo-res, colour reg = 38 */ |
| 556 | { 0x24, 0x24, 0x24 }, { 0x06, 0x91, 0xd8 }, { 0x2a, 0x44, 0xb9 }, { 0x0f, 0x9e, 0xfe }, |
| 557 | { 0x7a, 0x49, 0x00 }, { 0x58, 0xbc, 0x98 }, { 0x7a, 0x6d, 0x7f }, { 0x5e, 0xc8, 0xeb }, |
| 558 | { 0xa3, 0x36, 0x3a }, { 0x7f, 0x9c, 0xec }, { 0xa8, 0x54, 0xd7 }, { 0x8a, 0xad, 0xff }, |
| 559 | { 0xf7, 0x64, 0x00 }, { 0xe1, 0xd1, 0x9c }, { 0xfd, 0x7f, 0x8b }, { 0xe4, 0xe4, 0xe4 }, |
| 560 | /* Composite lo-res, colour reg = 39 */ |
| 561 | { 0x62, 0x46, 0xd3 }, { 0x3d, 0x93, 0xf2 }, { 0x6b, 0x46, 0xeb }, { 0x4f, 0xa0, 0xff }, |
| 562 | { 0x6f, 0x69, 0x6b }, { 0x58, 0xbb, 0x9b }, { 0x7b, 0x6e, 0x80 }, { 0x5e, 0xc8, 0xec }, |
| 563 | { 0x9d, 0x53, 0xbd }, { 0x81, 0x9d, 0xf0 }, { 0xa8, 0x54, 0xd8 }, { 0x86, 0xb1, 0xff }, |
| 564 | { 0xf4, 0x85, 0x5e }, { 0xdf, 0xd1, 0x9f }, { 0xfe, 0x7f, 0x88 }, { 0xe3, 0xe3, 0xe3 }, |
| 565 | /* Composite lo-res, colour reg = 3A */ |
| 566 | { 0x5a, 0xad, 0x2d }, { 0x58, 0xc1, 0x81 }, { 0x77, 0x74, 0x68 }, { 0x58, 0xcf, 0xd1 }, |
| 567 | { 0x5d, 0xa0, 0x4d }, { 0x59, 0xbb, 0x9b }, { 0x7c, 0x6d, 0x7f }, { 0x5e, 0xc9, 0xeb }, |
| 568 | { 0x83, 0x7d, 0x9e }, { 0x7f, 0x9c, 0xec }, { 0xa9, 0x54, 0xd6 }, { 0x8c, 0xae, 0xff }, |
| 569 | { 0xde, 0xae, 0x4b }, { 0xdc, 0xd0, 0x98 }, { 0xfc, 0x81, 0x8a }, { 0xe4, 0xe4, 0xe4 }, |
| 570 | /* Composite lo-res, colour reg = 3B */ |
| 571 | { 0x59, 0xbc, 0x9c }, { 0x59, 0xbc, 0x9c }, { 0x7a, 0x6a, 0x79 }, { 0x59, 0xce, 0xd9 }, |
| 572 | { 0x59, 0xbc, 0x9c }, { 0x59, 0xbc, 0x9c }, { 0x7b, 0x6b, 0x80 }, { 0x59, 0xcc, 0xd9 }, |
| 573 | { 0x81, 0x9b, 0xec }, { 0x81, 0x9b, 0xec }, { 0xa9, 0x54, 0xd4 }, { 0x8e, 0xb2, 0xff }, |
| 574 | { 0xdf, 0xcf, 0x9b }, { 0xdf, 0xcf, 0x9b }, { 0xfd, 0x85, 0x79 }, { 0xe3, 0xe3, 0xe3 }, |
| 575 | /* Composite lo-res, colour reg = 3C */ |
| 576 | { 0xaa, 0x46, 0x6a }, { 0x7a, 0xa3, 0xc7 }, { 0xa7, 0x58, 0xba }, { 0x84, 0xb5, 0xf8 }, |
| 577 | { 0x78, 0x5b, 0x23 }, { 0x59, 0xbc, 0x9c }, { 0x7a, 0x6e, 0x81 }, { 0x5f, 0xc9, 0xeb }, |
| 578 | { 0xa3, 0x44, 0x71 }, { 0x80, 0x9d, 0xec }, { 0xa8, 0x54, 0xd7 }, { 0x8a, 0xae, 0xff }, |
| 579 | { 0xf8, 0x74, 0x1a }, { 0xdf, 0xd1, 0x9e }, { 0xfe, 0x81, 0x8b }, { 0xe3, 0xe3, 0xe3 }, |
| 580 | /* Composite lo-res, colour reg = 3D */ |
| 581 | { 0xaa, 0x53, 0xd1 }, { 0x80, 0x9c, 0xec }, { 0xaa, 0x53, 0xd1 }, { 0x88, 0xad, 0xff }, |
| 582 | { 0x7a, 0x6b, 0x7e }, { 0x58, 0xbb, 0x9d }, { 0x7a, 0x6d, 0x81 }, { 0x5f, 0xc9, 0xe5 }, |
| 583 | { 0xaa, 0x53, 0xd1 }, { 0x84, 0x9d, 0xf2 }, { 0xaa, 0x53, 0xd1 }, { 0x88, 0xad, 0xff }, |
| 584 | { 0xfd, 0x85, 0x78 }, { 0xe0, 0xd2, 0x9e }, { 0xfe, 0x80, 0x87 }, { 0xe3, 0xe3, 0xe3 }, |
| 585 | /* Composite lo-res, colour reg = 3E */ |
| 586 | { 0xa1, 0xba, 0x2f }, { 0x90, 0xce, 0x70 }, { 0xb4, 0x80, 0x4b }, { 0x9d, 0xe0, 0xba }, |
| 587 | { 0x6a, 0x9f, 0x68 }, { 0x5a, 0xba, 0x9f }, { 0x7a, 0x6b, 0x7a }, { 0x5a, 0xce, 0xdb }, |
| 588 | { 0x91, 0x83, 0xae }, { 0x80, 0x9b, 0xef }, { 0xaa, 0x54, 0xd2 }, { 0x8c, 0xb1, 0xff }, |
| 589 | { 0xeb, 0xb3, 0x59 }, { 0xdd, 0xd3, 0x94 }, { 0xfc, 0x85, 0x79 }, { 0xe4, 0xe4, 0xe4 }, |
| 590 | /* Composite lo-res, colour reg = 3F */ |
| 591 | { 0xe4, 0xe4, 0xe4 }, { 0xdd, 0xd2, 0x93 }, { 0xfc, 0x85, 0x7a }, { 0xe4, 0xe4, 0xe4 }, |
| 592 | { 0x59, 0xcc, 0xda }, { 0x59, 0xbb, 0x9c }, { 0x7b, 0x6d, 0x7f }, { 0x5c, 0xca, 0xe5 }, |
| 593 | { 0x87, 0xb3, 0xff }, { 0x7f, 0x9a, 0xea }, { 0xa8, 0x54, 0xd4 }, { 0x8c, 0xb0, 0xff }, |
| 594 | { 0xe4, 0xe4, 0xe4 }, { 0xdf, 0xd1, 0x98 }, { 0xfd, 0x84, 0x7d }, { 0xe4, 0xe4, 0xe4 }, |
| 595 | }; |
| 596 | |
| 597 | |
| 598 | static MC6845_UPDATE_ROW( cga_update_row ) |
| 599 | { |
| 600 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 601 | if ( cga->m_update_row ) |
| 602 | { |
| 603 | cga->m_update_row( device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param ); |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | |
| 608 | static const mc6845_interface mc6845_cga_intf = |
| 609 | { |
| 610 | CGA_SCREEN_NAME, /* screen number */ |
| 611 | 8, /* numbers of pixels per video memory address */ |
| 612 | NULL, /* begin_update */ |
| 613 | cga_update_row, /* update_row */ |
| 614 | NULL, /* end_update */ |
| 615 | DEVCB_NULL, /* on_de_changed */ |
| 616 | DEVCB_NULL, /* on_cur_changed */ |
| 617 | DEVCB_LINE_MEMBER(isa8_cga_device, hsync_changed), /* on_hsync_changed */ |
| 618 | DEVCB_LINE_MEMBER(isa8_cga_device, vsync_changed), /* on_vsync_changed */ |
| 619 | NULL |
| 620 | }; |
| 621 | |
| 622 | #define CGA_HCLK (XTAL_14_31818MHz/8) |
| 623 | #define CGA_LCLK (XTAL_14_31818MHz/16) |
| 624 | |
| 625 | |
| 626 | static MACHINE_CONFIG_FRAGMENT( cga ) |
| 627 | MCFG_SCREEN_ADD(CGA_SCREEN_NAME, RASTER) |
| 628 | MCFG_SCREEN_RAW_PARAMS(XTAL_14_31818MHz,912,0,640,262,0,200) |
| 629 | MCFG_SCREEN_UPDATE_DRIVER( isa8_cga_device, screen_update ) |
| 630 | |
| 631 | MCFG_PALETTE_LENGTH(/* CGA_PALETTE_SETS * 16*/ 65536 ) |
| 632 | |
| 633 | MCFG_MC6845_ADD(CGA_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mc6845_cga_intf) |
| 634 | MACHINE_CONFIG_END |
| 635 | |
| 636 | |
| 637 | ROM_START( cga ) |
| 638 | /* IBM 1501981(CGA) and 1501985(MDA) Character rom */ |
| 639 | ROM_REGION(0x2000,"gfx1", 0) |
| 640 | ROM_LOAD("5788005.u33", 0x00000, 0x2000, CRC(0bf56d70) SHA1(c2a8b10808bf51a3c123ba3eb1e9dd608231916f)) /* "AMI 8412PI // 5788005 // (C) IBM CORP. 1981 // KOREA" */ |
| 641 | ROM_END |
| 642 | |
| 643 | |
| 644 | //************************************************************************** |
| 645 | // GLOBAL VARIABLES |
| 646 | //************************************************************************** |
| 647 | |
| 648 | const device_type ISA8_CGA = &device_creator<isa8_cga_device>; |
| 649 | |
| 650 | //------------------------------------------------- |
| 651 | // machine_config_additions - device-specific |
| 652 | // machine configurations |
| 653 | //------------------------------------------------- |
| 654 | |
| 655 | machine_config_constructor isa8_cga_device::device_mconfig_additions() const |
| 656 | { |
| 657 | return MACHINE_CONFIG_NAME( cga ); |
| 658 | } |
| 659 | |
| 660 | ioport_constructor isa8_cga_device::device_input_ports() const |
| 661 | { |
| 662 | return INPUT_PORTS_NAME( cga ); |
| 663 | } |
| 664 | |
| 665 | //------------------------------------------------- |
| 666 | // rom_region - device-specific ROM region |
| 667 | //------------------------------------------------- |
| 668 | |
| 669 | const rom_entry *isa8_cga_device::device_rom_region() const |
| 670 | { |
| 671 | return ROM_NAME( cga ); |
| 672 | } |
| 673 | |
| 674 | |
| 675 | //------------------------------------------------- |
| 676 | // isa8_cga_device - constructor |
| 677 | //------------------------------------------------- |
| 678 | |
| 679 | isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 680 | device_t(mconfig, ISA8_CGA, "ISA8_CGA", tag, owner, clock), |
| 681 | device_isa8_card_interface(mconfig, *this), |
| 682 | m_vram_size( 0x4000 ) |
| 683 | { |
| 684 | m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800; |
| 685 | m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000; |
| 686 | m_font_selection_mask = 0x01; |
| 687 | m_shortname = "cga"; |
| 688 | } |
| 689 | |
| 690 | isa8_cga_device::isa8_cga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : |
| 691 | device_t(mconfig, type, name, tag, owner, clock), |
| 692 | device_isa8_card_interface(mconfig, *this), |
| 693 | m_vram_size( 0x4000 ) |
| 694 | { |
| 695 | m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800; |
| 696 | m_chr_gen_offset[1] = m_chr_gen_offset[3] = 0x1000; |
| 697 | m_font_selection_mask = 0x01; |
| 698 | m_shortname = "cga"; |
| 699 | } |
| 700 | |
| 701 | |
| 702 | //------------------------------------------------- |
| 703 | // device_start - device-specific startup |
| 704 | //------------------------------------------------- |
| 705 | |
| 706 | void isa8_cga_device::device_start() |
| 707 | { |
| 708 | set_isa_device(); |
| 709 | m_vram = auto_alloc_array(machine(), UINT8, m_vram_size); |
| 710 | m_update_row = NULL; |
| 711 | m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_device::io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) ); |
| 712 | m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, 0, m_vram_size & 0x4000, "bank_cga", m_vram); |
| 713 | m_superimpose = false; |
| 714 | |
| 715 | /* Initialise the cga palette */ |
| 716 | int i; |
| 717 | |
| 718 | for ( i = 0; i < CGA_PALETTE_SETS * 16; i++ ) |
| 719 | { |
| 720 | palette_set_color_rgb( machine(), i, cga_palette[i][0], cga_palette[i][1], cga_palette[i][2] ); |
| 721 | } |
| 722 | |
| 723 | i = 0x8000; |
| 724 | for ( int r = 0; r < 32; r++ ) |
| 725 | { |
| 726 | for ( int g = 0; g < 32; g++ ) |
| 727 | { |
| 728 | for ( int b = 0; b < 32; b++ ) |
| 729 | { |
| 730 | palette_set_color_rgb( machine(), i, r << 3, g << 3, b << 3 ); |
| 731 | i++; |
| 732 | } |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | astring tempstring; |
| 737 | m_chr_gen_base = machine().region(subtag(tempstring, "gfx1"))->base(); |
| 738 | m_chr_gen = m_chr_gen_base + m_chr_gen_offset[1]; |
| 739 | } |
| 740 | |
| 741 | |
| 742 | //------------------------------------------------- |
| 743 | // device_reset - device-specific reset |
| 744 | //------------------------------------------------- |
| 745 | |
| 746 | void isa8_cga_device::device_reset() |
| 747 | { |
| 748 | m_update_row = NULL; |
| 749 | m_framecnt = 0; |
| 750 | m_mode_control = 0; |
| 751 | m_vsync = 0; |
| 752 | m_hsync = 0; |
| 753 | } |
| 754 | |
| 755 | /*************************************************************************** |
| 756 | |
| 757 | Methods |
| 758 | |
| 759 | ***************************************************************************/ |
| 760 | |
| 761 | |
| 762 | const device_type ISA8_CGA_MC1502 = &device_creator<isa8_cga_mc1502_device>; |
| 763 | |
| 764 | //------------------------------------------------- |
| 765 | // isa8_cga_mc1502_device - constructor |
| 766 | //------------------------------------------------- |
| 767 | |
| 768 | isa8_cga_mc1502_device::isa8_cga_mc1502_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 769 | isa8_cga_device( mconfig, ISA8_CGA_MC1502, "ISA8_CGA_MC1502", tag, owner, clock ) |
| 770 | { |
| 771 | m_vram_size = 0x8000; |
| 772 | } |
| 773 | |
| 774 | |
| 775 | ROM_START( mc1502 ) |
| 776 | ROM_REGION(0x2000,"gfx1", 0) |
| 777 | ROM_LOAD( "symgen.rom", 0x0000, 0x2000, CRC(b2747a52) SHA1(6766d275467672436e91ac2997ac6b77700eba1e)) |
| 778 | ROM_END |
| 779 | |
| 780 | //------------------------------------------------- |
| 781 | // rom_region - device-specific ROM region |
| 782 | //------------------------------------------------- |
| 783 | |
| 784 | const rom_entry *isa8_cga_mc1502_device::device_rom_region() const |
| 785 | { |
| 786 | return ROM_NAME( mc1502 ); |
| 787 | } |
| 788 | |
| 789 | UINT32 isa8_cga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 790 | { |
| 791 | mc6845_device *mc6845 = subdevice<mc6845_device>(CGA_MC6845_NAME); |
| 792 | |
| 793 | mc6845->screen_update( screen, bitmap, cliprect); |
| 794 | |
| 795 | /* Check for changes in font dipsetting */ |
| 796 | switch ( CGA_FONT ) |
| 797 | { |
| 798 | case 0: |
| 799 | m_chr_gen = m_chr_gen_base + m_chr_gen_offset[0]; |
| 800 | break; |
| 801 | case 1: |
| 802 | m_chr_gen = m_chr_gen_base + m_chr_gen_offset[1]; |
| 803 | break; |
| 804 | case 2: |
| 805 | m_chr_gen = m_chr_gen_base + m_chr_gen_offset[2]; |
| 806 | break; |
| 807 | case 3: |
| 808 | m_chr_gen = m_chr_gen_base + m_chr_gen_offset[3]; |
| 809 | break; |
| 810 | } |
| 811 | return 0; |
| 812 | } |
| 813 | |
| 814 | |
| 815 | const device_type ISA8_CGA_POISK1 = &device_creator<isa8_cga_poisk1_device>; |
| 816 | |
| 817 | //------------------------------------------------- |
| 818 | // isa8_cga_poisk1_device - constructor |
| 819 | //------------------------------------------------- |
| 820 | |
| 821 | isa8_cga_poisk1_device::isa8_cga_poisk1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 822 | isa8_cga_device( mconfig, ISA8_CGA_POISK1, "ISA8_CGA_POISK1", tag, owner, clock ) |
| 823 | { |
| 824 | m_chr_gen_offset[0] = 0x0000; |
| 825 | m_font_selection_mask = 0; |
| 826 | } |
| 827 | |
| 828 | ROM_START( cga_poisk1 ) |
| 829 | ROM_REGION(0x2000,"gfx1", 0) |
| 830 | ROM_LOAD( "poisk.cga", 0x0000, 0x0800, CRC(f6eb39f0) SHA1(0b788d8d7a8e92cc612d044abcb2523ad964c200)) |
| 831 | ROM_END |
| 832 | |
| 833 | //------------------------------------------------- |
| 834 | // rom_region - device-specific ROM region |
| 835 | //------------------------------------------------- |
| 836 | |
| 837 | const rom_entry *isa8_cga_poisk1_device::device_rom_region() const |
| 838 | { |
| 839 | return ROM_NAME( cga_poisk1 ); |
| 840 | } |
| 841 | |
| 842 | |
| 843 | const device_type ISA8_CGA_POISK2 = &device_creator<isa8_cga_poisk2_device>; |
| 844 | |
| 845 | //------------------------------------------------- |
| 846 | // isa8_cga_poisk2_device - constructor |
| 847 | //------------------------------------------------- |
| 848 | |
| 849 | isa8_cga_poisk2_device::isa8_cga_poisk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 850 | isa8_cga_device( mconfig, ISA8_CGA_POISK2, "ISA8_CGA_POISK2", tag, owner, clock ) |
| 851 | { |
| 852 | m_chr_gen_offset[0] = 0x0000; |
| 853 | m_chr_gen_offset[1] = 0x0800; |
| 854 | } |
| 855 | |
| 856 | ROM_START( cga_poisk2 ) |
| 857 | ROM_REGION(0x2000,"gfx1", 0) |
| 858 | ROM_LOAD( "p2_ecga.rf4", 0x0000, 0x2000, CRC(d537f665) SHA1(d70f085b9b0cbd53df7c3122fbe7592998ba8fed)) |
| 859 | ROM_END |
| 860 | |
| 861 | //------------------------------------------------- |
| 862 | // rom_region - device-specific ROM region |
| 863 | //------------------------------------------------- |
| 864 | |
| 865 | const rom_entry *isa8_cga_poisk2_device::device_rom_region() const |
| 866 | { |
| 867 | return ROM_NAME( cga_poisk2 ); |
| 868 | } |
| 869 | |
| 870 | |
| 871 | /* for superimposing CGA over a different source video (i.e. tetriskr) */ |
| 872 | const device_type ISA8_CGA_SUPERIMPOSE = &device_creator<isa8_cga_superimpose_device>; |
| 873 | |
| 874 | //------------------------------------------------- |
| 875 | // isa8_cga_superimpose_device - constructor |
| 876 | //------------------------------------------------- |
| 877 | |
| 878 | isa8_cga_superimpose_device::isa8_cga_superimpose_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 879 | isa8_cga_device( mconfig, ISA8_CGA_SUPERIMPOSE, "ISA8_CGA_SUPERIMPOSE", tag, owner, clock ) |
| 880 | { |
| 881 | m_superimpose = true; |
| 882 | } |
| 883 | |
| 884 | |
| 885 | /*************************************************************************** |
| 886 | Draw text mode with 40x25 characters (default) with high intensity bg. |
| 887 | The character cell size is 16x8 |
| 888 | ***************************************************************************/ |
| 889 | |
| 890 | static MC6845_UPDATE_ROW( cga_text_inten_update_row ) |
| 891 | { |
| 892 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 893 | UINT8 *videoram = cga->m_vram; |
| 894 | UINT32 *p = &bitmap.pix32(y); |
| 895 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 896 | int i; |
| 897 | running_machine &machine = device->machine(); |
| 898 | |
| 899 | if ( y == 0 ) CGA_LOG(1,"cga_text_inten_update_row",("\n")); |
| 900 | for ( i = 0; i < x_count; i++ ) |
| 901 | { |
| 902 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; |
| 903 | UINT8 chr = videoram[ offset ]; |
| 904 | UINT8 attr = videoram[ offset +1 ]; |
| 905 | UINT8 data = cga->m_chr_gen[ chr * 8 + ra ]; |
| 906 | UINT16 fg = attr & 0x0F; |
| 907 | UINT16 bg = attr >> 4; |
| 908 | |
| 909 | if ( i == cursor_x && ( cga->m_framecnt & 0x08 ) ) |
| 910 | { |
| 911 | data = 0xFF; |
| 912 | } |
| 913 | |
| 914 | *p = palette[( data & 0x80 ) ? fg : bg]; p++; |
| 915 | *p = palette[( data & 0x40 ) ? fg : bg]; p++; |
| 916 | *p = palette[( data & 0x20 ) ? fg : bg]; p++; |
| 917 | *p = palette[( data & 0x10 ) ? fg : bg]; p++; |
| 918 | *p = palette[( data & 0x08 ) ? fg : bg]; p++; |
| 919 | *p = palette[( data & 0x04 ) ? fg : bg]; p++; |
| 920 | *p = palette[( data & 0x02 ) ? fg : bg]; p++; |
| 921 | *p = palette[( data & 0x01 ) ? fg : bg]; p++; |
| 922 | } |
| 923 | } |
| 924 | |
| 925 | |
| 926 | /*************************************************************************** |
| 927 | Draw text mode with 40x25 characters (default) with high intensity bg. |
| 928 | The character cell size is 16x8. Composite monitor, greyscale. |
| 929 | ***************************************************************************/ |
| 930 | |
| 931 | static MC6845_UPDATE_ROW( cga_text_inten_comp_grey_update_row ) |
| 932 | { |
| 933 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 934 | UINT8 *videoram = cga->m_vram; |
| 935 | UINT32 *p = &bitmap.pix32(y); |
| 936 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 937 | int i; |
| 938 | running_machine &machine = device->machine(); |
| 939 | |
| 940 | if ( y == 0 ) CGA_LOG(1,"cga_text_inten_update_row",("\n")); |
| 941 | for ( i = 0; i < x_count; i++ ) |
| 942 | { |
| 943 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; |
| 944 | UINT8 chr = videoram[ offset ]; |
| 945 | UINT8 attr = videoram[ offset +1 ]; |
| 946 | UINT8 data = cga->m_chr_gen[ chr * 8 + ra ]; |
| 947 | UINT16 fg = 0x10 + ( attr & 0x0F ); |
| 948 | UINT16 bg = 0x10 + ( ( attr >> 4 ) & 0x07 ); |
| 949 | |
| 950 | if ( i == cursor_x && ( cga->m_framecnt & 0x08 ) ) |
| 951 | { |
| 952 | data = 0xFF; |
| 953 | } |
| 954 | |
| 955 | *p = palette[( data & 0x80 ) ? fg : bg]; p++; |
| 956 | *p = palette[( data & 0x40 ) ? fg : bg]; p++; |
| 957 | *p = palette[( data & 0x20 ) ? fg : bg]; p++; |
| 958 | *p = palette[( data & 0x10 ) ? fg : bg]; p++; |
| 959 | *p = palette[( data & 0x08 ) ? fg : bg]; p++; |
| 960 | *p = palette[( data & 0x04 ) ? fg : bg]; p++; |
| 961 | *p = palette[( data & 0x02 ) ? fg : bg]; p++; |
| 962 | *p = palette[( data & 0x01 ) ? fg : bg]; p++; |
| 963 | } |
| 964 | } |
| 965 | |
| 966 | /*************************************************************************** |
| 967 | Draw text mode with 40x25 characters (default) with high intensity bg. |
| 968 | The character cell size is 16x8 |
| 969 | ***************************************************************************/ |
| 970 | |
| 971 | static MC6845_UPDATE_ROW( cga_text_inten_alt_update_row ) |
| 972 | { |
| 973 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 974 | UINT8 *videoram = cga->m_vram; |
| 975 | UINT32 *p = &bitmap.pix32(y); |
| 976 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 977 | int i; |
| 978 | running_machine &machine = device->machine(); |
| 979 | |
| 980 | if ( y == 0 ) CGA_LOG(1,"cga_text_inten_alt_update_row",("\n")); |
| 981 | for ( i = 0; i < x_count; i++ ) |
| 982 | { |
| 983 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; |
| 984 | UINT8 chr = videoram[ offset ]; |
| 985 | UINT8 attr = videoram[ offset +1 ]; |
| 986 | UINT8 data = cga->m_chr_gen[ chr * 8 + ra ]; |
| 987 | UINT16 fg = attr & 0x0F; |
| 988 | |
| 989 | if ( i == cursor_x && ( cga->m_framecnt & 0x08 ) ) |
| 990 | { |
| 991 | data = 0xFF; |
| 992 | } |
| 993 | |
| 994 | *p = palette[( data & 0x80 ) ? fg : 0]; p++; |
| 995 | *p = palette[( data & 0x40 ) ? fg : 0]; p++; |
| 996 | *p = palette[( data & 0x20 ) ? fg : 0]; p++; |
| 997 | *p = palette[( data & 0x10 ) ? fg : 0]; p++; |
| 998 | *p = palette[( data & 0x08 ) ? fg : 0]; p++; |
| 999 | *p = palette[( data & 0x04 ) ? fg : 0]; p++; |
| 1000 | *p = palette[( data & 0x02 ) ? fg : 0]; p++; |
| 1001 | *p = palette[( data & 0x01 ) ? fg : 0]; p++; |
| 1002 | } |
| 1003 | } |
| 1004 | |
| 1005 | |
| 1006 | /*************************************************************************** |
| 1007 | Draw text mode with 40x25 characters (default) and blinking colors. |
| 1008 | The character cell size is 16x8 |
| 1009 | ***************************************************************************/ |
| 1010 | |
| 1011 | static MC6845_UPDATE_ROW( cga_text_blink_update_row ) |
| 1012 | { |
| 1013 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 1014 | UINT8 *videoram = cga->m_vram; |
| 1015 | UINT32 *p = &bitmap.pix32(y); |
| 1016 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 1017 | int i; |
| 1018 | running_machine &machine = device->machine(); |
| 1019 | |
| 1020 | if ( y == 0 ) CGA_LOG(1,"cga_text_blink_update_row",("\n")); |
| 1021 | for ( i = 0; i < x_count; i++ ) |
| 1022 | { |
| 1023 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; |
| 1024 | UINT8 chr = videoram[ offset ]; |
| 1025 | UINT8 attr = videoram[ offset +1 ]; |
| 1026 | UINT8 data = cga->m_chr_gen[ chr * 8 + ra ]; |
| 1027 | UINT16 fg = attr & 0x0F; |
| 1028 | UINT16 bg = attr >> 4; |
| 1029 | |
| 1030 | if ( i == cursor_x ) |
| 1031 | { |
| 1032 | if ( cga->m_framecnt & 0x08 ) |
| 1033 | { |
| 1034 | data = 0xFF; |
| 1035 | } |
| 1036 | } |
| 1037 | else |
| 1038 | { |
| 1039 | if ( ( attr & 0x80 ) && ( cga->m_framecnt & 0x10 ) ) |
| 1040 | { |
| 1041 | data = 0x00; |
| 1042 | } |
| 1043 | } |
| 1044 | |
| 1045 | *p = palette[( data & 0x80 ) ? fg : bg]; p++; |
| 1046 | *p = palette[( data & 0x40 ) ? fg : bg]; p++; |
| 1047 | *p = palette[( data & 0x20 ) ? fg : bg]; p++; |
| 1048 | *p = palette[( data & 0x10 ) ? fg : bg]; p++; |
| 1049 | *p = palette[( data & 0x08 ) ? fg : bg]; p++; |
| 1050 | *p = palette[( data & 0x04 ) ? fg : bg]; p++; |
| 1051 | *p = palette[( data & 0x02 ) ? fg : bg]; p++; |
| 1052 | *p = palette[( data & 0x01 ) ? fg : bg]; p++; |
| 1053 | } |
| 1054 | } |
| 1055 | |
| 1056 | static MC6845_UPDATE_ROW( cga_text_blink_update_row_si ) |
| 1057 | { |
| 1058 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 1059 | UINT8 *videoram = cga->m_vram; |
| 1060 | UINT32 *p = &bitmap.pix32(y); |
| 1061 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 1062 | int i; |
| 1063 | running_machine &machine = device->machine(); |
| 1064 | |
| 1065 | if ( y == 0 ) CGA_LOG(1,"cga_text_blink_update_row",("\n")); |
| 1066 | for ( i = 0; i < x_count; i++ ) |
| 1067 | { |
| 1068 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; |
| 1069 | UINT8 chr = videoram[ offset ]; |
| 1070 | UINT8 attr = videoram[ offset +1 ]; |
| 1071 | UINT8 data = cga->m_chr_gen[ chr * 8 + ra ]; |
| 1072 | UINT16 fg = attr & 0x0F; |
| 1073 | UINT16 bg = attr >> 4; |
| 1074 | UINT8 xi; |
| 1075 | |
| 1076 | if ( i == cursor_x ) |
| 1077 | { |
| 1078 | if ( cga->m_framecnt & 0x08 ) |
| 1079 | { |
| 1080 | data = 0xFF; |
| 1081 | } |
| 1082 | } |
| 1083 | else |
| 1084 | { |
| 1085 | if ( ( attr & 0x80 ) && ( cga->m_framecnt & 0x10 ) ) |
| 1086 | { |
| 1087 | data = 0x00; |
| 1088 | } |
| 1089 | } |
| 1090 | |
| 1091 | for(xi=0;xi<8;xi++) |
| 1092 | { |
| 1093 | UINT8 pen_data, dot; |
| 1094 | |
| 1095 | dot = (data & (1 << (7-xi))); |
| 1096 | pen_data = dot ? fg : bg; |
| 1097 | if(pen_data || dot) |
| 1098 | *p = palette[pen_data]; |
| 1099 | p++; |
| 1100 | } |
| 1101 | } |
| 1102 | } |
| 1103 | |
| 1104 | /*************************************************************************** |
| 1105 | Draw text mode with 40x25 characters (default) and blinking colors. |
| 1106 | The character cell size is 16x8 |
| 1107 | ***************************************************************************/ |
| 1108 | |
| 1109 | static MC6845_UPDATE_ROW( cga_text_blink_alt_update_row ) |
| 1110 | { |
| 1111 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 1112 | UINT8 *videoram = cga->m_vram; |
| 1113 | UINT32 *p = &bitmap.pix32(y); |
| 1114 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 1115 | int i; |
| 1116 | running_machine &machine = device->machine(); |
| 1117 | |
| 1118 | if ( y == 0 ) CGA_LOG(1,"cga_text_blink_alt_update_row",("\n")); |
| 1119 | for ( i = 0; i < x_count; i++ ) |
| 1120 | { |
| 1121 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; |
| 1122 | UINT8 chr = videoram[ offset ]; |
| 1123 | UINT8 attr = videoram[ offset +1 ]; |
| 1124 | UINT8 data = cga->m_chr_gen[ chr * 8 + ra ]; |
| 1125 | UINT16 fg = attr & 0x07; |
| 1126 | UINT16 bg = 0; |
| 1127 | |
| 1128 | if ( i == cursor_x ) |
| 1129 | { |
| 1130 | if ( cga->m_framecnt & 0x08 ) |
| 1131 | { |
| 1132 | data = 0xFF; |
| 1133 | } |
| 1134 | } |
| 1135 | else |
| 1136 | { |
| 1137 | if ( ( attr & 0x80 ) && ( cga->m_framecnt & 0x10 ) ) |
| 1138 | { |
| 1139 | data = 0x00; |
| 1140 | bg = ( attr >> 4 ) & 0x07; |
| 1141 | } |
| 1142 | } |
| 1143 | |
| 1144 | *p = palette[( data & 0x80 ) ? fg : bg]; p++; |
| 1145 | *p = palette[( data & 0x40 ) ? fg : bg]; p++; |
| 1146 | *p = palette[( data & 0x20 ) ? fg : bg]; p++; |
| 1147 | *p = palette[( data & 0x10 ) ? fg : bg]; p++; |
| 1148 | *p = palette[( data & 0x08 ) ? fg : bg]; p++; |
| 1149 | *p = palette[( data & 0x04 ) ? fg : bg]; p++; |
| 1150 | *p = palette[( data & 0x02 ) ? fg : bg]; p++; |
| 1151 | *p = palette[( data & 0x01 ) ? fg : bg]; p++; |
| 1152 | } |
| 1153 | } |
| 1154 | |
| 1155 | |
| 1156 | /* The lo-res (320x200) graphics mode on a colour composite monitor */ |
| 1157 | |
| 1158 | static MC6845_UPDATE_ROW( cga_gfx_4bppl_update_row ) |
| 1159 | { |
| 1160 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 1161 | UINT8 *videoram = cga->m_vram; |
| 1162 | UINT32 *p = &bitmap.pix32(y); |
| 1163 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 1164 | int i; |
| 1165 | running_machine &machine = device->machine(); |
| 1166 | |
| 1167 | if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bppl_update_row",("\n")); |
| 1168 | for ( i = 0; i < x_count; i++ ) |
| 1169 | { |
| 1170 | UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); |
| 1171 | UINT8 data = videoram[ offset ]; |
| 1172 | |
| 1173 | *p = palette[data >> 4]; p++; |
| 1174 | *p = palette[data >> 4]; p++; |
| 1175 | *p = palette[data & 0x0F]; p++; |
| 1176 | *p = palette[data & 0x0F]; p++; |
| 1177 | |
| 1178 | data = videoram[ offset + 1 ]; |
| 1179 | |
| 1180 | *p = palette[data >> 4]; p++; |
| 1181 | *p = palette[data >> 4]; p++; |
| 1182 | *p = palette[data & 0x0F]; p++; |
| 1183 | *p = palette[data & 0x0F]; p++; |
| 1184 | } |
| 1185 | } |
| 1186 | |
| 1187 | |
| 1188 | /* The hi-res graphics mode on a colour composite monitor |
| 1189 | * |
| 1190 | * The different scaling factors mean that the '160x200' versions of screens |
| 1191 | * are the same size as the normal colour ones. |
| 1192 | */ |
| 1193 | |
| 1194 | static const UINT8 yc_lut2[4] = { 0, 182, 71, 255 }; |
| 1195 | |
| 1196 | static const UINT8 yc_lut[16][8] = |
| 1197 | { |
| 1198 | { 0, 0, 0, 0, 0, 0, 0, 0 }, /* black */ |
| 1199 | { 0, 0, 0, 0, 1, 1, 1, 1 }, /* blue */ |
| 1200 | { 0, 1, 1, 1, 1, 0, 0, 0 }, /* green */ |
| 1201 | { 0, 0, 1, 1, 1, 1, 0, 0 }, /* cyan */ |
| 1202 | { 1, 1, 0, 0, 0, 0, 1, 1 }, /* red */ |
| 1203 | { 1, 0, 0, 0, 0, 1, 1, 1 }, /* magenta */ |
| 1204 | { 1, 1, 1, 1, 0, 0, 0, 0 }, /* yellow */ |
| 1205 | { 1, 1, 1, 1, 1, 1, 1, 1 }, /* white */ |
| 1206 | /* Intensity set */ |
| 1207 | { 2, 2, 2, 2, 2, 2, 2, 2 }, /* black */ |
| 1208 | { 2, 2, 2, 2, 3, 3, 3, 3 }, /* blue */ |
| 1209 | { 2, 3, 3, 3, 3, 2, 2, 2 }, /* green */ |
| 1210 | { 2, 2, 3, 3, 3, 3, 2, 2 }, /* cyan */ |
| 1211 | { 3, 3, 2, 2, 2, 2, 3, 3 }, /* red */ |
| 1212 | { 3, 2, 2, 2, 2, 3, 3, 3 }, /* magenta */ |
| 1213 | { 3, 3, 3, 3, 2, 2, 2, 2 }, /* yellow */ |
| 1214 | { 3, 3, 3, 3, 3, 3, 3, 3 }, /* white */ |
| 1215 | }; |
| 1216 | |
| 1217 | static MC6845_UPDATE_ROW( cga_gfx_4bpph_update_row ) |
| 1218 | { |
| 1219 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 1220 | UINT8 *videoram = cga->m_vram; |
| 1221 | UINT32 *p = &bitmap.pix32(y); |
| 1222 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 1223 | int i; |
| 1224 | running_machine &machine = device->machine(); |
| 1225 | |
| 1226 | if ( y == 0 ) CGA_LOG(1,"cga_gfx_4bpph_update_row",("\n")); |
| 1227 | |
| 1228 | for ( i = 0; i < x_count; i++ ) |
| 1229 | { |
| 1230 | UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); |
| 1231 | UINT8 data = videoram[ offset ]; |
| 1232 | |
| 1233 | *p = palette[data >> 4]; p++; |
| 1234 | *p = palette[data >> 4]; p++; |
| 1235 | *p = palette[data >> 4]; p++; |
| 1236 | *p = palette[data >> 4]; p++; |
| 1237 | *p = palette[data & 0x0F]; p++; |
| 1238 | *p = palette[data & 0x0F]; p++; |
| 1239 | *p = palette[data & 0x0F]; p++; |
| 1240 | *p = palette[data & 0x0F]; p++; |
| 1241 | |
| 1242 | data = videoram[ offset + 1 ]; |
| 1243 | |
| 1244 | *p = palette[data >> 4]; p++; |
| 1245 | *p = palette[data >> 4]; p++; |
| 1246 | *p = palette[data >> 4]; p++; |
| 1247 | *p = palette[data >> 4]; p++; |
| 1248 | *p = palette[data & 0x0F]; p++; |
| 1249 | *p = palette[data & 0x0F]; p++; |
| 1250 | *p = palette[data & 0x0F]; p++; |
| 1251 | *p = palette[data & 0x0F]; p++; |
| 1252 | } |
| 1253 | } |
| 1254 | |
| 1255 | |
| 1256 | /*************************************************************************** |
| 1257 | Draw graphics mode with 320x200 pixels (default) with 2 bits/pixel. |
| 1258 | Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000 |
| 1259 | cga fetches 2 byte per mc6845 access. |
| 1260 | ***************************************************************************/ |
| 1261 | |
| 1262 | static MC6845_UPDATE_ROW( cga_gfx_2bpp_update_row ) |
| 1263 | { |
| 1264 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 1265 | UINT8 *videoram = cga->m_vram; |
| 1266 | UINT32 *p = &bitmap.pix32(y); |
| 1267 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 1268 | int i; |
| 1269 | running_machine &machine = device->machine(); |
| 1270 | |
| 1271 | if ( y == 0 ) CGA_LOG(1,"cga_gfx_2bpp_update_row",("\n")); |
| 1272 | for ( i = 0; i < x_count; i++ ) |
| 1273 | { |
| 1274 | UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( y & 1 ) << 13 ); |
| 1275 | UINT8 data = videoram[ offset ]; |
| 1276 | |
| 1277 | *p = palette[cga->m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++; |
| 1278 | *p = palette[cga->m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++; |
| 1279 | *p = palette[cga->m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++; |
| 1280 | *p = palette[cga->m_palette_lut_2bpp[ data & 0x03 ]]; p++; |
| 1281 | |
| 1282 | data = videoram[ offset+1 ]; |
| 1283 | |
| 1284 | *p = palette[cga->m_palette_lut_2bpp[ ( data >> 6 ) & 0x03 ]]; p++; |
| 1285 | *p = palette[cga->m_palette_lut_2bpp[ ( data >> 4 ) & 0x03 ]]; p++; |
| 1286 | *p = palette[cga->m_palette_lut_2bpp[ ( data >> 2 ) & 0x03 ]]; p++; |
| 1287 | *p = palette[cga->m_palette_lut_2bpp[ data & 0x03 ]]; p++; |
| 1288 | } |
| 1289 | } |
| 1290 | |
| 1291 | |
| 1292 | |
| 1293 | /*************************************************************************** |
| 1294 | Draw graphics mode with 640x200 pixels (default). |
| 1295 | The cell size is 1x1 (1 scanline is the real default) |
| 1296 | Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000 |
| 1297 | ***************************************************************************/ |
| 1298 | |
| 1299 | static MC6845_UPDATE_ROW( cga_gfx_1bpp_update_row ) |
| 1300 | { |
| 1301 | isa8_cga_device *cga = downcast<isa8_cga_device *>(device->owner()); |
| 1302 | UINT8 *videoram = cga->m_vram; |
| 1303 | UINT32 *p = &bitmap.pix32(y); |
| 1304 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 1305 | UINT8 fg = cga->m_color_select & 0x0F; |
| 1306 | int i; |
| 1307 | running_machine &machine = device->machine(); |
| 1308 | |
| 1309 | if ( y == 0 ) CGA_LOG(1,"cga_gfx_1bpp_update_row",("\n")); |
| 1310 | for ( i = 0; i < x_count; i++ ) |
| 1311 | { |
| 1312 | UINT16 offset = ( ( ( ma + i ) << 1 ) & 0x1fff ) | ( ( ra & 1 ) << 13 ); |
| 1313 | UINT8 data = videoram[ offset ]; |
| 1314 | |
| 1315 | *p = palette[( data & 0x80 ) ? fg : 0]; p++; |
| 1316 | *p = palette[( data & 0x40 ) ? fg : 0]; p++; |
| 1317 | *p = palette[( data & 0x20 ) ? fg : 0]; p++; |
| 1318 | *p = palette[( data & 0x10 ) ? fg : 0]; p++; |
| 1319 | *p = palette[( data & 0x08 ) ? fg : 0]; p++; |
| 1320 | *p = palette[( data & 0x04 ) ? fg : 0]; p++; |
| 1321 | *p = palette[( data & 0x02 ) ? fg : 0]; p++; |
| 1322 | *p = palette[( data & 0x01 ) ? fg : 0]; p++; |
| 1323 | |
| 1324 | data = videoram[ offset + 1 ]; |
| 1325 | |
| 1326 | *p = palette[( data & 0x80 ) ? fg : 0]; p++; |
| 1327 | *p = palette[( data & 0x40 ) ? fg : 0]; p++; |
| 1328 | *p = palette[( data & 0x20 ) ? fg : 0]; p++; |
| 1329 | *p = palette[( data & 0x10 ) ? fg : 0]; p++; |
| 1330 | *p = palette[( data & 0x08 ) ? fg : 0]; p++; |
| 1331 | *p = palette[( data & 0x04 ) ? fg : 0]; p++; |
| 1332 | *p = palette[( data & 0x02 ) ? fg : 0]; p++; |
| 1333 | *p = palette[( data & 0x01 ) ? fg : 0]; p++; |
| 1334 | } |
| 1335 | } |
| 1336 | |
| 1337 | |
| 1338 | WRITE_LINE_MEMBER( isa8_cga_device::hsync_changed ) |
| 1339 | { |
| 1340 | m_hsync = state ? 1 : 0; |
| 1341 | } |
| 1342 | |
| 1343 | |
| 1344 | WRITE_LINE_MEMBER( isa8_cga_device::vsync_changed ) |
| 1345 | { |
| 1346 | m_vsync = state ? 9 : 0; |
| 1347 | if ( state ) |
| 1348 | { |
| 1349 | m_framecnt++; |
| 1350 | } |
| 1351 | } |
| 1352 | |
| 1353 | |
| 1354 | void isa8_cga_device::set_palette_luts(void) |
| 1355 | { |
| 1356 | /* Setup 2bpp palette lookup table */ |
| 1357 | if ( m_mode_control & 0x10 ) |
| 1358 | { |
| 1359 | m_palette_lut_2bpp[0] = 0; |
| 1360 | } |
| 1361 | else |
| 1362 | { |
| 1363 | m_palette_lut_2bpp[0] = m_color_select & 0x0F; |
| 1364 | } |
| 1365 | if ( m_mode_control & 0x04 ) |
| 1366 | { |
| 1367 | m_palette_lut_2bpp[1] = ( ( m_color_select & 0x10 ) >> 1 ) | 3; |
| 1368 | m_palette_lut_2bpp[2] = ( ( m_color_select & 0x10 ) >> 1 ) | 4; |
| 1369 | m_palette_lut_2bpp[3] = ( ( m_color_select & 0x10 ) >> 1 ) | 7; |
| 1370 | } |
| 1371 | else |
| 1372 | { |
| 1373 | if ( m_color_select & 0x20 ) |
| 1374 | { |
| 1375 | m_palette_lut_2bpp[1] = ( ( m_color_select & 0x10 ) >> 1 ) | 3; |
| 1376 | m_palette_lut_2bpp[2] = ( ( m_color_select & 0x10 ) >> 1 ) | 5; |
| 1377 | m_palette_lut_2bpp[3] = ( ( m_color_select & 0x10 ) >> 1 ) | 7; |
| 1378 | } |
| 1379 | else |
| 1380 | { |
| 1381 | m_palette_lut_2bpp[1] = ( ( m_color_select & 0x10 ) >> 1 ) | 2; |
| 1382 | m_palette_lut_2bpp[2] = ( ( m_color_select & 0x10 ) >> 1 ) | 4; |
| 1383 | m_palette_lut_2bpp[3] = ( ( m_color_select & 0x10 ) >> 1 ) | 6; |
| 1384 | } |
| 1385 | } |
| 1386 | //logerror("2bpp lut set to %d,%d,%d,%d\n", cga.palette_lut_2bpp[0], cga.palette_lut_2bpp[1], cga.palette_lut_2bpp[2], cga.palette_lut_2bpp[3]); |
| 1387 | } |
| 1388 | |
| 1389 | /* |
| 1390 | * rW CGA mode control register (see #P138) |
| 1391 | * |
| 1392 | * x x x 0 1 0 0 0 - 320x200, 40x25 text. Colour on RGB and composite monitors. |
| 1393 | * x x x 0 1 0 0 1 - 640x200, 80x25 text. Colour on RGB and composite monitors. |
| 1394 | * x x x 0 1 0 1 0 - 320x200 graphics. Colour on RGB and composite monitors. |
| 1395 | * x x x 0 1 0 1 1 - unknown/invalid. |
| 1396 | * x x x 0 1 1 0 0 - 320x200, 40x25 text. Colour on RGB, greyscale on composite monitors. |
| 1397 | * x x x 0 1 1 0 1 - 640x200, 80x25 text. Colour on RGB, greyscale on composite monitors. |
| 1398 | * x x x 0 1 1 1 0 - 320x200 graphics. Alternative palette on RGB, greyscale on composite monitors. |
| 1399 | * x x x 0 1 1 1 1 - unknown/invalid. |
| 1400 | * x x x 1 1 0 0 0 - unknown/invalid. |
| 1401 | * x x x 1 1 0 0 1 - unknown/invalid. |
| 1402 | * x x x 1 1 0 1 0 - 160x200/640x200 graphics. 640x200 ?? on RGB monitor, 160x200 on composite monitor. |
| 1403 | * x x x 1 1 0 1 1 - unknown/invalid. |
| 1404 | * x x x 1 1 1 0 0 - unknown/invalid. |
| 1405 | * x x x 1 1 1 0 1 - unknown/invalid. |
| 1406 | * x x x 1 1 1 1 0 - 640x200 graphics. Colour on black on RGB monitor, monochrome on composite monitor. |
| 1407 | * x x x 1 1 1 1 1 - unknown/invalid. |
| 1408 | */ |
| 1409 | void isa8_cga_device::mode_control_w(UINT8 data) |
| 1410 | { |
| 1411 | mc6845_device *mc6845 = subdevice<mc6845_device>(CGA_MC6845_NAME); |
| 1412 | UINT8 monitor = CGA_MONITOR; |
| 1413 | |
| 1414 | m_mode_control = data; |
| 1415 | |
| 1416 | //logerror("mode set to %02X\n", cga.mode_control & 0x3F ); |
| 1417 | switch ( m_mode_control & 0x3F ) |
| 1418 | { |
| 1419 | case 0x08: case 0x09: case 0x0C: case 0x0D: |
| 1420 | mc6845->set_hpixels_per_column( 8 ); |
| 1421 | if ( monitor == CGA_MONITOR_COMPOSITE ) |
| 1422 | { |
| 1423 | if ( m_mode_control & 0x04 ) |
| 1424 | { |
| 1425 | /* Composite greyscale */ |
| 1426 | m_update_row = cga_text_inten_comp_grey_update_row; |
| 1427 | } |
| 1428 | else |
| 1429 | { |
| 1430 | /* Composite colour */ |
| 1431 | m_update_row = cga_text_inten_update_row; |
| 1432 | } |
| 1433 | } |
| 1434 | else |
| 1435 | { |
| 1436 | /* RGB colour */ |
| 1437 | m_update_row = cga_text_inten_update_row; |
| 1438 | } |
| 1439 | break; |
| 1440 | case 0x0A: case 0x0B: case 0x2A: case 0x2B: |
| 1441 | mc6845->set_hpixels_per_column( 8 ); |
| 1442 | if ( monitor == CGA_MONITOR_COMPOSITE ) |
| 1443 | { |
| 1444 | m_update_row = cga_gfx_4bppl_update_row; |
| 1445 | } |
| 1446 | else |
| 1447 | { |
| 1448 | m_update_row = cga_gfx_2bpp_update_row; |
| 1449 | } |
| 1450 | break; |
| 1451 | case 0x0E: case 0x0F: case 0x2E: case 0x2F: |
| 1452 | mc6845->set_hpixels_per_column( 8 ); |
| 1453 | m_update_row = cga_gfx_2bpp_update_row; |
| 1454 | break; |
| 1455 | case 0x18: case 0x19: case 0x1C: case 0x1D: |
| 1456 | mc6845->set_hpixels_per_column( 8 ); |
| 1457 | m_update_row = cga_text_inten_alt_update_row; |
| 1458 | break; |
| 1459 | case 0x1A: case 0x1B: case 0x3A: case 0x3B: |
| 1460 | mc6845->set_hpixels_per_column( 16 ); |
| 1461 | if ( monitor == CGA_MONITOR_COMPOSITE ) |
| 1462 | { |
| 1463 | m_update_row = cga_gfx_4bpph_update_row; |
| 1464 | } |
| 1465 | else |
| 1466 | { |
| 1467 | m_update_row = cga_gfx_1bpp_update_row; |
| 1468 | } |
| 1469 | break; |
| 1470 | case 0x1E: case 0x1F: case 0x3E: case 0x3F: |
| 1471 | mc6845->set_hpixels_per_column( 16 ); |
| 1472 | m_update_row = cga_gfx_1bpp_update_row; |
| 1473 | break; |
| 1474 | case 0x28: case 0x29: case 0x2C: case 0x2D: |
| 1475 | mc6845->set_hpixels_per_column( 8 ); |
| 1476 | if ( monitor == CGA_MONITOR_COMPOSITE ) |
| 1477 | { |
| 1478 | if ( m_mode_control & 0x04 ) |
| 1479 | { |
| 1480 | /* Composite greyscale */ |
| 1481 | m_update_row = m_superimpose ? cga_text_blink_update_row_si : cga_text_blink_update_row; |
| 1482 | } |
| 1483 | else |
| 1484 | { |
| 1485 | /* Composite colour */ |
| 1486 | m_update_row = m_superimpose ? cga_text_blink_update_row_si : cga_text_blink_update_row; |
| 1487 | } |
| 1488 | } |
| 1489 | else |
| 1490 | { |
| 1491 | /* RGB colour */ |
| 1492 | m_update_row = m_superimpose ? cga_text_blink_update_row_si : cga_text_blink_update_row; |
| 1493 | } |
| 1494 | break; |
| 1495 | case 0x38: case 0x39: case 0x3C: case 0x3D: |
| 1496 | mc6845->set_hpixels_per_column( 8 ); |
| 1497 | m_update_row = cga_text_blink_alt_update_row; |
| 1498 | break; |
| 1499 | default: |
| 1500 | m_update_row = NULL; |
| 1501 | break; |
| 1502 | } |
| 1503 | |
| 1504 | // The lowest bit of the mode register selects, among others, the |
| 1505 | // input clock to the 6845. |
| 1506 | mc6845->set_clock( ( m_mode_control & 1 ) ? CGA_HCLK : CGA_LCLK ); |
| 1507 | |
| 1508 | set_palette_luts(); |
| 1509 | } |
| 1510 | |
| 1511 | |
| 1512 | |
| 1513 | /* |
| 1514 | * Select Plantronics modes |
| 1515 | */ |
| 1516 | void isa8_cga_device::plantronics_w(UINT8 data) |
| 1517 | { |
| 1518 | if ( ( CGA_CHIPSET ) != CGA_CHIPSET_ATI) return; |
| 1519 | |
| 1520 | data &= 0x70; /* Only bits 6-4 are used */ |
| 1521 | m_plantronics = data; |
| 1522 | } |
| 1523 | |
| 1524 | |
| 1525 | |
| 1526 | /************************************************************************* |
| 1527 | * |
| 1528 | * CGA |
| 1529 | * color graphics adapter |
| 1530 | * |
| 1531 | *************************************************************************/ |
| 1532 | |
| 1533 | WRITE8_MEMBER( isa8_cga_device::char_ram_write ) |
| 1534 | { |
| 1535 | logerror("write char ram %04x %02x\n",offset,data); |
| 1536 | m_chr_gen_base[offset + 0x0000] = data; |
| 1537 | m_chr_gen_base[offset + 0x0800] = data; |
| 1538 | m_chr_gen_base[offset + 0x1000] = data; |
| 1539 | m_chr_gen_base[offset + 0x1800] = data; |
| 1540 | } |
| 1541 | |
| 1542 | |
| 1543 | READ8_MEMBER( isa8_cga_device::char_ram_read ) |
| 1544 | { |
| 1545 | return m_chr_gen_base[offset]; |
| 1546 | } |
| 1547 | |
| 1548 | |
| 1549 | READ8_MEMBER( isa8_cga_device::io_read ) |
| 1550 | { |
| 1551 | mc6845_device *mc6845 = subdevice<mc6845_device>(CGA_MC6845_NAME); |
| 1552 | UINT8 data = 0xff; |
| 1553 | |
| 1554 | switch( offset ) |
| 1555 | { |
| 1556 | case 0: case 2: case 4: case 6: |
| 1557 | /* return last written mc6845 address value here? */ |
| 1558 | break; |
| 1559 | case 1: case 3: case 5: case 7: |
| 1560 | data = mc6845->register_r( space, offset ); |
| 1561 | break; |
| 1562 | case 10: |
| 1563 | data = m_vsync | ( ( data & 0x40 ) >> 4 ) | m_hsync; |
| 1564 | break; |
| 1565 | case 0x0f: |
| 1566 | data = m_p3df; |
| 1567 | break; |
| 1568 | } |
| 1569 | return data; |
| 1570 | } |
| 1571 | |
| 1572 | |
| 1573 | |
| 1574 | WRITE8_MEMBER( isa8_cga_device::io_write ) |
| 1575 | { |
| 1576 | mc6845_device *mc6845 = subdevice<mc6845_device>(CGA_MC6845_NAME); |
| 1577 | |
| 1578 | switch(offset) { |
| 1579 | case 0: case 2: case 4: case 6: |
| 1580 | mc6845->address_w( space, offset, data ); |
| 1581 | break; |
| 1582 | case 1: case 3: case 5: case 7: |
| 1583 | mc6845->register_w( space, offset, data ); |
| 1584 | break; |
| 1585 | case 8: |
| 1586 | mode_control_w(data); |
| 1587 | break; |
| 1588 | case 9: |
| 1589 | m_color_select = data; |
| 1590 | set_palette_luts(); |
| 1591 | break; |
| 1592 | case 0x0d: |
| 1593 | plantronics_w(data); |
| 1594 | break; |
| 1595 | case 0x0f: |
| 1596 | // Not sure if some all CGA cards have ability to upload char definition |
| 1597 | // The original CGA card had a char rom |
| 1598 | // TODO: This should be moved to card implementations that actually had this feature |
| 1599 | m_p3df = data; |
| 1600 | if (data & 1) { |
| 1601 | address_space *space_prg = machine().firstcpu->memory().space(AS_PROGRAM); |
| 1602 | |
| 1603 | space_prg->install_readwrite_handler(0xb8000, 0xb87ff, read8_delegate( FUNC(isa8_cga_device::char_ram_read), this), write8_delegate(FUNC(isa8_cga_device::char_ram_write), this) ); |
| 1604 | } else { |
| 1605 | m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, 0, m_vram_size & 0x4000, "bank_cga", m_vram); |
| 1606 | } |
| 1607 | break; |
| 1608 | |
| 1609 | } |
| 1610 | } |
| 1611 | |
| 1612 | |
| 1613 | |
| 1614 | /* Old plantronics rendering code, leaving it uncommented until we have re-implemented it */ |
| 1615 | |
| 1616 | // |
| 1617 | // From choosevideomode: |
| 1618 | // |
| 1619 | // /* Plantronics high-res */ |
| 1620 | // if ((cga.mode_control & 2) && (cga.plantronics & 0x20)) |
| 1621 | // proc = cga_pgfx_2bpp; |
| 1622 | // /* Plantronics low-res */ |
| 1623 | // if ((cga.mode_control & 2) && (cga.plantronics & 0x10)) |
| 1624 | // proc = cga_pgfx_4bpp; |
| 1625 | // |
| 1626 | |
| 1627 | //INLINE void pgfx_plot_unit_4bpp(bitmap_ind16 &bitmap, |
| 1628 | // int x, int y, int offs) |
| 1629 | //{ |
| 1630 | // int color, values[2]; |
| 1631 | // int i; |
| 1632 | // |
| 1633 | // if (cga.plantronics & 0x40) |
| 1634 | // { |
| 1635 | // values[0] = videoram[offs | 0x4000]; |
| 1636 | // values[1] = videoram[offs]; |
| 1637 | // } |
| 1638 | // else |
| 1639 | // { |
| 1640 | // values[0] = videoram[offs]; |
| 1641 | // values[1] = videoram[offs | 0x4000]; |
| 1642 | // } |
| 1643 | // for (i=3; i>=0; i--) |
| 1644 | // { |
| 1645 | // color = ((values[0] & 0x3) << 1) | |
| 1646 | // ((values[1] & 2) >> 1) | |
| 1647 | // ((values[1] & 1) << 3); |
| 1648 | // bitmap.pix16(y, x+i) = Machine->pens[color]; |
| 1649 | // values[0]>>=2; |
| 1650 | // values[1]>>=2; |
| 1651 | // } |
| 1652 | //} |
| 1653 | // |
| 1654 | // |
| 1655 | // |
| 1656 | ///*************************************************************************** |
| 1657 | // Draw graphics mode with 640x200 pixels (default) with 2 bits/pixel. |
| 1658 | // Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000 |
| 1659 | // Second plane at CGA_base + 0x4000 / 0x6000 |
| 1660 | //***************************************************************************/ |
| 1661 | // |
| 1662 | //static void cga_pgfx_4bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc) |
| 1663 | //{ |
| 1664 | // int i, sx, sy, sh; |
| 1665 | // int offs = mscrtc6845_get_start(crtc)*2; |
| 1666 | // int lines = mscrtc6845_get_char_lines(crtc); |
| 1667 | // int height = mscrtc6845_get_char_height(crtc); |
| 1668 | // int columns = mscrtc6845_get_char_columns(crtc)*2; |
| 1669 | // |
| 1670 | // for (sy=0; sy<lines; sy++,offs=(offs+columns)&0x1fff) |
| 1671 | // { |
| 1672 | // for (sh=0; sh<height; sh++, offs|=0x2000) |
| 1673 | // { |
| 1674 | // // char line 0 used as a12 line in graphic mode |
| 1675 | // if (!(sh & 1)) |
| 1676 | // { |
| 1677 | // for (i=offs, sx=0; sx<columns; sx++, i=(i+1)&0x1fff) |
| 1678 | // { |
| 1679 | // pgfx_plot_unit_4bpp(bitmap, sx*4, sy*height+sh, i); |
| 1680 | // } |
| 1681 | // } |
| 1682 | // else |
| 1683 | // { |
| 1684 | // for (i=offs|0x2000, sx=0; sx<columns; sx++, i=((i+1)&0x1fff)|0x2000) |
| 1685 | // { |
| 1686 | // pgfx_plot_unit_4bpp(bitmap, sx*4, sy*height+sh, i); |
| 1687 | // } |
| 1688 | // } |
| 1689 | // } |
| 1690 | // } |
| 1691 | //} |
| 1692 | // |
| 1693 | // |
| 1694 | // |
| 1695 | //INLINE void pgfx_plot_unit_2bpp(bitmap_ind16 &bitmap, |
| 1696 | // int x, int y, const UINT16 *palette, int offs) |
| 1697 | //{ |
| 1698 | // int i; |
| 1699 | // UINT8 bmap[2], values[2]; |
| 1700 | // UINT16 *dest; |
| 1701 | // |
| 1702 | // if (cga.plantronics & 0x40) |
| 1703 | // { |
| 1704 | // values[0] = videoram[offs]; |
| 1705 | // values[1] = videoram[offs | 0x4000]; |
| 1706 | // } |
| 1707 | // else |
| 1708 | // { |
| 1709 | // values[0] = videoram[offs | 0x4000]; |
| 1710 | // values[1] = videoram[offs]; |
| 1711 | // } |
| 1712 | // bmap[0] = bmap[1] = 0; |
| 1713 | // for (i=3; i>=0; i--) |
| 1714 | // { |
| 1715 | // bmap[0] = bmap[0] << 1; if (values[0] & 0x80) bmap[0] |= 1; |
| 1716 | // bmap[0] = bmap[0] << 1; if (values[1] & 0x80) bmap[0] |= 1; |
| 1717 | // bmap[1] = bmap[1] << 1; if (values[0] & 0x08) bmap[1] |= 1; |
| 1718 | // bmap[1] = bmap[1] << 1; if (values[1] & 0x08) bmap[1] |= 1; |
| 1719 | // values[0] = values[0] << 1; |
| 1720 | // values[1] = values[1] << 1; |
| 1721 | // } |
| 1722 | // |
| 1723 | // dest = &bitmap.pix16(y, x); |
| 1724 | // *(dest++) = palette[(bmap[0] >> 6) & 0x03]; |
| 1725 | // *(dest++) = palette[(bmap[0] >> 4) & 0x03]; |
| 1726 | // *(dest++) = palette[(bmap[0] >> 2) & 0x03]; |
| 1727 | // *(dest++) = palette[(bmap[0] >> 0) & 0x03]; |
| 1728 | // *(dest++) = palette[(bmap[1] >> 6) & 0x03]; |
| 1729 | // *(dest++) = palette[(bmap[1] >> 4) & 0x03]; |
| 1730 | // *(dest++) = palette[(bmap[1] >> 2) & 0x03]; |
| 1731 | // *(dest++) = palette[(bmap[1] >> 0) & 0x03]; |
| 1732 | //} |
| 1733 | // |
| 1734 | // |
| 1735 | // |
| 1736 | ///*************************************************************************** |
| 1737 | // Draw graphics mode with 320x200 pixels (default) with 2 bits/pixel. |
| 1738 | // Even scanlines are from CGA_base + 0x0000, odd from CGA_base + 0x2000 |
| 1739 | // cga fetches 2 byte per mscrtc6845 access (not modeled here)! |
| 1740 | //***************************************************************************/ |
| 1741 | // |
| 1742 | //static void cga_pgfx_2bpp(bitmap_ind16 &bitmap, struct mscrtc6845 *crtc) |
| 1743 | //{ |
| 1744 | // int i, sx, sy, sh; |
| 1745 | // int offs = mscrtc6845_get_start(crtc)*2; |
| 1746 | // int lines = mscrtc6845_get_char_lines(crtc); |
| 1747 | // int height = mscrtc6845_get_char_height(crtc); |
| 1748 | // int columns = mscrtc6845_get_char_columns(crtc)*2; |
| 1749 | // int colorset = cga.color_select & 0x3F; |
| 1750 | // const UINT16 *palette; |
| 1751 | // |
| 1752 | // /* Most chipsets use bit 2 of the mode control register to |
| 1753 | // * access a third palette. But not consistently. */ |
| 1754 | // pc_cga_check_palette(); |
| 1755 | // switch(CGA_CHIPSET) |
| 1756 | // { |
| 1757 | // /* The IBM Professional Graphics Controller behaves like |
| 1758 | // * the PC1512, btw. */ |
| 1759 | // case CGA_CHIPSET_PC1512: |
| 1760 | // if ((colorset < 32) && (cga.mode_control & 4)) colorset += 64; |
| 1761 | // break; |
| 1762 | // |
| 1763 | // case CGA_CHIPSET_IBM: |
| 1764 | // case CGA_CHIPSET_PC200: |
| 1765 | // case CGA_CHIPSET_ATI: |
| 1766 | // case CGA_CHIPSET_PARADISE: |
| 1767 | // if (cga.mode_control & 4) colorset = (colorset & 0x1F) + 64; |
| 1768 | // break; |
| 1769 | // } |
| 1770 | // |
| 1771 | // |
| 1772 | // /* The fact that our palette is located in cga_colortable is a vestigial |
| 1773 | // * aspect from when we were doing that ugly trick where drawgfx() would |
| 1774 | // * handle graphics drawing. Truthfully, we should probably be using |
| 1775 | // * palette_set_color_rgb() here and not doing the palette lookup in the loop |
| 1776 | // */ |
| 1777 | // palette = &cga_colortable[256*2 + 16*2] + colorset * 4; |
| 1778 | // |
| 1779 | // for (sy=0; sy<lines; sy++,offs=(offs+columns)&0x1fff) { |
| 1780 | // |
| 1781 | // for (sh=0; sh<height; sh++) |
| 1782 | // { |
| 1783 | // if (!(sh&1)) { // char line 0 used as a12 line in graphic mode |
| 1784 | // for (i=offs, sx=0; sx<columns; sx++, i=(i+1)&0x1fff) |
| 1785 | // { |
| 1786 | // pgfx_plot_unit_2bpp(bitmap, sx*8, sy*height+sh, palette, i); |
| 1787 | // } |
| 1788 | // } |
| 1789 | // else |
| 1790 | // { |
| 1791 | // for (i=offs|0x2000, sx=0; sx<columns; sx++, i=((i+1)&0x1fff)|0x2000) |
| 1792 | // { |
| 1793 | // pgfx_plot_unit_2bpp(bitmap, sx*8, sy*height+sh, palette, i); |
| 1794 | // } |
| 1795 | // } |
| 1796 | // } |
| 1797 | // } |
| 1798 | //} |
| 1799 | |
| 1800 | |
| 1801 | static MC6845_UPDATE_ROW( pc1512_gfx_4bpp_update_row ) |
| 1802 | { |
| 1803 | isa8_cga_pc1512_device *cga = downcast<isa8_cga_pc1512_device *>(device->owner()); |
| 1804 | UINT8 *videoram = cga->m_vram; |
| 1805 | UINT32 *p = &bitmap.pix32(y); |
| 1806 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 1807 | UINT16 offset_base = ra << 13; |
| 1808 | int j; |
| 1809 | running_machine &machine = device->machine(); |
| 1810 | |
| 1811 | if ( y == 0 ) CGA_LOG(1,"pc1512_gfx_4bpp_update_row",("\n")); |
| 1812 | for ( j = 0; j < x_count; j++ ) |
| 1813 | { |
| 1814 | UINT16 offset = offset_base | ( ( ma + j ) & 0x1FFF ); |
| 1815 | UINT16 i = ( cga->m_color_select & 8 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[3] | offset ] << 3 : 0; |
| 1816 | UINT16 r = ( cga->m_color_select & 4 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[2] | offset ] << 2 : 0; |
| 1817 | UINT16 g = ( cga->m_color_select & 2 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[1] | offset ] << 1 : 0; |
| 1818 | UINT16 b = ( cga->m_color_select & 1 ) ? videoram[ isa8_cga_pc1512_device::vram_offset[0] | offset ] : 0; |
| 1819 | |
| 1820 | *p = palette[( ( i & 0x400 ) | ( r & 0x200 ) | ( g & 0x100 ) | ( b & 0x80 ) ) >> 7]; p++; |
| 1821 | *p = palette[( ( i & 0x200 ) | ( r & 0x100 ) | ( g & 0x080 ) | ( b & 0x40 ) ) >> 6]; p++; |
| 1822 | *p = palette[( ( i & 0x100 ) | ( r & 0x080 ) | ( g & 0x040 ) | ( b & 0x20 ) ) >> 5]; p++; |
| 1823 | *p = palette[( ( i & 0x080 ) | ( r & 0x040 ) | ( g & 0x020 ) | ( b & 0x10 ) ) >> 4]; p++; |
| 1824 | *p = palette[( ( i & 0x040 ) | ( r & 0x020 ) | ( g & 0x010 ) | ( b & 0x08 ) ) >> 3]; p++; |
| 1825 | *p = palette[( ( i & 0x020 ) | ( r & 0x010 ) | ( g & 0x008 ) | ( b & 0x04 ) ) >> 2]; p++; |
| 1826 | *p = palette[( ( i & 0x010 ) | ( r & 0x008 ) | ( g & 0x004 ) | ( b & 0x02 ) ) >> 1]; p++; |
| 1827 | *p = palette[ ( i & 0x008 ) | ( r & 0x004 ) | ( g & 0x002 ) | ( b & 0x01 ) ]; p++; |
| 1828 | } |
| 1829 | } |
| 1830 | |
| 1831 | |
| 1832 | WRITE8_MEMBER( isa8_cga_pc1512_device::io_write ) |
| 1833 | { |
| 1834 | mc6845_device *mc6845 = subdevice<mc6845_device>(CGA_MC6845_NAME); |
| 1835 | |
| 1836 | switch (offset) |
| 1837 | { |
| 1838 | case 0: case 2: case 4: case 6: |
| 1839 | data &= 0x1F; |
| 1840 | mc6845->address_w( space, offset, data ); |
| 1841 | m_mc6845_address = data; |
| 1842 | break; |
| 1843 | |
| 1844 | case 1: case 3: case 5: case 7: |
| 1845 | if ( ! m_mc6845_locked_register[m_mc6845_address] ) |
| 1846 | { |
| 1847 | mc6845->register_w( space, offset, data ); |
| 1848 | if ( isa8_cga_pc1512_device::mc6845_writeonce_register[m_mc6845_address] ) |
| 1849 | { |
| 1850 | m_mc6845_locked_register[m_mc6845_address] = 1; |
| 1851 | } |
| 1852 | } |
| 1853 | break; |
| 1854 | |
| 1855 | case 0x8: |
| 1856 | /* Check if we're changing to graphics mode 2 */ |
| 1857 | if ( ( m_mode_control & 0x12 ) != 0x12 && ( data & 0x12 ) == 0x12 ) |
| 1858 | { |
| 1859 | m_write = 0x0F; |
| 1860 | } |
| 1861 | else |
| 1862 | { |
| 1863 | memory_set_bankptr(machine(),"bank1", m_vram + isa8_cga_pc1512_device::vram_offset[0]); |
| 1864 | } |
| 1865 | m_mode_control = data; |
| 1866 | switch( m_mode_control & 0x3F ) |
| 1867 | { |
| 1868 | case 0x08: case 0x09: case 0x0C: case 0x0D: |
| 1869 | mc6845->set_hpixels_per_column( 8 ); |
| 1870 | m_update_row = cga_text_inten_update_row; |
| 1871 | break; |
| 1872 | case 0x0A: case 0x0B: case 0x2A: case 0x2B: |
| 1873 | mc6845->set_hpixels_per_column( 8 ); |
| 1874 | if ( ( CGA_MONITOR ) == CGA_MONITOR_COMPOSITE ) |
| 1875 | { |
| 1876 | m_update_row = cga_gfx_4bppl_update_row; |
| 1877 | } |
| 1878 | else |
| 1879 | { |
| 1880 | m_update_row = cga_gfx_2bpp_update_row; |
| 1881 | } |
| 1882 | break; |
| 1883 | case 0x0E: case 0x0F: case 0x2E: case 0x2F: |
| 1884 | mc6845->set_hpixels_per_column( 8 ); |
| 1885 | m_update_row = cga_gfx_2bpp_update_row; |
| 1886 | break; |
| 1887 | case 0x18: case 0x19: case 0x1C: case 0x1D: |
| 1888 | mc6845->set_hpixels_per_column( 8 ); |
| 1889 | m_update_row = cga_text_inten_alt_update_row; |
| 1890 | break; |
| 1891 | case 0x1A: case 0x1B: case 0x3A: case 0x3B: |
| 1892 | mc6845->set_hpixels_per_column( 8 ); |
| 1893 | m_update_row = pc1512_gfx_4bpp_update_row; |
| 1894 | break; |
| 1895 | case 0x1E: case 0x1F: case 0x3E: case 0x3F: |
| 1896 | mc6845->set_hpixels_per_column( 16 ); |
| 1897 | m_update_row = cga_gfx_1bpp_update_row; |
| 1898 | break; |
| 1899 | case 0x28: case 0x29: case 0x2C: case 0x2D: |
| 1900 | mc6845->set_hpixels_per_column( 8 ); |
| 1901 | m_update_row = cga_text_blink_update_row; |
| 1902 | break; |
| 1903 | case 0x38: case 0x39: case 0x3C: case 0x3D: |
| 1904 | mc6845->set_hpixels_per_column( 8 ); |
| 1905 | m_update_row = cga_text_blink_alt_update_row; |
| 1906 | break; |
| 1907 | default: |
| 1908 | m_update_row = NULL; |
| 1909 | break; |
| 1910 | } |
| 1911 | break; |
| 1912 | |
| 1913 | case 0xd: |
| 1914 | m_write = data; |
| 1915 | break; |
| 1916 | |
| 1917 | case 0xe: |
| 1918 | m_read = data; |
| 1919 | if ( ( m_mode_control & 0x12 ) == 0x12 ) |
| 1920 | { |
| 1921 | memory_set_bankptr(machine(),"bank1", m_vram + isa8_cga_pc1512_device::vram_offset[data & 3]); |
| 1922 | } |
| 1923 | break; |
| 1924 | |
| 1925 | default: |
| 1926 | isa8_cga_device::io_write(space, offset,data); |
| 1927 | break; |
| 1928 | } |
| 1929 | } |
| 1930 | |
| 1931 | |
| 1932 | READ8_MEMBER( isa8_cga_pc1512_device::io_read ) |
| 1933 | { |
| 1934 | UINT8 data; |
| 1935 | |
| 1936 | switch (offset) |
| 1937 | { |
| 1938 | case 0xd: |
| 1939 | data = m_write; |
| 1940 | break; |
| 1941 | |
| 1942 | case 0xe: |
| 1943 | data = m_read; |
| 1944 | break; |
| 1945 | |
| 1946 | default: |
| 1947 | data = isa8_cga_device::io_read(space, offset); |
| 1948 | break; |
| 1949 | } |
| 1950 | return data; |
| 1951 | } |
| 1952 | |
| 1953 | |
| 1954 | WRITE8_MEMBER( isa8_cga_pc1512_device::vram_w ) |
| 1955 | { |
| 1956 | if ( ( m_mode_control & 0x12 ) == 0x12 ) |
| 1957 | { |
| 1958 | if (m_write & 1) |
| 1959 | m_vram[offset+isa8_cga_pc1512_device::vram_offset[0]] = data; /* blue plane */ |
| 1960 | if (m_write & 2) |
| 1961 | m_vram[offset+isa8_cga_pc1512_device::vram_offset[1]] = data; /* green */ |
| 1962 | if (m_write & 4) |
| 1963 | m_vram[offset+isa8_cga_pc1512_device::vram_offset[2]] = data; /* red */ |
| 1964 | if (m_write & 8) |
| 1965 | m_vram[offset+isa8_cga_pc1512_device::vram_offset[3]] = data; /* intensity (text, 4color) */ |
| 1966 | } |
| 1967 | else |
| 1968 | { |
| 1969 | m_vram[offset + isa8_cga_pc1512_device::vram_offset[0]] = data; |
| 1970 | } |
| 1971 | } |
| 1972 | |
| 1973 | |
| 1974 | const device_type ISA8_CGA_PC1512 = &device_creator<isa8_cga_pc1512_device>; |
| 1975 | |
| 1976 | const offs_t isa8_cga_pc1512_device::vram_offset[4]= { 0x0000, 0x4000, 0x8000, 0xC000 }; |
| 1977 | const UINT8 isa8_cga_pc1512_device::mc6845_writeonce_register[31] = |
| 1978 | { |
| 1979 | 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| 1980 | }; |
| 1981 | |
| 1982 | //------------------------------------------------- |
| 1983 | // isa8_cga_pc1512_device - constructor |
| 1984 | //------------------------------------------------- |
| 1985 | |
| 1986 | isa8_cga_pc1512_device::isa8_cga_pc1512_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 1987 | isa8_cga_device( mconfig, ISA8_CGA_PC1512, "ISA8_CGA_PC1512", tag, owner, clock ) |
| 1988 | { |
| 1989 | m_vram_size = 0x10000; |
| 1990 | m_chr_gen_offset[0] = 0x0000; |
| 1991 | m_chr_gen_offset[1] = 0x0800; |
| 1992 | m_chr_gen_offset[2] = 0x1000; |
| 1993 | m_chr_gen_offset[3] = 0x1800; |
| 1994 | } |
| 1995 | |
| 1996 | |
| 1997 | const rom_entry *isa8_cga_pc1512_device::device_rom_region() const |
| 1998 | { |
| 1999 | return NULL; |
| 2000 | } |
| 2001 | |
| 2002 | |
| 2003 | ioport_constructor isa8_cga_pc1512_device::device_input_ports() const |
| 2004 | { |
| 2005 | return INPUT_PORTS_NAME( pc1512 ); |
| 2006 | } |
| 2007 | |
| 2008 | //------------------------------------------------- |
| 2009 | // device_start - device-specific startup |
| 2010 | //------------------------------------------------- |
| 2011 | |
| 2012 | void isa8_cga_pc1512_device::device_start() |
| 2013 | { |
| 2014 | isa8_cga_device::device_start(); |
| 2015 | |
| 2016 | m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_pc1512_device::io_read), this ), write8_delegate( FUNC(isa8_cga_pc1512_device::io_write), this ) ); |
| 2017 | m_isa->install_bank(0xb8000, 0xbbfff, 0, 0, "bank1", m_vram); |
| 2018 | |
| 2019 | address_space *space = machine().firstcpu->memory().space( AS_PROGRAM ); |
| 2020 | |
| 2021 | space->install_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) ); |
| 2022 | } |
| 2023 | |
| 2024 | void isa8_cga_pc1512_device::device_reset() |
| 2025 | { |
| 2026 | isa8_cga_device::device_reset(); |
| 2027 | |
| 2028 | m_write = 0x0f; |
| 2029 | m_read = 0; |
| 2030 | m_mc6845_address = 0; |
| 2031 | for ( int i = 0; i < 31; i++ ) |
| 2032 | { |
| 2033 | m_mc6845_locked_register[i] = 0; |
| 2034 | } |
| 2035 | |
| 2036 | memory_set_bankptr(machine(), "bank1", m_vram + isa8_cga_pc1512_device::vram_offset[0]); |
| 2037 | } |
| 2038 | |