Previous 15994 Revisions Next

r5728 Monday 14th September, 2009 at 10:05:50 UTC by Curt Coder
[VIP] Cleanup.
[src/mess/audio]vp550.c vp550.h
[src/mess/drivers]vip.c
[src/mess/includes]vip.h

src/mess/audio/vp550.c
r5727r5728
9797{
9898   if (state)
9999   {
100      cpu_set_input_line(device->machine->firstcpu, CDP1802_INPUT_LINE_INT, CLEAR_LINE);
100      cpu_set_input_line(device, CDP1802_INPUT_LINE_INT, CLEAR_LINE);
101101
102102      if (LOG) logerror("VP550 Clear Interrupt\n");
103103   }
r5727r5728
131131}
132132
133133/*-------------------------------------------------
134    vp550_vlmna_w - amplitude A write
134    vp550_vlmn_w - amplitude write
135135-------------------------------------------------*/
136136
137static WRITE8_DEVICE_HANDLER( vp550_vlmna_w )
137static WRITE8_DEVICE_HANDLER( vp550_vlmn_w )
138138{
139   vp550_t *vp550 = get_safe_token(device);
140139   float gain = 0.625f * (data & 0x0f);
141140
142   sound_set_output_gain(vp550->cdp1863[CHANNEL_A], 0, gain);
141   sound_set_output_gain(device, 0, gain);
143142
144   if (LOG) logerror("VP550 Volume A: %u\n", data & 0x0f);
143   if (LOG) logerror("VP550 '%s' Volume: %u\n", device->tag, data & 0x0f);
145144}
146145
147146/*-------------------------------------------------
148    vp550_vlmnb_w - amplitude B write
149-------------------------------------------------*/
150
151static WRITE8_DEVICE_HANDLER( vp550_vlmnb_w )
152{
153   vp550_t *vp550 = get_safe_token(device);
154   float gain = 0.625f * (data & 0x0f);
155
156   sound_set_output_gain(vp550->cdp1863[CHANNEL_B], 0, gain);
157
158   if (LOG) logerror("VP550 Volume B: %u\n", data & 0x0f);
159}
160
161/*-------------------------------------------------
162147    vp550_sync_w - interrupt enable write
163148-------------------------------------------------*/
164149
165150static WRITE8_DEVICE_HANDLER( vp550_sync_w )
166151{
167   vp550_t *vp550 = get_safe_token(device);
168
169   timer_device_enable(vp550->sync_timer, BIT(data, 0));
152   timer_device_enable(device, BIT(data, 0));
170153   
171154   if (LOG) logerror("VP550 Interrupt Enable: %u\n", BIT(data, 0));
172155}
r5727r5728
185168      memory_install_write8_device_handler(program, vp550->cdp1863[CHANNEL_A], 0x8001, 0x8001, 0, 0, cdp1863_str_w);
186169      memory_install_write8_device_handler(program, vp550->cdp1863[CHANNEL_B], 0x8002, 0x8002, 0, 0, cdp1863_str_w);
187170      memory_install_write8_device_handler(program, device, 0x8003, 0x8003, 0, 0, vp550_octave_w);
188      memory_install_write8_device_handler(program, device, 0x8010, 0x8010, 0, 0, vp550_vlmna_w);
189      memory_install_write8_device_handler(program, device, 0x8020, 0x8020, 0, 0, vp550_vlmnb_w);
190      memory_install_write8_device_handler(program, device, 0x8030, 0x8030, 0, 0, vp550_sync_w);
171      memory_install_write8_device_handler(program, vp550->cdp1863[CHANNEL_A], 0x8010, 0x8010, 0, 0, vp550_vlmn_w);
172      memory_install_write8_device_handler(program, vp550->cdp1863[CHANNEL_B], 0x8020, 0x8020, 0, 0, vp550_vlmn_w);
173      memory_install_write8_device_handler(program, vp550->sync_timer, 0x8030, 0x8030, 0, 0, vp550_sync_w);
191174   }
192175   else
193176   {
r5727r5728
201184}
202185
203186/*-------------------------------------------------
187    vp551_install_readwrite_handler - install
188   or uninstall write handlers
189-------------------------------------------------*/
190
191void vp551_install_write_handlers(const device_config *device, const address_space *program, int enabled)
192{
193}
194
195/*-------------------------------------------------
204196    TIMER_DEVICE_CALLBACK( sync_tick )
205197-------------------------------------------------*/
206198
src/mess/audio/vp550.h
r5727r5728
4444
4545/* install write handlers */
4646void vp550_install_write_handlers(const device_config *device, const address_space *program, int enabled) ATTR_NONNULL(1) ATTR_NONNULL(2);
47void vp551_install_write_handlers(const device_config *device, const address_space *program, int enabled) ATTR_NONNULL(1) ATTR_NONNULL(2);
4748
4849#endif /* __VP550__ */
src/mess/includes/vip.h
r5727r5728
5252   const device_config *cdp1863;
5353   const device_config *cassette;
5454   const device_config *beeper;
55   const device_config *vp595;
5556   const device_config *vp550;
56   const device_config *vp595;
57   const device_config *vp551;
5758};
5859
5960#endif
src/mess/drivers/vip.c
r5727r5728
540540   switch (input_port_read(device->machine, "SOUND"))
541541   {
542542   case VIP_SOUND_VP550:
543      vp550_sc1_w(driver_state->vp550, sc1);
544      break;
545
546543   case VIP_SOUND_VP551:
547//      vp551_sc1_w(driver_state->vp551, sc1);
544      vp550_sc1_w(device, sc1);
548545      break;
549546   }
550547}
r5727r5728
656653   state->cdp1862 = devtag_get_device(machine, CDP1862_TAG);
657654   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
658655   state->beeper = devtag_get_device(machine, DISCRETE_TAG);
656   state->vp595 = devtag_get_device(machine, VP595_TAG);
659657   state->vp550 = devtag_get_device(machine, VP550_TAG);
660   state->vp595 = devtag_get_device(machine, VP595_TAG);
658   state->vp551 = devtag_get_device(machine, VP551_TAG);
661659
662660   /* reset sound */
663661   discrete_sound_w(state->beeper, NODE_01, 0);
664662   vp595_q_w(state->vp595, 0);
665663   vp550_q_w(state->vp550, 0);
664   vp550_q_w(state->vp551, 0);
666665
667666   /* register for state saving */
668667   state_save_register_global(machine, state->reset);
r5727r5728
684683   device_reset(state->cdp1862);
685684
686685   /* reset devices */
686   device_reset(state->vp595);
687687   device_reset(state->vp550);
688   device_reset(state->vp595);
688   device_reset(state->vp551);
689689
690690   /* configure video */
691691   switch (input_port_read(machine, "VIDEO"))
r5727r5728
707707   case VIP_SOUND_SPEAKER:
708708      vp595_install_write_handlers(state->vp595, io, 0);
709709      vp550_install_write_handlers(state->vp550, program, 0);
710//      vp551_install_write_handlers(state->vp551, program, 0);
710      vp551_install_write_handlers(state->vp551, program, 0);
711711      break;
712712
713713   case VIP_SOUND_VP595:
714714      vp595_install_write_handlers(state->vp595, io, 1);
715715      vp550_install_write_handlers(state->vp550, program, 0);
716//      vp551_install_write_handlers(state->vp551, program, 0);
716      vp551_install_write_handlers(state->vp551, program, 0);
717717      break;
718718
719719   case VIP_SOUND_VP550:
720720      vp595_install_write_handlers(state->vp595, io, 0);
721721      vp550_install_write_handlers(state->vp550, program, 1);
722//      vp551_install_write_handlers(state->vp551, program, 0);
722      vp551_install_write_handlers(state->vp551, program, 0);
723723      break;
724724
725725   case VIP_SOUND_VP551:
726726      vp595_install_write_handlers(state->vp595, io, 0);
727727      vp550_install_write_handlers(state->vp550, program, 0);
728//      vp551_install_write_handlers(state->vp551, program, 1);
728      vp551_install_write_handlers(state->vp551, program, 1);
729729      break;
730730   }
731731
r5727r5728
776776
777777   MDRV_VP595_ADD
778778   MDRV_VP550_ADD(XTAL_3_52128MHz/2)
779   MDRV_VP551_ADD(XTAL_3_52128MHz/2)
779780
780781   /* devices */
781782   MDRV_QUICKLOAD_ADD("quickload", vip, "bin,c8,c8x", 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team