src/mess/drivers/x1.c
| r5508 | r5509 | |
| 9 | 9 | - Hook-up image formats; |
| 10 | 10 | - Video part is bare minimum, chances are that's probably a tilemap/bitmap nightmare; |
| 11 | 11 | - Sort out / redump the gfx roms; |
| 12 | - Fix the interrupts (uses IM 2) |
| 12 | 13 | |
| 13 | 14 | per-game specific TODO: |
| 14 | | - 177 / Dragon Buster: check why it does a tight loop (patching it makes the game go further) |
| 15 | - 177 / Dragon Buster: fix the keyboard flags otherwise these doesn't boot |
| 15 | 16 | - Dragon Buster: uses PCG + sets bitmap in a weird way; |
| 16 | 17 | - Shanghai: tests the ay8910 read regs, mouse/joystick perhaps? |
| 17 | 18 | - Gaia: Hits a FDC drive assert; |
| r5508 | r5509 | |
| 120 | 121 | |
| 121 | 122 | #include "driver.h" |
| 122 | 123 | #include "cpu/z80/z80.h" |
| 124 | #include "machine/z80ctc.h" |
| 123 | 125 | #include "machine/8255ppi.h" |
| 124 | 126 | #include "sound/ay8910.h" |
| 125 | 127 | #include "video/mc6845.h" |
| r5508 | r5509 | |
| 137 | 139 | { |
| 138 | 140 | int y,x,w; |
| 139 | 141 | |
| 140 | | w = (hres_320 & 0x40) ? 1 : 2; |
| 142 | w = (video_screen_get_width(screen) < 640) ? 1 : 2; |
| 141 | 143 | |
| 142 | 144 | bitmap_fill(bitmap, cliprect, 0); |
| 143 | 145 | |
| r5508 | r5509 | |
| 146 | 148 | int pen_r,pen_g,pen_b,color; |
| 147 | 149 | |
| 148 | 150 | count = 0; |
| 151 | |
| 149 | 152 | for(yi=0;yi<8;yi++) |
| 150 | 153 | { |
| 151 | 154 | for(y=0;y<200;y+=8) |
| 152 | 155 | { |
| 153 | | for(x=0;x<640;x+=8) |
| 156 | for(x=0;x<(320*w);x+=8) |
| 154 | 157 | { |
| 155 | 158 | for(xi=0;xi<8;xi++) |
| 156 | 159 | { |
| r5508 | r5509 | |
| 161 | 164 | color = pen_r<<2 | pen_g<<1 | pen_b<<0; |
| 162 | 165 | |
| 163 | 166 | if((x+xi)<=video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y) |
| 164 | | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = screen->machine->pens[color+0x80]; |
| 167 | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = screen->machine->pens[color+0x100]; |
| 165 | 168 | |
| 166 | 169 | } |
| 167 | 170 | count++; |
| 168 | 171 | } |
| 169 | 172 | } |
| 170 | | count+=48; |
| 173 | count+= (w == 2) ? 48 : 24; |
| 171 | 174 | } |
| 172 | 175 | } |
| 173 | 176 | |
| r5508 | r5509 | |
| 176 | 179 | for (x=0;x<40*w;x++) |
| 177 | 180 | { |
| 178 | 181 | int tile = videoram[x+(y*40*w)]; |
| 179 | | int color = colorram[x+(y*40*w)] & 0x3f; |
| 182 | int color = colorram[x+(y*40*w)] & 0x1f; |
| 180 | 183 | int width = (colorram[x+(y*40*w)] & 0x80)>>7; |
| 184 | int bank = (colorram[x+(y*40*w)] & 0x20)>>4; |
| 181 | 185 | |
| 182 | 186 | if(tile == 0) continue; //<- correct? |
| 183 | 187 | |
| 184 | 188 | if(color & 0x38) |
| 185 | | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[width],tile,color,0,0,(x/(width+1))*8*(width+1),y*8); |
| 189 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[width+bank],tile,color,0,0,(x/(width+1))*8*(width+1),y*8); |
| 186 | 190 | else |
| 187 | | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[width],tile,color,0,0,(x/(width+1))*8*(width+1),y*8,0); |
| 191 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[width+bank],tile,color,0,0,(x/(width+1))*8*(width+1),y*8,0); |
| 188 | 192 | } |
| 189 | 193 | } |
| 190 | 194 | |
| r5508 | r5509 | |
| 193 | 197 | |
| 194 | 198 | |
| 195 | 199 | |
| 196 | | static UINT8 sub_cmd,sub_val; |
| 200 | static UINT8 sub_cmd,sub_val,key_flag; |
| 197 | 201 | |
| 198 | 202 | /* |
| 199 | 203 | Keyboard MCU simulation |
| 200 | 204 | */ |
| 201 | 205 | |
| 206 | static UINT8 check_keyboard_press(running_machine *machine) |
| 207 | { |
| 208 | const char* portnames[3] = { "key1","key2","key3" }; |
| 209 | int i,port_i,scancode; |
| 210 | |
| 211 | scancode = 0; |
| 212 | |
| 213 | for(port_i=0;port_i<3;port_i++) |
| 214 | { |
| 215 | for(i=0;i<32;i++) |
| 216 | { |
| 217 | if((input_port_read(machine,portnames[port_i])>>i) & 1) |
| 218 | { |
| 219 | key_flag = 1; |
| 220 | return scancode; |
| 221 | } |
| 222 | |
| 223 | scancode++; |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | return 0; |
| 228 | } |
| 229 | |
| 202 | 230 | static READ8_HANDLER( sub_io_r ) |
| 203 | 231 | { |
| 204 | | //printf("R\n"); |
| 232 | if(key_flag == 1) |
| 233 | { |
| 234 | key_flag = 0; |
| 235 | return 0x82; |
| 236 | } |
| 237 | |
| 205 | 238 | return sub_val; |
| 206 | 239 | } |
| 207 | 240 | |
| 208 | 241 | static WRITE8_HANDLER( sub_io_w ) |
| 209 | 242 | { |
| 210 | | static UINT32 test; |
| 211 | | |
| 212 | 243 | /* TODO: check sub-routine at $10e */ |
| 213 | 244 | /* $17a -> floppy? */ |
| 214 | 245 | /* $094 -> ROM */ |
| 215 | 246 | /* $0c0 -> timer*/ |
| 216 | 247 | /* $052 -> cmt */ |
| 217 | 248 | /* $0f5 -> reload sub-routine? */ |
| 218 | | test = input_code_pressed(KEYCODE_C) ? 0x02 : 0x00; //temp kludge |
| 219 | 249 | |
| 220 | 250 | switch(data) |
| 221 | 251 | { |
| 222 | | case 0xe6: sub_val = 0; break; //RTC timer? |
| 252 | case 0xe6: |
| 253 | sub_val = check_keyboard_press(space->machine); |
| 254 | break; |
| 223 | 255 | case 0xe8: sub_val = sub_cmd; break; |
| 224 | | case 0xeb: sub_val = test; break; //used on device select |
| 256 | //case 0xeb: sub_val = test; break; //used on device select |
| 225 | 257 | //case 0xed: sub_val = test; break; |
| 226 | 258 | //case 0xef: sub_val = test; break; //used on timer select? |
| 227 | 259 | #if 0 |
| r5508 | r5509 | |
| 232 | 264 | } |
| 233 | 265 | #endif |
| 234 | 266 | } |
| 267 | |
| 235 | 268 | sub_cmd = data; |
| 236 | 269 | } |
| 237 | 270 | |
| r5508 | r5509 | |
| 378 | 411 | |
| 379 | 412 | for(addr=0;addr<8;addr++) |
| 380 | 413 | { |
| 381 | | r = ((x_r)>>(7-addr)) & 1; |
| 382 | | g = ((x_g)>>(7-addr)) & 1; |
| 383 | | b = ((x_b)>>(7-addr)) & 1; |
| 414 | r = ((x_r)>>(addr)) & 1; |
| 415 | g = ((x_g)>>(addr)) & 1; |
| 416 | b = ((x_b)>>(addr)) & 1; |
| 384 | 417 | |
| 385 | 418 | palette_set_color_rgb(machine, addr+0x100, pal1bit(r), pal1bit(g), pal1bit(b)); |
| 386 | 419 | } |
| r5508 | r5509 | |
| 390 | 423 | static WRITE8_HANDLER( x1_pal_g_w ) { x_g = data; set_current_palette(space->machine); } |
| 391 | 424 | static WRITE8_HANDLER( x1_pal_b_w ) { x_b = data; set_current_palette(space->machine); } |
| 392 | 425 | |
| 426 | static WRITE8_HANDLER( x1_dma_w ) |
| 427 | { |
| 428 | if(data) |
| 429 | fatalerror("Data written to the DMA space"); |
| 430 | } |
| 393 | 431 | |
| 432 | static WRITE8_HANDLER( x1_pcg_w ) |
| 433 | { |
| 434 | int addr,pcg_offset; |
| 435 | static int pcg_index[3]; |
| 436 | UINT8 *PCG_RAM = memory_region(space->machine, "pcg"); |
| 437 | |
| 438 | addr = (offset & 0x300) >> 8; |
| 439 | |
| 440 | if(addr == 0) |
| 441 | { |
| 442 | /* maybe data actually? */ |
| 443 | pcg_index[0] = 0; |
| 444 | pcg_index[1] = 0; |
| 445 | pcg_index[2] = 0; |
| 446 | } |
| 447 | else |
| 448 | { |
| 449 | pcg_offset = ((pcg_index[addr-1]*8)+(offset & 7)) & 0x7ff; |
| 450 | pcg_offset+=((addr-1)*0x800); |
| 451 | PCG_RAM[pcg_offset] = data; |
| 452 | |
| 453 | pcg_offset &= 0x7ff; |
| 454 | |
| 455 | gfx_element_mark_dirty(space->machine->gfx[2], pcg_offset >> 3); |
| 456 | |
| 457 | if((offset & 7) == 7) |
| 458 | pcg_index[addr-1]++; |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | |
| 394 | 463 | static ADDRESS_MAP_START( x1_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| 395 | 464 | ADDRESS_MAP_UNMAP_HIGH |
| 396 | 465 | AM_RANGE(0x0000, 0x7fff) AM_ROMBANK(1) AM_WRITE(rom_data_w) |
| r5508 | r5509 | |
| 400 | 469 | static ADDRESS_MAP_START( x1_io , ADDRESS_SPACE_IO, 8 ) |
| 401 | 470 | ADDRESS_MAP_UNMAP_HIGH |
| 402 | 471 | // AM_RANGE(0x0700, 0x0701) AM_WRITENOP //YM-2151 reg/data |
| 403 | | // AM_RANGE(0x0704, 0x0707) AM_NOP //ctc regs |
| 472 | AM_RANGE(0x0704, 0x0707) AM_DEVREADWRITE("ctc", z80ctc_r, z80ctc_w) |
| 404 | 473 | // 0x0c00 rs232c port |
| 405 | 474 | AM_RANGE(0x0e00, 0x0e02) AM_WRITE(x1_rom_w) |
| 406 | 475 | AM_RANGE(0x0e03, 0x0e03) AM_READ(x1_rom_r) |
| 407 | 476 | // AM_RANGE(0x0e80, 0x0e82) AM_WRITENOP //kanji registers? |
| 408 | 477 | AM_RANGE(0x0ff8, 0x0fff) AM_READWRITE(x1_fdc_r,x1_fdc_w) //fdc registers |
| 409 | 478 | AM_RANGE(0x1000, 0x10ff) AM_WRITE(x1_pal_b_w) //paletteram |
| 410 | | AM_RANGE(0x1100, 0x11ff) AM_WRITE(x1_pal_r_w) //paletteram |
| 411 | | AM_RANGE(0x1200, 0x12ff) AM_WRITE(x1_pal_g_w) //paletteram |
| 479 | AM_RANGE(0x1100, 0x11ff) AM_WRITE(x1_pal_g_w) //paletteram |
| 480 | AM_RANGE(0x1200, 0x12ff) AM_WRITE(x1_pal_r_w) //paletteram |
| 412 | 481 | // AM_RANGE(0x1300, 0x13ff) AM_WRITENOP //ply port, mirrored |
| 413 | | // AM_RANGE(0x1400, 0x17ff) AM_RAM //PCG = Programmable Character Generator |
| 482 | AM_RANGE(0x1400, 0x17ff) AM_WRITE(x1_pcg_w) //PCG = Programmable Character Generator |
| 414 | 483 | AM_RANGE(0x1800, 0x1800) AM_DEVWRITE("crtc", mc6845_address_w) |
| 415 | 484 | AM_RANGE(0x1801, 0x1801) AM_DEVWRITE("crtc", mc6845_register_w) |
| 416 | 485 | AM_RANGE(0x1900, 0x19ff) AM_READWRITE(sub_io_r,sub_io_w) //sub port comms, mirrored |
| 417 | 486 | AM_RANGE(0x1a00, 0x1a03) AM_MIRROR(0xfc) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w) //8255, mirrored |
| 418 | | // AM_RANGE(0x1b00, 0x1bff) AM_DEVREADWRITE("ay", ay8910_r, ay8910_data_w) //PSG / ay-3-8910 data port |
| 419 | | AM_RANGE(0x1b00, 0x1bff) AM_DEVWRITE("ay", ay8910_data_w) //PSG / ay-3-8910 data port |
| 487 | AM_RANGE(0x1b00, 0x1bff) AM_DEVREADWRITE("ay", ay8910_r, ay8910_data_w) //PSG / ay-3-8910 data port |
| 488 | // AM_RANGE(0x1b00, 0x1bff) AM_DEVWRITE("ay", ay8910_data_w) //PSG / ay-3-8910 data port |
| 420 | 489 | AM_RANGE(0x1c00, 0x1cff) AM_DEVWRITE("ay", ay8910_address_w) //PSG / ay-3-8910 reg port |
| 421 | | AM_RANGE(0x1d00, 0x1dff) AM_WRITE(rom_bank_1_w) //ROM bankswitch = 1 |
| 422 | | AM_RANGE(0x1e00, 0x1eff) AM_WRITE(rom_bank_0_w) //ROM bankswitch = 0 |
| 423 | | // AM_RANGE(0x1f80, 0x1f8f) AM_WRITENOP //dma |
| 490 | AM_RANGE(0x1d00, 0x1dff) AM_READNOP AM_WRITE(rom_bank_1_w) //ROM/RAM bankswitch = ROM |
| 491 | AM_RANGE(0x1e00, 0x1eff) AM_WRITE(rom_bank_0_w) //ROM/RAM bankswitch = RAM |
| 492 | AM_RANGE(0x1f80, 0x1f8f) AM_WRITE(x1_dma_w) //dma |
| 424 | 493 | // AM_RANGE(0x1f90, 0x1f93) AM_NOP //sio |
| 425 | | // AM_RANGE(0x1fa0, 0x1fa3) AM_NOP //ctc regs |
| 426 | | // AM_RANGE(0x1fa8, 0x1fab) AM_NOP //ctc regs |
| 494 | AM_RANGE(0x1fa0, 0x1fa3) AM_DEVREADWRITE("ctc", z80ctc_r, z80ctc_w) |
| 495 | AM_RANGE(0x1fa8, 0x1fab) AM_DEVREADWRITE("ctc", z80ctc_r, z80ctc_w) |
| 427 | 496 | // AM_RANGE(0x1fd0, 0x1fdf) AM_RAM //scrn? |
| 428 | 497 | AM_RANGE(0x2000, 0x2fff) AM_RAM AM_BASE(&colorram)//txt mode RAM |
| 429 | 498 | AM_RANGE(0x3000, 0x3fff) AM_RAM AM_BASE(&videoram)//txt mode RAM |
| 430 | | AM_RANGE(0x4000, 0xffff) AM_RAM AM_BASE(&gfx_bitmap_ram)//gfx mode bank b/r/g RAM |
| 499 | AM_RANGE(0x4000, 0xffff) AM_RAM AM_BASE(&gfx_bitmap_ram)//gfx mode bank b/g/r RAM |
| 431 | 500 | ADDRESS_MAP_END |
| 432 | 501 | |
| 433 | 502 | static const gfx_layout x1_chars_8x8 = |
| r5508 | r5509 | |
| 463 | 532 | 16*16 |
| 464 | 533 | }; |
| 465 | 534 | |
| 535 | static const gfx_layout x1_pcg_8x8 = |
| 536 | { |
| 537 | 8,8, |
| 538 | RGN_FRAC(1,3), |
| 539 | 3, |
| 540 | { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) }, |
| 541 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 542 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 543 | 8*8 |
| 544 | }; |
| 545 | |
| 466 | 546 | /* TODO: separe the different x1 decodings accordingly */ |
| 467 | 547 | static GFXDECODE_START( x1 ) |
| 468 | 548 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8, 0, 0x40 ) |
| 469 | 549 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8wx8, 0, 0x40 ) |
| 550 | GFXDECODE_ENTRY( "pcg", 0x00000, x1_pcg_8x8, 0x80, 1 ) |
| 470 | 551 | GFXDECODE_ENTRY( "cgrom", 0x01800, x1_chars_16x16, 0, 0x40 ) //only x1turboz uses this so far |
| 471 | 552 | GFXDECODE_ENTRY( "kanji", 0x27000, x1_chars_16x16, 0, 0x40 ) //needs to be checked when the ROM will be redumped |
| 472 | 553 | GFXDECODE_END |
| r5508 | r5509 | |
| 484 | 565 | palette_set_color_rgb(machine, 2*i+0, pal1bit(i >> 5), pal1bit(i >> 4), pal1bit(i >> 3)); |
| 485 | 566 | } |
| 486 | 567 | |
| 487 | | //bitmap mode,TODO |
| 568 | /* TODO: fix this */ |
| 488 | 569 | for(i=0;i<8;i++) |
| 489 | | palette_set_color_rgb(machine, 0x80+i, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0)); |
| 570 | palette_set_color_rgb(machine, i+0x80, pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0)); |
| 490 | 571 | } |
| 491 | 572 | |
| 492 | 573 | static READ8_DEVICE_HANDLER( x1_porta_r ) |
| r5508 | r5509 | |
| 618 | 699 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 619 | 700 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 620 | 701 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 702 | |
| 703 | /* TODO: check if the other inputs are actually used (including button 2)... */ |
| 704 | PORT_START("P1") |
| 705 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 706 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 707 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 708 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 709 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 710 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 711 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 712 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 713 | |
| 714 | PORT_START("P2") |
| 715 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 716 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 717 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 718 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 719 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 720 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 721 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 722 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 723 | |
| 724 | PORT_START("key1") //0x00-0x1f |
| 725 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_UNUSED) //0x00 null |
| 726 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_UNUSED) //0x01 soh |
| 727 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_UNUSED) //0x02 stx |
| 728 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_UNUSED) //0x03 etx |
| 729 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_UNUSED) //0x04 etx |
| 730 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_UNUSED) //0x05 eot |
| 731 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_UNUSED) //0x06 enq |
| 732 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_UNUSED) //0x07 ack |
| 733 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_UNUSED) //0x08 bel |
| 734 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 735 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) |
| 736 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0b lf |
| 737 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0c vt |
| 738 | PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0d ff |
| 739 | PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0e cr |
| 740 | PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x0f so |
| 741 | |
| 742 | PORT_BIT(0x00010000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x10 si |
| 743 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x11 dle |
| 744 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x12 dc1 |
| 745 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x13 dc2 |
| 746 | PORT_BIT(0x00100000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x14 dc3 |
| 747 | PORT_BIT(0x00200000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x15 dc4 |
| 748 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x16 nak |
| 749 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x17 syn |
| 750 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x18 etb |
| 751 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x19 cancel |
| 752 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x1a em |
| 753 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x1b sub |
| 754 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_TILDE) PORT_CHAR(27) |
| 755 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x1d fs |
| 756 | PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x1e gs |
| 757 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x1f us |
| 758 | |
| 759 | PORT_START("key2") //0x20-0x3f |
| 760 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 761 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_UNUSED) //0x21 ! |
| 762 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_UNUSED) //0x22 " |
| 763 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_UNUSED) //0x23 # |
| 764 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_UNUSED) //0x24 $ |
| 765 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_UNUSED) //0x25 % |
| 766 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_UNUSED) //0x26 & |
| 767 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_UNUSED) //0x27 ' |
| 768 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_UNUSED) //0x28 ( |
| 769 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_UNUSED) //0x29 ) |
| 770 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2a * |
| 771 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2b + |
| 772 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2c , |
| 773 | PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') |
| 774 | PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2e . |
| 775 | PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2f / |
| 776 | |
| 777 | PORT_BIT(0x00010000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 778 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 779 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 780 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 781 | PORT_BIT(0x00100000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 782 | PORT_BIT(0x00200000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 783 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 784 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 785 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 786 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 787 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(":") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') |
| 788 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') |
| 789 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x3c < |
| 790 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x3d = |
| 791 | PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x3e > |
| 792 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x3f ? |
| 793 | |
| 794 | PORT_START("key3") //0x40-0x5f |
| 795 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("@") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') |
| 796 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 797 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 798 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 799 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 800 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 801 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 802 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 803 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 804 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 805 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 806 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 807 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 808 | PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 809 | PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 810 | PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 811 | PORT_BIT(0x00010000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 812 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 813 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 814 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 815 | PORT_BIT(0x00100000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 816 | PORT_BIT(0x00200000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 817 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 818 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 819 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 820 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 821 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 822 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("[") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') |
| 823 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_UNUSED) |
| 824 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') |
| 825 | PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("^") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') |
| 826 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("_") |
| 827 | |
| 828 | #if 0 |
| 829 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(27) |
| 830 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') |
| 831 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') |
| 832 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') |
| 833 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey *") PORT_CODE(KEYCODE_ASTERISK) |
| 834 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey /") PORT_CODE(KEYCODE_SLASH_PAD) |
| 835 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey +") PORT_CODE(KEYCODE_PLUS_PAD) |
| 836 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey -") PORT_CODE(KEYCODE_MINUS_PAD) |
| 837 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 7") PORT_CODE(KEYCODE_7_PAD) |
| 838 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 8") PORT_CODE(KEYCODE_8_PAD) |
| 839 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 9") PORT_CODE(KEYCODE_9_PAD) |
| 840 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey =") |
| 841 | PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 4") PORT_CODE(KEYCODE_4_PAD) |
| 842 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 5") PORT_CODE(KEYCODE_5_PAD) |
| 843 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xEF\xBF\xA5") |
| 844 | |
| 845 | PORT_START("key3") |
| 846 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 6") PORT_CODE(KEYCODE_6_PAD) |
| 847 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey ,") |
| 848 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 1") PORT_CODE(KEYCODE_1_PAD) |
| 849 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 2") PORT_CODE(KEYCODE_2_PAD) |
| 850 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 3") PORT_CODE(KEYCODE_3_PAD) |
| 851 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey Enter") PORT_CODE(KEYCODE_ENTER_PAD) |
| 852 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 0") PORT_CODE(KEYCODE_0_PAD) |
| 853 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey .") PORT_CODE(KEYCODE_DEL_PAD) |
| 854 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("INS") PORT_CODE(KEYCODE_INSERT) |
| 855 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("EL") PORT_CODE(KEYCODE_PGUP) |
| 856 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("CLS") PORT_CODE(KEYCODE_PGDN) |
| 857 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) |
| 858 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("DUP") PORT_CODE(KEYCODE_END) |
| 859 | PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) |
| 860 | PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_HOME) |
| 861 | PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) |
| 862 | PORT_BIT(0x00010000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) |
| 863 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) |
| 864 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("BREAK") PORT_CODE(KEYCODE_ESC) |
| 865 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF1") PORT_CODE(KEYCODE_F1) |
| 866 | PORT_BIT(0x00100000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF2") PORT_CODE(KEYCODE_F2) |
| 867 | PORT_BIT(0x00200000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF3") PORT_CODE(KEYCODE_F3) |
| 868 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF4") PORT_CODE(KEYCODE_F4) |
| 869 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF5") PORT_CODE(KEYCODE_F5) |
| 870 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF6") PORT_CODE(KEYCODE_F6) |
| 871 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF7") PORT_CODE(KEYCODE_F7) |
| 872 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF8") PORT_CODE(KEYCODE_F8) |
| 873 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF9") PORT_CODE(KEYCODE_F9) |
| 874 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF10") PORT_CODE(KEYCODE_F10) |
| 875 | |
| 876 | PORT_START("key_modifiers") |
| 877 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) |
| 878 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) |
| 879 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) |
| 880 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("CAP") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 881 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_RALT) |
| 882 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Kana") PORT_CODE(KEYCODE_RCONTROL) PORT_TOGGLE |
| 883 | #endif |
| 621 | 884 | INPUT_PORTS_END |
| 622 | 885 | |
| 623 | 886 | static MACHINE_RESET( x1 ) |
| 624 | 887 | { |
| 625 | 888 | UINT8 *ROM = memory_region(machine, "maincpu"); |
| 889 | UINT8 *PCG_RAM = memory_region(machine, "pcg"); |
| 890 | int i; |
| 626 | 891 | |
| 627 | 892 | memory_set_bankptr(machine, 1, &ROM[0x00000]); |
| 628 | 893 | |
| 629 | 894 | memset(gfx_bitmap_ram,0x00,0xc000); |
| 895 | |
| 896 | for(i=0;i<0x1800;i++) |
| 897 | PCG_RAM[i] = 0; |
| 630 | 898 | } |
| 631 | 899 | |
| 900 | static void ctc0_interrupt(const device_config *device, int state) |
| 901 | { |
| 902 | //cputag_set_input_line(device->machine, "maincpu", 0, state); |
| 903 | } |
| 632 | 904 | |
| 905 | |
| 906 | static const z80ctc_interface ctc_intf = |
| 907 | { |
| 908 | 0, // timer disables |
| 909 | ctc0_interrupt, // interrupt handler |
| 910 | 0, // ZC/TO0 callback |
| 911 | 0, // ZC/TO1 callback |
| 912 | 0, // ZC/TO2 callback |
| 913 | }; |
| 914 | |
| 915 | static const ay8910_interface ay8910_config = |
| 916 | { |
| 917 | AY8910_LEGACY_OUTPUT, |
| 918 | AY8910_DEFAULT_LOADS, |
| 919 | DEVCB_INPUT_PORT("P1"), |
| 920 | DEVCB_INPUT_PORT("P2"), |
| 921 | DEVCB_NULL, |
| 922 | DEVCB_NULL |
| 923 | }; |
| 924 | |
| 925 | |
| 633 | 926 | static MACHINE_DRIVER_START( x1 ) |
| 634 | 927 | /* basic machine hardware */ |
| 635 | 928 | MDRV_CPU_ADD("maincpu", Z80, XTAL_4MHz) |
| 636 | 929 | MDRV_CPU_PROGRAM_MAP(x1_mem) |
| 637 | 930 | MDRV_CPU_IO_MAP(x1_io) |
| 638 | 931 | |
| 932 | MDRV_Z80CTC_ADD( "ctc", XTAL_4MHz , ctc_intf ) |
| 933 | |
| 639 | 934 | MDRV_MACHINE_RESET(x1) |
| 640 | 935 | |
| 641 | 936 | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf ) |
| r5508 | r5509 | |
| 661 | 956 | |
| 662 | 957 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 663 | 958 | |
| 664 | | MDRV_SOUND_ADD("ay", AY8910, XTAL_4MHz/8) //unknown clock / divider |
| 665 | | //MDRV_SOUND_CONFIG(ay8910_config) |
| 959 | MDRV_SOUND_ADD("ay", AY8910, XTAL_4MHz/4) //unknown clock / divider |
| 960 | MDRV_SOUND_CONFIG(ay8910_config) |
| 666 | 961 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 667 | 962 | MACHINE_DRIVER_END |
| 668 | 963 | |
| r5508 | r5509 | |
| 717 | 1012 | ROM_REGION(0x1000, "mcu", ROMREGION_ERASEFF) //MCU for the Keyboard, "sub cpu" |
| 718 | 1013 | ROM_LOAD( "80c48", 0x0000, 0x1000, NO_DUMP ) |
| 719 | 1014 | |
| 1015 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 1016 | |
| 720 | 1017 | ROM_REGION(0x4c600, "cgrom", 0) |
| 721 | 1018 | ROM_LOAD("fnt0808.x1", 0x00000, 0x00800, CRC(e3995a57) SHA1(1c1a0d8c9f4c446ccd7470516b215ddca5052fb2) ) |
| 722 | 1019 | |
| r5508 | r5509 | |
| 733 | 1030 | ROM_REGION(0x1000, "mcu", ROMREGION_ERASEFF) //MCU for the Keyboard, "sub cpu" |
| 734 | 1031 | ROM_LOAD( "80c48", 0x0000, 0x1000, NO_DUMP ) |
| 735 | 1032 | |
| 1033 | ROM_REGION(0xc00, "pcg", ROMREGION_ERASEFF) |
| 1034 | |
| 736 | 1035 | ROM_REGION(0x0800, "cgrom", 0) |
| 737 | 1036 | ROM_LOAD("fnt0808.x1", 0x0000, 0x0800, CRC(e3995a57) SHA1(1c1a0d8c9f4c446ccd7470516b215ddca5052fb2) ) |
| 738 | 1037 | |
| r5508 | r5509 | |
| 748 | 1047 | ROM_REGION(0x1000, "mcu", ROMREGION_ERASEFF) //MCU for the Keyboard, "sub cpu" |
| 749 | 1048 | ROM_LOAD( "80c48", 0x0000, 0x1000, NO_DUMP ) |
| 750 | 1049 | |
| 1050 | ROM_REGION(0xc00, "pcg", ROMREGION_ERASEFF) |
| 1051 | |
| 751 | 1052 | ROM_REGION(0x0800, "cgrom", 0) |
| 752 | 1053 | /* This should be larger... hence, we are missing something (maybe part of the other fnt roms?) */ |
| 753 | 1054 | ROM_LOAD("fnt0808.x1", 0x0000, 0x0800, CRC(84a47530) SHA1(06c0995adc7a6609d4272417fe3570ca43bd0454) ) |
| r5508 | r5509 | |
| 767 | 1068 | ROM_REGION(0x1000, "mcu", ROMREGION_ERASEFF) //MCU for the Keyboard, "sub cpu" |
| 768 | 1069 | ROM_LOAD( "80c48", 0x0000, 0x1000, NO_DUMP ) |
| 769 | 1070 | |
| 1071 | ROM_REGION(0xc00, "pcg", ROMREGION_ERASEFF) |
| 1072 | |
| 770 | 1073 | ROM_REGION(0x4c600, "cgrom", 0) |
| 771 | 1074 | ROM_LOAD("fnt0808.x1", 0x0000, 0x0800, CRC(84a47530) SHA1(06c0995adc7a6609d4272417fe3570ca43bd0454) ) |
| 772 | 1075 | ROM_SYSTEM_BIOS( 0, "font1", "Font set 1" ) |