Previous 199869 Revisions Next

r35203 Sunday 22nd February, 2015 at 10:45:55 UTC by Miodrag Milanović
(MESS)-gamate: audio emulation [Peter Trauner]
[src/mess]mess.mak
[src/mess/audio]gamate.c*
[src/mess/drivers]gamate.c
[src/mess/includes]gamate.h*

trunk/src/mess/audio/gamate.c
r0r243715
1/***************************************************************************
2 gamate sound hardware
3
4 PeT mess@utanet.at
5***************************************************************************/
6
7#include "emu.h"
8#include "includes/gamate.h"
9
10
11// device type definition
12const device_type GAMATE_SND = &device_creator<gamate_sound_device>;
13
14
15//**************************************************************************
16//  LIVE DEVICE
17//**************************************************************************
18
19//-------------------------------------------------
20//  gamate_sound_device - constructor
21//-------------------------------------------------
22
23gamate_sound_device::gamate_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
24   : device_t(mconfig, GAMATE_SND, "Gamate Audio Custom", tag, owner, clock, "gamate_sound", __FILE__),
25      device_sound_interface(mconfig, *this),
26      m_mixer_channel(NULL)
27{
28}
29
30
31//-------------------------------------------------
32//  device_start - device-specific startup
33//-------------------------------------------------
34
35void gamate_sound_device::device_start()
36{
37   // bind callbacks
38//   m_irq_cb.bind_relative_to(*owner());
39
40   memset(m_channels, 0, sizeof(m_channels));
41   memset(reg, 0, sizeof(reg));
42
43   m_mixer_channel = stream_alloc(0, 2, machine().sample_rate());
44}
45
46
47//-------------------------------------------------
48//  sound_stream_update - handle a stream update
49//-------------------------------------------------
50
51void gamate_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
52{
53   stream_sample_t *left=outputs[0], *right=outputs[1];
54   int i, j;
55   GAMATE_CHANNEL *channel;
56
57   for (i = 0; i < samples; i++, left++, right++)
58   {
59      *left = 0;
60      *right = 0;
61      for (channel=m_channels, j=0; j<ARRAY_LENGTH(m_channels); j++, channel++)
62      {
63         if (channel->size != 0)
64         {
65            if (channel->on)//||channel->count)
66            {
67               int on = FALSE;
68               on = channel->pos <= channel->size / 2;
69               {
70                  INT16 s = on ? channel->volume << 8 : 0;
71                  if (j == 0)
72                     *right += s;
73                  else if (j==1)
74                     *left += s;
75                  else {
76                     *right += s;
77                     *left += s;
78                  }
79               }
80            }
81            channel->pos++;
82            if (channel->pos >= channel->size)
83               channel->pos = 0;
84         }
85      }
86   }
87}
88
89WRITE8_MEMBER( gamate_sound_device::device_w )
90{
91   UINT16 size;
92
93   m_mixer_channel->update();
94   reg[offset] = data;
95   int chan=-1;
96   
97   switch (offset)
98   {
99      case 0:
100      case 1:
101      case 2:
102      case 3:
103      case 4:
104      case 5:
105        chan=offset/2;
106         size = reg[chan*2] | ((reg[chan*2+1] & 0xf) << 8);
107         if (size)
108         {
109            m_channels[chan].size= (int) (machine().sample_rate() * (size << 5) / machine().device("maincpu")->unscaled_clock());
110         }
111         else
112         {
113            m_channels[chan].size = 0;
114         }
115         m_channels[chan].pos = 0;
116         break;
117      case 6:
118      case 7:
119      case 8:
120        chan=offset-6;
121//         m_channels[chan]->on = data & 0x40;
122//         channel->waveform = (data & 0x30) >> 4;
123         m_channels[chan].volume = data & 0xf;
124         break;
125   }
126  if (chan!=-1) m_channels[chan].on=m_channels[chan].volume!=0 && m_channels[chan].size>3/* avoid speed loss for unhearable >=23khz*/; 
127}
trunk/src/mess/drivers/gamate.c
r243714r243715
1010#include "bus/generic/slot.h"
1111#include "bus/generic/carts.h"
1212#include "rendlay.h"
13#include "includes/gamate.h"
14#include "ui/ui.h"
1315
14//#define USE_GFX
15
1616class gamate_state : public driver_device
1717{
1818public:
1919   gamate_state(const machine_config &mconfig, device_type type, const char *tag)
2020      : driver_device(mconfig, type, tag)
2121      , m_maincpu(*this, "maincpu")
22      , m_sound(*this, "custom")
2223      , m_cart(*this, "cartslot")
23#ifdef USE_GFX
24      , m_gfxdecode(*this, "gfxdecode")
25#endif
2624      , m_io_joy(*this, "JOY")
2725      , m_palette(*this, "palette")
2826      , m_bios(*this, "bios")
r243714r243715
5351
5452   struct
5553   {
56   UINT8 reg[8];
57   struct {
58      bool write;
59      bool page2; // else page1
54     UINT8 reg[8];
55     struct {
56       bool write;
57       bool page2; // else page1
6058   UINT8 ypos, xpos/*tennis*/;
61      UINT8 data[2][0x100][0x20];
62      } bitmap;
63   UINT8 x, y;
59       UINT8 data[2][0x100][0x20];
60     } bitmap;
61     UINT8 x, y;
6462      bool y_increment;
6563   } video;
6664
6765   struct {
68      bool set;
66     bool set;
6967      int bit_shifter;
7068      UINT8 cartridge_byte;
7169      UINT16 address; // in reality something more like short local cartridge address offset
7270      bool unprotected;
7371      bool failed;
74
72     
7573   } card_protection;
7674
7775   required_device<cpu_device> m_maincpu;
76   required_device<gamate_sound_device> m_sound;
7877   required_device<generic_slot_device> m_cart;
79#ifdef USE_GFX
80   required_device<gfxdecode_device> m_gfxdecode;
81#endif
8278   required_ioport m_io_joy;
8379   required_device<palette_device> m_palette;
8480   required_shared_ptr<UINT8> m_bios;
8581   emu_timer *timer1;
8682   emu_timer *timer2;
87   UINT8 bank_multi;
88   UINT8 *m_cart_ptr;
83   UINT8 bank_multi; 
8984};
9085
9186WRITE8_MEMBER( gamate_state::gamate_cart_protection_w )
9287{
93      logerror("%.6f protection write %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, data, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter);
94
88        logerror("%.6f protection write %x %x address:%x data:%x shift:%d\n",machine().time().as_double(), offset, data, card_protection.address, card_protection.cartridge_byte, card_protection.bit_shifter);
89 
9590   switch (offset) {
9691   case 0:
9792      card_protection.failed= card_protection.failed || ((card_protection.cartridge_byte&0x80)!=0) != ((data&4)!=0);
9893      card_protection.bit_shifter++;
9994      if (card_protection.bit_shifter>=8) {
100         card_protection.cartridge_byte=m_cart_ptr[card_protection.address++];
95         card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++];
10196         card_protection.bit_shifter=0;
10297      }
10398      break;
r243714r243715
107102{
108103   UINT8 ret=1;
109104   if (card_protection.bit_shifter==7 && card_protection.unprotected) {
110   ret=m_cart_ptr[bank_multi*0x4000];
105   ret=m_cart->get_rom_base()[bank_multi*0x4000];
111106   } else {
112107   card_protection.bit_shifter++;
113108   if (card_protection.bit_shifter==8) {
r243714r243715
117112   }
118113   ret=(card_protection.cartridge_byte&0x80)?2:0;
119114   if (card_protection.bit_shifter==7 && !card_protection.failed) { // now protection chip on cartridge activates cartridge chip select on cpu accesses
120//        m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); // next time I will try to get this working
115//        m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); // next time I will try to get this working
121116   }
122117   card_protection.cartridge_byte<<=1;
123118   }
r243714r243715
132127   // writes 0x20
133128   card_protection.address=0x6005-0x6001;
134129   card_protection.bit_shifter=0;
135   card_protection.cartridge_byte=m_cart_ptr[card_protection.address++];//m_cart_rom[card_protection.address++];
130   card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++];//m_cart_rom[card_protection.address++];
136131   card_protection.failed=false;
137132   card_protection.unprotected=false;
138133}
r243714r243715
148143{
149144   video.reg[offset]=data;
150145   switch (offset) {
151   case 1: video.bitmap.write=data&0xc0; // more addressing mode
146   case 1:
147      if (data&0xf) printf("lcd mode %x\n", data);
148      video.bitmap.write=data&0xc0; // more addressing mode
152149      video.y_increment=data&0x40;
153150      break;
154   case 2: video.bitmap.xpos=data;break; // at least 7 bits
155   case 3: video.bitmap.ypos=data;break; // at least 7 bits
151   case 2: video.bitmap.xpos=data;break;
152   case 3:
153      if (data>=200) printf("lcd ypos: %x\n", data);
154      video.bitmap.ypos=data;
155      break;
156156   case 4: video.bitmap.page2=data&0x80;video.x=data&0x7f;break;
157157   case 5: video.y=data;break;
158158   case 7:
159   if (video.y>=200)
160   machine().ui().popup_time(2, "bitmap write to x:%x y:%x mode:%x data:%x\n", video.x, video.y, video.reg[1], data);
159161   if (video.bitmap.write) {
160      if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/)
161162      video.bitmap.data[video.bitmap.page2][video.y][video.x]=data;
162      else
163      logerror("%.6f %04x video bitmap x %x invalid\n",machine().time().as_double(), m_maincpu->pc(), video.x);
164163   } else {
165164      video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)]=data;
166165   }
r243714r243715
172171WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w )
173172{
174173   bank_multi=data;
175   membank("bankmulti")->set_base(m_cart_ptr+0x4000*data+1);
174   membank("bankmulti")->set_base(m_cart->get_rom_base()+0x4000*data+1);
176175}
177176
178177WRITE8_MEMBER( gamate_state::cart_bankswitch_w )
179178{
180   membank("bank")->set_base(m_cart_ptr+0x4000*data);
179   membank("bank")->set_base(m_cart->get_rom_base()+0x4000*data);
181180}
182181
183182READ8_MEMBER( gamate_state::gamate_video_r )
184183{
185   if (offset!=6) return 0;
186   UINT8 data=0;
187   if (video.bitmap.write) {
188      if (video.x<ARRAY_LENGTH(video.bitmap.data[0][0]) /*&& video.y<ARRAY_LENGTH(video.bitmap.data[0])*/)
189      data=video.bitmap.data[video.bitmap.page2][video.y][video.x];
190      else
191      logerror("%.6f video bitmap x %x invalid\n",machine().time().as_double(),video.x);
192   } else {
193   data=video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)];
194   }
195   if (m_maincpu->pc()<0xf000)
196   logerror("%.6f video read %04x %02x\n",machine().time().as_double(),offset, data);
197   return data;
184  if (offset!=6) return 0;
185  UINT8 data=0;
186  if (video.bitmap.write) {
187    data=video.bitmap.data[video.bitmap.page2][video.y][video.x];
188  } else {
189    data=video.bitmap.data[0][video.y][video.x&(ARRAY_LENGTH(video.bitmap.data[0][0])-1)];
190  }
191//  if (m_maincpu->pc()<0xf000)
192//    machine().ui().popup_time(2, "lcd read x:%x y:%x mode:%x data:%x\n", video.x, video.y, video.reg[1], data);
193  return data;
198194}
199195
200196WRITE8_MEMBER( gamate_state::gamate_audio_w )
201197{
202   logerror("%.6f %04x audio write %04x %02x\n",machine().time().as_double(),m_maincpu->pc(),offset,data);
198//  printf("audio write %x:%x\n", offset, data);//logerror("%.6f %04x audio write %04x %02x\n",machine().time().as_double(),m_maincpu->pc(),offset,data);
199  m_sound->device_w(space, offset, data);
203200}
204201
205202READ8_MEMBER( gamate_state::gamate_audio_r )
206203{
207   logerror("%.6f %04x audio read %04x \n",machine().time().as_double(),m_maincpu->pc(),offset);
208   return 0;
204// legend of dragon knight
205//  machine().ui().popup_time(2, "%.6f %04x audio read %04x \n",machine().time().as_double(),m_maincpu->pc(),offset);
206  return 0;
209207}
210208
211209
212210READ8_MEMBER( gamate_state::gamate_pad_r )
213211{
214   UINT8 data=m_io_joy->read();
215   return data;
212  UINT8 data=m_io_joy->read();
213  return data;
216214}
217215
218216static ADDRESS_MAP_START( gamate_mem, AS_PROGRAM, 8, gamate_state )
219   AM_RANGE(0x0000, 0x03ff) AM_RAM
220   AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w)
221   AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r)
222   AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w)
223   AM_RANGE(0x5800, 0x5800) AM_READ(newer_protection_set)
224   AM_RANGE(0x5900, 0x5900) AM_WRITE(protection_reset)
225   AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r)
217    AM_RANGE(0x0000, 0x03ff) AM_RAM
218  AM_RANGE(0x4000, 0x400d) AM_READWRITE(gamate_audio_r, gamate_audio_w)
219  AM_RANGE(0x4400, 0x4400) AM_READ(gamate_pad_r)
220  AM_RANGE(0x5000, 0x5007) AM_READWRITE(gamate_video_r, gamate_video_w)
221  AM_RANGE(0x5800, 0x5800) AM_READ(newer_protection_set)
222  AM_RANGE(0x5900, 0x5900) AM_WRITE(protection_reset)
223  AM_RANGE(0x5a00, 0x5a00) AM_READ(protection_r)
226224
227   AM_RANGE(0x6001, 0x9fff) AM_READ_BANK("bankmulti")
228   AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank")
225  AM_RANGE(0x6001, 0x9fff) AM_READ_BANK("bankmulti")
226  AM_RANGE(0xa000, 0xdfff) AM_READ_BANK("bank")
229227
230228   AM_RANGE(0x6000, 0x6000) AM_READWRITE(gamate_cart_protection_r, gamate_cart_protection_w)
231229   AM_RANGE(0x8000, 0x8000) AM_WRITE(cart_bankswitchmulti_w)
232230   AM_RANGE(0xc000, 0xc000) AM_WRITE(cart_bankswitch_w)
233231
234   AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios")
232  AM_RANGE(0xf000, 0xffff) AM_ROM AM_SHARE("bios")
235233ADDRESS_MAP_END
236234
237235
r243714r243715
247245   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SELECT) PORT_NAME("Select")
248246INPUT_PORTS_END
249247
250#ifdef USE_GFX
251static const struct gfx_layout gamate_charlayout =
248static const unsigned short gamate_palette[4] =
252249{
253      4,      /* width of object */
254      1,      /* height of object */
255      256,/* 256 characters */
256      2,      /* bits per pixel */
257      { 0,4 }, /* no bitplanes */
258      /* x offsets */
259      { 0,1,2,3 },
260      /* y offsets */
261      { 0 },
262      8*1 /* size of 1 object in bits */
250   0,1,2,3
263251};
264252
265static GFXDECODE_START( gamate )
266      GFXDECODE_ENTRY( "gfx1", 0x0000, gamate_charlayout, 0, 0x100 )
267GFXDECODE_END
268#endif
269253
270254/* palette in red, green, blue tribles */
271255static const unsigned char gamate_colors[4][3] =
272256{
273   { 255,255,255 },
274   { 0xa0, 0xa0, 0xa0 },
275   { 0x60, 0x60, 0x60 },
276   { 0, 0, 0 }
257  { 255,255,255 },
258  { 0xa0, 0xa0, 0xa0 },
259  { 0x60, 0x60, 0x60 },
260  { 0, 0, 0 }
277261};
278262
279263PALETTE_INIT_MEMBER(gamate_state, gamate)
r243714r243715
286270   }
287271}
288272
289#ifndef USE_GFX
290273static void BlitPlane(UINT16* line, UINT8 plane1, UINT8 plane2)
291274{
292275   line[3]=(plane1&1)|((plane2<<1)&2);
r243714r243715
294277   line[1]=((plane1>>2)&1)|((plane2>>1)&2);
295278   line[0]=((plane1>>3)&1)|((plane2>>2)&2);
296279}
297#endif
298280
299281UINT32 gamate_state::screen_update_gamate(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
300282{
301   int x, y, j;
302   for (y=0;y<152;y++) {
303   for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) {
304      UINT8 d1=video.bitmap.data[0][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f];
305      UINT8 d2=video.bitmap.data[1][(y+video.bitmap.ypos)&0xff][(j+video.bitmap.xpos/8)&0x1f];
306#ifdef USE_GFX
307      m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, (d1&0xf)|((d2&0xf)<<4), 0,0,0,x+4,y);
308   m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, (d1>>4)|(d2&0xf0),0,0,0,x,y);
309#else
310      BlitPlane(&bitmap.pix16(y, x+4), d1, d2);
311      BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4);
312#endif
313   }
314   }
315   return 0;
283  int x, y, j;
284  for (y=0;y<152;y++) {
285    for (x=-(video.bitmap.xpos&7), j=0;x<160;x+=8, j++) {     
286      UINT8 d1, d2;
287      if (video.bitmap.ypos<200) {
288   d1=video.bitmap.data[0][(y+video.bitmap.ypos)%200][(j+video.bitmap.xpos/8)&0x1f];
289   d2=video.bitmap.data[1][(y+video.bitmap.ypos)%200][(j+video.bitmap.xpos/8)&0x1f];
290      } else if ((video.bitmap.ypos&0xf)<8) { // lcdtest, of course still some registers not known, my gamate doesn't display bottom lines
291   int yi=(y+(video.bitmap.ypos&0xf)-8);
292   if (yi<0) yi=video.bitmap.ypos+y; // in this case only 2nd plane used!?, source of first plane?
293   d1=video.bitmap.data[0][yi][(j+video.bitmap.xpos/8)&0x1f]; // value of lines bevor 0 chaos
294   d2=video.bitmap.data[1][yi][(j+video.bitmap.xpos/8)&0x1f];
295      } else {
296   d1=video.bitmap.data[0][y][(j+video.bitmap.xpos/8)&0x1f];
297   d2=video.bitmap.data[1][y][(j+video.bitmap.xpos/8)&0x1f];   
298      }
299      BlitPlane(&bitmap.pix16(y, x+4), d1, d2);
300      BlitPlane(&bitmap.pix16(y, x), d1>>4, d2>>4);
301    }
302  }
303  return 0;
316304}
317305
318306DRIVER_INIT_MEMBER(gamate_state,gamate)
319307{
320308   memset(&video, 0, sizeof(video));/* memset(m_ram, 0, sizeof(m_ram));*/
321#ifdef USE_GFX
322   UINT8 *gfx=memregion("gfx1")->base();
323   for (int i=0; i<256; i++) gfx[i]=i;
324#endif
325309   timer1 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamate_state::gamate_timer),this));
326310   timer2 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamate_state::gamate_timer2),this));
327311}
r243714r243715
329313
330314void gamate_state::machine_start()
331315{
332   m_cart_ptr = memregion("maincpu")->base() + 0x6000;
333316   if (m_cart->exists()) {
334//      m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r));
335      m_cart_ptr = m_cart->get_rom_base();
317//      m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r));
336318      membank("bankmulti")->set_base(m_cart->get_rom_base()+1);
337319      membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset
338320   }
339//  m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // default bios: $47 protection readback
321//   m_bios[0xdf1]=0xea; m_bios[0xdf2]=0xea; // default bios: $47 protection readback
340322   card_protection.set=false;
341323   bank_multi=0;
342324   card_protection.unprotected=false;
r243714r243715
367349   timer1->enable(TRUE);
368350   timer1->reset(m_maincpu->cycles_to_attotime(10/* cycles short enought to clear irq line early enough*/));
369351   timer2->enable(TRUE);
370   timer2->reset(m_maincpu->cycles_to_attotime(40000));
352   timer2->reset(m_maincpu->cycles_to_attotime(32768/2));
371353}
372354
373355
r243714r243715
376358}
377359
378360static MACHINE_CONFIG_START( gamate, gamate_state )
379   MCFG_CPU_ADD("maincpu", M6502, 4433000)
361   MCFG_CPU_ADD("maincpu", M6502, 4433000/2)
380362   MCFG_CPU_PROGRAM_MAP(gamate_mem)
381363   MCFG_CPU_VBLANK_INT_DRIVER("screen", gamate_state,  gamate_interrupt)
382364
r243714r243715
387369   MCFG_SCREEN_UPDATE_DRIVER(gamate_state, screen_update_gamate)
388370   MCFG_SCREEN_PALETTE("palette")
389371
390#ifdef USE_GFX
391   MCFG_GFXDECODE_ADD("gfxdecode", "palette", gamate )
392#endif
393372   MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(gamate_colors))
394373   MCFG_PALETTE_INIT_OWNER(gamate_state, gamate)
395374   MCFG_DEFAULT_LAYOUT(layout_lcd)
396375
376   /* sound hardware */
377   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
378   MCFG_SOUND_ADD("custom", GAMATE_SND, 0)
379   MCFG_SOUND_ROUTE(0, "lspeaker", 0.50)
380   MCFG_SOUND_ROUTE(1, "rspeaker", 0.50)
381   
397382   MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "gamate_cart")
398383   MCFG_GENERIC_MANDATORY
399384
r243714r243715
407392   ROMX_LOAD("gamate_bios_umc.bin", 0xf000, 0x1000, CRC(07090415) SHA1(ea449dc607601f9a68d855ad6ab53800d2e99297), ROM_BIOS(1) )
408393   ROM_SYSTEM_BIOS(1, "newer", "NEWER")
409394   ROMX_LOAD("gamate_bios_9130__unknown__bit_icasc00001_9130-bs_r32261.bin", 0xf000, 0x1000, CRC(03a5f3a7) SHA1(4e9dfbfe916ca485530ef4221593ab68738e2217), ROM_BIOS(2) )
410#ifdef USE_GFX
411   ROM_REGION(0x100,"gfx1", ROMREGION_ERASEFF)
412#endif
413395ROM_END
414396
415397
416398/*    YEAR  NAME      PARENT  COMPAT    MACHINE   INPUT    CLASS          INIT      COMPANY    FULLNAME */
417CONS( 19??, gamate,  0,      0,        gamate,  gamate, gamate_state, gamate, "Bit Corp", "Gamate", GAME_NO_SOUND)
399CONS( 19??, gamate,  0,      0,        gamate,  gamate, gamate_state, gamate, "Bit Corp", "Gamate", GAME_IMPERFECT_SOUND)
400
401
trunk/src/mess/includes/gamate.h
r0r243715
1/*****************************************************************************
2 *
3 * includes/gamate.h
4 *
5 ****************************************************************************/
6
7#ifndef GAMATE_H_
8#define GAMATE_H_
9
10#include "cpu/m6502/m6502.h"
11#include "bus/generic/slot.h"
12#include "bus/generic/carts.h"
13
14struct GAMATE_CHANNEL
15{
16   GAMATE_CHANNEL() :
17//      on(0),
18//      waveform(0),
19      volume(0),
20      pos(0),
21      size(0)
22//      count(0)
23   {
24   }
25
26   int on;
27   int /*waveform,*/ volume;
28   int pos;
29   int size;
30//   int count;
31};
32
33
34// ======================> gamate_sound_device
35
36class gamate_sound_device : public device_t,
37                        public device_sound_interface
38{
39public:
40   gamate_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
41   ~gamate_sound_device() { }
42
43protected:
44   // device-level overrides
45   virtual void device_start();
46
47   // sound stream update overrides
48   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
49
50public:
51   DECLARE_WRITE8_MEMBER( device_w );
52
53private:
54 
55   sound_stream *m_mixer_channel;
56   GAMATE_CHANNEL m_channels[3];
57   UINT8 reg[14];
58};
59
60extern const device_type GAMATE_SND;
61
62#endif /* GAMATE_H_ */
trunk/src/mess/mess.mak
r243714r243715
19501950   $(MESS_DRIVERS)/fc100.o     \
19511951   $(MESS_DRIVERS)/fk1.o       \
19521952   $(MESS_DRIVERS)/ft68m.o     \
1953   $(MESS_DRIVERS)/gamate.o    \
1953   $(MESS_DRIVERS)/gamate.o    $(MESS_AUDIO)/gamate.o    \
19541954   $(MESS_DRIVERS)/gameking.o  \
19551955   $(MESS_DRIVERS)/gimix.o     \
19561956   $(MESS_DRIVERS)/grfd2301.o  \


Previous 199869 Revisions Next


© 1997-2024 The MAME Team