Created
October 20, 2011 01:02
-
-
Save inactive123/1300140 to your computer and use it in GitHub Desktop.
Libnes fixed - PS3 build same speed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/trunk/platform/libgba/libsnes.cpp b/trunk/platform/libgba/libsnes.cpp | |
index 69ce3f1..f6f7838 100644 | |
--- a/trunk/platform/libgba/libsnes.cpp | |
+++ b/trunk/platform/libgba/libsnes.cpp | |
@@ -15,6 +15,7 @@ static snes_video_refresh_t video_cb = NULL; | |
static snes_audio_sample_t audio_cb = NULL; | |
static snes_input_poll_t poll_cb = NULL; | |
static snes_input_state_t input_cb = NULL; | |
+extern uint64_t joy; | |
unsigned snes_library_revision_major(void) | |
{ | |
@@ -97,9 +98,62 @@ void snes_power(void) | |
void snes_reset(void) | |
{} | |
+void systemReadJoypadGB(int n) | |
+{ | |
+#if 0 | |
+ poll_cb(); | |
+ | |
+ u32 J = 0; | |
+ | |
+ static const unsigned binds[] = { | |
+ SNES_DEVICE_ID_JOYPAD_A, | |
+ SNES_DEVICE_ID_JOYPAD_B, | |
+ SNES_DEVICE_ID_JOYPAD_SELECT, | |
+ SNES_DEVICE_ID_JOYPAD_START, | |
+ SNES_DEVICE_ID_JOYPAD_RIGHT, | |
+ SNES_DEVICE_ID_JOYPAD_LEFT, | |
+ SNES_DEVICE_ID_JOYPAD_UP, | |
+ SNES_DEVICE_ID_JOYPAD_DOWN, | |
+ SNES_DEVICE_ID_JOYPAD_R, | |
+ SNES_DEVICE_ID_JOYPAD_L | |
+ }; | |
+ | |
+ for (unsigned i = 0; i < 10; i++) | |
+ J |= input_cb(SNES_PORT_1, SNES_DEVICE_JOYPAD, 0, binds[i]) << i; | |
+ | |
+ joy = J; | |
+#endif | |
+} | |
+ | |
+static void systemReadJoypadGBA(void) | |
+{ | |
+ poll_cb(); | |
+ | |
+ u32 J = 0; | |
+ | |
+ static const unsigned binds[] = { | |
+ SNES_DEVICE_ID_JOYPAD_A, | |
+ SNES_DEVICE_ID_JOYPAD_B, | |
+ SNES_DEVICE_ID_JOYPAD_SELECT, | |
+ SNES_DEVICE_ID_JOYPAD_START, | |
+ SNES_DEVICE_ID_JOYPAD_RIGHT, | |
+ SNES_DEVICE_ID_JOYPAD_LEFT, | |
+ SNES_DEVICE_ID_JOYPAD_UP, | |
+ SNES_DEVICE_ID_JOYPAD_DOWN, | |
+ SNES_DEVICE_ID_JOYPAD_R, | |
+ SNES_DEVICE_ID_JOYPAD_L | |
+ }; | |
+ | |
+ for (unsigned i = 0; i < 10; i++) | |
+ J |= input_cb(SNES_PORT_1, SNES_DEVICE_JOYPAD, 0, binds[i]) << i; | |
+ | |
+ joy = J; | |
+} | |
+ | |
void snes_run(void) | |
{ | |
CPULoop(); | |
+ systemReadJoypadGBA(); | |
} | |
@@ -236,7 +290,7 @@ void systemSoundReset() | |
void systemSoundResume() | |
{} | |
-void systemOnWriteDataToSoundBuffer(uint16_t *finalWave, int length) | |
+void systemOnWriteDataToSoundBuffer(int16_t *finalWave, int length) | |
{ | |
for (int i = 0; i < length; i += 2) | |
audio_cb(finalWave[i + 0], finalWave[i + 1]); | |
@@ -274,30 +328,6 @@ int systemBlueShift = 0; | |
void systemMessage(int, const char*, ...) | |
{} | |
-u32 systemReadJoypad(int) | |
-{ | |
- poll_cb(); | |
- | |
- u32 J = 0; | |
- | |
- static const unsigned binds[] = { | |
- SNES_DEVICE_ID_JOYPAD_A, | |
- SNES_DEVICE_ID_JOYPAD_B, | |
- SNES_DEVICE_ID_JOYPAD_SELECT, | |
- SNES_DEVICE_ID_JOYPAD_START, | |
- SNES_DEVICE_ID_JOYPAD_RIGHT, | |
- SNES_DEVICE_ID_JOYPAD_LEFT, | |
- SNES_DEVICE_ID_JOYPAD_UP, | |
- SNES_DEVICE_ID_JOYPAD_DOWN, | |
- SNES_DEVICE_ID_JOYPAD_R, | |
- SNES_DEVICE_ID_JOYPAD_L | |
- }; | |
- | |
- for (unsigned i = 0; i < 10; i++) | |
- J |= input_cb(SNES_PORT_1, SNES_DEVICE_JOYPAD, 0, binds[i]) << i; | |
- | |
- return J; | |
-} | |
bool systemSoundInit() | |
{ | |
diff --git a/trunk/platform/ps3/src/emu-ps3.cpp b/trunk/platform/ps3/src/emu-ps3.cpp | |
index 930bcc6..4181457 100644 | |
--- a/trunk/platform/ps3/src/emu-ps3.cpp | |
+++ b/trunk/platform/ps3/src/emu-ps3.cpp | |
@@ -3,7 +3,6 @@ | |
* | |
* Created on: May 4, 2011 | |
********************************************************************************/ | |
-#include <string> | |
#include <sys/timer.h> | |
#include <sys/return_code.h> | |
@@ -13,6 +12,8 @@ | |
#include <sysutil/sysutil_msgdialog.h> | |
#include <cell/sysmodule.h> | |
+#include <cell/cell_fs.h> | |
+#include <string> | |
#include "sys/types.h" | |
#include "../../../src/vba/gba/GBA.h" | |
@@ -203,12 +204,6 @@ void systemGbPrint(uint8_t *data,int pages,int feed,int palette, int contrast) | |
} | |
// updates the joystick data | |
-#if 0 | |
-__attribute__ ((__always_inline__)) bool systemReadJoypads() | |
-{ | |
- return true; | |
-} | |
-#endif | |
static void ingame_menu_enable (int enable) | |
{ | |
@@ -507,7 +502,7 @@ static void ingame_menu_enable (int enable) | |
} \ | |
} | |
-void systemReadJoypad(int n) | |
+void systemReadJoypadGB(int n) | |
{ | |
//n is the max amount of players connected for us to loop through | |
const uint64_t pads_connected = cell_pad_input_pads_connected(); | |
@@ -634,17 +629,6 @@ void systemGbBorderOn() | |
{ | |
} | |
-void DbgMsg(const char *msg, ...) | |
-{ | |
- | |
-} | |
- | |
- | |
-void winlog(const char *,...) | |
-{ | |
- | |
-} | |
- | |
float Emulator_GetFontSize() | |
{ | |
return Settings.PS3FontSize/100.0; | |
@@ -656,12 +640,6 @@ bool Emulator_IsROMLoaded() | |
return current_rom != NULL && need_load_rom == false; | |
} | |
- | |
-bool IsROMRunning() | |
-{ | |
- return is_running; | |
-} | |
- | |
static void emulator_shutdown() | |
{ | |
if (Emulator_IsROMLoaded()) | |
@@ -830,40 +808,40 @@ init_setting_uint(string_concat_ps3_controls(padno, AnalogR_Right_Type), PS3Inpu | |
#define map_ps3_button_array(buttonarray) \ | |
for(int i = 0; i < MAX_PADS; i++) \ | |
{ \ | |
- Input_MapButton(PS3Input.DPad_Up[i],false, buttonarray[0]); \ | |
- Input_MapButton(PS3Input.DPad_Down[i],false, buttonarray[1]); \ | |
- Input_MapButton(PS3Input.DPad_Left[i],false, buttonarray[2]); \ | |
- Input_MapButton(PS3Input.DPad_Right[i],false, buttonarray[3]); \ | |
- Input_MapButton(PS3Input.ButtonCircle[i],false, buttonarray[4]); \ | |
- Input_MapButton(PS3Input.ButtonCross[i],false, buttonarray[5]); \ | |
- Input_MapButton(PS3Input.ButtonTriangle[i],false, buttonarray[6]); \ | |
- Input_MapButton(PS3Input.ButtonSquare[i],false, buttonarray[7]); \ | |
- Input_MapButton(PS3Input.ButtonSelect[i],false, buttonarray[8]); \ | |
- Input_MapButton(PS3Input.ButtonStart[i],false, buttonarray[9]); \ | |
- Input_MapButton(PS3Input.ButtonL1[i],false, buttonarray[10]); \ | |
- Input_MapButton(PS3Input.ButtonL2[i],false, buttonarray[11]); \ | |
- Input_MapButton(PS3Input.ButtonR2[i],false, buttonarray[12]); \ | |
- Input_MapButton(PS3Input.ButtonL3[i],false, buttonarray[13]); \ | |
- Input_MapButton(PS3Input.ButtonR3[i],false, buttonarray[14]); \ | |
- Input_MapButton(PS3Input.ButtonR1[i],false, buttonarray[15]); \ | |
- Input_MapButton(PS3Input.ButtonL2_ButtonL3[i],false, buttonarray[16]); \ | |
- Input_MapButton(PS3Input.ButtonL2_ButtonR2[i],false, buttonarray[17]); \ | |
- Input_MapButton(PS3Input.ButtonL2_ButtonR3[i],false, buttonarray[18]); \ | |
- Input_MapButton(PS3Input.ButtonR2_ButtonR3[i],false, buttonarray[19]); \ | |
- Input_MapButton(PS3Input.AnalogR_Up[i],false, buttonarray[20]); \ | |
- Input_MapButton(PS3Input.AnalogR_Down[i],false, buttonarray[21]); \ | |
- Input_MapButton(PS3Input.AnalogR_Left[i],false, buttonarray[22]); \ | |
- Input_MapButton(PS3Input.AnalogR_Right[i],false, buttonarray[23]); \ | |
- Input_MapButton(PS3Input.ButtonL2_AnalogR_Right[i],false, buttonarray[24]); \ | |
- Input_MapButton(PS3Input.ButtonL2_AnalogR_Left[i],false, buttonarray[25]); \ | |
- Input_MapButton(PS3Input.ButtonL2_AnalogR_Up[i],false, buttonarray[26]); \ | |
- Input_MapButton(PS3Input.ButtonL2_AnalogR_Down[i],false, buttonarray[27]); \ | |
- Input_MapButton(PS3Input.ButtonR2_AnalogR_Right[i],false, buttonarray[28]); \ | |
- Input_MapButton(PS3Input.ButtonR2_AnalogR_Left[i],false, buttonarray[29]); \ | |
- Input_MapButton(PS3Input.ButtonR2_AnalogR_Up[i],false, buttonarray[30]); \ | |
- Input_MapButton(PS3Input.ButtonR2_AnalogR_Down[i],false, buttonarray[31]); \ | |
- Input_MapButton(PS3Input.ButtonL2_ButtonR2_AnalogR_Down[i],false, buttonarray[32]); \ | |
- Input_MapButton(PS3Input.ButtonR3_ButtonL3[i],false, buttonarray[33]); \ | |
+ INPUT_MAPBUTTON(PS3Input.DPad_Up[i],false, buttonarray[0]); \ | |
+ INPUT_MAPBUTTON(PS3Input.DPad_Down[i],false, buttonarray[1]); \ | |
+ INPUT_MAPBUTTON(PS3Input.DPad_Left[i],false, buttonarray[2]); \ | |
+ INPUT_MAPBUTTON(PS3Input.DPad_Right[i],false, buttonarray[3]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonCircle[i],false, buttonarray[4]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonCross[i],false, buttonarray[5]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonTriangle[i],false, buttonarray[6]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonSquare[i],false, buttonarray[7]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonSelect[i],false, buttonarray[8]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonStart[i],false, buttonarray[9]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL1[i],false, buttonarray[10]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2[i],false, buttonarray[11]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR2[i],false, buttonarray[12]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL3[i],false, buttonarray[13]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR3[i],false, buttonarray[14]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR1[i],false, buttonarray[15]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2_ButtonL3[i],false, buttonarray[16]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2_ButtonR2[i],false, buttonarray[17]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2_ButtonR3[i],false, buttonarray[18]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR2_ButtonR3[i],false, buttonarray[19]); \ | |
+ INPUT_MAPBUTTON(PS3Input.AnalogR_Up[i],false, buttonarray[20]); \ | |
+ INPUT_MAPBUTTON(PS3Input.AnalogR_Down[i],false, buttonarray[21]); \ | |
+ INPUT_MAPBUTTON(PS3Input.AnalogR_Left[i],false, buttonarray[22]); \ | |
+ INPUT_MAPBUTTON(PS3Input.AnalogR_Right[i],false, buttonarray[23]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2_AnalogR_Right[i],false, buttonarray[24]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2_AnalogR_Left[i],false, buttonarray[25]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2_AnalogR_Up[i],false, buttonarray[26]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2_AnalogR_Down[i],false, buttonarray[27]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR2_AnalogR_Right[i],false, buttonarray[28]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR2_AnalogR_Left[i],false, buttonarray[29]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR2_AnalogR_Up[i],false, buttonarray[30]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR2_AnalogR_Down[i],false, buttonarray[31]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonL2_ButtonR2_AnalogR_Down[i],false, buttonarray[32]); \ | |
+ INPUT_MAPBUTTON(PS3Input.ButtonR3_ButtonL3[i],false, buttonarray[33]); \ | |
PS3Input.AnalogR_Up_Type[i] = buttonarray[34]; \ | |
PS3Input.AnalogR_Down_Type[i] = buttonarray[35]; \ | |
PS3Input.AnalogR_Left_Type[i] = buttonarray[36]; \ | |
@@ -911,10 +889,26 @@ void emulator_implementation_button_mapping_settings(int map_button_option_enum) | |
} | |
} | |
+static bool file_exists(const char * filename) | |
+{ | |
+ CellFsStat sb; | |
+ if(cellFsStat(filename,&sb) == CELL_FS_SUCCEEDED) | |
+ return true; | |
+ else | |
+ return false; | |
+} | |
+ | |
static void emulator_init_settings() | |
{ | |
memset((&Settings), 0, (sizeof(Settings))); | |
+ if(!file_exists(SYS_CONFIG_FILE)) | |
+ { | |
+ FILE * f; | |
+ f = fopen(SYS_CONFIG_FILE, "w"); | |
+ fclose(f); | |
+ } | |
+ | |
config_file_t * currentconfig = config_file_new(SYS_CONFIG_FILE); | |
init_setting_uint("PS3General::ApplyShaderPresetOnStartup", Settings.ApplyShaderPresetOnStartup, 0); | |
@@ -2006,7 +2000,7 @@ int main(int argc, char **argv) | |
emulator_init_settings(); | |
-#if(CELL_SDK_VERSION == 0x340001) | |
+#if(CELL_SDK_VERSION > 0x340000) | |
if (Settings.ScreenshotsEnabled) | |
{ | |
cellSysmoduleLoadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); | |
@@ -2182,7 +2176,7 @@ void systemSoundResume() | |
audio_driver->unpause(audio_handle); | |
} | |
-void systemOnWriteDataToSoundBuffer(uint16_t * finalWave, int length) | |
+void systemOnWriteDataToSoundBuffer(int16_t * finalWave, int length) | |
{ | |
- audio_driver->write(audio_handle,(int16_t*)finalWave, length); | |
+ audio_driver->write(audio_handle,finalWave, length); | |
} | |
diff --git a/trunk/platform/ps3/src/emu-ps3.hpp b/trunk/platform/ps3/src/emu-ps3.hpp | |
index e4b1a6a..897216c 100644 | |
--- a/trunk/platform/ps3/src/emu-ps3.hpp | |
+++ b/trunk/platform/ps3/src/emu-ps3.hpp | |
@@ -82,14 +82,12 @@ enum { | |
float Emulator_GetFontSize(); | |
void Emulator_StopROMRunning(); | |
void Emulator_StartROMRunning(uint32_t set_is_running = 1); | |
-bool IsROMRunning(); | |
void Emulator_RequestLoadROM(const char * filename); | |
bool Emulator_IsROMLoaded(); | |
void vba_toggle_sgb_border(bool set_border); | |
void emulator_save_settings(uint64_t filetosave); | |
extern void emulator_implementation_set_shader_preset(const char * fname); | |
void emulator_implementation_button_mapping_settings(int map_button_option_enum); | |
-void LoadImagePreferences(); | |
void emulator_implementation_switch_control_scheme(); | |
void emulator_toggle_sound(uint64_t soundmode); | |
void emulator_implementation_save_custom_controls(bool showdialog); | |
diff --git a/trunk/platform/ps3/src/menu.cpp b/trunk/platform/ps3/src/menu.cpp | |
index 8e5844a..cfbdb23 100644 | |
--- a/trunk/platform/ps3/src/menu.cpp | |
+++ b/trunk/platform/ps3/src/menu.cpp | |
@@ -170,18 +170,18 @@ static void RenderBrowser(FileBrowser* b) | |
\ | |
if(CTRL_LEFT(state) | CTRL_LSTICK_LEFT(state)) \ | |
{ \ | |
- Input_MapButton(settingsptr,false,NULL); \ | |
+ INPUT_MAPBUTTON(settingsptr,false,NULL); \ | |
sys_timer_usleep(FILEBROWSER_DELAY); \ | |
} \ | |
if(CTRL_RIGHT(state) || CTRL_LSTICK_RIGHT(state) || CTRL_CROSS(button_was_pressed)) \ | |
{ \ | |
- Input_MapButton(settingsptr,true,NULL); \ | |
+ INPUT_MAPBUTTON(settingsptr,true,NULL); \ | |
sys_timer_usleep(FILEBROWSER_DELAY); \ | |
} \ | |
\ | |
if(CTRL_START(state)) \ | |
{ \ | |
- Input_MapButton(settingsptr,true,defaultvalue); \ | |
+ INPUT_MAPBUTTON(settingsptr,true,defaultvalue); \ | |
} \ | |
old_state = state; \ | |
} | |
diff --git a/trunk/platform/ps3/src/menu/settings-logic.h b/trunk/platform/ps3/src/menu/settings-logic.h | |
index 338dacf..94f9234 100644 | |
--- a/trunk/platform/ps3/src/menu/settings-logic.h | |
+++ b/trunk/platform/ps3/src/menu/settings-logic.h | |
@@ -442,7 +442,7 @@ static void producesettingentry(uint64_t switchvalue) | |
Graphics->set_vsync(Settings.Throttled); | |
Settings.ScreenshotsEnabled = false; | |
emulator_implementation_set_texture(DEFAULT_BORDER_FILE); | |
-#if(CELL_SDK_VERSION == 0x340001) | |
+#if(CELL_SDK_VERSION > 0x340000) | |
cellScreenShotDisable(); | |
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_SCREENSHOT); | |
#endif | |
diff --git a/trunk/platform/ps3/src/ps3input.h b/trunk/platform/ps3/src/ps3input.h | |
index 7552f87..8197132 100644 | |
--- a/trunk/platform/ps3/src/ps3input.h | |
+++ b/trunk/platform/ps3/src/ps3input.h | |
@@ -38,7 +38,7 @@ extern "C" { | |
#define MAX_PADS 7 | |
-#define Input_MapButton(buttonmap, next, defaultbutton) \ | |
+#define INPUT_MAPBUTTON(buttonmap, next, defaultbutton) \ | |
if(defaultbutton == NULL) \ | |
buttonmap = Input_GetAdjacentButtonmap(buttonmap, next); \ | |
else \ | |
diff --git a/trunk/platform/ps3/src/ps3video.cpp b/trunk/platform/ps3/src/ps3video.cpp | |
index 46c6efe..e9488cc 100644 | |
--- a/trunk/platform/ps3/src/ps3video.cpp | |
+++ b/trunk/platform/ps3/src/ps3video.cpp | |
@@ -485,7 +485,6 @@ void PS3Graphics::Draw(uint8_t *XBuf) | |
texture_backdrop(0); | |
glDrawArrays(GL_QUADS, 0, 4); | |
- glFlush(); | |
glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); | |
glBindTexture(GL_TEXTURE_2D, fbo_tex); | |
@@ -514,7 +513,6 @@ void PS3Graphics::Draw(uint8_t *XBuf) | |
glBufferSubData(GL_ARRAY_BUFFER, 256, sizeof(fbo_tex_coord), fbo_tex_coord); | |
glDrawArrays(GL_QUADS, 0, 4); | |
- glFlush(); | |
glTexCoordPointer(2, GL_FLOAT, 0, (void*)128); | |
cgGLBindProgram(_vertexProgram[0]); | |
@@ -534,7 +532,6 @@ void PS3Graphics::Draw(uint8_t *XBuf) | |
texture_backdrop(0); | |
glDrawArrays(GL_QUADS, 0, 4); | |
- glFlush(); | |
write_fps(); | |
} | |
} | |
diff --git a/trunk/platform/ps3/src/ps3video.hpp b/trunk/platform/ps3/src/ps3video.hpp | |
index 089a6ff..c6ee3d0 100644 | |
--- a/trunk/platform/ps3/src/ps3video.hpp | |
+++ b/trunk/platform/ps3/src/ps3video.hpp | |
@@ -31,10 +31,6 @@ | |
#endif | |
/* emulator-specific */ | |
-#define SCREEN_RENDER_TEXTURE_WIDTH FCEU_RENDER_TEXTURE_WIDTH | |
-#define SCREEN_RENDER_TEXTURE_HEIGHT FCEU_RENDER_TEXTURE_HEIGHT | |
- | |
-#define SCREEN_RENDER_TEXTURE_PITCH FCEU_SCREEN_PITCH | |
#define SCREEN_RENDER_PIXEL_FORMAT GL_ARGB_SCE | |
/* resolution constants */ | |
diff --git a/trunk/src/vba/System.h b/trunk/src/vba/System.h | |
index 521d673..ab24f6a 100644 | |
--- a/trunk/src/vba/System.h | |
+++ b/trunk/src/vba/System.h | |
@@ -1,11 +1,8 @@ | |
#ifndef SYSTEM_H | |
#define SYSTEM_H | |
-#ifdef __CELLOS_LV2__ | |
-#include "../../platform/common/utils/zlib/zlib.h" | |
-#else | |
+#include <stdint.h> | |
#include <zlib.h> | |
-#endif | |
// For backwards compatibility with the original VBA defines | |
#ifdef FRAMESKIP | |
@@ -28,7 +25,7 @@ extern void systemDrawScreen(); | |
// updates the joystick data | |
extern bool systemReadJoypads(); | |
// return information about the given joystick, -1 for default joystick | |
-extern void systemReadJoypad(int); | |
+extern void systemReadJoypadGB(int); | |
extern uint32_t systemGetClock(); | |
extern void systemMessage(int, const char *, ...); | |
extern void systemSetTitle(const char *); | |
@@ -66,7 +63,7 @@ extern void systemSoundResume(); | |
extern void systemSoundReset(); | |
extern void systemSoundSetThrottle(unsigned short throttle); | |
extern void systemSoundNonblock(bool enable); | |
-extern void systemOnWriteDataToSoundBuffer(uint16_t * finalWave, int length); | |
+extern void systemOnWriteDataToSoundBuffer(int16_t * finalWave, int length); | |
extern void systemOnSoundShutdown(); | |
//extern uint16_t systemColorMap16[0x10000]; | |
diff --git a/trunk/src/vba/gb/GB.cpp b/trunk/src/vba/gb/GB.cpp | |
index 7133b66..4e08769 100644 | |
--- a/trunk/src/vba/gb/GB.cpp | |
+++ b/trunk/src/vba/gb/GB.cpp | |
@@ -4934,26 +4934,22 @@ gbRedoLoop: | |
} | |
#endif | |
-#if 0 | |
- if(systemReadJoypads()) { | |
-#endif | |
// read joystick | |
if(gbSgbMode && gbSgbMultiplayer) | |
{ | |
if(gbSgbFourPlayers) | |
{ | |
- systemReadJoypad(4); | |
+ systemReadJoypadGB(4); | |
} | |
else | |
{ | |
- systemReadJoypad(2); | |
+ systemReadJoypadGB(2); | |
} | |
} | |
else | |
{ | |
- systemReadJoypad(1); | |
+ systemReadJoypadGB(1); | |
} | |
- //} | |
int newmask = gbJoymask[0] & 255; | |
#ifdef USE_MOTION_SENSOR | |
@@ -5182,24 +5178,22 @@ gbRedoLoop: | |
systemDrawScreen(); | |
} | |
} | |
- //if(systemReadJoypads()) { | |
// read joystick | |
if(gbSgbMode && gbSgbMultiplayer) | |
{ | |
if(gbSgbFourPlayers) | |
{ | |
- systemReadJoypad(4); | |
+ systemReadJoypadGB(4); | |
} | |
else | |
{ | |
- systemReadJoypad(2); | |
+ systemReadJoypadGB(2); | |
} | |
} | |
else | |
{ | |
- systemReadJoypad(1); | |
+ systemReadJoypadGB(1); | |
} | |
- //} | |
gbFrameCount++; | |
systemFrame(); | |
@@ -5447,20 +5441,18 @@ gbRedoLoop: | |
{ | |
if(!(register_LCDC & 0x80)) | |
{ | |
- //if(systemReadJoypads()) { | |
// read joystick | |
if(gbSgbMode && gbSgbMultiplayer) | |
{ | |
if(gbSgbFourPlayers) | |
- systemReadJoypad(4); | |
+ systemReadJoypadGB(4); | |
else | |
- systemReadJoypad(2); | |
+ systemReadJoypadGB(2); | |
} | |
else | |
{ | |
- systemReadJoypad(1); | |
+ systemReadJoypadGB(1); | |
} | |
- //} | |
} | |
return; | |
} | |
diff --git a/trunk/src/vba/gb/gbGlobals.cpp b/trunk/src/vba/gb/gbGlobals.cpp | |
index bebc678..f7dfe26 100644 | |
--- a/trunk/src/vba/gb/gbGlobals.cpp | |
+++ b/trunk/src/vba/gb/gbGlobals.cpp | |
@@ -1,3 +1,4 @@ | |
+#include <stdint.h> | |
#include <cstdlib> | |
uint8_t *gbMemoryMap[16]; | |
diff --git a/trunk/src/vba/gba/Sound.cpp b/trunk/src/vba/gba/Sound.cpp | |
index 0e626a8..d4111c2 100644 | |
--- a/trunk/src/vba/gba/Sound.cpp | |
+++ b/trunk/src/vba/gba/Sound.cpp | |
@@ -40,7 +40,7 @@ extern bool stopState; // TODO: silence sound when true | |
int const SOUND_CLOCK_TICKS_ = 167772; // 1/100 second | |
-static uint16_t soundFinalWave [1600]; | |
+static int16_t soundFinalWave [1600]; | |
long soundSampleRate = 22050; | |
bool soundPaused = true; | |
#ifdef USE_SOUND_FILTERING |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment