diff --git a/src/libpinmame/libpinmame.cpp b/src/libpinmame/libpinmame.cpp index a80bd7009..a0ae65962 100644 --- a/src/libpinmame/libpinmame.cpp +++ b/src/libpinmame/libpinmame.cpp @@ -625,7 +625,7 @@ int StartGame(const int gameNum) * PinmameGetGame ******************************************************/ -LIBPINMAME_API PINMAME_STATUS PinmameGetGame(const char* const p_name, PinmameGameCallback callback, const void* p_userData) +PINMAMEAPI PINMAME_STATUS PinmameGetGame(const char* const p_name, PinmameGameCallback callback, const void* p_userData) { if (!_p_Config) return PINMAME_STATUS_CONFIG_NOT_SET; @@ -657,7 +657,7 @@ LIBPINMAME_API PINMAME_STATUS PinmameGetGame(const char* const p_name, PinmameGa * PinmameGetGames ******************************************************/ -LIBPINMAME_API PINMAME_STATUS PinmameGetGames(PinmameGameCallback callback, const void* p_userData) +PINMAMEAPI PINMAME_STATUS PinmameGetGames(PinmameGameCallback callback, const void* p_userData) { if (!_p_Config) return PINMAME_STATUS_CONFIG_NOT_SET; @@ -690,7 +690,7 @@ LIBPINMAME_API PINMAME_STATUS PinmameGetGames(PinmameGameCallback callback, cons * PinmameSetConfig ******************************************************/ -LIBPINMAME_API void PinmameSetConfig(const PinmameConfig* const p_config) +PINMAMEAPI void PinmameSetConfig(const PinmameConfig* const p_config) { if (!_p_Config) _p_Config = (PinmameConfig*)malloc(sizeof(PinmameConfig)); @@ -723,7 +723,7 @@ LIBPINMAME_API void PinmameSetConfig(const PinmameConfig* const p_config) * PinmameSetPath ******************************************************/ -LIBPINMAME_API void PinmameSetPath(const PINMAME_FILE_TYPE fileType, const char* const p_path) +PINMAMEAPI void PinmameSetPath(const PINMAME_FILE_TYPE fileType, const char* const p_path) { if (!p_path) return; @@ -754,7 +754,7 @@ LIBPINMAME_API void PinmameSetPath(const PINMAME_FILE_TYPE fileType, const char* * PinmameGetCheat ******************************************************/ -LIBPINMAME_API int PinmameGetCheat() +PINMAMEAPI int PinmameGetCheat() { return options.cheat; } @@ -763,7 +763,7 @@ LIBPINMAME_API int PinmameGetCheat() * PinmameSetCheat ******************************************************/ -LIBPINMAME_API void PinmameSetCheat(const int cheat) +PINMAMEAPI void PinmameSetCheat(const int cheat) { options.cheat = cheat; } @@ -772,7 +772,7 @@ LIBPINMAME_API void PinmameSetCheat(const int cheat) * PinmameGetHandleKeyboard ******************************************************/ -LIBPINMAME_API int PinmameGetHandleKeyboard() +PINMAMEAPI int PinmameGetHandleKeyboard() { return g_fHandleKeyboard; } @@ -781,7 +781,7 @@ LIBPINMAME_API int PinmameGetHandleKeyboard() * PinmameSetHandleKeyboard ******************************************************/ -LIBPINMAME_API void PinmameSetHandleKeyboard(const int handleKeyboard) +PINMAMEAPI void PinmameSetHandleKeyboard(const int handleKeyboard) { g_fHandleKeyboard = handleKeyboard ? 1 : 0; } @@ -790,7 +790,7 @@ LIBPINMAME_API void PinmameSetHandleKeyboard(const int handleKeyboard) * PinmameGetHandleMechanics ******************************************************/ -LIBPINMAME_API int PinmameGetHandleMechanics() +PINMAMEAPI int PinmameGetHandleMechanics() { return g_fHandleMechanics; } @@ -799,7 +799,7 @@ LIBPINMAME_API int PinmameGetHandleMechanics() * PinmameSetHandleMechanics ******************************************************/ -LIBPINMAME_API void PinmameSetHandleMechanics(const int handleMechanics) +PINMAMEAPI void PinmameSetHandleMechanics(const int handleMechanics) { g_fHandleMechanics = handleMechanics; } @@ -808,7 +808,7 @@ LIBPINMAME_API void PinmameSetHandleMechanics(const int handleMechanics) * PinmameSetDmdMode ******************************************************/ -LIBPINMAME_API void PinmameSetDmdMode(const PINMAME_DMD_MODE dmdMode) +PINMAMEAPI void PinmameSetDmdMode(const PINMAME_DMD_MODE dmdMode) { g_fDmdMode = dmdMode; } @@ -817,7 +817,7 @@ LIBPINMAME_API void PinmameSetDmdMode(const PINMAME_DMD_MODE dmdMode) * PinmameGetDmdMode ******************************************************/ -LIBPINMAME_API PINMAME_DMD_MODE PinmameGetDmdMode() +PINMAMEAPI PINMAME_DMD_MODE PinmameGetDmdMode() { return g_fDmdMode; } @@ -826,7 +826,7 @@ LIBPINMAME_API PINMAME_DMD_MODE PinmameGetDmdMode() * PinmameGetSoundMode ******************************************************/ -LIBPINMAME_API PINMAME_SOUND_MODE PinmameGetSoundMode() +PINMAMEAPI PINMAME_SOUND_MODE PinmameGetSoundMode() { return g_fSoundMode; } @@ -835,7 +835,7 @@ LIBPINMAME_API PINMAME_SOUND_MODE PinmameGetSoundMode() * PinmameSetSoundMode ******************************************************/ -LIBPINMAME_API void PinmameSetSoundMode(const PINMAME_SOUND_MODE soundMode) +PINMAMEAPI void PinmameSetSoundMode(const PINMAME_SOUND_MODE soundMode) { g_fSoundMode = soundMode; } @@ -844,7 +844,7 @@ LIBPINMAME_API void PinmameSetSoundMode(const PINMAME_SOUND_MODE soundMode) * PinmameRun ******************************************************/ -LIBPINMAME_API PINMAME_STATUS PinmameRun(const char* const p_name) +PINMAMEAPI PINMAME_STATUS PinmameRun(const char* const p_name) { if (!_p_Config) return PINMAME_STATUS_CONFIG_NOT_SET; @@ -868,7 +868,7 @@ LIBPINMAME_API PINMAME_STATUS PinmameRun(const char* const p_name) * PinmameIsRunning ******************************************************/ -LIBPINMAME_API int PinmameIsRunning() +PINMAMEAPI int PinmameIsRunning() { return _isRunning; } @@ -877,7 +877,7 @@ LIBPINMAME_API int PinmameIsRunning() * PinmameReset ******************************************************/ -LIBPINMAME_API PINMAME_STATUS PinmameReset() +PINMAMEAPI PINMAME_STATUS PinmameReset() { if (!_isRunning) return PINMAME_STATUS_EMULATOR_NOT_RUNNING; @@ -891,7 +891,7 @@ LIBPINMAME_API PINMAME_STATUS PinmameReset() * PinmamePause ******************************************************/ -LIBPINMAME_API PINMAME_STATUS PinmamePause(const int pause) +PINMAMEAPI PINMAME_STATUS PinmamePause(const int pause) { if (!_isRunning) return PINMAME_STATUS_EMULATOR_NOT_RUNNING; @@ -905,7 +905,7 @@ LIBPINMAME_API PINMAME_STATUS PinmamePause(const int pause) * PinmameIsPaused ******************************************************/ -LIBPINMAME_API int PinmameIsPaused() +PINMAMEAPI int PinmameIsPaused() { return g_fPause; } @@ -914,7 +914,7 @@ LIBPINMAME_API int PinmameIsPaused() * PinmameStop ******************************************************/ -LIBPINMAME_API void PinmameStop() +PINMAMEAPI void PinmameStop() { if (!_p_gameThread) return; @@ -943,7 +943,7 @@ LIBPINMAME_API void PinmameStop() * PinmameGetHardwareGen ******************************************************/ -LIBPINMAME_API PINMAME_HARDWARE_GEN PinmameGetHardwareGen() +PINMAMEAPI PINMAME_HARDWARE_GEN PinmameGetHardwareGen() { const UINT64 hardwareGen = (_isRunning) ? core_gameData->gen : 0; return (PINMAME_HARDWARE_GEN)hardwareGen; @@ -953,7 +953,7 @@ LIBPINMAME_API PINMAME_HARDWARE_GEN PinmameGetHardwareGen() * PinmameGetSwitch ******************************************************/ -LIBPINMAME_API int PinmameGetSwitch(const int swNo) +PINMAMEAPI int PinmameGetSwitch(const int swNo) { return (_isRunning) ? vp_getSwitch(swNo) : 0; } @@ -962,7 +962,7 @@ LIBPINMAME_API int PinmameGetSwitch(const int swNo) * PinmameSetSwitch ******************************************************/ -LIBPINMAME_API void PinmameSetSwitch(const int swNo, const int state) +PINMAMEAPI void PinmameSetSwitch(const int swNo, const int state) { if (!_isRunning) return; @@ -974,7 +974,7 @@ LIBPINMAME_API void PinmameSetSwitch(const int swNo, const int state) * PinmameSetSwitches ******************************************************/ -LIBPINMAME_API void PinmameSetSwitches(const PinmameSwitchState* const p_states, const int numSwitches) +PINMAMEAPI void PinmameSetSwitches(const PinmameSwitchState* const p_states, const int numSwitches) { if (!_isRunning) return; @@ -987,7 +987,7 @@ LIBPINMAME_API void PinmameSetSwitches(const PinmameSwitchState* const p_states, * PinmameGetSolenoidMask ******************************************************/ -LIBPINMAME_API uint32_t PinmameGetSolenoidMask(const int low) +PINMAMEAPI uint32_t PinmameGetSolenoidMask(const int low) { return vp_getSolMask(low); } @@ -996,7 +996,7 @@ LIBPINMAME_API uint32_t PinmameGetSolenoidMask(const int low) * PinmameSetSolenoidMask ******************************************************/ -LIBPINMAME_API void PinmameSetSolenoidMask(const int low, const uint32_t mask) +PINMAMEAPI void PinmameSetSolenoidMask(const int low, const uint32_t mask) { vp_setSolMask(low, mask); } @@ -1005,7 +1005,7 @@ LIBPINMAME_API void PinmameSetSolenoidMask(const int low, const uint32_t mask) * PinmameGetMaxSolenoids ******************************************************/ -LIBPINMAME_API int PinmameGetMaxSolenoids() +PINMAMEAPI int PinmameGetMaxSolenoids() { return (CORE_MAXSOL + CORE_MODSOL_MAX); } @@ -1014,7 +1014,7 @@ LIBPINMAME_API int PinmameGetMaxSolenoids() * PinmameGetSolenoid ******************************************************/ -LIBPINMAME_API int PinmameGetSolenoid(const int solNo) +PINMAMEAPI int PinmameGetSolenoid(const int solNo) { return (_isRunning) ? vp_getSolenoid(solNo) : 0; } @@ -1023,7 +1023,7 @@ LIBPINMAME_API int PinmameGetSolenoid(const int solNo) * PinmameGetChangedSolenoids ******************************************************/ -LIBPINMAME_API int PinmameGetChangedSolenoids(PinmameSolenoidState* const p_changedStates) +PINMAMEAPI int PinmameGetChangedSolenoids(PinmameSolenoidState* const p_changedStates) { if (!_isRunning) return -1; @@ -1039,7 +1039,7 @@ LIBPINMAME_API int PinmameGetChangedSolenoids(PinmameSolenoidState* const p_chan * PinmameGetMaxLamps ******************************************************/ -LIBPINMAME_API int PinmameGetMaxLamps() +PINMAMEAPI int PinmameGetMaxLamps() { return (CORE_MAXLAMPCOL * 8) + CORE_MAXRGBLAMPS; } @@ -1048,7 +1048,7 @@ LIBPINMAME_API int PinmameGetMaxLamps() * PinmameGetLamp ******************************************************/ -LIBPINMAME_API int PinmameGetLamp(const int lampNo) +PINMAMEAPI int PinmameGetLamp(const int lampNo) { return (_isRunning) ? vp_getLamp(lampNo) : 0; } @@ -1057,7 +1057,7 @@ LIBPINMAME_API int PinmameGetLamp(const int lampNo) * PinmameGetChangedLamps ******************************************************/ -LIBPINMAME_API int PinmameGetChangedLamps(PinmameLampState* const p_changedStates) +PINMAMEAPI int PinmameGetChangedLamps(PinmameLampState* const p_changedStates) { if (!_isRunning) return -1; @@ -1073,7 +1073,7 @@ LIBPINMAME_API int PinmameGetChangedLamps(PinmameLampState* const p_changedState * PinmameGetMaxGIs ******************************************************/ -LIBPINMAME_API int PinmameGetMaxGIs() +PINMAMEAPI int PinmameGetMaxGIs() { return CORE_MAXGI; } @@ -1082,7 +1082,7 @@ LIBPINMAME_API int PinmameGetMaxGIs() * PinmameGetGI ******************************************************/ -LIBPINMAME_API int PinmameGetGI(const int giNo) +PINMAMEAPI int PinmameGetGI(const int giNo) { return (_isRunning) ? vp_getGI(giNo) : 0; } @@ -1091,7 +1091,7 @@ LIBPINMAME_API int PinmameGetGI(const int giNo) * PinmameGetChangedGIs ******************************************************/ -LIBPINMAME_API int PinmameGetChangedGIs(PinmameGIState* const p_changedStates) +PINMAMEAPI int PinmameGetChangedGIs(PinmameGIState* const p_changedStates) { if (!_isRunning) return -1; @@ -1107,7 +1107,7 @@ LIBPINMAME_API int PinmameGetChangedGIs(PinmameGIState* const p_changedStates) * PinmameGetMaxLEDs ******************************************************/ -LIBPINMAME_API int PinmameGetMaxLEDs() +PINMAMEAPI int PinmameGetMaxLEDs() { return CORE_SEGCOUNT; } @@ -1116,7 +1116,7 @@ LIBPINMAME_API int PinmameGetMaxLEDs() * PinmameGetChangedLEDs ******************************************************/ -LIBPINMAME_API int PinmameGetChangedLEDs(const uint64_t mask, const uint64_t mask2, PinmameLEDState* const p_changedStates) +PINMAMEAPI int PinmameGetChangedLEDs(const uint64_t mask, const uint64_t mask2, PinmameLEDState* const p_changedStates) { if (!_isRunning) return -1; @@ -1132,7 +1132,7 @@ LIBPINMAME_API int PinmameGetChangedLEDs(const uint64_t mask, const uint64_t mas * PinmameGetMaxMechs ******************************************************/ -LIBPINMAME_API int PinmameGetMaxMechs() +PINMAMEAPI int PinmameGetMaxMechs() { return (MECH_MAXMECH / 2); } @@ -1141,7 +1141,7 @@ LIBPINMAME_API int PinmameGetMaxMechs() * PinmameGetMech ******************************************************/ -LIBPINMAME_API int PinmameGetMech(const int mechNo) +PINMAMEAPI int PinmameGetMech(const int mechNo) { return (_isRunning) ? vp_getMech(mechNo) : 0; } @@ -1150,7 +1150,7 @@ LIBPINMAME_API int PinmameGetMech(const int mechNo) * PinmameSetMech ******************************************************/ -LIBPINMAME_API PINMAME_STATUS PinmameSetMech(const int mechNo, const PinmameMechConfig* const p_mechConfig) +PINMAMEAPI PINMAME_STATUS PinmameSetMech(const int mechNo, const PinmameMechConfig* const p_mechConfig) { if (g_fHandleMechanics) return PINMAME_STATUS_MECH_HANDLE_MECHANICS; @@ -1191,7 +1191,7 @@ LIBPINMAME_API PINMAME_STATUS PinmameSetMech(const int mechNo, const PinmameMech * PinmameGetMaxSoundCommands ******************************************************/ -LIBPINMAME_API int PinmameGetMaxSoundCommands() +PINMAMEAPI int PinmameGetMaxSoundCommands() { return MAX_CMD_LOG; } @@ -1200,7 +1200,7 @@ LIBPINMAME_API int PinmameGetMaxSoundCommands() * PinmameGetNewSoundCommands ******************************************************/ -LIBPINMAME_API int PinmameGetNewSoundCommands(PinmameSoundCommand* const p_newCommands) +PINMAMEAPI int PinmameGetNewSoundCommands(PinmameSoundCommand* const p_newCommands) { if (!_isRunning) return -1; @@ -1216,7 +1216,7 @@ LIBPINMAME_API int PinmameGetNewSoundCommands(PinmameSoundCommand* const p_newCo * PinmameGetDIP ******************************************************/ -LIBPINMAME_API int PinmameGetDIP(const int dipBank) +PINMAMEAPI int PinmameGetDIP(const int dipBank) { return (_isRunning) ? vp_getDIP(dipBank) : 0; } @@ -1225,7 +1225,7 @@ LIBPINMAME_API int PinmameGetDIP(const int dipBank) * PinmameSetDIP ******************************************************/ -LIBPINMAME_API void PinmameSetDIP(const int dipBank, const int value) +PINMAMEAPI void PinmameSetDIP(const int dipBank, const int value) { if (!_isRunning) return; @@ -1237,7 +1237,7 @@ LIBPINMAME_API void PinmameSetDIP(const int dipBank, const int value) * PinmameSetUserData ******************************************************/ -LIBPINMAME_API void PinmameSetUserData(const void* p_userData) +PINMAMEAPI void PinmameSetUserData(const void* p_userData) { _p_userData = (void*)p_userData; } diff --git a/src/libpinmame/libpinmame.h b/src/libpinmame/libpinmame.h index fa71aa8f7..4be338d09 100644 --- a/src/libpinmame/libpinmame.h +++ b/src/libpinmame/libpinmame.h @@ -6,11 +6,11 @@ #include #ifdef _MSC_VER -#define LIBPINMAME_API extern "C" __declspec(dllexport) -#define CALLBACK __stdcall +#define PINMAMEAPI extern "C" __declspec(dllexport) +#define PINMAMECALLBACK __stdcall #else -#define LIBPINMAME_API extern "C" __attribute__((visibility("default"))) -#define CALLBACK +#define PINMAMEAPI extern "C" __attribute__((visibility("default"))) +#define PINMAMECALLBACK #endif #define PINMAME_MAX_PATH 512 @@ -382,19 +382,19 @@ typedef struct { unsigned int standardcode; } PinmameKeyboardInfo; -typedef void (CALLBACK *PinmameGameCallback)(PinmameGame* p_game, const void* p_userData); -typedef void (CALLBACK *PinmameOnStateUpdatedCallback)(int state, const void* p_userData); -typedef void (CALLBACK *PinmameOnDisplayAvailableCallback)(int index, int displayCount, PinmameDisplayLayout* p_displayLayout, const void* p_userData); -typedef void (CALLBACK *PinmameOnDisplayUpdatedCallback)(int index, void* p_displayData, PinmameDisplayLayout* p_displayLayout, const void* p_userData); -typedef int (CALLBACK *PinmameOnAudioAvailableCallback)(PinmameAudioInfo* p_audioInfo, const void* p_userData); -typedef int (CALLBACK *PinmameOnAudioUpdatedCallback)(void* p_buffer, int samples, const void* p_userData); -typedef void (CALLBACK *PinmameOnMechAvailableCallback)(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_userData); -typedef void (CALLBACK *PinmameOnMechUpdatedCallback)(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_userData); -typedef void (CALLBACK *PinmameOnSolenoidUpdatedCallback)(PinmameSolenoidState* p_solenoidState, const void* p_userData); -typedef void (CALLBACK *PinmameOnConsoleDataUpdatedCallback)(void* p_data, int size, const void* p_userData); -typedef int (CALLBACK *PinmameIsKeyPressedFunction)(PINMAME_KEYCODE keycode, const void* p_userData); -typedef void (CALLBACK *PinmameOnLogMessageCallback)(PINMAME_LOG_LEVEL logLevel, const char* format, va_list args, const void* p_userData); -typedef void (CALLBACK *PinmameOnSoundCommandCallback)(int boardNo, int cmd, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameGameCallback)(PinmameGame* p_game, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnStateUpdatedCallback)(int state, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnDisplayAvailableCallback)(int index, int displayCount, PinmameDisplayLayout* p_displayLayout, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnDisplayUpdatedCallback)(int index, void* p_displayData, PinmameDisplayLayout* p_displayLayout, const void* p_userData); +typedef int (PINMAMECALLBACK *PinmameOnAudioAvailableCallback)(PinmameAudioInfo* p_audioInfo, const void* p_userData); +typedef int (PINMAMECALLBACK *PinmameOnAudioUpdatedCallback)(void* p_buffer, int samples, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnMechAvailableCallback)(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnMechUpdatedCallback)(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnSolenoidUpdatedCallback)(PinmameSolenoidState* p_solenoidState, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnConsoleDataUpdatedCallback)(void* p_data, int size, const void* p_userData); +typedef int (PINMAMECALLBACK *PinmameIsKeyPressedFunction)(PINMAME_KEYCODE keycode, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnLogMessageCallback)(PINMAME_LOG_LEVEL logLevel, const char* format, va_list args, const void* p_userData); +typedef void (PINMAMECALLBACK *PinmameOnSoundCommandCallback)(int boardNo, int cmd, const void* p_userData); typedef struct { const PINMAME_AUDIO_FORMAT audioFormat; @@ -414,48 +414,48 @@ typedef struct { PinmameOnSoundCommandCallback cb_OnSoundCommand; } PinmameConfig; -LIBPINMAME_API PINMAME_STATUS PinmameGetGame(const char* const p_name, PinmameGameCallback callback, const void* p_userData); -LIBPINMAME_API PINMAME_STATUS PinmameGetGames(PinmameGameCallback callback, const void* p_userData); -LIBPINMAME_API void PinmameSetConfig(const PinmameConfig* const p_config); -LIBPINMAME_API void PinmameSetPath(const PINMAME_FILE_TYPE fileType, const char* const p_path); -LIBPINMAME_API int PinmameGetCheat(); -LIBPINMAME_API void PinmameSetCheat(const int cheat); -LIBPINMAME_API int PinmameGetHandleKeyboard(); -LIBPINMAME_API void PinmameSetHandleKeyboard(const int handleKeyboard); -LIBPINMAME_API int PinmameGetHandleMechanics(); -LIBPINMAME_API void PinmameSetHandleMechanics(const int handleMechanics); -LIBPINMAME_API PINMAME_DMD_MODE PinmameGetDmdMode(); -LIBPINMAME_API void PinmameSetDmdMode(const PINMAME_DMD_MODE dmdMode); -LIBPINMAME_API PINMAME_SOUND_MODE PinmameGetSoundMode(); -LIBPINMAME_API void PinmameSetSoundMode(const PINMAME_SOUND_MODE soundMode); -LIBPINMAME_API PINMAME_STATUS PinmameRun(const char* const p_name); -LIBPINMAME_API int PinmameIsRunning(); -LIBPINMAME_API PINMAME_STATUS PinmamePause(const int pause); -LIBPINMAME_API int PinmameIsPaused(); -LIBPINMAME_API PINMAME_STATUS PinmameReset(); -LIBPINMAME_API void PinmameStop(); -LIBPINMAME_API PINMAME_HARDWARE_GEN PinmameGetHardwareGen(); -LIBPINMAME_API int PinmameGetSwitch(const int swNo); -LIBPINMAME_API void PinmameSetSwitch(const int swNo, const int state); -LIBPINMAME_API void PinmameSetSwitches(const PinmameSwitchState* const p_states, const int numSwitches); -LIBPINMAME_API uint32_t PinmameGetSolenoidMask(const int low); -LIBPINMAME_API void PinmameSetSolenoidMask(const int low, const uint32_t mask); -LIBPINMAME_API int PinmameGetMaxSolenoids(); -LIBPINMAME_API int PinmameGetSolenoid(const int solNo); -LIBPINMAME_API int PinmameGetChangedSolenoids(PinmameSolenoidState* const p_changedStates); -LIBPINMAME_API int PinmameGetMaxLamps(); -LIBPINMAME_API int PinmameGetLamp(const int lampNo); -LIBPINMAME_API int PinmameGetChangedLamps(PinmameLampState* const p_changedStates); -LIBPINMAME_API int PinmameGetMaxGIs(); -LIBPINMAME_API int PinmameGetGI(const int giNo); -LIBPINMAME_API int PinmameGetChangedGIs(PinmameGIState* const p_changedStates); -LIBPINMAME_API int PinmameGetMaxLEDs(); -LIBPINMAME_API int PinmameGetChangedLEDs(const uint64_t mask, const uint64_t, PinmameLEDState* const p_changedStates); -LIBPINMAME_API int PinmameGetMaxMechs(); -LIBPINMAME_API int PinmameGetMech(const int mechNo); -LIBPINMAME_API PINMAME_STATUS PinmameSetMech(const int mechNo, const PinmameMechConfig* const p_mechConfig); -LIBPINMAME_API int PinmameGetMaxSoundCommands(); -LIBPINMAME_API int PinmameGetNewSoundCommands(PinmameSoundCommand* const p_newCommands); -LIBPINMAME_API int PinmameGetDIP(const int dipBank); -LIBPINMAME_API void PinmameSetDIP(const int dipBank, const int value); -LIBPINMAME_API void PinmameSetUserData(const void* p_userData); +PINMAMEAPI PINMAME_STATUS PinmameGetGame(const char* const p_name, PinmameGameCallback callback, const void* p_userData); +PINMAMEAPI PINMAME_STATUS PinmameGetGames(PinmameGameCallback callback, const void* p_userData); +PINMAMEAPI void PinmameSetConfig(const PinmameConfig* const p_config); +PINMAMEAPI void PinmameSetPath(const PINMAME_FILE_TYPE fileType, const char* const p_path); +PINMAMEAPI int PinmameGetCheat(); +PINMAMEAPI void PinmameSetCheat(const int cheat); +PINMAMEAPI int PinmameGetHandleKeyboard(); +PINMAMEAPI void PinmameSetHandleKeyboard(const int handleKeyboard); +PINMAMEAPI int PinmameGetHandleMechanics(); +PINMAMEAPI void PinmameSetHandleMechanics(const int handleMechanics); +PINMAMEAPI PINMAME_DMD_MODE PinmameGetDmdMode(); +PINMAMEAPI void PinmameSetDmdMode(const PINMAME_DMD_MODE dmdMode); +PINMAMEAPI PINMAME_SOUND_MODE PinmameGetSoundMode(); +PINMAMEAPI void PinmameSetSoundMode(const PINMAME_SOUND_MODE soundMode); +PINMAMEAPI PINMAME_STATUS PinmameRun(const char* const p_name); +PINMAMEAPI int PinmameIsRunning(); +PINMAMEAPI PINMAME_STATUS PinmamePause(const int pause); +PINMAMEAPI int PinmameIsPaused(); +PINMAMEAPI PINMAME_STATUS PinmameReset(); +PINMAMEAPI void PinmameStop(); +PINMAMEAPI PINMAME_HARDWARE_GEN PinmameGetHardwareGen(); +PINMAMEAPI int PinmameGetSwitch(const int swNo); +PINMAMEAPI void PinmameSetSwitch(const int swNo, const int state); +PINMAMEAPI void PinmameSetSwitches(const PinmameSwitchState* const p_states, const int numSwitches); +PINMAMEAPI uint32_t PinmameGetSolenoidMask(const int low); +PINMAMEAPI void PinmameSetSolenoidMask(const int low, const uint32_t mask); +PINMAMEAPI int PinmameGetMaxSolenoids(); +PINMAMEAPI int PinmameGetSolenoid(const int solNo); +PINMAMEAPI int PinmameGetChangedSolenoids(PinmameSolenoidState* const p_changedStates); +PINMAMEAPI int PinmameGetMaxLamps(); +PINMAMEAPI int PinmameGetLamp(const int lampNo); +PINMAMEAPI int PinmameGetChangedLamps(PinmameLampState* const p_changedStates); +PINMAMEAPI int PinmameGetMaxGIs(); +PINMAMEAPI int PinmameGetGI(const int giNo); +PINMAMEAPI int PinmameGetChangedGIs(PinmameGIState* const p_changedStates); +PINMAMEAPI int PinmameGetMaxLEDs(); +PINMAMEAPI int PinmameGetChangedLEDs(const uint64_t mask, const uint64_t, PinmameLEDState* const p_changedStates); +PINMAMEAPI int PinmameGetMaxMechs(); +PINMAMEAPI int PinmameGetMech(const int mechNo); +PINMAMEAPI PINMAME_STATUS PinmameSetMech(const int mechNo, const PinmameMechConfig* const p_mechConfig); +PINMAMEAPI int PinmameGetMaxSoundCommands(); +PINMAMEAPI int PinmameGetNewSoundCommands(PinmameSoundCommand* const p_newCommands); +PINMAMEAPI int PinmameGetDIP(const int dipBank); +PINMAMEAPI void PinmameSetDIP(const int dipBank, const int value); +PINMAMEAPI void PinmameSetUserData(const void* p_userData); diff --git a/src/libpinmame/test.cpp b/src/libpinmame/test.cpp index 65beb7a24..4857110b8 100644 --- a/src/libpinmame/test.cpp +++ b/src/libpinmame/test.cpp @@ -134,13 +134,13 @@ void DumpAlphanumeric(int index, UINT16* p_displayData, PinmameDisplayLayout* p_ printf("%s\n", output[row]); } -void CALLBACK Game(PinmameGame* game, const void* p_userData) +void PINMAMECALLBACK Game(PinmameGame* game, const void* p_userData) { printf("Game(): name=%s, description=%s, manufacturer=%s, year=%s, flags=%lu, found=%d\n", game->name, game->description, game->manufacturer, game->year, (unsigned long)game->flags, game->found); } -void CALLBACK OnStateUpdated(int state, const void* p_userData) +void PINMAMECALLBACK OnStateUpdated(int state, const void* p_userData) { printf("OnStateUpdated(): state=%d\n", state); @@ -161,7 +161,7 @@ void CALLBACK OnStateUpdated(int state, const void* p_userData) PinmameSetMech(1, &mechConfig); } -void CALLBACK OnDisplayAvailable(int index, int displayCount, PinmameDisplayLayout* p_displayLayout, const void* p_userData) +void PINMAMECALLBACK OnDisplayAvailable(int index, int displayCount, PinmameDisplayLayout* p_displayLayout, const void* p_userData) { printf("OnDisplayAvailable(): index=%d, displayCount=%d, type=%d, top=%d, left=%d, width=%d, height=%d, depth=%d, length=%d\n", index, @@ -175,7 +175,7 @@ void CALLBACK OnDisplayAvailable(int index, int displayCount, PinmameDisplayLayo p_displayLayout->length); } -void CALLBACK OnDisplayUpdated(int index, void* p_displayData, PinmameDisplayLayout* p_displayLayout, const void* p_userData) +void PINMAMECALLBACK OnDisplayUpdated(int index, void* p_displayData, PinmameDisplayLayout* p_displayLayout, const void* p_userData) { printf("OnDisplayUpdated(): index=%d, type=%d, top=%d, left=%d, width=%d, height=%d, depth=%d, length=%d\n", index, @@ -197,7 +197,7 @@ void CALLBACK OnDisplayUpdated(int index, void* p_displayData, PinmameDisplayLay } } -int CALLBACK OnAudioAvailable(PinmameAudioInfo* p_audioInfo, const void* p_userData) +int PINMAMECALLBACK OnAudioAvailable(PinmameAudioInfo* p_audioInfo, const void* p_userData) { printf("OnAudioAvailable(): format=%d, channels=%d, sampleRate=%.2f, framesPerSecond=%.2f, samplesPerFrame=%d, bufferSize=%d\n", p_audioInfo->format, @@ -209,17 +209,17 @@ int CALLBACK OnAudioAvailable(PinmameAudioInfo* p_audioInfo, const void* p_userD return p_audioInfo->samplesPerFrame; } -int CALLBACK OnAudioUpdated(void* p_buffer, int samples, const void* p_userData) +int PINMAMECALLBACK OnAudioUpdated(void* p_buffer, int samples, const void* p_userData) { return samples; } -void CALLBACK OnSolenoidUpdated(PinmameSolenoidState* p_solenoidState, const void* p_userData) +void PINMAMECALLBACK OnSolenoidUpdated(PinmameSolenoidState* p_solenoidState, const void* p_userData) { printf("OnSolenoidUpdated: solenoid=%d, state=%d\n", p_solenoidState->solNo, p_solenoidState->state); } -void CALLBACK OnMechAvailable(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_userData) +void PINMAMECALLBACK OnMechAvailable(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_userData) { printf("OnMechAvailable: mechNo=%d, type=%d, length=%d, steps=%d, pos=%d, speed=%d\n", mechNo, @@ -230,7 +230,7 @@ void CALLBACK OnMechAvailable(int mechNo, PinmameMechInfo* p_mechInfo, const voi p_mechInfo->speed); } -void CALLBACK OnMechUpdated(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_userData) +void PINMAMECALLBACK OnMechUpdated(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_userData) { printf("OnMechUpdated: mechNo=%d, type=%d, length=%d, steps=%d, pos=%d, speed=%d\n", mechNo, @@ -241,17 +241,17 @@ void CALLBACK OnMechUpdated(int mechNo, PinmameMechInfo* p_mechInfo, const void* p_mechInfo->speed); } -void CALLBACK OnConsoleDataUpdated(void* p_data, int size, const void* p_userData) +void PINMAMECALLBACK OnConsoleDataUpdated(void* p_data, int size, const void* p_userData) { printf("OnConsoleDataUpdated: size=%d\n", size); } -int CALLBACK IsKeyPressed(PINMAME_KEYCODE keycode, const void* p_userData) +int PINMAMECALLBACK IsKeyPressed(PINMAME_KEYCODE keycode, const void* p_userData) { return 0; } -void CALLBACK OnLogMessage(PINMAME_LOG_LEVEL logLevel, const char* format, va_list args, const void* p_userData) +void PINMAMECALLBACK OnLogMessage(PINMAME_LOG_LEVEL logLevel, const char* format, va_list args, const void* p_userData) { char buffer[1024]; vsnprintf(buffer, sizeof(buffer), format, args); @@ -262,7 +262,7 @@ void CALLBACK OnLogMessage(PINMAME_LOG_LEVEL logLevel, const char* format, va_li printf("ERROR: %s\n", buffer); } -void CALLBACK OnSoundCommand(int boardNo, int cmd, const void* p_userData) +void PINMAMECALLBACK OnSoundCommand(int boardNo, int cmd, const void* p_userData) { printf("OnSoundCommand: boardNo=%d, cmd=%d\n", boardNo, cmd); }