src/mess/drivers/bullet.c
| r0 | r9052 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | WaveMate Bullet |
| 4 | |
| 5 | 12/05/2009 Skeleton driver. |
| 6 | |
| 7 | ****************************************************************************/ |
| 8 | |
| 9 | #include "emu.h" |
| 10 | #include "cpu/z80/z80.h" |
| 11 | #include "machine/wd17xx.h" |
| 12 | #include "devices/flopdrv.h" |
| 13 | #include "devices/messram.h" |
| 14 | |
| 15 | static ADDRESS_MAP_START(bullet_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 16 | ADDRESS_MAP_UNMAP_HIGH |
| 17 | AM_RANGE(0x0000, 0x001f) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2") |
| 18 | AM_RANGE(0x0020, 0xbfff) AM_RAMBANK("bank3") |
| 19 | AM_RANGE(0xc000, 0xffff) AM_RAMBANK("bank4") |
| 20 | ADDRESS_MAP_END |
| 21 | |
| 22 | static UINT8 port19 = 0; |
| 23 | |
| 24 | static READ8_HANDLER(port19_r) |
| 25 | { |
| 26 | return port19; |
| 27 | } |
| 28 | |
| 29 | static WRITE8_HANDLER(port15_w) |
| 30 | { |
| 31 | memory_set_bankptr(space->machine, "bank1", messram_get_ptr(space->machine->device("messram")) + 0x0000); |
| 32 | } |
| 33 | |
| 34 | static ADDRESS_MAP_START( bullet_io , ADDRESS_SPACE_IO, 8) |
| 35 | ADDRESS_MAP_UNMAP_HIGH |
| 36 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 37 | AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("wd179x", wd17xx_r, wd17xx_w) |
| 38 | AM_RANGE(0x15, 0x15) AM_READ(port15_w) |
| 39 | AM_RANGE(0x19, 0x19) AM_READ(port19_r) |
| 40 | ADDRESS_MAP_END |
| 41 | |
| 42 | /* Input ports */ |
| 43 | INPUT_PORTS_START( bullet ) |
| 44 | INPUT_PORTS_END |
| 45 | |
| 46 | INLINE running_device *get_floppy_image(running_machine *machine, int drive) |
| 47 | { |
| 48 | return floppy_get_device(machine, drive); |
| 49 | } |
| 50 | |
| 51 | static MACHINE_RESET(bullet) |
| 52 | { |
| 53 | floppy_mon_w(get_floppy_image(machine, 0), 1); |
| 54 | floppy_mon_w(get_floppy_image(machine, 1), 1); |
| 55 | floppy_mon_w(get_floppy_image(machine, 2), 1); |
| 56 | floppy_mon_w(get_floppy_image(machine, 3), 1); |
| 57 | |
| 58 | floppy_drive_set_ready_state(get_floppy_image(machine, 0), 1, 1); |
| 59 | floppy_drive_set_ready_state(get_floppy_image(machine, 1), 1, 1); |
| 60 | floppy_drive_set_ready_state(get_floppy_image(machine, 2), 1, 1); |
| 61 | floppy_drive_set_ready_state(get_floppy_image(machine, 3), 1, 1); |
| 62 | |
| 63 | memory_set_bankptr(machine, "bank1", memory_region(machine, "maincpu")); |
| 64 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x0000); |
| 65 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x0020); |
| 66 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0xc000); |
| 67 | } |
| 68 | |
| 69 | static VIDEO_START( bullet ) |
| 70 | { |
| 71 | } |
| 72 | |
| 73 | static VIDEO_UPDATE( bullet ) |
| 74 | { |
| 75 | return 0; |
| 76 | } |
| 77 | |
| 78 | static const floppy_config bullet_floppy_config = |
| 79 | { |
| 80 | DEVCB_NULL, |
| 81 | DEVCB_NULL, |
| 82 | DEVCB_NULL, |
| 83 | DEVCB_NULL, |
| 84 | DEVCB_NULL, |
| 85 | FLOPPY_STANDARD_5_25_DSHD, |
| 86 | FLOPPY_OPTIONS_NAME(default), |
| 87 | "bullet_flop" |
| 88 | }; |
| 89 | |
| 90 | static WRITE_LINE_DEVICE_HANDLER( bullet_wd17xx_irq_w ) |
| 91 | { |
| 92 | if (state) |
| 93 | port19 |= (1<<6); |
| 94 | else |
| 95 | port19 &=~(1<<6); |
| 96 | } |
| 97 | static WRITE_LINE_DEVICE_HANDLER( bullet_wd17xx_drq_w ) |
| 98 | { |
| 99 | if (state) |
| 100 | port19 |= (1<<7); |
| 101 | else |
| 102 | port19 &=~(1<<7); |
| 103 | } |
| 104 | |
| 105 | static const wd17xx_interface bullet_wd17xx_interface = |
| 106 | { |
| 107 | DEVCB_NULL, |
| 108 | DEVCB_LINE(bullet_wd17xx_irq_w), |
| 109 | DEVCB_LINE(bullet_wd17xx_drq_w), |
| 110 | {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} |
| 111 | }; |
| 112 | |
| 113 | static MACHINE_CONFIG_START( bullet,driver_device ) |
| 114 | /* basic machine hardware */ |
| 115 | MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz) |
| 116 | MDRV_CPU_PROGRAM_MAP(bullet_mem) |
| 117 | MDRV_CPU_IO_MAP(bullet_io) |
| 118 | |
| 119 | MDRV_MACHINE_RESET(bullet) |
| 120 | |
| 121 | /* video hardware */ |
| 122 | MDRV_SCREEN_ADD("screen", RASTER) |
| 123 | MDRV_SCREEN_REFRESH_RATE(50) |
| 124 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 125 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 126 | MDRV_SCREEN_SIZE(640, 480) |
| 127 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 128 | MDRV_PALETTE_LENGTH(2) |
| 129 | MDRV_PALETTE_INIT(black_and_white) |
| 130 | |
| 131 | MDRV_VIDEO_START(bullet) |
| 132 | MDRV_VIDEO_UPDATE(bullet) |
| 133 | |
| 134 | MDRV_WD179X_ADD("wd179x", bullet_wd17xx_interface ) |
| 135 | |
| 136 | MDRV_FLOPPY_4_DRIVES_ADD(bullet_floppy_config) |
| 137 | |
| 138 | /* internal ram */ |
| 139 | MDRV_RAM_ADD("messram") |
| 140 | MDRV_RAM_DEFAULT_SIZE("128K") |
| 141 | MACHINE_CONFIG_END |
| 142 | |
| 143 | /* ROM definition */ |
| 144 | ROM_START( bullet ) |
| 145 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 146 | ROM_LOAD( "sr70x.u8", 0x0000, 0x0020, CRC(d54b8a30) SHA1(65ff8753dd63c9dd1899bc9364a016225585d050)) |
| 147 | ROM_END |
| 148 | |
| 149 | /* Driver */ |
| 150 | |
| 151 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 152 | COMP( 197?, bullet, 0, 0, bullet, bullet, 0, "WaveMate", "Bullet", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 153 | |