src/mess/video/super80.c
| r4926 | r4927 | |
| 1 | 1 | /* Super80.c written by Robbbert, 2005-2009. See the MESS wiki for documentation. */ |
| 2 | 2 | |
| 3 | | /* Notes on using MAME MC6845 device (MMD). |
| 3 | /* Notes on using MAME MC6845 Device (MMD). |
| 4 | 4 | 1. Speed of MMD is about 20% slower than pre-MMD coding |
| 5 | 5 | 2. Undocumented cursor start and end-lines is not supported by MMD, so we do it here |
| 6 | 6 | 3. MMD doesn't support auto-screen-resize, so we do it here. */ |
| r4926 | r4927 | |
| 16 | 16 | static UINT8 current_palette; /* for super80m and super80v */ |
| 17 | 17 | static UINT8 current_charset; /* for super80m */ |
| 18 | 18 | |
| 19 | | static UINT8 mc6845_cursor[16]; // cursor shape |
| 20 | | static UINT8 mc6845_reg[20]; /* registers */ |
| 21 | | static UINT8 mc6845_ind; /* register index */ |
| 22 | | static const UINT8 mc6845_mask[]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0}; |
| 23 | | |
| 24 | | static const device_config *mc6845; |
| 19 | static const UINT8 *FNT; |
| 25 | 20 | static UINT8 chr,col,gfx,fg,bg; |
| 26 | 21 | static UINT16 mem,x; |
| 27 | | static UINT8 framecnt=0; |
| 28 | | static UINT8 speed,flash; |
| 29 | | static UINT16 cursor; |
| 30 | 22 | static UINT8 options; |
| 31 | 23 | |
| 32 | 24 | |
| r4926 | r4927 | |
| 79 | 71 | while (color_count--) |
| 80 | 72 | { |
| 81 | 73 | r = *colors++; g = *colors++; b = *colors++; |
| 82 | | colortable_palette_set_color(machine->colortable, 15 - color_count, MAKE_RGB(r, g, b)); |
| 74 | palette_set_color(machine, 15-color_count, MAKE_RGB(r, g, b)); |
| 83 | 75 | } |
| 84 | 76 | } |
| 85 | 77 | |
| 86 | 78 | PALETTE_INIT( super80m ) |
| 87 | 79 | { |
| 88 | | int i; |
| 89 | | machine->colortable = colortable_alloc(machine, 16); |
| 90 | 80 | palette_set_colors_rgb(machine, super80_rgb_palette); |
| 81 | } |
| 91 | 82 | |
| 92 | | for( i = 0; i < 256; i++ ) |
| 83 | |
| 84 | |
| 85 | VIDEO_EOF( super80m ) |
| 86 | { |
| 87 | /* if we chose another palette or colour mode, enable it */ |
| 88 | UINT8 chosen_palette = (input_port_read(machine, "CONFIG") & 0x60)>>5; // read colour dipswitches |
| 89 | |
| 90 | if (chosen_palette != current_palette) // any changes? |
| 93 | 91 | { |
| 94 | | colortable_entry_set_value(machine->colortable, i*2, i>>4); |
| 95 | | colortable_entry_set_value(machine->colortable, i*2+1, i&15); |
| 92 | current_palette = chosen_palette; // save new palette |
| 93 | if (!current_palette) |
| 94 | palette_set_colors_rgb(machine, super80_comp_palette); // composite colour |
| 95 | else |
| 96 | palette_set_colors_rgb(machine, super80_rgb_palette); // rgb and b&w |
| 96 | 97 | } |
| 97 | 98 | } |
| 98 | 99 | |
| 100 | VIDEO_UPDATE( super80 ) |
| 101 | { |
| 102 | UINT8 y,ra,chr=32,gfx,screen_on=0; |
| 103 | UINT16 sy=0,ma=vidpg,x; |
| 104 | UINT8 *RAM = memory_region(screen->machine, "maincpu"); |
| 99 | 105 | |
| 100 | | /**************************** VIDEO *****************************************************************/ |
| 101 | | /* the following are for super80v */ |
| 106 | if ((super80_mhz == 1) || (!(input_port_read(screen->machine, "CONFIG") & 4))) /* bit 2 of port F0 is high, OR user turned on config switch */ |
| 107 | screen_on++; |
| 108 | |
| 109 | for (y = 0; y < 16; y++) |
| 110 | { |
| 111 | for (ra = 0; ra < 10; ra++) |
| 112 | { |
| 113 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 114 | |
| 115 | for (x = 0; x < 32; x++) // done this way to avoid x overflowing on page FF |
| 116 | { |
| 117 | if (screen_on) |
| 118 | chr = RAM[ma | x] & 0x3f; |
| 119 | |
| 120 | /* get pattern of pixels for that character scanline */ |
| 121 | gfx = FNT[(chr<<4) | ((ra & 8) >> 3) | ((ra & 7) << 1)]; |
| 122 | |
| 123 | /* Display a scanline of a character (8 pixels) */ |
| 124 | *p = ( gfx & 0x80 ) ? 1 : 0; p++; |
| 125 | *p = ( gfx & 0x40 ) ? 1 : 0; p++; |
| 126 | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 127 | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 128 | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 129 | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 130 | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 131 | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 132 | } |
| 133 | } |
| 134 | ma+=32; |
| 135 | } |
| 136 | return 0; |
| 137 | } |
| 138 | |
| 139 | VIDEO_UPDATE( super80d ) |
| 140 | { |
| 141 | UINT8 y,ra,chr=32,gfx,screen_on=0; |
| 142 | UINT16 sy=0,ma=vidpg,x; |
| 143 | UINT8 *RAM = memory_region(screen->machine, "maincpu"); |
| 144 | |
| 145 | if ((super80_mhz == 1) || (!(input_port_read(screen->machine, "CONFIG") & 4))) /* bit 2 of port F0 is high, OR user turned on config switch */ |
| 146 | screen_on++; |
| 147 | |
| 148 | for (y = 0; y < 16; y++) |
| 149 | { |
| 150 | for (ra = 0; ra < 10; ra++) |
| 151 | { |
| 152 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 153 | |
| 154 | for (x = 0; x < 32; x++) |
| 155 | { |
| 156 | if (screen_on) |
| 157 | chr = RAM[ma | x]; |
| 158 | |
| 159 | /* get pattern of pixels for that character scanline */ |
| 160 | gfx = FNT[((chr & 0x7f)<<4) | ((ra & 8) >> 3) | ((ra & 7) << 1)] ^ ((chr & 0x80) ? 0xff : 0); |
| 161 | |
| 162 | /* Display a scanline of a character (8 pixels) */ |
| 163 | *p = ( gfx & 0x80 ) ? 1 : 0; p++; |
| 164 | *p = ( gfx & 0x40 ) ? 1 : 0; p++; |
| 165 | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 166 | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 167 | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 168 | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 169 | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 170 | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 171 | } |
| 172 | } |
| 173 | ma+=32; |
| 174 | } |
| 175 | return 0; |
| 176 | } |
| 177 | |
| 178 | VIDEO_UPDATE( super80e ) |
| 179 | { |
| 180 | UINT8 y,ra,chr=32,gfx,screen_on=0; |
| 181 | UINT16 sy=0,ma=vidpg,x; |
| 182 | UINT8 *RAM = memory_region(screen->machine, "maincpu"); |
| 183 | |
| 184 | if ((super80_mhz == 1) || (!(input_port_read(screen->machine, "CONFIG") & 4))) /* bit 2 of port F0 is high, OR user turned on config switch */ |
| 185 | screen_on++; |
| 186 | |
| 187 | for (y = 0; y < 16; y++) |
| 188 | { |
| 189 | for (ra = 0; ra < 10; ra++) |
| 190 | { |
| 191 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 192 | |
| 193 | for (x = 0; x < 32; x++) |
| 194 | { |
| 195 | if (screen_on) |
| 196 | chr = RAM[ma | x]; |
| 197 | |
| 198 | /* get pattern of pixels for that character scanline */ |
| 199 | gfx = FNT[(chr<<4) | ((ra & 8) >> 3) | ((ra & 7) << 1)]; |
| 200 | |
| 201 | /* Display a scanline of a character (8 pixels) */ |
| 202 | *p = ( gfx & 0x80 ) ? 1 : 0; p++; |
| 203 | *p = ( gfx & 0x40 ) ? 1 : 0; p++; |
| 204 | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 205 | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 206 | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 207 | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 208 | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 209 | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 210 | } |
| 211 | } |
| 212 | ma+=32; |
| 213 | } |
| 214 | return 0; |
| 215 | } |
| 216 | |
| 217 | VIDEO_UPDATE( super80m ) |
| 218 | { |
| 219 | UINT8 y,ra,chr=32,gfx,screen_on=0; |
| 220 | UINT16 sy=0,ma=vidpg,x; |
| 221 | UINT8 col, bg=0, fg=0, options=input_port_read(screen->machine, "CONFIG"); |
| 222 | UINT8 *RAM = memory_region(screen->machine, "maincpu"); |
| 223 | |
| 224 | /* get selected character generator */ |
| 225 | UINT8 cgen = current_charset ^ ((options & 0x10)>>4); /* bit 0 of port F1 and cgen config switch */ |
| 226 | |
| 227 | if ((super80_mhz == 1) || (!(options & 4))) /* bit 2 of port F0 is high, OR user turned on config switch */ |
| 228 | screen_on++; |
| 229 | |
| 230 | if (screen_on) |
| 231 | { |
| 232 | if ((options & 0x60) == 0x60) |
| 233 | fg = 15; /* b&w */ |
| 234 | else |
| 235 | fg = 5; /* green */ |
| 236 | } |
| 237 | |
| 238 | for (y = 0; y < 16; y++) |
| 239 | { |
| 240 | for (ra = 0; ra < 10; ra++) |
| 241 | { |
| 242 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 243 | |
| 244 | for (x = 0; x < 32; x++) |
| 245 | { |
| 246 | if (screen_on) |
| 247 | chr = RAM[ma | x]; |
| 248 | |
| 249 | if (!(options & 0x40)) |
| 250 | { |
| 251 | col = RAM[0xfe00 | ma | x]; /* byte of colour to display */ |
| 252 | fg = col & 0x0f; |
| 253 | bg = (col & 0xf0) >> 4; |
| 254 | } |
| 255 | |
| 256 | /* get pattern of pixels for that character scanline */ |
| 257 | if (cgen) |
| 258 | gfx = FNT[(chr<<4) | ((ra & 8) >> 3) | ((ra & 7) << 1)]; |
| 259 | else |
| 260 | gfx = FNT[0x1000 | ((chr & 0x7f)<<4) | ((ra & 8) >> 3) | ((ra & 7) << 1)] ^ ((chr & 0x80) ? 0xff : 0); |
| 261 | |
| 262 | /* Display a scanline of a character (8 pixels) */ |
| 263 | *p = ( gfx & 0x80 ) ? fg : bg; p++; |
| 264 | *p = ( gfx & 0x40 ) ? fg : bg; p++; |
| 265 | *p = ( gfx & 0x20 ) ? fg : bg; p++; |
| 266 | *p = ( gfx & 0x10 ) ? fg : bg; p++; |
| 267 | *p = ( gfx & 0x08 ) ? fg : bg; p++; |
| 268 | *p = ( gfx & 0x04 ) ? fg : bg; p++; |
| 269 | *p = ( gfx & 0x02 ) ? fg : bg; p++; |
| 270 | *p = ( gfx & 0x01 ) ? fg : bg; p++; |
| 271 | } |
| 272 | } |
| 273 | ma+=32; |
| 274 | } |
| 275 | return 0; |
| 276 | } |
| 277 | |
| 278 | VIDEO_START( super80 ) |
| 279 | { |
| 280 | FNT = memory_region(machine, "gfx1"); |
| 281 | } |
| 282 | |
| 283 | /*--------------------------------------------------------------- |
| 284 | |
| 285 | Super-80R and Super-80V |
| 286 | |
| 287 | ---------------------------------------------------------------*/ |
| 288 | |
| 289 | static UINT8 mc6845_cursor[16]; // cursor shape |
| 290 | static UINT8 mc6845_reg[20]; /* registers */ |
| 291 | static UINT8 mc6845_ind; /* register index */ |
| 292 | static const UINT8 mc6845_mask[]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0}; |
| 293 | static const device_config *mc6845; |
| 294 | static UINT8 framecnt=0; |
| 295 | static UINT8 speed,flash; |
| 296 | static UINT16 cursor; |
| 297 | |
| 102 | 298 | READ8_HANDLER( super80v_low_r ) |
| 103 | 299 | { |
| 104 | 300 | if (!super80v_vid_col) |
| r4926 | r4927 | |
| 192 | 388 | video_screen_set_visarea(machine->primary_screen, 0, width, 0, height); |
| 193 | 389 | } |
| 194 | 390 | |
| 195 | | VIDEO_EOF( super80m ) |
| 196 | | { |
| 197 | | /* if we chose another palette or colour mode, enable it */ |
| 198 | | UINT8 chosen_palette = (input_port_read(machine, "CONFIG") & 0x60)>>5; // read colour dipswitches |
| 199 | | |
| 200 | | if (chosen_palette != current_palette) // any changes? |
| 201 | | { |
| 202 | | current_palette = chosen_palette; // save new palette |
| 203 | | if (!current_palette) |
| 204 | | palette_set_colors_rgb(machine, super80_comp_palette); // composite colour |
| 205 | | else |
| 206 | | palette_set_colors_rgb(machine, super80_rgb_palette); // rgb and b&w |
| 207 | | } |
| 208 | | } |
| 209 | | |
| 210 | | VIDEO_UPDATE( super80 ) |
| 211 | | { |
| 212 | | UINT8 x, y, code=32, screen_on=0; |
| 213 | | UINT8 mask = screen->machine->gfx[0]->total_elements - 1; /* 0x3F for super80; 0xFF for super80d & super80e */ |
| 214 | | UINT8 *RAM = memory_region(screen->machine, "maincpu"); |
| 215 | | |
| 216 | | if ((super80_mhz == 1) || (!(input_port_read(screen->machine, "CONFIG") & 4))) /* bit 2 of port F0 is high, OR user turned on config switch */ |
| 217 | | screen_on++; |
| 218 | | |
| 219 | | /* display the picture */ |
| 220 | | for (y=0; y<16; y++) |
| 221 | | { |
| 222 | | for (x=0; x<32; x++) |
| 223 | | { |
| 224 | | if (screen_on) |
| 225 | | code = RAM[vidpg | x | (y<<5)]; /* get character to display */ |
| 226 | | |
| 227 | | drawgfx(bitmap, screen->machine->gfx[0], code & mask, 0, 0, 0, x*8, y*10, cliprect, TRANSPARENCY_NONE, 0); |
| 228 | | } |
| 229 | | } |
| 230 | | |
| 231 | | return 0; |
| 232 | | } |
| 233 | | |
| 234 | | VIDEO_UPDATE( super80m ) |
| 235 | | { |
| 236 | | UINT8 x, y, code=32, col=0, screen_on=0, options=input_port_read(screen->machine, "CONFIG"); |
| 237 | | UINT8 *RAM = memory_region(screen->machine, "maincpu"); |
| 238 | | |
| 239 | | /* get selected character generator */ |
| 240 | | UINT8 cgen = current_charset ^ ((options & 0x10)>>4); /* bit 0 of port F1 and cgen config switch */ |
| 241 | | |
| 242 | | if ((super80_mhz == 1) || (!(options & 4))) /* bit 2 of port F0 is high, OR user turned on config switch */ |
| 243 | | screen_on++; |
| 244 | | |
| 245 | | if (screen_on) |
| 246 | | { |
| 247 | | if ((options & 0x60) == 0x60) |
| 248 | | col = 15; /* b&w */ |
| 249 | | else |
| 250 | | col = 5; /* green */ |
| 251 | | } |
| 252 | | |
| 253 | | /* display the picture */ |
| 254 | | for (y=0; y<16; y++) |
| 255 | | { |
| 256 | | for (x=0; x<32; x++) |
| 257 | | { |
| 258 | | if (screen_on) |
| 259 | | { |
| 260 | | code = RAM[vidpg | x | (y<<5)]; /* get character to display */ |
| 261 | | |
| 262 | | if (!(options & 0x40)) col = RAM[0xfe00 | x | (y<<5)]; /* byte of colour to display */ |
| 263 | | } |
| 264 | | |
| 265 | | drawgfx(bitmap, screen->machine->gfx[cgen], code, col, 0, 0, x*8, y*10, cliprect, TRANSPARENCY_NONE, 0); |
| 266 | | } |
| 267 | | } |
| 268 | | |
| 269 | | return 0; |
| 270 | | } |
| 271 | | |
| 272 | | |
| 273 | 391 | VIDEO_START( super80v ) |
| 274 | 392 | { |
| 275 | 393 | mc6845 = devtag_get_device(machine, "crtc"); |
| 394 | FNT = memory_region(machine, "gfx1"); |
| 276 | 395 | } |
| 277 | 396 | |
| 278 | 397 | VIDEO_UPDATE( super80v ) |
| 279 | 398 | { |
| 280 | 399 | framecnt++; |
| 281 | | speed = mc6845_reg[10]&0x20, flash = mc6845_reg[10]&0x40; // cursor modes |
| 400 | speed = mc6845_reg[10]&0x20, flash = mc6845_reg[10]&0x40, bg=0; // cursor modes |
| 282 | 401 | cursor = (mc6845_reg[14]<<8) | mc6845_reg[15]; // get cursor position |
| 283 | 402 | options=input_port_read(screen->machine, "CONFIG"); |
| 284 | 403 | mc6845_update(mc6845, bitmap, cliprect); |
| r4926 | r4927 | |
| 297 | 416 | chr = videoram[mem]; |
| 298 | 417 | |
| 299 | 418 | /* get colour or b&w */ |
| 300 | | col = 5; /* green */ |
| 301 | | if ((options & 0x60) == 0x60) col = 15; /* b&w */ |
| 302 | | if (!(options & 0x40)) col = colorram[mem]; // read a byte of colour |
| 419 | fg = 5; /* green */ |
| 420 | if ((options & 0x60) == 0x60) fg = 15; /* b&w */ |
| 303 | 421 | |
| 422 | if (!(options & 0x40)) |
| 423 | { |
| 424 | col = colorram[mem]; /* byte of colour to display */ |
| 425 | fg = col & 0x0f; |
| 426 | bg = (col & 0xf0) >> 4; |
| 427 | } |
| 428 | |
| 304 | 429 | /* if inverse mode, replace any pcgram chrs with inverse chrs */ |
| 305 | 430 | if ((!super80v_rom_pcg) && (chr & 0x80)) // is it a high chr in inverse mode |
| 306 | 431 | { |
| r4926 | r4927 | |
| 317 | 442 | |
| 318 | 443 | /* get pattern of pixels for that character scanline */ |
| 319 | 444 | gfx = pcgram[(chr<<4) | ra] ^ inv; |
| 320 | | fg = ((col & 0x0f) << 1) + 1; |
| 321 | | bg = ((col & 0xf0) >> 3) + 1; |
| 322 | 445 | |
| 323 | 446 | /* Display a scanline of a character (7 pixels) */ |
| 324 | 447 | *p = ( gfx & 0x80 ) ? fg : bg; p++; |
| r4926 | r4927 | |
| 335 | 458 | |
| 336 | 459 | WRITE8_HANDLER( super80v_10_w ) |
| 337 | 460 | { |
| 338 | | if (data < 18) mc6845_ind = data; else mc6845_ind = 19; /* make sure if you try using an invalid register your write will go nowhere */ |
| 461 | data &= 0x1f; |
| 462 | mc6845_ind = data; |
| 339 | 463 | mc6845_address_w( mc6845, 0, data ); |
| 340 | 464 | } |
| 341 | 465 | |
src/mess/drivers/super80.c
| r4926 | r4927 | |
| 550 | 550 | PORT_CONFSETTING( 0x40, "Green") |
| 551 | 551 | INPUT_PORTS_END |
| 552 | 552 | |
| 553 | | /**************************** GRAPHICS DECODE *****************************************************************/ |
| 554 | 553 | |
| 555 | | static const gfx_layout super80_charlayout = |
| 556 | | { |
| 557 | | 8,10, /* 8 x 10 characters */ |
| 558 | | 64, /* 64 characters */ |
| 559 | | 1, /* 1 bits per pixel */ |
| 560 | | { 0 }, /* no bitplanes; 1 bit per pixel */ |
| 561 | | /* x offsets */ |
| 562 | | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 563 | | /* y offsets */ |
| 564 | | { 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8, |
| 565 | | 1*8, 3*8, 5*8, 7*8, 9*8, 11*8, 13*8, 15*8 }, |
| 566 | | 8*16 /* every char takes 16 bytes */ |
| 567 | | }; |
| 568 | | |
| 569 | | static const gfx_layout super80d_charlayout = |
| 570 | | { |
| 571 | | 8,10, /* 8 x 10 characters */ |
| 572 | | 256, /* 256 characters */ |
| 573 | | 1, /* 1 bits per pixel */ |
| 574 | | { 0 }, /* no bitplanes; 1 bit per pixel */ |
| 575 | | /* x offsets */ |
| 576 | | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 577 | | /* y offsets */ |
| 578 | | { 0*8, 2*8, 4*8, 6*8, 8*8, 10*8, 12*8, 14*8, |
| 579 | | 1*8, 3*8, 5*8, 7*8, 9*8, 11*8, 13*8, 15*8 }, |
| 580 | | 8*16 /* every char takes 16 bytes */ |
| 581 | | }; |
| 582 | | |
| 583 | | /* for documentation only - not needed by video update */ |
| 584 | | static const gfx_layout super80v_charlayout = |
| 585 | | { |
| 586 | | 8,16, /* 8 x 16 characters */ |
| 587 | | 257, /* 256 characters + cursor character */ |
| 588 | | 1, /* 1 bits per pixel */ |
| 589 | | { 0 }, /* no bitplanes; 1 bit per pixel */ |
| 590 | | /* x offsets */ |
| 591 | | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 592 | | /* y offsets triple height: use each line three times */ |
| 593 | | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, |
| 594 | | 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, |
| 595 | | 8*16 /* every char takes 16 bytes */ |
| 596 | | }; |
| 597 | | |
| 598 | | static GFXDECODE_START( super80 ) |
| 599 | | GFXDECODE_ENTRY( "gfx1", 0x0000, super80_charlayout, 0, 1 ) |
| 600 | | GFXDECODE_END |
| 601 | | |
| 602 | | static GFXDECODE_START( super80d ) |
| 603 | | GFXDECODE_ENTRY( "gfx1", 0x0000, super80d_charlayout, 0, 1 ) |
| 604 | | GFXDECODE_END |
| 605 | | |
| 606 | | static GFXDECODE_START( super80m ) |
| 607 | | GFXDECODE_ENTRY( "gfx1", 0x0000, super80d_charlayout, 0, 256 ) |
| 608 | | GFXDECODE_ENTRY( "gfx2", 0x0000, super80d_charlayout, 0, 256 ) |
| 609 | | GFXDECODE_END |
| 610 | | |
| 611 | | static GFXDECODE_START( super80v ) |
| 612 | | GFXDECODE_ENTRY( "maincpu", 0xf000, super80v_charlayout, 0, 256 ) |
| 613 | | GFXDECODE_END |
| 614 | | |
| 615 | 554 | /**************************** BASIC MACHINE CONSTRUCTION ***********************************************************/ |
| 616 | 555 | |
| 617 | 556 | static TIMER_CALLBACK( super80_halfspeed ) |
| r4926 | r4927 | |
| 705 | 644 | |
| 706 | 645 | MDRV_Z80PIO_ADD( "z80pio", super80_pio_intf ) |
| 707 | 646 | |
| 708 | | MDRV_GFXDECODE(super80) |
| 709 | 647 | MDRV_SCREEN_ADD("screen", RASTER) |
| 710 | 648 | MDRV_SCREEN_REFRESH_RATE(48.8) |
| 711 | 649 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| r4926 | r4927 | |
| 713 | 651 | MDRV_PALETTE_LENGTH(2) |
| 714 | 652 | MDRV_PALETTE_INIT(black_and_white) |
| 715 | 653 | |
| 654 | MDRV_VIDEO_START(super80) |
| 716 | 655 | MDRV_VIDEO_UPDATE(super80) |
| 717 | 656 | |
| 718 | 657 | /* sound hardware */ |
| r4926 | r4927 | |
| 737 | 676 | |
| 738 | 677 | static MACHINE_DRIVER_START( super80d ) |
| 739 | 678 | MDRV_IMPORT_FROM(super80) |
| 740 | | MDRV_GFXDECODE(super80d) |
| 679 | MDRV_VIDEO_UPDATE(super80d) |
| 741 | 680 | MACHINE_DRIVER_END |
| 742 | 681 | |
| 682 | static MACHINE_DRIVER_START( super80e ) |
| 683 | MDRV_IMPORT_FROM(super80) |
| 684 | MDRV_VIDEO_UPDATE(super80e) |
| 685 | MACHINE_DRIVER_END |
| 686 | |
| 743 | 687 | static MACHINE_DRIVER_START( super80m ) |
| 744 | 688 | MDRV_IMPORT_FROM(super80) |
| 745 | 689 | MDRV_CPU_MODIFY("maincpu") |
| 746 | 690 | MDRV_CPU_PROGRAM_MAP(super80m_map) |
| 747 | 691 | |
| 748 | | MDRV_GFXDECODE(super80m) |
| 749 | | MDRV_PALETTE_LENGTH(256*2) |
| 692 | MDRV_PALETTE_LENGTH(16) |
| 750 | 693 | MDRV_PALETTE_INIT(super80m) |
| 751 | 694 | MDRV_VIDEO_EOF(super80m) |
| 752 | 695 | MDRV_VIDEO_UPDATE(super80m) |
| r4926 | r4927 | |
| 763 | 706 | |
| 764 | 707 | MDRV_Z80PIO_ADD( "z80pio", super80_pio_intf ) |
| 765 | 708 | |
| 766 | | MDRV_GFXDECODE(super80v) |
| 767 | 709 | MDRV_SCREEN_ADD("screen", RASTER) |
| 768 | 710 | MDRV_SCREEN_REFRESH_RATE(50) |
| 769 | 711 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 770 | 712 | MDRV_SCREEN_SIZE(SUPER80V_SCREEN_WIDTH, SUPER80V_SCREEN_HEIGHT) |
| 771 | 713 | MDRV_SCREEN_VISIBLE_AREA(0, SUPER80V_SCREEN_WIDTH-1, 0, SUPER80V_SCREEN_HEIGHT-1) |
| 772 | | MDRV_PALETTE_LENGTH(256*2) |
| 714 | MDRV_PALETTE_LENGTH(16) |
| 773 | 715 | MDRV_PALETTE_INIT(super80m) |
| 774 | 716 | |
| 775 | 717 | MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / SUPER80V_DOTS, super80v_crtc) |
| r4926 | r4927 | |
| 817 | 759 | driver_init_common(machine); |
| 818 | 760 | } |
| 819 | 761 | |
| 820 | | static DRIVER_INIT( super80d ) |
| 821 | | { |
| 822 | | UINT8 *RAM = memory_region(machine, "gfx1"); |
| 823 | | UINT16 i; /* create inverse characters */ |
| 824 | | for (i = 0x0800; i < 0x1000; i++) RAM[i] = ~RAM[i]; |
| 825 | | DRIVER_INIT_CALL( super80 ); |
| 826 | | } |
| 827 | | |
| 828 | 762 | static DRIVER_INIT( super80v ) |
| 829 | 763 | { |
| 830 | 764 | pcgram = memory_region(machine, "maincpu")+0xf000; |
| r4926 | r4927 | |
| 843 | 777 | ROM_LOAD("super80.u42", 0xe000, 0x1000, CRC(a1c6cb75) SHA1(d644ca3b399c1a8902f365c6095e0bbdcea6733b) ) |
| 844 | 778 | ROM_FILL( 0xf000, 0x1000, 0xff) /* This makes the screen show the FF character when O F1 F0 entered */ |
| 845 | 779 | |
| 846 | | ROM_REGION(0x0400, "gfx1", ROMREGION_DISPOSE) |
| 780 | ROM_REGION(0x0400, "gfx1", 0) // 2513 prom |
| 847 | 781 | ROM_LOAD("super80.u27", 0x0000, 0x0400, CRC(d1e4b3c6) SHA1(3667b97c6136da4761937958f281609690af4081) ) |
| 848 | 782 | ROM_END |
| 849 | 783 | |
| r4926 | r4927 | |
| 859 | 793 | ROM_LOAD("super80.u42", 0xe000, 0x1000, CRC(a1c6cb75) SHA1(d644ca3b399c1a8902f365c6095e0bbdcea6733b) ) |
| 860 | 794 | ROM_FILL( 0xf000, 0x1000, 0xff) |
| 861 | 795 | |
| 862 | | ROM_REGION(0x1000, "gfx1", ROMREGION_DISPOSE) |
| 796 | ROM_REGION(0x0800, "gfx1", 0) // 2716 eprom |
| 863 | 797 | ROM_LOAD("super80d.u27", 0x0000, 0x0800, CRC(cb4c81e2) SHA1(8096f21c914fa76df5d23f74b1f7f83bd8645783) ) |
| 864 | | ROM_RELOAD( 0x0800, 0x0800 ) |
| 865 | 798 | ROM_END |
| 866 | 799 | |
| 867 | 800 | ROM_START( super80e ) |
| r4926 | r4927 | |
| 871 | 804 | ROM_LOAD("super80.u42", 0xe000, 0x1000, CRC(a1c6cb75) SHA1(d644ca3b399c1a8902f365c6095e0bbdcea6733b) ) |
| 872 | 805 | ROM_FILL( 0xf000, 0x1000, 0xff) |
| 873 | 806 | |
| 874 | | ROM_REGION(0x1000, "gfx1", ROMREGION_DISPOSE) |
| 807 | ROM_REGION(0x1000, "gfx1", 0) // 2732 eprom |
| 875 | 808 | ROM_LOAD("super80e.u27", 0x0000, 0x1000, CRC(ebe763a7) SHA1(ffaa6d6a2c5dacc5a6651514e6707175a32e83e8) ) |
| 876 | 809 | ROM_END |
| 877 | 810 | |
| r4926 | r4927 | |
| 880 | 813 | ROM_LOAD("s80-8r0.u26", 0xc000, 0x1000, CRC(48d410d8) SHA1(750d984abc013a3344628300288f6d1ba140a95f) ) |
| 881 | 814 | ROM_LOAD("s80-8r0.u33", 0xd000, 0x1000, CRC(9765793e) SHA1(4951b127888c1f3153004cc9fb386099b408f52c) ) |
| 882 | 815 | ROM_LOAD("s80-8r0.u42", 0xe000, 0x1000, CRC(5f65d94b) SHA1(fe26b54dec14e1c4911d996c9ebd084a38dcb691) ) |
| 883 | | |
| 884 | | ROM_REGION(0x1000, "gfx1", ROMREGION_DISPOSE) |
| 885 | | ROM_LOAD("super80d.u27", 0x0000, 0x0800, CRC(cb4c81e2) SHA1(8096f21c914fa76df5d23f74b1f7f83bd8645783) ) |
| 886 | | ROM_RELOAD( 0x0800, 0x0800 ) |
| 887 | | |
| 888 | | ROM_REGION(0x1000, "gfx2", ROMREGION_DISPOSE) |
| 816 | #if 0 |
| 817 | /* Temporary patch to fix crash when lprinting a tab */ |
| 818 | ROM_FILL(0xcc44,1,0x46) |
| 819 | ROM_FILL(0xcc45,1,0xc5) |
| 820 | ROM_FILL(0xcc46,1,0x06) |
| 821 | ROM_FILL(0xcc47,1,0x20) |
| 822 | ROM_FILL(0xcc48,1,0xcd) |
| 823 | ROM_FILL(0xcc49,1,0xc7) |
| 824 | ROM_FILL(0xcc4a,1,0xcb) |
| 825 | ROM_FILL(0xcc4b,1,0xc1) |
| 826 | ROM_FILL(0xcc4c,1,0x10) |
| 827 | ROM_FILL(0xcc4d,1,0xf7) |
| 828 | ROM_FILL(0xcc4e,1,0x00) |
| 829 | ROM_FILL(0xcc4f,1,0x00) |
| 830 | #endif |
| 831 | ROM_REGION(0x1800, "gfx1", 0) |
| 889 | 832 | ROM_LOAD("super80e.u27", 0x0000, 0x1000, CRC(ebe763a7) SHA1(ffaa6d6a2c5dacc5a6651514e6707175a32e83e8) ) |
| 833 | ROM_LOAD("super80d.u27", 0x1000, 0x0800, CRC(cb4c81e2) SHA1(8096f21c914fa76df5d23f74b1f7f83bd8645783) ) |
| 890 | 834 | ROM_END |
| 891 | 835 | |
| 892 | 836 | ROM_START( super80r ) |
| r4926 | r4927 | |
| 911 | 855 | |
| 912 | 856 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 913 | 857 | COMP( 1981, super80, 0, 0, super80, super80, super80, 0, "Dick Smith Electronics","Super-80 (V1.2)" , 0) |
| 914 | | COMP( 1981, super80d, super80, 0, super80d, super80d, super80d, 0, "Dick Smith Electronics","Super-80 (V2.2)" , 0) |
| 915 | | COMP( 1981, super80e, super80, 0, super80d, super80d, super80, 0, "Dick Smith Electronics","Super-80 (El Graphix 4)" , 0) |
| 916 | | COMP( 1981, super80m, super80, 0, super80m, super80m, super80d, 0, "Dick Smith Electronics","Super-80 (8R0)" , 0) |
| 858 | COMP( 1981, super80d, super80, 0, super80d, super80d, super80, 0, "Dick Smith Electronics","Super-80 (V2.2)" , 0) |
| 859 | COMP( 1981, super80e, super80, 0, super80e, super80d, super80, 0, "Dick Smith Electronics","Super-80 (El Graphix 4)" , 0) |
| 860 | COMP( 1981, super80m, super80, 0, super80m, super80m, super80, 0, "Dick Smith Electronics","Super-80 (8R0)" , 0) |
| 917 | 861 | COMP( 1981, super80r, super80, 0, super80r, super80r, super80v, 0, "Dick Smith Electronics","Super-80 (with VDUEB)" , 0) |
| 918 | 862 | COMP( 1981, super80v, super80, 0, super80v, super80v, super80v, 0, "Dick Smith Electronics","Super-80 (with enhanced VDUEB)" , 0) |