src/mess/audio/mac.c
| r4258 | r4259 | |
| 82 | 82 | /* |
| 83 | 83 | Set the sound enable flag (VIA port line) |
| 84 | 84 | */ |
| 85 | | void mac_enable_sound(int on) |
| 85 | void mac_enable_sound(running_machine *machine, int on) |
| 86 | 86 | { |
| 87 | 87 | sample_enable = on; |
| 88 | 88 | } |
| r4258 | r4259 | |
| 92 | 92 | /* |
| 93 | 93 | Set the current sound buffer (one VIA port line) |
| 94 | 94 | */ |
| 95 | | void mac_set_sound_buffer(int buffer) |
| 95 | void mac_set_sound_buffer(running_machine *machine, int buffer) |
| 96 | 96 | { |
| 97 | 97 | if (buffer) |
| 98 | 98 | mac_snd_buf_ptr = (UINT16 *) (mess_ram + mess_ram_size - MAC_MAIN_SND_BUF_OFFSET); |
| r4258 | r4259 | |
| 105 | 105 | /* |
| 106 | 106 | Set the current sound volume (3 VIA port line) |
| 107 | 107 | */ |
| 108 | | void mac_set_volume(int volume) |
| 108 | void mac_set_volume(running_machine *machine, int volume) |
| 109 | 109 | { |
| 110 | 110 | stream_update(mac_stream); |
| 111 | 111 | |
| r4258 | r4259 | |
| 119 | 119 | /* |
| 120 | 120 | Fetch one byte from sound buffer and put it to sound output (called every scanline) |
| 121 | 121 | */ |
| 122 | | void mac_sh_updatebuffer(void) |
| 122 | void mac_sh_updatebuffer(running_machine *machine) |
| 123 | 123 | { |
| 124 | 124 | static int indexx; |
| 125 | 125 | UINT16 *base = mac_snd_buf_ptr; |
src/mess/includes/mac.h
| r4258 | r4259 | |
| 69 | 69 | |
| 70 | 70 | CUSTOM_START( mac_sh_start ); |
| 71 | 71 | |
| 72 | | void mac_enable_sound( int on ); |
| 73 | | void mac_set_sound_buffer( int buffer ); |
| 74 | | void mac_set_volume( int volume ); |
| 72 | void mac_enable_sound( running_machine *machine, int on ); |
| 73 | void mac_set_sound_buffer( running_machine *machine, int buffer ); |
| 74 | void mac_set_volume( running_machine *machine, int volume ); |
| 75 | 75 | |
| 76 | | void mac_sh_updatebuffer(void); |
| 76 | void mac_sh_updatebuffer(running_machine *machine); |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | #endif /* MAC_H_ */ |
src/mess/machine/mac.c
| r4258 | r4259 | |
| 1732 | 1732 | |
| 1733 | 1733 | if (mac_model < MODEL_MAC_SE) // SE no longer has dual buffers |
| 1734 | 1734 | { |
| 1735 | | mac_set_sound_buffer((data & 0x08) >> 3); |
| 1735 | mac_set_sound_buffer(device->machine, (data & 0x08) >> 3); |
| 1736 | 1736 | } |
| 1737 | | mac_set_volume(data & 0x07); |
| 1737 | mac_set_volume(device->machine, data & 0x07); |
| 1738 | 1738 | |
| 1739 | 1739 | /* Early Mac models had VIA A4 control overlaying. In the Mac SE (and |
| 1740 | 1740 | * possibly later models), overlay was set on reset, but cleared on the |
| r4258 | r4259 | |
| 1747 | 1747 | { |
| 1748 | 1748 | int new_rtc_rTCClk; |
| 1749 | 1749 | |
| 1750 | | mac_enable_sound((data & 0x80) == 0); |
| 1750 | mac_enable_sound(device->machine, (data & 0x80) == 0); |
| 1751 | 1751 | |
| 1752 | 1752 | // SE and Classic have SCSI enable/disable here |
| 1753 | 1753 | if (mac_model >= MODEL_MAC_SE) |
| r4258 | r4259 | |
| 1883 | 1883 | mac_set_screen_buffer(1); |
| 1884 | 1884 | |
| 1885 | 1885 | /* setup sound */ |
| 1886 | | mac_set_sound_buffer(0); |
| 1886 | mac_set_sound_buffer(machine, 0); |
| 1887 | 1887 | |
| 1888 | 1888 | if (has_adb()) |
| 1889 | 1889 | { |
| r4258 | r4259 | |
| 1895 | 1895 | |
| 1896 | 1896 | if ((mac_model == MODEL_MAC_SE) || (mac_model == MODEL_MAC_CLASSIC)) |
| 1897 | 1897 | { |
| 1898 | | mac_set_sound_buffer(1); |
| 1898 | mac_set_sound_buffer(machine, 1); |
| 1899 | 1899 | |
| 1900 | 1900 | // classic will fail RAM test and try to boot appletalk if RAM is not all zero |
| 1901 | 1901 | memset(mess_ram, 0, mess_ram_size); |
| r4258 | r4259 | |
| 2084 | 2084 | { |
| 2085 | 2085 | int scanline; |
| 2086 | 2086 | |
| 2087 | | mac_sh_updatebuffer(); |
| 2087 | mac_sh_updatebuffer(machine); |
| 2088 | 2088 | |
| 2089 | 2089 | scanline = video_screen_get_vpos(machine->primary_screen); |
| 2090 | 2090 | if (scanline == MAC_V_VIS) |
src/mess/drivers/nc.c
| r4258 | r4259 | |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | |
| 704 | | static void nc_sound_update(int channel) |
| 704 | static void nc_sound_update(running_machine *machine, int channel) |
| 705 | 705 | { |
| 706 | 706 | int on; |
| 707 | 707 | int frequency; |
| r4258 | r4259 | |
| 733 | 733 | nc_sound_channel_periods[0] = |
| 734 | 734 | (nc_sound_channel_periods[0] & 0x0ff00) | (data & 0x0ff); |
| 735 | 735 | |
| 736 | | nc_sound_update(0); |
| 736 | nc_sound_update(space->machine, 0); |
| 737 | 737 | } |
| 738 | 738 | break; |
| 739 | 739 | |
| r4258 | r4259 | |
| 742 | 742 | nc_sound_channel_periods[0] = |
| 743 | 743 | (nc_sound_channel_periods[0] & 0x0ff) | ((data & 0x0ff)<<8); |
| 744 | 744 | |
| 745 | | nc_sound_update(0); |
| 745 | nc_sound_update(space->machine, 0); |
| 746 | 746 | } |
| 747 | 747 | break; |
| 748 | 748 | |
| r4258 | r4259 | |
| 752 | 752 | nc_sound_channel_periods[1] = |
| 753 | 753 | (nc_sound_channel_periods[1] & 0x0ff00) | (data & 0x0ff); |
| 754 | 754 | |
| 755 | | nc_sound_update(1); |
| 755 | nc_sound_update(space->machine, 1); |
| 756 | 756 | } |
| 757 | 757 | break; |
| 758 | 758 | |
| r4258 | r4259 | |
| 761 | 761 | nc_sound_channel_periods[1] = |
| 762 | 762 | (nc_sound_channel_periods[1] & 0x0ff) | ((data & 0x0ff)<<8); |
| 763 | 763 | |
| 764 | | nc_sound_update(1); |
| 764 | nc_sound_update(space->machine, 1); |
| 765 | 765 | } |
| 766 | 766 | break; |
| 767 | 767 | |