Previous 15994 Revisions Next

r9481 Sunday 31st October, 2010 at 11:12:57 UTC by Angelo Salese
[PC-88VA]: Added General purpose timer 3 (mouse), BIOS now moans about something (presumably a system boot error)
[src/mess/drivers]pc88va.c

src/mess/drivers/pc88va.c
r9480r9481
1717//#include "cpu/z80/z80.h"
1818#include "machine/i8255a.h"
1919#include "machine/pic8259.h"
20#include "machine/pit8253.h"
2021#include "machine/pc_fdc.h"
2122#include "machine/upd765.h"
2223
2324static UINT16 *palram;
2425static UINT16 bank_reg;
2526static UINT16 screen_ctrl_reg;
27static UINT8 timer3_io_reg;
28static emu_timer *t3_mouse_timer;
2629static struct
2730{
2831   UINT16 tvram_vreg_offset;
r9480r9481
636639   screen_ctrl_reg = data;
637640}
638641
642static TIMER_CALLBACK( t3_mouse_callback )
643{
644   if(timer3_io_reg & 0x80)
645   {
646      pic8259_ir5_w(machine->device("pic8259_slave"), 1);
647      timer_adjust_oneshot(t3_mouse_timer, ATTOTIME_IN_HZ(120 >> (timer3_io_reg & 3)), 0);
648   }
649}
650
651static WRITE8_HANDLER( timer3_ctrl_reg_w )
652{
653   /*
654   x--- ---- MINTEN (TCU irq enable)
655   ---- --xx general purpose timer 3 interval (120, 60, 30, 15)
656   */
657   timer3_io_reg = data;
658
659   if(data & 0x80)
660      timer_adjust_oneshot(t3_mouse_timer, ATTOTIME_IN_HZ(120 >> (timer3_io_reg & 3)), 0);
661   else
662   {
663      pic8259_ir5_w(space->machine->device("pic8259_slave"), 0);
664      timer_adjust_oneshot(t3_mouse_timer, attotime_never, 0);
665   }
666}
667
639668static ADDRESS_MAP_START( pc88va_io_map, ADDRESS_SPACE_IO, 16 )
640669   AM_RANGE(0x0000, 0x000f) AM_READ8(key_r,0xffff) // Keyboard ROW reading
641670//   AM_RANGE(0x0010, 0x0010) Printer / Calendar Clock Interface
r9480r9481
692721//   AM_RANGE(0x0196, 0x0197) Keyboard sub CPU command port
693722   AM_RANGE(0x0198, 0x0199) AM_WRITE(backupram_wp_1_w) //Backup RAM write inhibit
694723   AM_RANGE(0x019a, 0x019b) AM_WRITE(backupram_wp_0_w) //Backup RAM write permission
695//   AM_RANGE(0x01a0, 0x01a7) TCU (timer counter unit)
696//   AM_RANGE(0x01a8, 0x01a9) General-purpose timer 3 control port
724   AM_RANGE(0x01a0, 0x01a7) AM_DEVREADWRITE8("pit8253", pit8253_r, pit8253_w, 0x00ff)// vTCU (timer counter unit)
725   AM_RANGE(0x01a8, 0x01a9) AM_WRITE8(timer3_ctrl_reg_w,0x00ff) // General-purpose timer 3 control port
697726   AM_RANGE(0x01b0, 0x01bb) AM_READWRITE8(pc88va_fdc_r,pc88va_fdc_w,0x00ff)// FDC related (765)
698727//   AM_RANGE(0x01c0, 0x01c1) ?
699728   AM_RANGE(0x01c6, 0x01c7) AM_WRITENOP // ???
r9480r9481
10851114   cpu_set_irq_callback(machine->device("maincpu"), pc88va_irq_callback);
10861115
10871116   pc_fdc_init(machine, &pc88va_fdc_interface);
1117
1118   t3_mouse_timer = timer_alloc(machine, t3_mouse_callback, 0);
1119   timer_adjust_oneshot(t3_mouse_timer, attotime_never, 0);
10881120}
10891121
10901122static MACHINE_RESET( pc88va )
r9480r9481
11251157};
11261158
11271159
1160static WRITE_LINE_DEVICE_HANDLER( pc88va_pit_out0_changed )
1161{
1162   pic8259_ir0_w(device->machine->device("pic8259_master"), 1);
1163}
1164
1165static const struct pit8253_config pc88va_pit8253_config =
1166{
1167   {
1168      {
1169         /* general purpose timer 1 */
1170         8000000,
1171         DEVCB_NULL,
1172         DEVCB_LINE(pc88va_pit_out0_changed)
1173      },
1174      {
1175         /* BEEP frequency setting */
1176         8000000,
1177         DEVCB_NULL,
1178         DEVCB_NULL
1179      },
1180      {
1181         /* RS232C baud rate setting  */
1182         8000000,
1183         DEVCB_NULL,
1184         DEVCB_NULL
1185      }
1186   }
1187};
1188
11281189static MACHINE_CONFIG_START( pc88va, driver_device )
11291190
11301191   MDRV_CPU_ADD("maincpu", V30, 8000000)        /* 8 MHz */
r9480r9481
11621223   MDRV_UPD765A_ADD("upd765", pc_fdc_upd765_connected_interface)
11631224   MDRV_FLOPPY_2_DRIVES_ADD(pc88va_floppy_config)
11641225
1226    MDRV_PIT8253_ADD("pit8253",pc88va_pit8253_config)
1227
1228
11651229MACHINE_CONFIG_END
11661230
11671231

Previous 15994 Revisions Next


© 1998-2018 The MESS Team