src/mess/drivers/jr200.c
| r8934 | r8935 | |
| 250 | 250 | jr200_border_col = data; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | | static READ8_HANDLER( mn1271_io_r ) |
| 253 | emu_timer *timer_d; |
| 254 | |
| 255 | static TIMER_CALLBACK(timer_d_callback) |
| 254 | 256 | { |
| 255 | | if((offset+0xc800) > 0xca00) |
| 256 | | return 0xff; |
| 257 | cpu_set_input_line(machine->firstcpu, 0, HOLD_LINE); |
| 258 | } |
| 257 | 259 | |
| 260 | static READ8_HANDLER( mn1271_io_r ) |
| 261 | { |
| 262 | UINT8 retVal = mn1271_ram[offset]; |
| 263 | if((offset+0xc800) > 0xca00) |
| 264 | retVal= 0xff; |
| 265 | |
| 258 | 266 | switch(offset+0xc800) |
| 259 | 267 | { |
| 260 | | case 0xc801: return mcu_keyb_r(space,0); |
| 261 | | case 0xc803: return (mn1271_ram[0x03] & 0xcf) | 0x30; //---x ---- printer status ready (ACTIVE HIGH) |
| 262 | | case 0xc807: return (mn1271_ram[0x07] & 0x80) | 0x60; |
| 263 | | case 0xc80a: return (mn1271_ram[0x0a] & 0xfe); |
| 264 | | case 0xc80c: return (mn1271_ram[0x0c] & 0xdf) | 0x20; |
| 265 | | case 0xc80e: return 0; |
| 266 | | case 0xc810: return 0; |
| 267 | | case 0xc816: return 0x4e; |
| 268 | | case 0xc81c: return (mn1271_ram[0x1c] & 0xfe) | 1; //bit 0 needs to be high otherwise system refuses to boot |
| 269 | | case 0xc81d: return (mn1271_ram[0x1d] & 0xed); |
| 268 | case 0xc801: retVal= mcu_keyb_r(space,0); break; |
| 269 | case 0xc803: retVal= (mn1271_ram[0x03] & 0xcf) | 0x30; break;//---x ---- printer status ready (ACTIVE HIGH) |
| 270 | case 0xc807: retVal= (mn1271_ram[0x07] & 0x80) | 0x60; break; |
| 271 | case 0xc80a: retVal= (mn1271_ram[0x0a] & 0xfe); break; |
| 272 | case 0xc80c: retVal= (mn1271_ram[0x0c] & 0xdf) | 0x20; break; |
| 273 | case 0xc80e: retVal= 0; break; |
| 274 | case 0xc810: retVal= 0; break; |
| 275 | case 0xc816: retVal= 0x4e; break; |
| 276 | case 0xc81c: retVal= (mn1271_ram[0x1c] & 0xfe) | 1; break;//bit 0 needs to be high otherwise system refuses to boot |
| 277 | case 0xc81d: retVal= (mn1271_ram[0x1d] & 0xed); break; |
| 270 | 278 | } |
| 271 | | |
| 272 | | return mn1271_ram[offset]; |
| 279 | //logerror("mn1271_io_r [%04x] = %02x\n",offset+0xc800,retVal); |
| 280 | return retVal; |
| 273 | 281 | } |
| 274 | 282 | |
| 275 | 283 | static WRITE8_HANDLER( mn1271_io_w ) |
| 276 | 284 | { |
| 277 | 285 | mn1271_ram[offset] = data; |
| 278 | | |
| 279 | 286 | switch(offset+0xc800) |
| 280 | 287 | { |
| 281 | 288 | case 0xc805: break; //LPT printer port W |
| 289 | case 0xc816: if (data!=0) { |
| 290 | timer_adjust_periodic(timer_d, attotime_zero, 0, attotime_mul(ATTOTIME_IN_HZ(XTAL_14_31818MHz), (mn1271_ram[0x17]*0x100 + mn1271_ram[0x18]))); |
| 291 | } else { |
| 292 | timer_adjust_periodic(timer_d, attotime_zero, 0, attotime_zero); |
| 293 | } |
| 294 | break; |
| 282 | 295 | case 0xc819: jr200_beep_w(space,0,data); break; |
| 283 | 296 | case 0xc81a: |
| 284 | 297 | case 0xc81b: jr200_beep_freq_w(space,offset-0x1a,data); break; |
| r8934 | r8935 | |
| 436 | 449 | GFXDECODE_ENTRY( "pcg", 0, tiles8x8_layout, 0, 1 ) |
| 437 | 450 | GFXDECODE_END |
| 438 | 451 | |
| 439 | | |
| 440 | 452 | static MACHINE_START(jr200) |
| 441 | 453 | { |
| 442 | 454 | beep_set_frequency(machine->device("beeper"),0); |
| 443 | | beep_set_state(machine->device("beeper"),0); |
| 455 | beep_set_state(machine->device("beeper"),0); |
| 456 | timer_d = timer_alloc(machine, timer_d_callback, NULL); |
| 444 | 457 | } |
| 445 | 458 | |
| 446 | 459 | static MACHINE_RESET(jr200) |
| r8934 | r8935 | |
| 448 | 461 | static UINT8 *gfx_rom = memory_region(machine, "gfx_rom"); |
| 449 | 462 | static UINT8 *gfx_ram = memory_region(machine, "gfx_ram"); |
| 450 | 463 | int i; |
| 464 | memset(mn1271_ram,0,0x800); |
| 451 | 465 | |
| 452 | 466 | for(i=0;i<0x800;i++) |
| 453 | 467 | gfx_ram[i] = gfx_rom[i]; |
| r8934 | r8935 | |
| 457 | 471 | } |
| 458 | 472 | |
| 459 | 473 | |
| 460 | | static INTERRUPT_GEN( jr200_nmi ) |
| 461 | | { |
| 462 | | // cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); |
| 463 | | } |
| 464 | | |
| 465 | | static INTERRUPT_GEN( jr200_irq ) |
| 466 | | { |
| 467 | | cpu_set_input_line(device, 0, HOLD_LINE); |
| 468 | | } |
| 469 | | |
| 470 | 474 | static MACHINE_DRIVER_START( jr200 ) |
| 471 | 475 | /* basic machine hardware */ |
| 472 | 476 | MDRV_CPU_ADD("maincpu", M6802, XTAL_14_31818MHz / 4) /* MN1800A, ? Mhz assumption that it is same as JR-100*/ |
| 473 | 477 | MDRV_CPU_PROGRAM_MAP(jr200_mem) |
| 474 | | MDRV_CPU_VBLANK_INT("screen", jr200_irq) |
| 475 | | MDRV_CPU_PERIODIC_INT(jr200_nmi,20) |
| 476 | | // MDRV_CPU_PERIODIC_INT(jr200_irq,20) |
| 477 | 478 | |
| 478 | 479 | // MDRV_CPU_ADD("mn1544", MN1544, ?) |
| 479 | 480 | |