Commit 757e2ea2 authored by GnoStiC's avatar GnoStiC

puae 2.3.1

parent f73bdd59
# P-UAE
#
# 2010 Mustafa TUFAN (aka GnoStiC/BRONX)
#
#
#
base=" --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --enable-drvsnd "
cd32=" --enable-cd32 "
a600=" --enable-gayle "
scsi=" --enable-scsi-device --enable-ncr --enable-a2091 "
other=" --with-caps --enable-amax --disable-jit"
#
#
./bootstrap.sh
./configure --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --with-caps --enable-drvsnd --enable-amax --enable-cd32 --enable-scsi-device --enable-a2091 --enable-gayle --enable-ncr --disable-jit
./configure $base $cd32 $a600 $scsi $other
make clean
make
......@@ -2016,12 +2016,6 @@ void audio_vsync (void)
#endif
}
int audio_setup (void) { return setup_sound (); }
void audio_close (void) { close_sound (); }
void audio_pause (void) { pause_sound (); }
void audio_resume (void) { resume_sound (); }
void audio_volume (int volume) { sound_volume (volume); }
#ifdef SAVESTATE
void restore_audio_finish (void)
{
......
......@@ -37,13 +37,6 @@ extern void set_audio (void);
extern int audio_activate (void);
extern void audio_vsync (void);
extern int audio_setup (void);
extern void audio_close (void);
extern void audio_reset (void);
extern void audio_pause (void);
extern void audio_resume (void);
extern void audio_volume (int);
void switch_audio_interpol (void);
extern int sound_available;
......
......@@ -781,6 +781,8 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR *
pr->input_analog_joystick_mult = _tstol (value);
if (!strcasecmp (p, "analog_joystick_offset"))
pr->input_analog_joystick_offset = _tstol (value);
if (!strcasecmp (p, "contact_bounce"))
pr->input_contact_bounce = _tstol (value);
idnum = _tstol (p);
if (idnum <= 0 || idnum > MAX_INPUT_SETTINGS)
......@@ -2451,16 +2453,16 @@ void inputdevice_handle_inputcode (void)
sound_volume (1);
break;
case AKS_VOLMUTE:
//sound_mute (-1);
sound_mute (-1);
break;
case AKS_MVOLDOWN:
//master_sound_volume (-1);
master_sound_volume (-1);
break;
case AKS_MVOLUP:
//master_sound_volume (1);
master_sound_volume (1);
break;
case AKS_MVOLMUTE:
//master_sound_volume (0);
master_sound_volume (0);
break;
case AKS_QUIT:
uae_quit ();
......@@ -5618,9 +5620,9 @@ void warpmode (int mode)
if (currprefs.turbo_emulation) {
if (!currprefs.cpu_cycle_exact && !currprefs.blitter_cycle_exact)
changed_prefs.gfx_framerate = currprefs.gfx_framerate = 10;
audio_pause ();
pause_sound ();
} else {
audio_resume ();
resume_sound ();
}
compute_vsynctime ();
#ifdef RETROPLATFORM
......
......@@ -853,7 +853,7 @@ static int real_main2 (int argc, TCHAR **argv)
fixup_prefs (&currprefs);
}
if (! audio_setup ()) {
if (! setup_sound ()) {
write_log ("Sound driver unavailable: Sound output disabled\n");
currprefs.produce_sound = 0;
}
......
......@@ -171,8 +171,6 @@ static int REGPARAM3 dummy_check (uaecptr addr, uae_u32 size) REGPARAM;
static void dummylog (int rw, uaecptr addr, int size, uae_u32 val, int ins)
{
if (M68K_GETPC == 0xf81a16)
activate_debugger ();
if (illegal_count >= MAX_ILG)
return;
/* ignore Zorro3 expansion space */
......
......@@ -37,7 +37,6 @@
#define f_out fprintf
#define console_out printf
#ifdef JIT
//extern uae_u8* compiled_code;
#include "compemu.h"
#else
/* Need to have these somewhere */
......
......@@ -19,6 +19,7 @@
#include "options.h"
#include "gensound.h"
#include "sounddep/sound.h"
#include "driveclick.h"
#include <alsa/asoundlib.h>
......@@ -34,6 +35,8 @@ int paula_sndbufsize;
snd_pcm_t *alsa_playback_handle = 0;
int bytes_per_frame;
static struct sound_data sdpaula;
static struct sound_data *sdp = &sdpaula;
void close_sound (void)
{
......@@ -299,3 +302,67 @@ int audio_parse_option (struct uae_prefs *p, const char *option, const char *val
return (cfgfile_string (option, value, "device", alsa_device, 256)
|| cfgfile_yesno (option, value, "verbose", &alsa_verbose));
}
void set_volume_sound_device (struct sound_data *sd, int volume, int mute)
{
}
void set_volume (int volume, int mute)
{
set_volume_sound_device (sdp, volume, mute);
config_changed = 1;
}
static int setget_master_volume_linux (int setvolume, int *volume, int *mute)
{
unsigned int ok = 0;
if (setvolume) {
;//set
} else {
;//get
}
return ok;
}
static int set_master_volume (int volume, int mute)
{
return setget_master_volume_linux (1, &volume, &mute);
}
static int get_master_volume (int *volume, int *mute)
{
*volume = 0;
*mute = 0;
return setget_master_volume_linux (0, volume, mute);
}
void master_sound_volume (int dir)
{
int vol, mute, r;
r = get_master_volume (&vol, &mute);
if (!r)
return;
if (dir == 0)
mute = mute ? 0 : 1;
vol += dir * (65536 / 10);
if (vol < 0)
vol = 0;
if (vol > 65535)
vol = 65535;
set_master_volume (vol, mute);
config_changed = 1;
}
void sound_mute (int newmute)
{
if (newmute < 0)
sdp->mute = sdp->mute ? 0 : 1;
else
sdp->mute = newmute;
set_volume (currprefs.sound_volume, sdp->mute);
config_changed = 1;
}
......@@ -19,6 +19,20 @@ extern int paula_sndbufsize;
extern snd_pcm_t *alsa_playback_handle;
extern int bytes_per_frame;
struct sound_data
{
int waiting_for_buffer;
int devicetype;
int obtainedfreq;
int paused;
int mute;
int channels;
int freq;
int samplesize;
int sndbufsize;
struct sound_dp *data;
};
/* alsa_xrun_recovery() function is copied from ALSA manual. why the hell did
they make ALSA this hard?! i bet 95% of ALSA programmers would like a
simpler way to do error handling.. let the 5% use tricky APIs.
......
......@@ -61,3 +61,11 @@ int audio_parse_option (struct uae_prefs *p, const char *option, const char *val
{
return 0;
}
void master_sound_volume (int dir)
{
}
void sound_mute (int newmute)
{
}
/*
/*
* UAE - The Un*x Amiga Emulator
*
* Support for SDL sound
......@@ -18,6 +18,7 @@
#include "custom.h"
#include "gui.h"
#include "gensound.h"
#include "driveclick.h"
#include "sounddep/sound.h"
#include "threaddep/thread.h"
#include <SDL_audio.h>
......@@ -33,6 +34,9 @@ static SDL_AudioSpec spec;
static smp_comm_pipe to_sound_pipe;
static uae_sem_t data_available_sem, callback_done_sem, sound_init_sem;
static struct sound_data sdpaula;
static struct sound_data *sdp = &sdpaula;
static int in_callback, closing_sound;
static void clearbuffer (void)
......@@ -61,7 +65,6 @@ static void sound_callback (void *userdata, Uint8 *stream, int len)
/* Notify writer that we're done. */
uae_sem_post (&callback_done_sem);
}
in_callback = 0;
}
......@@ -109,7 +112,6 @@ int setup_sound (void)
}
sound_available = success;
return sound_available;
}
......@@ -196,6 +198,7 @@ void close_sound (void)
closing_sound = 1;
uae_sem_post (&data_available_sem);
}
write_comm_pipe_int (&to_sound_pipe, 1, 1);
uae_sem_wait (&sound_init_sem);
SDL_CloseAudio ();
......@@ -274,3 +277,66 @@ int audio_parse_option (struct uae_prefs *p, const char *option, const char *val
{
return 0;
}
void set_volume_sound_device (struct sound_data *sd, int volume, int mute)
{
}
void set_volume (int volume, int mute)
{
set_volume_sound_device (sdp, volume, mute);
config_changed = 1;
}
static int setget_master_volume_linux (int setvolume, int *volume, int *mute)
{
unsigned int ok = 0;
if (setvolume) {
;//set
} else {
;//get
}
return ok;
}
static int set_master_volume (int volume, int mute)
{
return setget_master_volume_linux (1, &volume, &mute);
}
static int get_master_volume (int *volume, int *mute)
{
*volume = 0;
*mute = 0;
return setget_master_volume_linux (0, volume, mute);
}
void master_sound_volume (int dir)
{
int vol, mute, r;
r = get_master_volume (&vol, &mute);
if (!r)
return;
if (dir == 0)
mute = mute ? 0 : 1;
vol += dir * (65536 / 10);
if (vol < 0)
vol = 0;
if (vol > 65535)
vol = 65535;
set_master_volume (vol, mute);
config_changed = 1;
}
void sound_mute (int newmute)
{
if (newmute < 0)
sdp->mute = sdp->mute ? 0 : 1;
else
sdp->mute = newmute;
set_volume (currprefs.sound_volume, sdp->mute);
config_changed = 1;
}
......@@ -107,7 +107,7 @@ static uae_u32 REGPARAM2 uaeexe_server (TrapContext *context)
{
int len;
TCHAR *cmd;
char *dst;
char *dst, *s;
if (ARG (0) && !running) {
running = 1;
......@@ -124,8 +124,10 @@ static uae_u32 REGPARAM2 uaeexe_server (TrapContext *context)
dst = (char*)get_real_address (ARG (0));
len = ARG (1);
strncpy (dst, cmd, len);
s = ua (cmd);
strncpy (dst, s, len);
write_log ("Sending '%s' to remote cli\n", cmd);
xfree (s);
xfree (cmd);
return ARG (0);
}
......@@ -246,8 +246,10 @@ static uae_u32 emulib_GetUaeConfig (uaecptr place)
put_byte (place + 35, 1);
for (j = 0; j < 4; j++) {
char *s = ua (currprefs.floppyslots[j].df);
for (i = 0; i < 256; i++)
put_byte (place + 36 + i + j * 256, currprefs.floppyslots[j].df[i]);
put_byte (place + 36 + i + j * 256, s[i]);
xfree (s);
}
return 1;
}
......@@ -338,6 +340,7 @@ static uae_u32 emulib_Minimize (void)
static int native_dos_op (uae_u32 mode, uae_u32 p1, uae_u32 p2, uae_u32 p3)
{
TCHAR tmp[MAX_DPATH];
char *s;
int v, i;
if (mode)
......@@ -348,10 +351,12 @@ static int native_dos_op (uae_u32 mode, uae_u32 p1, uae_u32 p2, uae_u32 p3)
v = get_native_path (p1, tmp);
if (v)
return v;
for (i = 0; i <= strlen (tmp) && i < p3 - 1; i++) {
put_byte (p2 + i, tmp[i]);
s = ua (tmp);
for (i = 0; i <= strlen (s) && i < p3 - 1; i++) {
put_byte (p2 + i, s[i]);
put_byte (p2 + i + 1, 0);
}
xfree (s);
return 0;
}
#ifndef UAEGFX_INTERNAL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment