Previous 199869 Revisions Next

r18262 Wednesday 3rd October, 2012 at 13:55:12 UTC by Miodrag Milanović
Moved handling of quad pokey into drivers as asked (no whatsnew)
[src/emu/sound]pokey.c pokey.h
[src/mame/drivers]irobot.c mhavoc.c starwars.c
[src/mame/includes]irobot.h mhavoc.h starwars.h

trunk/src/mame/drivers/mhavoc.c
r18261r18262
193193#include "machine/nvram.h"
194194#include "includes/mhavoc.h"
195195
196READ8_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
207WRITE8_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
196219/*************************************
197220 *
198221 *  Alpha One: dual POKEY?
r18261r18262
265288static ADDRESS_MAP_START( gamma_map, AS_PROGRAM, 8, mhavoc_state )
266289   AM_RANGE(0x0000, 0x07ff) AM_RAM                        /* Program RAM (2K) */
267290    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  */
269292   AM_RANGE(0x2800, 0x2800) AM_READ_PORT("IN1")            /* Gamma Input Port */
270293   AM_RANGE(0x3000, 0x3000) AM_READ(mhavoc_alpha_r)         /* Alpha Comm. Read Port*/
271294   AM_RANGE(0x3800, 0x3803) AM_READ_PORT("DIAL")            /* Roller Controller Input*/
trunk/src/mame/drivers/irobot.c
r18261r18262
117117}
118118
119119
120READ8_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]);
120127
128   return pokey->read(pokey_reg);
129}
130
131WRITE8_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
121143/*************************************
122144 *
123145 *  Main CPU memory handlers
r18261r18262
137159    AM_RANGE(0x11c0, 0x11c0) AM_WRITE(irobot_rom_banksel_w)
138160    AM_RANGE(0x1200, 0x12ff) AM_RAM_WRITE(irobot_nvram_w) AM_SHARE("nvram")
139161    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)
141163    AM_RANGE(0x1800, 0x18ff) AM_WRITE(irobot_paletteram_w)
142164    AM_RANGE(0x1900, 0x19ff) AM_WRITEONLY            /* Watchdog reset */
143165    AM_RANGE(0x1a00, 0x1a00) AM_WRITE(irobot_clearfirq_w)
trunk/src/mame/drivers/starwars.c
r18261r18262
3636#define CLOCK_3KHZ  (MASTER_CLOCK / 4096)
3737
3838
39WRITE8_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]);
3946
47    pokey->write(pokey_reg, data);
48}
49
4050/*************************************
4151 *
4252 *  Machine init
r18261r18262
192202   AM_RANGE(0x0800, 0x0fff) AM_READ(starwars_sin_r)      /* SIN Read */
193203   AM_RANGE(0x1000, 0x107f) AM_RAM                     /* 6532 ram */
194204   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)
196206   AM_RANGE(0x2000, 0x27ff) AM_RAM                     /* program RAM */
197207   AM_RANGE(0x4000, 0x7fff) AM_ROM                     /* sound roms */
198208   AM_RANGE(0xb000, 0xffff) AM_ROM                     /* more sound roms */
trunk/src/mame/includes/starwars.h
r18261r18262
5858   DECLARE_READ8_MEMBER(starwars_main_ready_flag_r);
5959   DECLARE_WRITE8_MEMBER(starwars_main_wr_w);
6060   DECLARE_WRITE8_MEMBER(starwars_soundrst_w);
61   DECLARE_WRITE8_MEMBER(quad_pokeyn_w);
6162   DECLARE_DIRECT_UPDATE_MEMBER(esb_setdirect);
6263   DECLARE_DRIVER_INIT(esb);
6364   DECLARE_DRIVER_INIT(starwars);
trunk/src/mame/includes/irobot.h
r18261r18262
7373   DECLARE_READ8_MEMBER(irobot_control_r);
7474   DECLARE_READ8_MEMBER(irobot_status_r);
7575   DECLARE_WRITE8_MEMBER(irobot_paletteram_w);
76   DECLARE_READ8_MEMBER(quad_pokeyn_r);
77   DECLARE_WRITE8_MEMBER(quad_pokeyn_w);   
7678   DECLARE_DRIVER_INIT(irobot);
7779   virtual void machine_reset();
7880   virtual void video_start();
trunk/src/mame/includes/mhavoc.h
r18261r18262
5252   DECLARE_WRITE8_MEMBER(mhavoc_out_1_w);
5353   DECLARE_WRITE8_MEMBER(mhavocrv_speech_data_w);
5454   DECLARE_WRITE8_MEMBER(mhavocrv_speech_strobe_w);
55   DECLARE_READ8_MEMBER(quad_pokeyn_r);
56   DECLARE_WRITE8_MEMBER(quad_pokeyn_w);
5557   DECLARE_CUSTOM_INPUT_MEMBER(tms5220_r);
5658   DECLARE_CUSTOM_INPUT_MEMBER(mhavoc_bit67_r);
5759   DECLARE_CUSTOM_INPUT_MEMBER(gamma_rcvd_r);
trunk/src/emu/sound/pokey.c
r18261r18262
12841284      m_div2(0)
12851285{
12861286}
1287
1288//-------------------------------------------------
1289//  Quad Pokey support - should be in game drivers, really
1290//-------------------------------------------------
1291
1292
1293READ8_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
1304WRITE8_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
trunk/src/emu/sound/pokey.h
r18261r18262
345345// device type definition
346346extern const device_type POKEY;
347347
348
349/* fix me: eventually this should be a single device with pokey subdevices */
350DECLARE_READ8_HANDLER( quad_pokeyn_r );
351DECLARE_WRITE8_HANDLER( quad_pokeyn_w );
352
353
354348#endif   /* __POKEY_H__ */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team