mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-13 10:31:04 +00:00
save speaker volume to XPRAM
This commit is contained in:
parent
d3aa80f703
commit
4cc1333939
@ -25,6 +25,7 @@
|
||||
#include "user_strings.h"
|
||||
#include "audio.h"
|
||||
#include "audio_defs.h"
|
||||
#include "xpram.h"
|
||||
|
||||
#include <SDL_mutex.h>
|
||||
#include <SDL_audio.h>
|
||||
@ -369,6 +370,7 @@ void audio_set_speaker_volume(uint32 vol)
|
||||
speaker_volume = ((vol >> 16) + (vol & 0xffff)) / 2;
|
||||
if (speaker_volume > MAC_MAX_VOLUME)
|
||||
speaker_volume = MAC_MAX_VOLUME;
|
||||
XPRAM[8] = (XPRAM[8] & 0xf8) | (speaker_volume * 7 / 256 & 7);
|
||||
}
|
||||
|
||||
static int get_audio_volume() {
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "user_strings.h"
|
||||
#include "prefs.h"
|
||||
#include "main.h"
|
||||
#include "audio.h"
|
||||
|
||||
#define DEBUG 0
|
||||
#include "debug.h"
|
||||
@ -168,6 +169,9 @@ bool InitAll(const char *vmdir)
|
||||
|
||||
// Init audio
|
||||
AudioInit();
|
||||
int vol = (XPRAM[8] & 7) * 256 / 7;
|
||||
vol += vol < 256;
|
||||
audio_set_speaker_volume(vol | vol << 16);
|
||||
|
||||
// Init video
|
||||
if (!VideoInit(ROMVersion == ROM_VERSION_64K || ROMVersion == ROM_VERSION_PLUS || ROMVersion == ROM_VERSION_CLASSIC))
|
||||
|
Loading…
x
Reference in New Issue
Block a user