Skip to content

Commit

Permalink
Made mingw compile pinmame32, removed some compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
volkenborn committed Jan 17, 2024
1 parent beec0c3 commit 3b385cc
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 29 deletions.
1 change: 0 additions & 1 deletion src/sound/2151intf.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ void YM2151_sh_stop(void);
void YM2151_sh_reset(void);
void YM2151_set_mixing_levels(int chip, int l, int r);

static void YM2151UpdateRequest(int chip);
#endif
2 changes: 1 addition & 1 deletion src/sound/adpcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int OKIM6295_sh_start(const struct MachineSound *msound);
void OKIM6295_sh_stop(void);
void OKIM6295_sh_update(void);
void OKIM6295_set_bank_base(int which, int base);
void OKIM6295_set_pin7(int which, double clock, unsigned char pin7);
void OKIM6295_set_pin7(int which, double aclock, unsigned char pin7);

READ_HANDLER( OKIM6295_status_0_r );
READ_HANDLER( OKIM6295_status_1_r );
Expand Down
4 changes: 4 additions & 0 deletions src/ui/Win32ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,11 @@ static int RunMAME(int nGameIndex)
time_t start, end;
time_t elapsedtime;

#ifdef __GNUC__
strcpy(g_szGameName, drivers[nGameIndex]->name);
#else
strcpy_s(g_szGameName, sizeof(g_szGameName), drivers[nGameIndex]->name);
#endif

CreateCommandLine(nGameIndex, pCmdLine);

Expand Down
10 changes: 5 additions & 5 deletions src/wpc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,14 +555,14 @@ extern UINT64 core_getAllSol(void);
extern void core_getAllPhysicSols(float* state);

/*-- AC sync and PWM integration --*/
extern void core_request_pwm_output_update();
extern void core_request_pwm_output_update(void);
extern void core_set_pwm_output_type(int startIndex, int count, int type);
extern void core_set_pwm_output_types(int startIndex, int count, int* outputTypes);
extern void core_write_pwm_output(int index, int count, UINT8 bitStates); // Write binary state of count outputs, taking care of PWM integration based on physical model of connected device
extern void core_write_pwm_output_8b(int index, UINT8 bitStates);
extern void core_write_masked_pwm_output_8b(int index, UINT8 bitStates, UINT8 bitMask);
extern void core_write_pwm_output(int startIndex, int count, UINT8 bitStates); // Write binary state of count outputs, taking care of PWM integration based on physical model of connected device
extern void core_write_pwm_output_8b(int startIndex, UINT8 bitStates);
extern void core_write_masked_pwm_output_8b(int startIndex, UINT8 bitStates, UINT8 bitMask);
extern void core_write_pwm_output_lamp_matrix(int startIndex, UINT8 columns, UINT8 rows, int nCols);
INLINE void core_zero_cross() { coreGlobals.lastACZeroCrossTimeStamp = (float) timer_get_time(); }
INLINE void core_zero_cross(void) { coreGlobals.lastACZeroCrossTimeStamp = (float) timer_get_time(); }

extern void core_sound_throttle_adj(int sIn, int *sOut, int buffersize, double samplerate);

Expand Down
16 changes: 8 additions & 8 deletions src/wpc/gts3.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,14 +461,14 @@ static INTERRUPT_GEN(GTS3_vblank) {
if ((GTS3locals.vblankCount % GTS3_SOLSMOOTH) == 0) {
// FIXME ssEn is never set. Special solenoids are handled by core_updateSw triggered from GameOn directly read from solenoid #31 state
// Note that the code here would have a bug because it sets solenoids #23 as GameOn but this solenoid is used for other purposes by GTS3 hardware
/*if (GTS3locals.ssEn) {
int ii;
coreGlobals.solenoids |= CORE_SOLBIT(CORE_SSFLIPENSOL);
/*-- special solenoids updated based on switches --*/
/*for (ii = 0; ii < 6; ii++)
if (core_gameData->sxx.ssSw[ii] && core_getSw(core_gameData->sxx.ssSw[ii]))
coreGlobals.solenoids |= CORE_SOLBIT(CORE_FIRSTSSSOL+ii);
}*/
// if (GTS3locals.ssEn) {
// int ii;
// coreGlobals.solenoids |= CORE_SOLBIT(CORE_SSFLIPENSOL);
// /*-- special solenoids updated based on switches --*/
// for (ii = 0; ii < 6; ii++)
// if (core_gameData->sxx.ssSw[ii] && core_getSw(core_gameData->sxx.ssSw[ii]))
// coreGlobals.solenoids |= CORE_SOLBIT(CORE_FIRSTSSSOL+ii);
// }
GTS3locals.solenoids = coreGlobals.pulsedSolState;
}

Expand Down
26 changes: 13 additions & 13 deletions src/wpc/wpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,16 @@ MACHINE_DRIVER_START(wpc_95S)
MDRV_IMPORT_FROM(wmssnd_dcs2)
MACHINE_DRIVER_END

/* The FIRQ line is wired between the WPC chip and all external I/Os (sound) */
/* The DMD firq must be generated via the WPC but I don't how. */
static void wpc_firq(int set, int src) {
if (set)
wpclocals.firqSrc |= src;
else
wpclocals.firqSrc &= ~src;
cpu_set_irq_line(WPC_CPUNO, M6809_FIRQ_LINE, wpclocals.firqSrc ? HOLD_LINE : CLEAR_LINE);
}

/*--------------------------------------------------------------
/ This is generated WPC_VBLANKDIV times per frame (=60*WPC_VBLANKDIV Hz)
/ = every 32/(WPC_VBLANKDIV/2) lines.
Expand Down Expand Up @@ -615,16 +625,6 @@ static INTERRUPT_GEN(wpc_vblank) {
core_updateSw((core_gameData->gen & GENWPC_HASFLIPTRON) ? TRUE : (wpc_data[WPC_GILAMPS] & 0x80));
}

/* The FIRQ line is wired between the WPC chip and all external I/Os (sound) */
/* The DMD firq must be generated via the WPC but I don't how. */
static void wpc_firq(int set, int src) {
if (set)
wpclocals.firqSrc |= src;
else
wpclocals.firqSrc &= ~src;
cpu_set_irq_line(WPC_CPUNO, M6809_FIRQ_LINE, wpclocals.firqSrc ? HOLD_LINE : CLEAR_LINE);
}

/*----------------------
/ Emulate the WPC chip
/-----------------------*/
Expand Down Expand Up @@ -880,9 +880,9 @@ WRITE_HANDLER(wpc_w) {
if (prevIndex != newIndex)
for (int i = 0; i < 4; i++)
{
int offset = i == 0 ? 0 : i == 1 ? 8 : i == 2 ? 320 : 328;
core_write_pwm_output_8b(newIndex + offset, coreGlobals.binaryOutputState[(prevIndex + offset) >> 3]);
core_write_pwm_output_8b(prevIndex + offset, 0);
int offst = i == 0 ? 0 : i == 1 ? 8 : i == 2 ? 320 : 328;
core_write_pwm_output_8b(newIndex + offst, coreGlobals.binaryOutputState[(prevIndex + offst) >> 3]);
core_write_pwm_output_8b(prevIndex + offst, 0);
}
}
break; /* just save position */
Expand Down
1 change: 0 additions & 1 deletion src/wpc/wpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ extern WRITE_HANDLER(wpc_w);
/*-- use this function to send FIRQ to main CPU --*/
#define WPC_FIRQ_DMD 0x01
#define WPC_FIRQ_SOUND 0x02
static void wpc_firq(int set, int src);

extern MACHINE_DRIVER_EXTERN(wpc_alpha);
extern MACHINE_DRIVER_EXTERN(wpc_dmd);
Expand Down

0 comments on commit 3b385cc

Please sign in to comment.