Previous 15994 Revisions Next

r4259 Friday 13th February, 2009 at 12:54:34 UTC by Nathan Woods
Minor cleanups
[src/mess/audio]cgenie.c mac.c
[src/mess/drivers]nc.c
[src/mess/includes]mac.h
[src/mess/machine]mac.c

src/mess/audio/mac.c
r4258r4259
8282/*
8383   Set the sound enable flag (VIA port line)
8484*/
85void mac_enable_sound(int on)
85void mac_enable_sound(running_machine *machine, int on)
8686{
8787   sample_enable = on;
8888}
r4258r4259
9292/*
9393   Set the current sound buffer (one VIA port line)
9494*/
95void mac_set_sound_buffer(int buffer)
95void mac_set_sound_buffer(running_machine *machine, int buffer)
9696{
9797   if (buffer)
9898      mac_snd_buf_ptr = (UINT16 *) (mess_ram + mess_ram_size - MAC_MAIN_SND_BUF_OFFSET);
r4258r4259
105105/*
106106   Set the current sound volume (3 VIA port line)
107107*/
108void mac_set_volume(int volume)
108void mac_set_volume(running_machine *machine, int volume)
109109{
110110   stream_update(mac_stream);
111111
r4258r4259
119119/*
120120   Fetch one byte from sound buffer and put it to sound output (called every scanline)
121121*/
122void mac_sh_updatebuffer(void)
122void mac_sh_updatebuffer(running_machine *machine)
123123{
124124   static int indexx;
125125   UINT16 *base = mac_snd_buf_ptr;
src/mess/audio/cgenie.c
r4258r4259
99#include "includes/cgenie.h"
1010#include "sound/ay8910.h"
1111
12static int control_port;
12static UINT8 control_port;
1313
1414READ8_HANDLER( cgenie_sh_control_port_r )
1515{
src/mess/includes/mac.h
r4258r4259
6969
7070CUSTOM_START( mac_sh_start );
7171
72void mac_enable_sound( int on );
73void mac_set_sound_buffer( int buffer );
74void mac_set_volume( int volume );
72void mac_enable_sound( running_machine *machine, int on );
73void mac_set_sound_buffer( running_machine *machine, int buffer );
74void mac_set_volume( running_machine *machine, int volume );
7575
76void mac_sh_updatebuffer(void);
76void mac_sh_updatebuffer(running_machine *machine);
7777
7878
7979#endif /* MAC_H_ */
src/mess/machine/mac.c
r4258r4259
17321732
17331733   if (mac_model < MODEL_MAC_SE)   // SE no longer has dual buffers
17341734   {
1735      mac_set_sound_buffer((data & 0x08) >> 3);
1735      mac_set_sound_buffer(device->machine, (data & 0x08) >> 3);
17361736   }
1737   mac_set_volume(data & 0x07);
1737   mac_set_volume(device->machine, data & 0x07);
17381738
17391739   /* Early Mac models had VIA A4 control overlaying.  In the Mac SE (and
17401740    * possibly later models), overlay was set on reset, but cleared on the
r4258r4259
17471747{
17481748   int new_rtc_rTCClk;
17491749
1750   mac_enable_sound((data & 0x80) == 0);
1750   mac_enable_sound(device->machine, (data & 0x80) == 0);
17511751
17521752   // SE and Classic have SCSI enable/disable here
17531753   if (mac_model >= MODEL_MAC_SE)
r4258r4259
18831883   mac_set_screen_buffer(1);
18841884
18851885   /* setup sound */
1886   mac_set_sound_buffer(0);
1886   mac_set_sound_buffer(machine, 0);
18871887
18881888   if (has_adb())
18891889   {
r4258r4259
18951895
18961896   if ((mac_model == MODEL_MAC_SE) || (mac_model == MODEL_MAC_CLASSIC))
18971897   {
1898      mac_set_sound_buffer(1);
1898      mac_set_sound_buffer(machine, 1);
18991899
19001900      // classic will fail RAM test and try to boot appletalk if RAM is not all zero
19011901      memset(mess_ram, 0, mess_ram_size);
r4258r4259
20842084{
20852085   int scanline;
20862086
2087   mac_sh_updatebuffer();
2087   mac_sh_updatebuffer(machine);
20882088
20892089   scanline = video_screen_get_vpos(machine->primary_screen);
20902090   if (scanline == MAC_V_VIS)
src/mess/drivers/nc.c
r4258r4259
701701}
702702
703703
704static void nc_sound_update(int channel)
704static void nc_sound_update(running_machine *machine, int channel)
705705{
706706        int on;
707707        int frequency;
r4258r4259
733733         nc_sound_channel_periods[0]  =
734734            (nc_sound_channel_periods[0] & 0x0ff00) | (data & 0x0ff);
735735
736         nc_sound_update(0);
736         nc_sound_update(space->machine, 0);
737737      }
738738      break;
739739
r4258r4259
742742         nc_sound_channel_periods[0] =
743743            (nc_sound_channel_periods[0] & 0x0ff) | ((data & 0x0ff)<<8);
744744
745         nc_sound_update(0);
745         nc_sound_update(space->machine, 0);
746746      }
747747      break;
748748
r4258r4259
752752         nc_sound_channel_periods[1]  =
753753            (nc_sound_channel_periods[1] & 0x0ff00) | (data & 0x0ff);
754754
755         nc_sound_update(1);
755         nc_sound_update(space->machine, 1);
756756      }
757757      break;
758758
r4258r4259
761761         nc_sound_channel_periods[1] =
762762            (nc_sound_channel_periods[1] & 0x0ff) | ((data & 0x0ff)<<8);
763763
764         nc_sound_update(1);
764         nc_sound_update(space->machine, 1);
765765      }
766766      break;
767767

Previous 15994 Revisions Next


© 1998-2018 The MESS Team