trunk/src/mame/drivers/mhavoc.c
r18261 | r18262 | |
193 | 193 | #include "machine/nvram.h" |
194 | 194 | #include "includes/mhavoc.h" |
195 | 195 | |
| 196 | READ8_MEMBER(mhavoc_state::quad_pokeyn_r) |
| 197 | { |
| 198 | static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; |
| 199 | int pokey_num = (offset >> 3) & ~0x04; |
| 200 | int control = (offset & 0x20) >> 2; |
| 201 | int pokey_reg = (offset % 8) | control; |
| 202 | pokey_device *pokey = machine().device<pokey_device>(devname[pokey_num]); |
| 203 | |
| 204 | return pokey->read(pokey_reg); |
| 205 | } |
| 206 | |
| 207 | WRITE8_MEMBER(mhavoc_state::quad_pokeyn_w) |
| 208 | { |
| 209 | static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; |
| 210 | int pokey_num = (offset >> 3) & ~0x04; |
| 211 | int control = (offset & 0x20) >> 2; |
| 212 | int pokey_reg = (offset % 8) | control; |
| 213 | pokey_device *pokey = machine().device<pokey_device>(devname[pokey_num]); |
| 214 | |
| 215 | pokey->write(pokey_reg, data); |
| 216 | } |
| 217 | |
| 218 | |
196 | 219 | /************************************* |
197 | 220 | * |
198 | 221 | * Alpha One: dual POKEY? |
r18261 | r18262 | |
265 | 288 | static ADDRESS_MAP_START( gamma_map, AS_PROGRAM, 8, mhavoc_state ) |
266 | 289 | AM_RANGE(0x0000, 0x07ff) AM_RAM /* Program RAM (2K) */ |
267 | 290 | AM_RANGE(0x0800, 0x0fff) AM_RAM AM_MIRROR (0x1800) |
268 | | AM_RANGE(0x2000, 0x203f) AM_READWRITE_LEGACY(quad_pokeyn_r, quad_pokeyn_w) /* Quad Pokey read */ |
| 291 | AM_RANGE(0x2000, 0x203f) AM_READWRITE(quad_pokeyn_r, quad_pokeyn_w) /* Quad Pokey read */ |
269 | 292 | AM_RANGE(0x2800, 0x2800) AM_READ_PORT("IN1") /* Gamma Input Port */ |
270 | 293 | AM_RANGE(0x3000, 0x3000) AM_READ(mhavoc_alpha_r) /* Alpha Comm. Read Port*/ |
271 | 294 | AM_RANGE(0x3800, 0x3803) AM_READ_PORT("DIAL") /* Roller Controller Input*/ |
trunk/src/mame/drivers/irobot.c
r18261 | r18262 | |
117 | 117 | } |
118 | 118 | |
119 | 119 | |
| 120 | READ8_MEMBER(irobot_state::quad_pokeyn_r) |
| 121 | { |
| 122 | static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; |
| 123 | int pokey_num = (offset >> 3) & ~0x04; |
| 124 | int control = (offset & 0x20) >> 2; |
| 125 | int pokey_reg = (offset % 8) | control; |
| 126 | pokey_device *pokey = machine().device<pokey_device>(devname[pokey_num]); |
120 | 127 | |
| 128 | return pokey->read(pokey_reg); |
| 129 | } |
| 130 | |
| 131 | WRITE8_MEMBER(irobot_state::quad_pokeyn_w) |
| 132 | { |
| 133 | static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; |
| 134 | int pokey_num = (offset >> 3) & ~0x04; |
| 135 | int control = (offset & 0x20) >> 2; |
| 136 | int pokey_reg = (offset % 8) | control; |
| 137 | pokey_device *pokey = machine().device<pokey_device>(devname[pokey_num]); |
| 138 | |
| 139 | pokey->write(pokey_reg, data); |
| 140 | } |
| 141 | |
| 142 | |
121 | 143 | /************************************* |
122 | 144 | * |
123 | 145 | * Main CPU memory handlers |
r18261 | r18262 | |
137 | 159 | AM_RANGE(0x11c0, 0x11c0) AM_WRITE(irobot_rom_banksel_w) |
138 | 160 | AM_RANGE(0x1200, 0x12ff) AM_RAM_WRITE(irobot_nvram_w) AM_SHARE("nvram") |
139 | 161 | AM_RANGE(0x1300, 0x13ff) AM_READ(irobot_control_r) |
140 | | AM_RANGE(0x1400, 0x143f) AM_READWRITE_LEGACY(quad_pokeyn_r, quad_pokeyn_w) |
| 162 | AM_RANGE(0x1400, 0x143f) AM_READWRITE(quad_pokeyn_r, quad_pokeyn_w) |
141 | 163 | AM_RANGE(0x1800, 0x18ff) AM_WRITE(irobot_paletteram_w) |
142 | 164 | AM_RANGE(0x1900, 0x19ff) AM_WRITEONLY /* Watchdog reset */ |
143 | 165 | AM_RANGE(0x1a00, 0x1a00) AM_WRITE(irobot_clearfirq_w) |
trunk/src/mame/drivers/starwars.c
r18261 | r18262 | |
36 | 36 | #define CLOCK_3KHZ (MASTER_CLOCK / 4096) |
37 | 37 | |
38 | 38 | |
| 39 | WRITE8_MEMBER(starwars_state::quad_pokeyn_w) |
| 40 | { |
| 41 | static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; |
| 42 | int pokey_num = (offset >> 3) & ~0x04; |
| 43 | int control = (offset & 0x20) >> 2; |
| 44 | int pokey_reg = (offset % 8) | control; |
| 45 | pokey_device *pokey = machine().device<pokey_device>(devname[pokey_num]); |
39 | 46 | |
| 47 | pokey->write(pokey_reg, data); |
| 48 | } |
| 49 | |
40 | 50 | /************************************* |
41 | 51 | * |
42 | 52 | * Machine init |
r18261 | r18262 | |
192 | 202 | AM_RANGE(0x0800, 0x0fff) AM_READ(starwars_sin_r) /* SIN Read */ |
193 | 203 | AM_RANGE(0x1000, 0x107f) AM_RAM /* 6532 ram */ |
194 | 204 | AM_RANGE(0x1080, 0x109f) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
195 | | AM_RANGE(0x1800, 0x183f) AM_WRITE_LEGACY(quad_pokeyn_w) |
| 205 | AM_RANGE(0x1800, 0x183f) AM_WRITE(quad_pokeyn_w) |
196 | 206 | AM_RANGE(0x2000, 0x27ff) AM_RAM /* program RAM */ |
197 | 207 | AM_RANGE(0x4000, 0x7fff) AM_ROM /* sound roms */ |
198 | 208 | AM_RANGE(0xb000, 0xffff) AM_ROM /* more sound roms */ |
trunk/src/emu/sound/pokey.c
r18261 | r18262 | |
1284 | 1284 | m_div2(0) |
1285 | 1285 | { |
1286 | 1286 | } |
1287 | | |
1288 | | //------------------------------------------------- |
1289 | | // Quad Pokey support - should be in game drivers, really |
1290 | | //------------------------------------------------- |
1291 | | |
1292 | | |
1293 | | READ8_HANDLER( quad_pokeyn_r ) |
1294 | | { |
1295 | | static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; |
1296 | | int pokey_num = (offset >> 3) & ~0x04; |
1297 | | int control = (offset & 0x20) >> 2; |
1298 | | int pokey_reg = (offset % 8) | control; |
1299 | | pokey_device *pokey = space.machine().device<pokey_device>(devname[pokey_num]); |
1300 | | |
1301 | | return pokey->read(pokey_reg); |
1302 | | } |
1303 | | |
1304 | | WRITE8_HANDLER( quad_pokeyn_w ) |
1305 | | { |
1306 | | static const char *const devname[4] = { "pokey1", "pokey2", "pokey3", "pokey4" }; |
1307 | | int pokey_num = (offset >> 3) & ~0x04; |
1308 | | int control = (offset & 0x20) >> 2; |
1309 | | int pokey_reg = (offset % 8) | control; |
1310 | | pokey_device *pokey = space.machine().device<pokey_device>(devname[pokey_num]); |
1311 | | |
1312 | | pokey->write(pokey_reg, data); |
1313 | | } |
1314 | | |