Skip to content

Commit

Permalink
Sound support (#15)
Browse files Browse the repository at this point in the history
* Move sound related functions to sound.cpp

* Format code

* Added sound support based on Amiberry

* Format

* Windows fix
  • Loading branch information
emoon committed Feb 10, 2024
1 parent dcf5d1b commit c13c8da
Show file tree
Hide file tree
Showing 3 changed files with 953 additions and 82 deletions.
92 changes: 11 additions & 81 deletions src/dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@
#include "uae/time.h"
#include "fsdb.h"
#include "uae.h"
#include "gensound.h"
#include "ncr_scsi.h"
#include "ncr9x_scsi.h"
#include "gfxboard.h"
#include "audio.h"
#include "avioutput.h"
#include "xwin.h"
#include "clipboard.h"
#include "sounddep/sound.h"
#include "keybuf.h"
#include "savestate.h"
#include "cdtv.h"
Expand Down Expand Up @@ -454,10 +451,6 @@ void activate_console() {
UNIMPLEMENTED();
}

void ahi_close_sound() {
TRACE();
}

void alf3_add_scsi_unit(int, uaedev_config_info*, romconfig*) {
UNIMPLEMENTED();
}
Expand Down Expand Up @@ -493,14 +486,11 @@ bool ariadne2_init(autoconfig_info*) {
return false;
}

bool audio_is_pull_event() {
// TRACE();
return false;
}

void AVIOutput_Restart(bool) {
UNIMPLEMENTED();
TRACE();
// UNIMPLEMENTED();
}

void AVIOutput_Toggle(int, bool) {
UNIMPLEMENTED();
}
Expand Down Expand Up @@ -713,20 +703,21 @@ bool draco_mouse(int, int, int, int, int) {
}

void driveclick_fdrawcmd_detect() {
UNIMPLEMENTED();
TRACE();
// UNIMPLEMENTED();
}

void driveclick_fdrawcmd_motor(int, int) {
UNIMPLEMENTED();
TRACE();
}

int driveclick_fdrawcmd_open(int) {
UNIMPLEMENTED();
TRACE();
return 0;
}

void driveclick_fdrawcmd_seek(int, int) {
UNIMPLEMENTED();
TRACE();
}

void driveclick_fdrawcmd_vsync() {
Expand All @@ -735,7 +726,7 @@ void driveclick_fdrawcmd_vsync() {
}

int driveclick_loadresource(drvsample*, int) {
UNIMPLEMENTED();
TRACE();
return 0;
}

Expand Down Expand Up @@ -813,10 +804,6 @@ void filesys_addexternals() {
}
#endif

void finish_sound_buffer() {
UNIMPLEMENTED();
}

void flush_log() {
UNIMPLEMENTED();
}
Expand Down Expand Up @@ -1097,11 +1084,6 @@ void initparallel() {
// UNIMPLEMENTED();
}

int init_sound() {
TRACE();
return 0;
}

bool isguiactive() {
return false;
}
Expand Down Expand Up @@ -1331,10 +1313,6 @@ int parallel_direct_write_status(unsigned char, unsigned char) {
return 0;
}

void pause_sound_buffer() {
UNIMPLEMENTED();
}

void pci_read_dma(pci_board_state*, unsigned int, unsigned char*, int) {
UNIMPLEMENTED();
}
Expand All @@ -1355,14 +1333,6 @@ void release_keys() {
UNIMPLEMENTED();
}

void reset_sound() {
TRACE();
}

void restart_sound_buffer() {
TRACE();
}

void restore_cdtv_final() {
UNIMPLEMENTED();
}
Expand Down Expand Up @@ -1445,12 +1415,6 @@ void setup_brkhandler() {
TRACE();
}

int setup_sound() {
TRACE();
// UNIMPLEMENTED();
return 0;
}

bool show_screen_maybe(int, bool) {
UNIMPLEMENTED();
return false;
Expand Down Expand Up @@ -1482,10 +1446,6 @@ int sndboard_release_buffer(unsigned char*, int) {
return 0;
}

void sound_mute(int) {
UNIMPLEMENTED();
}

bool specialmonitor_autoconfig_init(autoconfig_info*) {
UNIMPLEMENTED();
return false;
Expand Down Expand Up @@ -1712,10 +1672,6 @@ void updatedisplayarea(int) {
TRACE();
}

void update_sound(float) {
UNIMPLEMENTED();
}

bool vsync_switchmode(int, int) {
UNIMPLEMENTED();
return false;
Expand Down Expand Up @@ -1749,10 +1705,6 @@ int x86_rt1000_init(autoconfig_info*) {
return 0;
}

void x86_update_sound(float) {
UNIMPLEMENTED();
}

void x86_xt_ide_bios(zfile*, romconfig*) {
UNIMPLEMENTED();
}
Expand All @@ -1766,11 +1718,6 @@ void zeus040_add_scsi_unit(int, uaedev_config_info*, romconfig*) {
UNIMPLEMENTED();
}

int audio_pull_buffer() {
UNIMPLEMENTED();
return 0;
}

void bsdlib_reset() {
UNIMPLEMENTED();
}
Expand All @@ -1780,10 +1727,6 @@ int build_comp() {
return 0;
}

void close_sound() {
UNIMPLEMENTED();
}

TCHAR console_getch() {
UNIMPLEMENTED();
return 0;
Expand Down Expand Up @@ -1820,7 +1763,8 @@ void draco_ext_interrupt(bool) {
}

void driveclick_fdrawcmd_close(int) {
UNIMPLEMENTED();
TRACE();
// UNIMPLEMENTED();
}

void dsp_pause(int) {
Expand Down Expand Up @@ -1928,10 +1872,6 @@ int my_rmdir(char const*) {
return 0;
}

void pause_sound() {
UNIMPLEMENTED();
}

uae_u8* restore_cdtv_dmac(unsigned char*) {
UNIMPLEMENTED();
return nullptr;
Expand All @@ -1942,11 +1882,6 @@ uae_u8* restore_cdtv(unsigned char*) {
return nullptr;
}

void resume_sound() {
TRACE();
// UNIMPLEMENTED();
}

uae_u8* save_cdtv_dmac(size_t*, uae_u8*) {
UNIMPLEMENTED();
return nullptr;
Expand Down Expand Up @@ -2051,11 +1986,6 @@ int uaeser_write(void*, unsigned char*, unsigned int) {
return 0;
}

int audio_is_pull() {
// TRACE();
return 0;
}

bool cdtv_front_panel(int) {
UNIMPLEMENTED();
return false;
Expand Down
3 changes: 2 additions & 1 deletion src/quaesar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ int main(int argc, char** argv) {
currprefs.cpu_memory_cycle_exact = 1;
currprefs.blitter_cycle_exact = 1;
currprefs.turbo_emulation = 0;
currprefs.sound_stereo_separation = 0;

strcpy(currprefs.romfile, options.kickstart.c_str());

// Initialize SDL
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) {
SDL_Log("Unable to initialize SDL: %s", SDL_GetError());
return 1;
}
Expand Down
Loading

0 comments on commit c13c8da

Please sign in to comment.