Previous 15994 Revisions Next

r8935 Sunday 29th August, 2010 at 09:10:45 UTC by Miodrag Milanović
[JR200] Boots in normal time, still needs info on real frequencies
[src/mess/drivers]jr200.c

src/mess/drivers/jr200.c
r8934r8935
250250   jr200_border_col = data;
251251}
252252
253static READ8_HANDLER( mn1271_io_r )
253emu_timer *timer_d;
254
255static TIMER_CALLBACK(timer_d_callback)
254256{
255   if((offset+0xc800) > 0xca00)
256      return 0xff;
257   cpu_set_input_line(machine->firstcpu, 0, HOLD_LINE);
258}
257259
260static READ8_HANDLER( mn1271_io_r )
261{   
262   UINT8 retVal = mn1271_ram[offset];
263   if((offset+0xc800) > 0xca00)
264      retVal= 0xff;
265
258266   switch(offset+0xc800)
259267   {
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;     
270278   }
271
272   return mn1271_ram[offset];
279   //logerror("mn1271_io_r [%04x] = %02x\n",offset+0xc800,retVal);
280   return retVal;
273281}
274282
275283static WRITE8_HANDLER( mn1271_io_w )
276284{
277285   mn1271_ram[offset] = data;
278
279286   switch(offset+0xc800)
280287   {
281288      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;
282295      case 0xc819: jr200_beep_w(space,0,data); break;
283296      case 0xc81a:
284297      case 0xc81b: jr200_beep_freq_w(space,offset-0x1a,data); break;
r8934r8935
436449   GFXDECODE_ENTRY( "pcg", 0, tiles8x8_layout, 0, 1 )
437450GFXDECODE_END
438451
439
440452static MACHINE_START(jr200)
441453{
442454   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);
444457}
445458
446459static MACHINE_RESET(jr200)
r8934r8935
448461   static UINT8 *gfx_rom = memory_region(machine, "gfx_rom");
449462   static UINT8 *gfx_ram = memory_region(machine, "gfx_ram");
450463   int i;
464   memset(mn1271_ram,0,0x800);
451465
452466   for(i=0;i<0x800;i++)
453467      gfx_ram[i] = gfx_rom[i];
r8934r8935
457471}
458472
459473
460static INTERRUPT_GEN( jr200_nmi )
461{
462//   cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
463}
464
465static INTERRUPT_GEN( jr200_irq )
466{
467   cpu_set_input_line(device, 0, HOLD_LINE);
468}
469
470474static MACHINE_DRIVER_START( jr200 )
471475   /* basic machine hardware */
472476   MDRV_CPU_ADD("maincpu", M6802, XTAL_14_31818MHz / 4) /* MN1800A, ? Mhz assumption that it is same as JR-100*/
473477   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)
477478
478479//   MDRV_CPU_ADD("mn1544", MN1544, ?)
479480

Previous 15994 Revisions Next


© 1998-2018 The MESS Team