Skip to content

Commit ca21417

Browse files
committed
minor cosmetic changes
1 parent fb026e9 commit ca21417

File tree

7 files changed

+23
-22
lines changed

7 files changed

+23
-22
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ endif ()
1515

1616
check_include_file("stdint.h" HAVE_STDINT)
1717
if(HAVE_STDINT)
18-
add_definitions("-D HAVE_STDINT")
18+
add_definitions("-D HAVE_STDINT_H")
1919
endif()
2020

2121
if(MSVC)

emu/cores/emu2149.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,8 @@ mix_output_stereo(EPSG *psg, int32_t out[2])
467467
if (! (~psg->stereo_mask[i] & 0x03))
468468
{
469469
// mono channel
470-
out[0] += APPLY_PANNING(psg->ch_out[i], psg->pan[i][0]);
471-
out[1] += APPLY_PANNING(psg->ch_out[i], psg->pan[i][1]);
470+
out[0] += APPLY_PANNING_S(psg->ch_out[i], psg->pan[i][0]);
471+
out[1] += APPLY_PANNING_S(psg->ch_out[i], psg->pan[i][1]);
472472
}
473473
else
474474
{

emu/cores/emu2413.c

+14-13
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@
1515
#include <stdlib.h>
1616
#include <string.h>
1717

18-
#ifndef INLINE
19-
#if defined(_MSC_VER)
20-
#define INLINE __inline
21-
#elif defined(__GNUC__)
22-
#define INLINE __inline__
23-
#else
24-
#define INLINE inline
25-
#endif
26-
#endif
27-
2818
#include "../../stdtype.h"
2919
#include "emutypes.h"
3020
#include "../snddef.h"
@@ -34,6 +24,7 @@
3424
#include "emu2413.h"
3525
#include "emu2413_private.h"
3626
#include "../panning.h" // Maxim
27+
#undef INLINE // emu2413 uses its own INLINE definition
3728

3829

3930
static UINT8 device_start_ym2413_emu(const DEV_GEN_CFG* cfg, DEV_INFO* retDevInf);
@@ -67,6 +58,16 @@ DEV_DEF devDef_YM2413_Emu =
6758
};
6859

6960

61+
#ifndef INLINE
62+
#if defined(_MSC_VER)
63+
#define INLINE __inline
64+
#elif defined(__GNUC__)
65+
#define INLINE __inline__
66+
#else
67+
#define INLINE inline
68+
#endif
69+
#endif
70+
7071
#define _PI_ 3.14159265358979323846264338327950288
7172

7273
#define EOPLL_TONE_NUM 3
@@ -187,7 +188,7 @@ static uint16_t fullsin_table[PG_WIDTH] = {
187188
/* clang-format on */
188189

189190
static uint16_t halfsin_table[PG_WIDTH];
190-
static uint16_t *wave_table_map[2] = {fullsin_table, halfsin_table};
191+
static const uint16_t *wave_table_map[2] = {fullsin_table, halfsin_table};
191192

192193
/* pitch modulator */
193194
/* offset to fnum, rough approximation of 14 cents depth. */
@@ -1078,9 +1079,9 @@ INLINE static void mix_output_stereo(EOPLL *opll) {
10781079
out[0] = out[1] = 0;
10791080
for (i = 0; i < 14; i++) {
10801081
if (opll->pan[i] & 1)
1081-
out[1] += APPLY_PANNING(opll->ch_out[i], opll->pan_fine[i][1]);
1082+
out[1] += APPLY_PANNING_S(opll->ch_out[i], opll->pan_fine[i][1]);
10821083
if (opll->pan[i] & 2)
1083-
out[0] += APPLY_PANNING(opll->ch_out[i], opll->pan_fine[i][0]);
1084+
out[0] += APPLY_PANNING_S(opll->ch_out[i], opll->pan_fine[i][0]);
10841085
}
10851086
if (opll->conv) {
10861087
EOPLL_RateConv_putData(opll->conv, 0, out[0]);

emu/cores/emu2413_private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef struct __EOPLL_SLOT {
3333
int32_t output[2]; /* output value, latest and previous. */
3434

3535
/* phase generator (pg) */
36-
uint16_t *wave_table; /* wave table */
36+
const uint16_t *wave_table; /* wave table */
3737
uint32_t pg_phase; /* pg phase */
3838
uint32_t pg_out; /* pg output, as index of wave table */
3939
uint8_t pg_keep; /* if 1, pg_phase is preserved when key-on */

emu/cores/sn76489.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ static void SN76489_Update(SN76489_Context* chip, UINT32 length, DEV_SMPL **buff
254254
if ( ( ( chip->PSGStereo >> i ) & 0x11 ) == 0x11 )
255255
{
256256
// no GG stereo for this channel
257-
buffer[0][j] += APPLY_PANNING( chnOut, chip->panning[i][0] ); // left
258-
buffer[1][j] += APPLY_PANNING( chnOut, chip->panning[i][1] ); // right
257+
buffer[0][j] += APPLY_PANNING_S( chnOut, chip->panning[i][0] ); // left
258+
buffer[1][j] += APPLY_PANNING_S( chnOut, chip->panning[i][1] ); // right
259259
}
260260
else
261261
{

emu/panning.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C"
1212
#define PANNING_NORMAL (1 << PANNING_BITS)
1313

1414
// apply panning value to x, x should be within +-16384
15-
#define APPLY_PANNING(x, panval) ((x * panval) >> PANNING_BITS)
15+
#define APPLY_PANNING_S(x, panval) ((x * panval) >> PANNING_BITS)
1616
// apply panning value to x, version for larger values
1717
#define APPLY_PANNING_L(x, panval) (INT32)(((INT64)x * panval) >> PANNING_BITS)
1818

stdtype.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef __CST_STDTYPE_H__
22
#define __CST_STDTYPE_H__
33

4-
#ifdef HAVE_STDINT
4+
#ifdef HAVE_STDINT_H
55

66
#include <stdint.h>
77

@@ -14,7 +14,7 @@ typedef int32_t INT32;
1414
typedef uint64_t UINT64;
1515
typedef int64_t INT64;
1616

17-
#else // ! HAVE_STDINT
17+
#else // ! HAVE_STDINT_H
1818

1919
// typedefs to use MAME's (U)INTxx types (copied from MAME\src\ods\odscomm.h)
2020
// 8-bit values

0 commit comments

Comments
 (0)