diff --git a/Makefile.common b/Makefile.common index f493168..36127ad 100644 --- a/Makefile.common +++ b/Makefile.common @@ -17,8 +17,6 @@ endif ifneq (,$(findstring msvc,$(platform))) COREDEFINES += -DINLINE=_inline -else -COREDEFINES += -DINLINE=inline endif ifeq ($(PSS_STYLE),2) diff --git a/src/boards/69.c b/src/boards/69.c index e29d4f0..672f924 100644 --- a/src/boards/69.c +++ b/src/boards/69.c @@ -97,7 +97,7 @@ static DECLFW(M69Write1) { } } -// SUNSOFT-5/FME-7 Sound +/* SUNSOFT-5/FME-7 Sound */ static void AYSound(int Count); static void AYSoundHQ(void); diff --git a/src/boards/emu2413.h b/src/boards/emu2413.h index 06eccd8..a0c173c 100644 --- a/src/boards/emu2413.h +++ b/src/boards/emu2413.h @@ -7,20 +7,6 @@ #include #include "../fceu-types.h" -#ifndef INLINE - -#if defined(_MSC_VER) -#define INLINE __forceinline -#elif defined(__GNUC__) -#define INLINE __inline__ -#elif defined(_MWERKS_) -#define INLINE inline -#else -#define INLINE -#endif -#endif - - #ifdef __cplusplus extern "C" { #endif diff --git a/src/boards/unrom512.c b/src/boards/unrom512.c index 9bc4736..59ac51d 100644 --- a/src/boards/unrom512.c +++ b/src/boards/unrom512.c @@ -226,16 +226,16 @@ void UNROM512_Init(CartInfo *info) { mirror = (head.ROM_type & 1) | ((head.ROM_type & 8) >> 2); switch (mirror) { - case 0: // hard horizontal, internal + case 0: /* hard horizontal, internal */ SetupCartMirroring(MI_H, 1, NULL); break; - case 1: // hard vertical, internal + case 1: /* hard vertical, internal */ SetupCartMirroring(MI_V, 1, NULL); break; - case 2: // switchable 1-screen, internal (flags: 4-screen + horizontal) + case 2: /* switchable 1-screen, internal (flags: 4-screen + horizontal) */ SetupCartMirroring(MI_0, 0, NULL); break; - case 3: // hard four screen, last 8k of 32k RAM (flags: 4-screen + vertical) + case 3: /* hard four screen, last 8k of 32k RAM (flags: 4-screen + vertical) */ SetupCartMirroring(4, 1, VROM + (info->vram_size - 8192)); break; } diff --git a/src/drivers/libretro/libretro.c b/src/drivers/libretro/libretro.c index f62ed8e..bd44830 100644 --- a/src/drivers/libretro/libretro.c +++ b/src/drivers/libretro/libretro.c @@ -713,12 +713,6 @@ void retro_set_environment(retro_environment_t cb) { "fceumm_sndvolume", "Sound Volume; 150|160|170|180|190|200|210|220|230|240|250|0|10|20|30|40|50|60|70|80|90|100|110|120|130|140" }, { "fceumm_sndquality", "Sound Quality; Low|High|Very High" }, { "fceumm_swapduty", "Swap Duty Cycles; disabled|enabled" }, - { "fceumm_turbo_enable", "Turbo Enable; None|Player 1|Player 2|Both" }, - { "fceumm_turbo_delay", "Turbo Delay (in frames); 3|5|10|15|30|60|1|2" }, - { "fceumm_zapper_mode", "Zapper Mode; lightgun|mouse" }, - { "fceumm_show_crosshair", "Show Crosshair; enabled|disabled" }, - { "fceumm_overclocking", "Overclocking; disabled|2x-Postrender|2x-VBlank" }, - { "fceumm_ramstate", "RAM power up state (Restart); fill $ff|fill $00|random" }, #ifdef DEBUG { "fceumm_apu_1", "Enable Sound Channel 1 (Square 1); enabled|disabled" }, { "fceumm_apu_2", "Enable Sound Channel 2 (Square 2); enabled|disabled" }, @@ -726,6 +720,12 @@ void retro_set_environment(retro_environment_t cb) { "fceumm_apu_4", "Enable Sound Channel 4 (Noise) ; enabled|disabled" }, { "fceumm_apu_5", "Enable Sound Channel 5 (PCM); enabled|disabled" }, #endif + { "fceumm_turbo_enable", "Turbo Enable; None|Player 1|Player 2|Both" }, + { "fceumm_turbo_delay", "Turbo Delay (in frames); 3|5|10|15|30|60|1|2" }, + { "fceumm_zapper_mode", "Zapper Mode; lightgun|mouse" }, + { "fceumm_show_crosshair", "Show Crosshair; enabled|disabled" }, + { "fceumm_overclocking", "Overclocking; disabled|2x-Postrender|2x-VBlank" }, + { "fceumm_ramstate", "RAM power up state (Restart); fill $ff|fill $00|random" }, { NULL, NULL }, }; @@ -966,11 +966,11 @@ static const keymap bindmap[] = { static void set_apu_channels(int chan) { - FSettings.SquareVolume[1] = 255 * ((chan >> 0) & 1); - FSettings.SquareVolume[0] = 255 * ((chan >> 1) & 1); - FSettings.TriangleVolume = 255 * ((chan >> 2) & 1); - FSettings.NoiseVolume = 255 * ((chan >> 3) & 1); - FSettings.PCMVolume = 255 * ((chan >> 4) & 1); + FSettings.SquareVolume[1] = 256 * ((chan >> 0) & 1); + FSettings.SquareVolume[0] = 256 * ((chan >> 1) & 1); + FSettings.TriangleVolume = 256 * ((chan >> 2) & 1); + FSettings.NoiseVolume = 256 * ((chan >> 3) & 1); + FSettings.PCMVolume = 256 * ((chan >> 4) & 1); } static void check_variables(bool startup) @@ -1356,7 +1356,7 @@ static void FCEUD_UpdateInput(void) JSReturn = 0; - // nes gamepad + /* nes gamepad */ for (player = 0; player < MAX_PLAYERS; player++) { uint8_t input_buf = 0; diff --git a/src/fceu-types.h b/src/fceu-types.h index dda3a8e..53c5ec5 100644 --- a/src/fceu-types.h +++ b/src/fceu-types.h @@ -53,6 +53,19 @@ typedef unsigned long long uint64; typedef long long int64; #endif +#ifndef INLINE + +#if defined(_MSC_VER) +#define INLINE __forceinline +#elif defined(__GNUC__) +#define INLINE __inline__ +#elif defined(_MWERKS_) +#define INLINE inline +#else +#define INLINE +#endif +#endif + #if PSS_STYLE == 2 #define PSS "\\" diff --git a/src/sound.c b/src/sound.c index 69b333a..0891eb7 100644 --- a/src/sound.c +++ b/src/sound.c @@ -1204,7 +1204,7 @@ SFORMAT FCEUSND_STATEINFO[] = { { &DMCFormat, 1, "5FMT" }, { &RawDALatch, 1, "RWDA" }, - //these are important for smooth sound after loading state + /* these are important for smooth sound after loading state */ { &sqacc[0], sizeof(sqacc[0]) | FCEUSTATE_RLSB, "SAC1" }, { &sqacc[1], sizeof(sqacc[1]) | FCEUSTATE_RLSB, "SAC2" }, { &RectDutyCount[0], sizeof(RectDutyCount[0]) | FCEUSTATE_RLSB, "RCD1"}, @@ -1213,7 +1213,7 @@ SFORMAT FCEUSND_STATEINFO[] = { { &lq_triacc, sizeof(lq_triacc) | FCEUSTATE_RLSB, "TACC" }, { &lq_noiseacc, sizeof(lq_noiseacc) | FCEUSTATE_RLSB, "NACC" }, - //less important but still necessary + /* less important but still necessary */ { &ChannelBC[0], sizeof(ChannelBC[0]) | FCEUSTATE_RLSB, "CBC1" }, { &ChannelBC[1], sizeof(ChannelBC[1]) | FCEUSTATE_RLSB, "CBC2" }, { &ChannelBC[2], sizeof(ChannelBC[2]) | FCEUSTATE_RLSB, "CBC3" }, @@ -1229,7 +1229,7 @@ SFORMAT FCEUSND_STATEINFO[] = { { &sexyfilter_acc2, sizeof(sexyfilter_acc2) | FCEUSTATE_RLSB, "FAC2" }, { &lq_tcout, sizeof(lq_tcout) | FCEUSTATE_RLSB, "TCOU"}, - //wave buffer is used for filtering, only need first 17 values from it + /* wave buffer is used for filtering, only need first 17 values from it */ { &Wave, 32 * sizeof(int32), "WAVE"}, { 0 } }; @@ -1243,7 +1243,7 @@ void FCEUSND_LoadState(int version) { RawDALatch &= 0x7F; DMCAddress &= 0x7FFF; - //minimal validation + /* minimal validation */ for (i = 0; i < 5; i++) { int BC_max = 15;