Skip to content

Commit

Permalink
Libretro: Refactoring for adding GB/GBC core
Browse files Browse the repository at this point in the history
  • Loading branch information
retro-wertz committed Jul 15, 2018
1 parent 0e60c34 commit f05a05e
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 97 deletions.
8 changes: 6 additions & 2 deletions src/libretro/Makefile
@@ -1,5 +1,6 @@
TILED_RENDERING=0
STATIC_LINKING=0
FRONTEND_SUPPORTS_RGB565=0

SPACE :=
SPACE := $(SPACE) $(SPACE)
Expand Down Expand Up @@ -226,16 +227,19 @@ include Makefile.common
OBJS := $(SOURCES_CXX:.cpp=.o)

VBA_DEFINES += -D__LIBRETRO__ -DFINAL_VERSION -DC_CORE -DNO_LINK -DNO_DEBUGGER

ifeq ($(FRONTEND_SUPPORTS_RGB565),1)
VBA_DEFINES += -DFRONTEND_SUPPORTS_RGB565
endif

ifneq ($(SANITIZER),)
CFLAGS += -fsanitize=$(SANITIZER)
LDFLAGS += -fsanitize=$(SANITIZER)
endif

ifeq ($(DEBUG), 1)
CFLAGS += -g
CXXFLAGS += -g
CFLAGS += -O0 -g
CXXFLAGS += -O0 -g
else
CFLAGS += -O2 -DNDEBUG
CXXFLAGS += -O2 -DNDEBUG
Expand Down
5 changes: 0 additions & 5 deletions src/libretro/SoundRetro.cpp
Expand Up @@ -18,7 +18,6 @@
#include "SoundRetro.h"
#include "libretro.h"

unsigned g_audio_frames;
extern retro_audio_sample_batch_t audio_batch_cb;

SoundRetro::SoundRetro()
Expand All @@ -30,14 +29,10 @@ void SoundRetro::write(uint16_t* finalWave, int length)
const int16_t* wave = (const int16_t*)finalWave;
int frames = length >> 1;
audio_batch_cb(wave, frames);

g_audio_frames += frames;
}

bool SoundRetro::init(long sampleRate)
{
g_audio_frames = 0;

return true;
}

Expand Down

0 comments on commit f05a05e

Please sign in to comment.