[Core/Sound] added nuked YM3438 core to SDL port and fixed some GCC warnings

This commit is contained in:
EkeEke 2017-12-22 20:37:58 +01:00
parent 2656abe7af
commit b62ce884b8
8 changed files with 23 additions and 7 deletions

View File

@ -3,7 +3,7 @@
* Sound Hardware * Sound Hardware
* *
* Copyright (C) 1998-2003 Charles Mac Donald (original code) * 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 * Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: * provided that the following conditions are met:
@ -63,7 +63,7 @@ static unsigned int (*YM_Read)(unsigned int a);
#ifdef HAVE_YM3438_CORE #ifdef HAVE_YM3438_CORE
static ym3438_t ym3438; static ym3438_t ym3438;
static int ym3438_accm[24][2]; static short ym3438_accm[24][2];
static int ym3438_sample[2]; static int ym3438_sample[2];
static unsigned int ym3438_cycles; static unsigned int ym3438_cycles;

View File

@ -3,7 +3,7 @@
* Sound Hardware * Sound Hardware
* *
* Copyright (C) 1998-2003 Charles Mac Donald (original code) * 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 * Redistribution and use of this code or any derivative works are permitted
* provided that the following conditions are met: * provided that the following conditions are met:

View File

@ -1223,7 +1223,7 @@ void OPN2_SetChipType(Bit32u type)
chip_type = 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->lfo_inc = chip->mode_test_21[1];
chip->pg_read >>= 1; chip->pg_read >>= 1;

View File

@ -209,7 +209,7 @@ typedef struct
void OPN2_Reset(ym3438_t *chip); void OPN2_Reset(ym3438_t *chip);
void OPN2_SetChipType(Bit32u type); 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_Write(ym3438_t *chip, Bit32u port, Bit8u data);
void OPN2_SetTestPin(ym3438_t *chip, Bit32u value); void OPN2_SetTestPin(ym3438_t *chip, Bit32u value);
Bit32u OPN2_ReadTestPin(ym3438_t *chip); Bit32u OPN2_ReadTestPin(ym3438_t *chip);

View File

@ -18,6 +18,12 @@
# -D15BPP_RENDERING - configure for 15-bit pixels (RGB555) # -D15BPP_RENDERING - configure for 15-bit pixels (RGB555)
# -D16BPP_RENDERING - configure for 16-bit pixels (RGB565) # -D16BPP_RENDERING - configure for 16-bit pixels (RGB565)
# -D32BPP_RENDERING - configure for 32-bit pixels (RGB888) # -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 NAME = gen_sdl
@ -26,7 +32,7 @@ CFLAGS = `sdl-config --cflags` -march=i686 -O6 -fomit-frame-pointer -Wall -Wn
#-g -ggdb -pg #-g -ggdb -pg
#-fomit-frame-pointer #-fomit-frame-pointer
#LDFLAGS = -pg #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) ifneq ($(OS),Windows_NT)
DEFINES += -DHAVE_ALLOCA_H DEFINES += -DHAVE_ALLOCA_H
@ -69,6 +75,7 @@ OBJECTS += $(OBJDIR)/input.o \
OBJECTS += $(OBJDIR)/sound.o \ OBJECTS += $(OBJDIR)/sound.o \
$(OBJDIR)/psg.o \ $(OBJDIR)/psg.o \
$(OBJDIR)/ym2413.o \ $(OBJDIR)/ym2413.o \
$(OBJDIR)/ym3438.o \
$(OBJDIR)/ym2612.o $(OBJDIR)/ym2612.o
OBJECTS += $(OBJDIR)/blip_buf.o OBJECTS += $(OBJDIR)/blip_buf.o

View File

@ -18,6 +18,12 @@
# -D15BPP_RENDERING - configure for 15-bit pixels (RGB555) # -D15BPP_RENDERING - configure for 15-bit pixels (RGB555)
# -D16BPP_RENDERING - configure for 16-bit pixels (RGB565) # -D16BPP_RENDERING - configure for 16-bit pixels (RGB565)
# -D32BPP_RENDERING - configure for 32-bit pixels (RGB888) # -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 NAME = gen_sdl2
@ -26,7 +32,7 @@ CFLAGS = `sdl2-config --cflags` -march=i686 -O6 -fomit-frame-pointer -Wall -W
#-g -ggdb -pg #-g -ggdb -pg
#-fomit-frame-pointer #-fomit-frame-pointer
#LDFLAGS = -pg #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) ifneq ($(OS),Windows_NT)
DEFINES += -DHAVE_ALLOCA_H DEFINES += -DHAVE_ALLOCA_H
@ -69,6 +75,7 @@ OBJECTS += $(OBJDIR)/input.o \
OBJECTS += $(OBJDIR)/sound.o \ OBJECTS += $(OBJDIR)/sound.o \
$(OBJDIR)/psg.o \ $(OBJDIR)/psg.o \
$(OBJDIR)/ym2413.o \ $(OBJDIR)/ym2413.o \
$(OBJDIR)/ym3438.o \
$(OBJDIR)/ym2612.o $(OBJDIR)/ym2612.o
OBJECTS += $(OBJDIR)/blip_buf.o OBJECTS += $(OBJDIR)/blip_buf.o

View File

@ -22,6 +22,7 @@ void set_config_defaults(void)
config.lp_range = 0x9999; /* 0.6 in 16.16 fixed point */ config.lp_range = 0x9999; /* 0.6 in 16.16 fixed point */
config.dac_bits = 14; config.dac_bits = 14;
config.ym2413 = 2; /* = AUTO (0 = always OFF, 1 = always ON) */ config.ym2413 = 2; /* = AUTO (0 = always OFF, 1 = always ON) */
config.ym3438 = 0;
config.mono = 0; config.mono = 0;
/* system options */ /* system options */

View File

@ -18,6 +18,7 @@ typedef struct
uint8 hq_psg; uint8 hq_psg;
uint8 dac_bits; uint8 dac_bits;
uint8 ym2413; uint8 ym2413;
uint8 ym3438;
int16 psg_preamp; int16 psg_preamp;
int16 fm_preamp; int16 fm_preamp;
uint32 lp_range; uint32 lp_range;