From 0f1b8f979b263c5ddfda3b309f15ac6bb2109af6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 23 Jul 2015 20:03:21 +0200 Subject: [PATCH] Cleanups --- libretro.cpp | 6 +----- mednafen/pce_fast/huc.h | 5 ----- mednafen/pce_fast/huc6280.cpp | 6 ------ mednafen/pce_fast/huc6280.h | 7 ------- mednafen/pce_fast/input.cpp | 5 ----- mednafen/pce_fast/input.h | 5 ----- mednafen/pce_fast/pce.h | 27 +++++++++++---------------- mednafen/pce_fast/pcecd.cpp | 5 ----- mednafen/pce_fast/pcecd.h | 4 ---- mednafen/pce_fast/pcecd_drive.cpp | 4 ---- mednafen/pce_fast/pcecd_drive.h | 5 ----- mednafen/pce_fast/psg.cpp | 5 ----- mednafen/pce_fast/psg.h | 5 ----- mednafen/pce_fast/vdc.cpp | 5 ----- mednafen/pce_fast/vdc.h | 5 ----- 15 files changed, 12 insertions(+), 87 deletions(-) diff --git a/libretro.cpp b/libretro.cpp index 11f28ca..f6dd75a 100755 --- a/libretro.cpp +++ b/libretro.cpp @@ -49,8 +49,6 @@ MDFNGI *MDFNGameInfo = &EmulatedPCE_Fast; extern "C" unsigned long crc32(unsigned long crc, const unsigned char *buf, unsigned int len); -namespace PCE_Fast -{ static PCEFast_PSG *psg = NULL; extern ArcadeCard *arcade_card; // Bah, lousy globals. @@ -911,8 +909,6 @@ void HuC_Power(void) arcade_card->Power(); } -}; - MDFNGI EmulatedPCE_Fast = { "pce_fast", @@ -1520,7 +1516,7 @@ static void check_variables(void) if (do_cdsettings) { - PCE_Fast::PCECD_Settings settings = {0}; + PCECD_Settings settings = {0}; settings.CDDA_Volume = (double)setting_pce_fast_cddavolume / 100; settings.CD_Speed = setting_pce_fast_cdspeed; settings.ADPCM_Volume = (double)setting_pce_fast_adpcmvolume / 100; diff --git a/mednafen/pce_fast/huc.h b/mednafen/pce_fast/huc.h index b466624..cd2129e 100644 --- a/mednafen/pce_fast/huc.h +++ b/mednafen/pce_fast/huc.h @@ -1,6 +1,3 @@ -namespace PCE_Fast -{ - int HuCLoad(const uint8 *data, uint32 len, uint32 crc32) MDFN_COLD; int HuCLoadCD(const char *bios_path) MDFN_COLD; void HuC_Close(void) MDFN_COLD; @@ -12,5 +9,3 @@ DECLFR(PCE_ACRead); DECLFW(PCE_ACWrite); extern bool PCE_IsCD; - -}; diff --git a/mednafen/pce_fast/huc6280.cpp b/mednafen/pce_fast/huc6280.cpp index c6defd4..9c94313 100644 --- a/mednafen/pce_fast/huc6280.cpp +++ b/mednafen/pce_fast/huc6280.cpp @@ -18,9 +18,6 @@ #include "pce.h" #include "vdc.h" -namespace PCE_Fast -{ - HuC6280 HuCPU; uint8 *HuCPUFastMap[0x100]; @@ -778,6 +775,3 @@ int HuC6280_StateAction(StateMem *sm, int load, int data_only) return(ret); } - - -}; diff --git a/mednafen/pce_fast/huc6280.h b/mednafen/pce_fast/huc6280.h index 0137d29..5ceb7ef 100644 --- a/mednafen/pce_fast/huc6280.h +++ b/mednafen/pce_fast/huc6280.h @@ -5,10 +5,6 @@ #define HUC6280_LAZY_FLAGS -namespace PCE_Fast -{ - - typedef struct __HuC6280 { #ifdef HUC6280_CRAZY_VERSION @@ -149,8 +145,5 @@ static INLINE void HuC6280_IRQStatusWrite(unsigned int A, uint8 V) } } - -}; - #define _HuC6280H #endif diff --git a/mednafen/pce_fast/input.cpp b/mednafen/pce_fast/input.cpp index d500c38..f9060cc 100644 --- a/mednafen/pce_fast/input.cpp +++ b/mednafen/pce_fast/input.cpp @@ -20,9 +20,6 @@ #include "huc.h" #include "../mednafen-endian.h" -namespace PCE_Fast -{ - static int InputTypes[5]; static uint8 *data_ptr[5]; @@ -333,5 +330,3 @@ static void SyncSettings(void) MDFNGameInfo->mouse_sensitivity = MDFN_GetSettingF("pce_fast.mouse_sensitivity"); InputDeviceInfo[1].IDII = MDFN_GetSettingB("pce_fast.disable_softreset") ? GamepadIDII_DSR : GamepadIDII; } - -}; diff --git a/mednafen/pce_fast/input.h b/mednafen/pce_fast/input.h index 92010ad..124bf47 100644 --- a/mednafen/pce_fast/input.h +++ b/mednafen/pce_fast/input.h @@ -1,9 +1,6 @@ #ifndef __PCE_INPUT_H #define __PCE_INPUT_H -namespace PCE_Fast -{ - void PCEINPUT_Init(void); void PCEINPUT_SettingChanged(const char *name); void PCEINPUT_SetInput(int port, const char *type, void *ptr); @@ -14,6 +11,4 @@ int INPUT_StateAction(StateMem *sm, int load, int data_only); extern InputInfoStruct PCEInputInfo; void INPUT_FixTS(void); -}; - #endif diff --git a/mednafen/pce_fast/pce.h b/mednafen/pce_fast/pce.h index 9775a0f..9db0632 100644 --- a/mednafen/pce_fast/pce.h +++ b/mednafen/pce_fast/pce.h @@ -12,29 +12,24 @@ #define DECLFR(x) uint8 MDFN_FASTCALL x (uint32 A) #define DECLFW(x) void MDFN_FASTCALL x (uint32 A, uint8 V) -namespace PCE_Fast -{ - extern uint8 ROMSpace[0x88 * 8192 + 8192]; +extern uint8 ROMSpace[0x88 * 8192 + 8192]; - typedef void (MDFN_FASTCALL *writefunc)(uint32 A, uint8 V); - typedef uint8 (MDFN_FASTCALL *readfunc)(uint32 A); +typedef void (MDFN_FASTCALL *writefunc)(uint32 A, uint8 V); +typedef uint8 (MDFN_FASTCALL *readfunc)(uint32 A); - extern uint8 PCEIODataBuffer; +extern uint8 PCEIODataBuffer; - bool PCE_InitCD(void) MDFN_COLD; +bool PCE_InitCD(void) MDFN_COLD; - extern bool PCE_ACEnabled; // Arcade Card emulation enabled? - void PCE_Power(void) MDFN_COLD; +extern bool PCE_ACEnabled; // Arcade Card emulation enabled? +void PCE_Power(void) MDFN_COLD; - extern readfunc PCERead[0x100]; - extern writefunc PCEWrite[0x100]; - extern int pce_overclocked; +extern readfunc PCERead[0x100]; +extern writefunc PCEWrite[0x100]; +extern int pce_overclocked; - extern uint8 BaseRAM[32768 + 8192]; -}; +extern uint8 BaseRAM[32768 + 8192]; #include "huc6280.h" -using namespace PCE_Fast; - #endif diff --git a/mednafen/pce_fast/pcecd.cpp b/mednafen/pce_fast/pcecd.cpp index b5eb41a..372d669 100644 --- a/mednafen/pce_fast/pcecd.cpp +++ b/mednafen/pce_fast/pcecd.cpp @@ -31,9 +31,6 @@ #include "pcecd.h" #include "../cdrom/SimpleFIFO.h" -namespace PCE_Fast -{ - //#define PCECD_DEBUG static unsigned int OC_Multiplier; @@ -983,5 +980,3 @@ int PCECD_StateAction(StateMem *sm, int load, int data_only) } return(ret); } - -} diff --git a/mednafen/pce_fast/pcecd.h b/mednafen/pce_fast/pcecd.h index 2735755..d43b207 100644 --- a/mednafen/pce_fast/pcecd.h +++ b/mednafen/pce_fast/pcecd.h @@ -3,9 +3,6 @@ #include "../include/blip/Blip_Buffer.h" -namespace PCE_Fast -{ - typedef struct { float CDDA_Volume; // Max 2.000... @@ -32,6 +29,5 @@ bool PCECD_IsBRAMEnabled(void); int PCECD_StateAction(StateMem *sm, int load, int data_only); -} #endif diff --git a/mednafen/pce_fast/pcecd_drive.cpp b/mednafen/pce_fast/pcecd_drive.cpp index 1c37ef9..97a7b00 100644 --- a/mednafen/pce_fast/pcecd_drive.cpp +++ b/mednafen/pce_fast/pcecd_drive.cpp @@ -22,8 +22,6 @@ #include "../cdrom/SimpleFIFO.h" #include "../msvc_compat.h" -namespace PCE_Fast -{ static inline void SCSIDBG(const char *format, ...) { //printf("SCSI: " format "\n", ## __VA_ARGS__); @@ -1365,5 +1363,3 @@ int PCECD_Drive_StateAction(StateMem * sm, int load, int data_only, const char * return (ret); } - -} diff --git a/mednafen/pce_fast/pcecd_drive.h b/mednafen/pce_fast/pcecd_drive.h index 134dc69..9ca0e07 100644 --- a/mednafen/pce_fast/pcecd_drive.h +++ b/mednafen/pce_fast/pcecd_drive.h @@ -3,9 +3,6 @@ #include "../include/blip/Blip_Buffer.h" -namespace PCE_Fast -{ - typedef int32 pcecd_drive_timestamp_t; struct pcecd_drive_bus_t @@ -84,6 +81,4 @@ int PCECD_Drive_StateAction(StateMem *sm, int load, int data_only, const char *s void PCECD_Drive_SetDisc(bool tray_open, CDIF *cdif, bool no_emu_side_effects = false) MDFN_COLD; -} - #endif diff --git a/mednafen/pce_fast/psg.cpp b/mednafen/pce_fast/psg.cpp index 9f9fce6..da1aed3 100644 --- a/mednafen/pce_fast/psg.cpp +++ b/mednafen/pce_fast/psg.cpp @@ -21,9 +21,6 @@ #include #include -namespace PCE_Fast -{ - void PCEFast_PSG::SetVolume(double new_volume) { OutputVolume = new_volume; @@ -672,5 +669,3 @@ int PCEFast_PSG::StateAction(StateMem *sm, int load, int data_only) } return(ret); } - -} diff --git a/mednafen/pce_fast/psg.h b/mednafen/pce_fast/psg.h index 9161771..a91f61a 100644 --- a/mednafen/pce_fast/psg.h +++ b/mednafen/pce_fast/psg.h @@ -3,9 +3,6 @@ #include "../include/blip/Blip_Buffer.h" -namespace PCE_Fast -{ - class PCEFast_PSG; struct psg_channel @@ -94,6 +91,4 @@ class PCEFast_PSG int32 dbtable[32][32]; }; -} - #endif diff --git a/mednafen/pce_fast/vdc.cpp b/mednafen/pce_fast/vdc.cpp index dec1856..cc8cfff 100644 --- a/mednafen/pce_fast/vdc.cpp +++ b/mednafen/pce_fast/vdc.cpp @@ -33,9 +33,6 @@ The spectrum peaked at 15734 Hz. 21477272.727272... / 3 / 15734 = 455.00(CPU cy #include "../FileStream.h" #include -namespace PCE_Fast -{ - static uint32 userle; // User layer enable. static uint32 disabled_layer_color; @@ -1221,5 +1218,3 @@ int VDC_StateAction(StateMem *sm, int load, int data_only) return(ret); } - -}; diff --git a/mednafen/pce_fast/vdc.h b/mednafen/pce_fast/vdc.h index 7176536..f7b925b 100644 --- a/mednafen/pce_fast/vdc.h +++ b/mednafen/pce_fast/vdc.h @@ -1,9 +1,6 @@ #ifndef _PCE_VDC_H #define _PCE_VDC_H -namespace PCE_Fast -{ - #define REGSETP(_reg, _data, _msb) { _reg &= 0xFF << ((_msb) ? 0 : 8); _reg |= (_data) << ((_msb) ? 8 : 0); } #define REGGETP(_reg, _msb) ((_reg >> ((_msb) ? 8 : 0)) & 0xFF) @@ -177,6 +174,4 @@ void VDC_Power(void) MDFN_COLD; int VDC_StateAction(StateMem *sm, int load, int data_only); -}; - #endif