diff --git a/core/sound/sound.c b/core/sound/sound.c index 168c132..9e9d2a2 100644 --- a/core/sound/sound.c +++ b/core/sound/sound.c @@ -3,7 +3,7 @@ * Sound Hardware * * Copyright (C) 1998-2003 Charles Mac Donald (original code) - * Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX) + * Copyright (C) 2007-2017 Eke-Eke (Genesis Plus GX) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: @@ -63,7 +63,7 @@ static unsigned int (*YM_Read)(unsigned int a); #ifdef HAVE_YM3438_CORE static ym3438_t ym3438; -static int ym3438_accm[24][2]; +static short ym3438_accm[24][2]; static int ym3438_sample[2]; static unsigned int ym3438_cycles; diff --git a/core/sound/sound.h b/core/sound/sound.h index ae7cc56..a4ae2cc 100644 --- a/core/sound/sound.h +++ b/core/sound/sound.h @@ -3,7 +3,7 @@ * Sound Hardware * * Copyright (C) 1998-2003 Charles Mac Donald (original code) - * Copyright (C) 2007-2016 Eke-Eke (Genesis Plus GX) + * Copyright (C) 2007-2017 Eke-Eke (Genesis Plus GX) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: diff --git a/core/sound/ym3438.c b/core/sound/ym3438.c index 1db7391..298bb21 100644 --- a/core/sound/ym3438.c +++ b/core/sound/ym3438.c @@ -1223,7 +1223,7 @@ void OPN2_SetChipType(Bit32u type) chip_type = type; } -void OPN2_Clock(ym3438_t *chip, Bit32u *buffer) +void OPN2_Clock(ym3438_t *chip, Bit16s *buffer) { chip->lfo_inc = chip->mode_test_21[1]; chip->pg_read >>= 1; diff --git a/core/sound/ym3438.h b/core/sound/ym3438.h index 1d1066d..baefa0f 100644 --- a/core/sound/ym3438.h +++ b/core/sound/ym3438.h @@ -209,7 +209,7 @@ typedef struct void OPN2_Reset(ym3438_t *chip); void OPN2_SetChipType(Bit32u type); -void OPN2_Clock(ym3438_t *chip, Bit32u *buffer); +void OPN2_Clock(ym3438_t *chip, Bit16s *buffer); void OPN2_Write(ym3438_t *chip, Bit32u port, Bit8u data); void OPN2_SetTestPin(ym3438_t *chip, Bit32u value); Bit32u OPN2_ReadTestPin(ym3438_t *chip); diff --git a/sdl/Makefile.sdl1 b/sdl/Makefile.sdl1 index dc38ca7..51e4d9c 100644 --- a/sdl/Makefile.sdl1 +++ b/sdl/Makefile.sdl1 @@ -18,6 +18,12 @@ # -D15BPP_RENDERING - configure for 15-bit pixels (RGB555) # -D16BPP_RENDERING - configure for 16-bit pixels (RGB565) # -D32BPP_RENDERING - configure for 32-bit pixels (RGB888) +# -DUSE_LIBCHDR : enable CHD file support +# -DUSE_LIBTREMOR : enable OGG file support for CD emulation using provided TREMOR library +# -DUSE_LIBVORBIS : enable OGG file support for CD emulation using external VORBIS library +# -DISABLE_MANY_OGG_OPEN_FILES : only have one OGG file opened at once to save RAM +# -DMAXROMSIZE: defines maximal size of ROM/SRAM buffer (also shared with CD hardware) */ +# -DHAVE_YM3438_CORE: enable (configurable) support for Nuked cycle-accurate YM3438 core */ NAME = gen_sdl @@ -26,7 +32,7 @@ CFLAGS = `sdl-config --cflags` -march=i686 -O6 -fomit-frame-pointer -Wall -Wn #-g -ggdb -pg #-fomit-frame-pointer #LDFLAGS = -pg -DEFINES = -DLSB_FIRST -DUSE_16BPP_RENDERING -DUSE_LIBTREMOR -DMAXROMSIZE=33554432 +DEFINES = -DLSB_FIRST -DUSE_16BPP_RENDERING -DUSE_LIBTREMOR -DUSE_LIBCHDR -DMAXROMSIZE=33554432 -DHAVE_YM3438_CORE ifneq ($(OS),Windows_NT) DEFINES += -DHAVE_ALLOCA_H @@ -69,6 +75,7 @@ OBJECTS += $(OBJDIR)/input.o \ OBJECTS += $(OBJDIR)/sound.o \ $(OBJDIR)/psg.o \ $(OBJDIR)/ym2413.o \ + $(OBJDIR)/ym3438.o \ $(OBJDIR)/ym2612.o OBJECTS += $(OBJDIR)/blip_buf.o diff --git a/sdl/Makefile.sdl2 b/sdl/Makefile.sdl2 index 46b5895..a946c12 100644 --- a/sdl/Makefile.sdl2 +++ b/sdl/Makefile.sdl2 @@ -18,6 +18,12 @@ # -D15BPP_RENDERING - configure for 15-bit pixels (RGB555) # -D16BPP_RENDERING - configure for 16-bit pixels (RGB565) # -D32BPP_RENDERING - configure for 32-bit pixels (RGB888) +# -DUSE_LIBCHDR : enable CHD file support +# -DUSE_LIBTREMOR : enable OGG file support for CD emulation using provided TREMOR library +# -DUSE_LIBVORBIS : enable OGG file support for CD emulation using external VORBIS library +# -DISABLE_MANY_OGG_OPEN_FILES : only have one OGG file opened at once to save RAM +# -DMAXROMSIZE: defines maximal size of ROM/SRAM buffer (also shared with CD hardware) */ +# -DHAVE_YM3438_CORE: enable (configurable) support for Nuked cycle-accurate YM3438 core */ NAME = gen_sdl2 @@ -26,7 +32,7 @@ CFLAGS = `sdl2-config --cflags` -march=i686 -O6 -fomit-frame-pointer -Wall -W #-g -ggdb -pg #-fomit-frame-pointer #LDFLAGS = -pg -DEFINES = -DLSB_FIRST -DUSE_16BPP_RENDERING -DUSE_LIBTREMOR -DMAXROMSIZE=33554432 +DEFINES = -DLSB_FIRST -DUSE_16BPP_RENDERING -DUSE_LIBTREMOR -DUSE_LIBCHDR -DMAXROMSIZE=33554432 -DHAVE_YM3438_CORE ifneq ($(OS),Windows_NT) DEFINES += -DHAVE_ALLOCA_H @@ -69,6 +75,7 @@ OBJECTS += $(OBJDIR)/input.o \ OBJECTS += $(OBJDIR)/sound.o \ $(OBJDIR)/psg.o \ $(OBJDIR)/ym2413.o \ + $(OBJDIR)/ym3438.o \ $(OBJDIR)/ym2612.o OBJECTS += $(OBJDIR)/blip_buf.o diff --git a/sdl/config.c b/sdl/config.c index 3a865a3..ec4ec1b 100644 --- a/sdl/config.c +++ b/sdl/config.c @@ -22,6 +22,7 @@ void set_config_defaults(void) config.lp_range = 0x9999; /* 0.6 in 16.16 fixed point */ config.dac_bits = 14; config.ym2413 = 2; /* = AUTO (0 = always OFF, 1 = always ON) */ + config.ym3438 = 0; config.mono = 0; /* system options */ diff --git a/sdl/config.h b/sdl/config.h index 78e7c84..2ca06da 100644 --- a/sdl/config.h +++ b/sdl/config.h @@ -18,6 +18,7 @@ typedef struct uint8 hq_psg; uint8 dac_bits; uint8 ym2413; + uint8 ym3438; int16 psg_preamp; int16 fm_preamp; uint32 lp_range;