Previous 15994 Revisions Next

r4312 Friday 20th February, 2009 at 12:55:14 UTC by Nathan Woods
Yet more CBM regressions
[src/emu/sound]sid6581.c sid6581.h
[src/mess/drivers]c128.c c16.c c64.c cbmb.c
[src/mess/machine]c128.c c16.c c64.c c65.c

src/emu/sound/sid6581.c
r4311r4312
1212
1313
1414
15static SID6581 *get_sid(int indx)
15static SID6581 *get_sid(const device_config *device)
1616{
17   return NULL;
18//  sound_type type = sndnum_to_sndti(indx, NULL);
19//  assert((type == SOUND_SID6581) || (type == SOUND_SID8580));
20//  return (SID6581 *) sndti_token(space->machine, type, indx);
17   assert(device != NULL);
18   assert((sound_get_type(device) == SOUND_SID6581) || (sound_get_type(device) == SOUND_SID8580));
19   return (SID6581 *) device->token;
2120}
2221
2322
r4311r4312
7069
7170
7271
73READ8_HANDLER ( sid6581_0_port_r )
72READ8_DEVICE_HANDLER ( sid6581_r )
7473{
75   return sid6581_port_r(space->machine, get_sid(0), offset);
74   return sid6581_port_r(device->machine, get_sid(device), offset);
7675}
7776
78READ8_HANDLER ( sid6581_1_port_r )
79{
80   return sid6581_port_r(space->machine, get_sid(1), offset);
81}
8277
83WRITE8_HANDLER ( sid6581_0_port_w )
78WRITE8_DEVICE_HANDLER ( sid6581_w )
8479{
85   sid6581_port_w(get_sid(0), offset, data);
80   sid6581_port_w(get_sid(device), offset, data);
8681}
8782
88WRITE8_HANDLER ( sid6581_1_port_w )
89{
90   sid6581_port_w(get_sid(1), offset, data);
91}
9283
9384
94
9585/**************************************************************************
9686 * Generic get_info
9787 **************************************************************************/
src/emu/sound/sid6581.h
r4311r4312
2727} ;
2828
2929
30READ8_HANDLER  ( sid6581_0_port_r );
31READ8_HANDLER  ( sid6581_1_port_r );
32WRITE8_HANDLER ( sid6581_0_port_w );
33WRITE8_HANDLER ( sid6581_1_port_w );
30READ8_DEVICE_HANDLER  ( sid6581_r );
31WRITE8_DEVICE_HANDLER ( sid6581_w );
3432
3533DEVICE_GET_INFO( sid6581 );
3634DEVICE_GET_INFO( sid8580 );
src/mess/machine/c65.c
r4311r4312
473473static WRITE8_HANDLER ( c65_write_io )
474474{
475475   running_machine *machine = space->machine;
476   const device_config *sid_0 = devtag_get_device(space->machine, SOUND, "sid_r");
477   const device_config *sid_1 = devtag_get_device(space->machine, SOUND, "sid_l");
478
476479   switch(offset&0xf00) {
477480   case 0x000:
478481      if (offset < 0x80)
r4311r4312
489492      break;
490493   case 0x400:
491494      if (offset<0x420) /* maybe 0x20 */
492         sid6581_0_port_w (space, offset & 0x3f, data);
495         sid6581_w(sid_0, offset & 0x3f, data);
493496      else if (offset<0x440)
494         sid6581_1_port_w(space, offset&0x3f, data);
497         sid6581_w(sid_1, offset & 0x3f, data);
495498      else
496499         DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data));
497500      break;
r4311r4312
530533static READ8_HANDLER ( c65_read_io )
531534{
532535   running_machine *machine = space->machine;
536   const device_config *sid_0 = devtag_get_device(space->machine, SOUND, "sid_r");
537   const device_config *sid_1 = devtag_get_device(space->machine, SOUND, "sid_l");
538
533539   switch(offset&0xf00) {
534540   case 0x000:
535541      if (offset < 0x80)
r4311r4312
547553      break;
548554   case 0x400:
549555      if (offset<0x420)
550         return sid6581_0_port_r(space, offset & 0x3f);
556         return sid6581_r(sid_0, offset & 0x3f);
551557      if (offset<0x440)
552         return sid6581_1_port_r(space, offset&0x3f);
558         return sid6581_r(sid_1, offset & 0x3f);
553559      DBG_LOG (1, "io read", ("%.3x\n", offset));
554560      break;
555561   case 0x500:
src/mess/machine/c128.c
r4311r4312
9595   running_machine *machine = space->machine;
9696   const device_config *cia_0 = devtag_get_device(space->machine, CIA6526R1, "cia_0");
9797   const device_config *cia_1 = devtag_get_device(space->machine, CIA6526R1, "cia_1");
98   const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581");
9899
99100   UINT8 c64_port6510 = (UINT8) device_get_info_int(space->machine->cpu[0], CPUINFO_INT_M6510_PORT);
100101
r4311r4312
113114         vic2_port_w (space, offset & 0x3ff, data);
114115         break;
115116      case 4:
116         sid6581_0_port_w (space, offset & 0x3f, data);
117         sid6581_w(sid, offset & 0x3f, data);
117118         break;
118119      case 5:
119120         c128_mmu8722_port_w (space, offset & 0xff, data);
r4311r4312
150151   running_machine *machine = space->machine;
151152   const device_config *cia_0 = devtag_get_device(space->machine, CIA6526R1, "cia_0");
152153   const device_config *cia_1 = devtag_get_device(space->machine, CIA6526R1, "cia_1");
154   const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581");
153155
154156   if (offset < 0x400)
155157      return vic2_port_r (space, offset & 0x3ff);
156158   else if (offset < 0x500)
157      return sid6581_0_port_r (space, offset & 0xff);
159      return sid6581_r (sid, offset & 0xff);
158160   else if (offset < 0x600)
159161      return c128_mmu8722_port_r (space, offset & 0xff);
160162   else if (offset < 0x800)
src/mess/machine/c16.c
r4311r4312
490490MACHINE_RESET( c16 )
491491{
492492   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
493   const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581");
493494   
494495   c364_speech_init(machine);
495496
496497   if (read_cfg1(machine) & 0x80)  /* SID card present */
497498   {
498      memory_install_read8_handler(space, 0xfd40, 0xfd5f, 0, 0, sid6581_0_port_r);
499      memory_install_write8_handler(space,  0xfd40, 0xfd5f, 0, 0, sid6581_0_port_w);
500      memory_install_read8_handler(space, 0xfe80, 0xfe9f, 0, 0, sid6581_0_port_r);
501      memory_install_write8_handler(space,  0xfe80, 0xfe9f, 0, 0, sid6581_0_port_w);
499      memory_install_read8_device_handler(space, sid, 0xfd40, 0xfd5f, 0, 0, sid6581_r);
500      memory_install_write8_device_handler(space,  sid, 0xfd40, 0xfd5f, 0, 0, sid6581_w);
501      memory_install_read8_device_handler(space, sid, 0xfe80, 0xfe9f, 0, 0, sid6581_r);
502      memory_install_write8_device_handler(space,  sid, 0xfe80, 0xfe9f, 0, 0, sid6581_w);
502503   }
503504   else
504505   {
src/mess/machine/c64.c
r4311r4312
470470   running_machine *machine = space->machine;
471471   const device_config *cia_0 = devtag_get_device(space->machine, CIA6526R1, "cia_0");
472472   const device_config *cia_1 = devtag_get_device(space->machine, CIA6526R1, "cia_1");
473   const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581");
473474
474475   c64_io_mirror[ offset ] = data;
475476   if (offset < 0x400) {
476477      vic2_port_w (space, offset & 0x3ff, data);
477478   } else if (offset < 0x800) {
478      sid6581_0_port_w (space, offset & 0x3ff, data);
479      sid6581_w (sid, offset & 0x3ff, data);
479480   } else if (offset < 0xc00)
480481      c64_colorram[offset & 0x3ff] = data | 0xf0;
481482   else if (offset < 0xd00)
r4311r4312
516517   running_machine *machine = space->machine;
517518   const device_config *cia_0 = devtag_get_device(space->machine, CIA6526R1, "cia_0");
518519   const device_config *cia_1 = devtag_get_device(space->machine, CIA6526R1, "cia_1");
520   const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581");
519521
520522   if (offset < 0x400)
521523      return vic2_port_r (space, offset & 0x3ff);
522524
523525   else if (offset < 0x800)
524      return sid6581_0_port_r (space, offset & 0x3ff);
526      return sid6581_r (sid, offset & 0x3ff);
525527
526528   else if (offset < 0xc00)
527529      return c64_colorram[offset & 0x3ff];
src/mess/drivers/cbmb.c
r4311r4312
133133//  AM_RANGE(0xfd800, 0xfd8ff)
134134   AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_DEVREAD(MC6845, "crtc", mc6845_register_r)
135135   /* disk units */
136   AM_RANGE(0xfda00, 0xfdaff) AM_READ( sid6581_0_port_r )
136   AM_RANGE(0xfda00, 0xfdaff) AM_DEVREAD(SOUND, "sid6581", sid6581_r)
137137   /* db00 coprocessor */
138138   AM_RANGE(0xfdc00, 0xfdcff) AM_DEVREAD( CIA6526R1, "cia", cia_r )
139139   /* dd00 acia */
r4311r4312
156156   AM_RANGE(0xfd800, 0xfd800) AM_MIRROR( 0xfe ) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
157157   AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
158158   /* disk units */
159   AM_RANGE(0xfda00, 0xfdaff) AM_WRITE( sid6581_0_port_w)
159   AM_RANGE(0xfda00, 0xfdaff) AM_DEVWRITE(SOUND, "sid6581", sid6581_w)
160160   /* db00 coprocessor */
161161   AM_RANGE(0xfdc00, 0xfdcff) AM_DEVWRITE( CIA6526R1, "cia", cia_w)
162162   /* dd00 acia */
r4311r4312
180180   AM_RANGE(0xfd400, 0xfd7ff) AM_READ( SMH_RAM ) /* colorram */
181181   AM_RANGE(0xfd800, 0xfd8ff) AM_READ( vic2_port_r )
182182   /* disk units */
183   AM_RANGE(0xfda00, 0xfdaff) AM_READ( sid6581_0_port_r )
183   AM_RANGE(0xfda00, 0xfdaff) AM_DEVREAD(SOUND, "sid6581", sid6581_r)
184184   /* db00 coprocessor */
185185   AM_RANGE(0xfdc00, 0xfdcff) AM_DEVREAD( CIA6526R1, "cia", cia_r )
186186   /* dd00 acia */
r4311r4312
204204   AM_RANGE(0xfd400, 0xfd7ff) AM_WRITE( cbmb_colorram_w) AM_BASE( &cbmb_colorram )
205205   AM_RANGE(0xfd800, 0xfd8ff) AM_WRITE( vic2_port_w )
206206   /* disk units */
207   AM_RANGE(0xfda00, 0xfdaff) AM_WRITE( sid6581_0_port_w)
207   AM_RANGE(0xfda00, 0xfdaff) AM_DEVWRITE(SOUND, "sid6581", sid6581_w)
208208   /* db00 coprocessor */
209209   AM_RANGE(0xfdc00, 0xfdcff) AM_DEVWRITE( CIA6526R1, "cia", cia_w)
210210   /* dd00 acia */
src/mess/drivers/c128.c
r4311r4312
251251static ADDRESS_MAP_START( c128_z80_io , ADDRESS_SPACE_IO, 8)
252252   AM_RANGE(0x1000, 0x13ff) AM_READWRITE(c64_colorram_read, c64_colorram_write)
253253   AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(vic2_port_r, vic2_port_w)
254   AM_RANGE(0xd400, 0xd4ff) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w)
254   AM_RANGE(0xd400, 0xd4ff) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w)
255255   AM_RANGE(0xd500, 0xd5ff) AM_READWRITE(c128_mmu8722_port_r, c128_mmu8722_port_w)
256256   AM_RANGE(0xd600, 0xd7ff) AM_READWRITE(vdc8563_port_r, vdc8563_port_w)
257257   AM_RANGE(0xdc00, 0xdcff) AM_DEVREADWRITE(CIA6526R1, "cia_0", cia_r, cia_w)
src/mess/drivers/c16.c
r4311r4312
192192   AM_RANGE(0x4000, 0x7fff) AM_WRITE( c16_write_4000)  /*configured in c16_common_init */
193193   AM_RANGE(0x8000, 0xbfff) AM_WRITE( c16_write_8000)  /*configured in c16_common_init */
194194   AM_RANGE(0xc000, 0xfcff) AM_WRITE( c16_write_c000)  /*configured in c16_common_init */
195   AM_RANGE(0xfd40, 0xfd5f) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w)   /* sidcard, eoroidpro ... */
195   AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w)   /* sidcard, eoroidpro ... */
196196   AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w)      /*configured in c16_common_init */
197197   AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w)      /*configured in c16_common_init */
198198   AM_RANGE(0xff20, 0xff3d) AM_WRITE( c16_write_ff20)  /*configure in c16_common_init */
r4311r4312
211211   AM_RANGE(0xfd30, 0xfd3f) AM_READWRITE(c16_6529_port_r, c16_6529_port_w) /* 6529 keyboard matrix */
212212   AM_RANGE(0xfdd0, 0xfddf) AM_WRITE( c16_select_roms) /* rom chips selection */
213213#if 0
214   AM_RANGE(0xfd40, 0xfd5f) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w)   /* sidcard, eoroidpro ... */
214   AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w)   /* sidcard, eoroidpro ... */
215215   AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w)      /*configured in c16_common_init */
216216   AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w)      /*configured in c16_common_init */
217217#endif
r4311r4312
235235   AM_RANGE(0xfd30, 0xfd3f) AM_READWRITE(c16_6529_port_r, c16_6529_port_w) /* 6529 keyboard matrix */
236236   AM_RANGE(0xfdd0, 0xfddf) AM_WRITE( c16_select_roms) /* rom chips selection */
237237#if 0
238   AM_RANGE(0xfd40, 0xfd5f) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w)   /* sidcard, eoroidpro ... */
238   AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w)   /* sidcard, eoroidpro ... */
239239   AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w)      /*configured in c16_common_init */
240240   AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w)      /*configured in c16_common_init */
241241#endif
src/mess/drivers/c64.c
r4311r4312
349349   AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(&c64_memory)
350350   AM_RANGE(0x8000, 0x9fff) AM_ROM AM_BASE(&c64_roml)
351351   AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(vic2_port_r, vic2_port_w)
352   AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w)
352   AM_RANGE(0xd400, 0xd7ff) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w)
353353   AM_RANGE(0xd800, 0xdbff) AM_READWRITE(SMH_RAM, c64_colorram_write) AM_BASE(&c64_colorram) /* colorram  */
354354   AM_RANGE(0xdc00, 0xdcff) AM_DEVREADWRITE(CIA6526R1, "cia_0", cia_r, cia_w)
355355   AM_RANGE(0xe000, 0xffff) AM_ROM AM_BASE(&c64_romh)            /* ram or kernel rom */
r4311r4312
493493
494494   /* sound hardware */
495495   MDRV_SPEAKER_STANDARD_MONO("mono")
496   MDRV_SOUND_ADD("sid", SID6581, VIC6567_CLOCK)
496   MDRV_SOUND_ADD("sid6581", SID6581, VIC6567_CLOCK)
497497   MDRV_SOUND_CONFIG(c64_sound_interface)
498498   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
499499   MDRV_SOUND_ADD("dac", DAC, 0)
r4311r4312
533533
534534   /* sound hardware */
535535   MDRV_SPEAKER_STANDARD_MONO("mono")
536   MDRV_SOUND_ADD("sid", SID6581, VIC6569_CLOCK)
536   MDRV_SOUND_ADD("sid6581", SID6581, VIC6569_CLOCK)
537537   MDRV_SOUND_CONFIG(c64_sound_interface)
538538   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
539539   MDRV_SOUND_ADD("dac", DAC, 0)
r4311r4312
557557   MDRV_CPU_REPLACE( "main", M6510, VIC6567_CLOCK)
558558   MDRV_CPU_PROGRAM_MAP( ultimax_mem, 0 )
559559
560   MDRV_SOUND_REPLACE("sid", SID6581, VIC6567_CLOCK)
560   MDRV_SOUND_REPLACE("sid6581", SID6581, VIC6567_CLOCK)
561561   MDRV_SOUND_CONFIG(c64_sound_interface)
562562   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
563563   

Previous 15994 Revisions Next


© 1998-2018 The MESS Team