Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
44670 committed Apr 17, 2022
1 parent 81227aa commit f2d59b1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ build
*.nro
.*

port-watchos
port-watchos
Release
*.bak
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Tested with [Goodboy Advance](https://www.gbadev.org/demos.php?showinfo=1486), i
| Name | Tested hardware | Performance | Notes |
| --- | --- | --- | --- |
| ESP32-S3 | ESP32-S3-WROOM-1-N8R8 | 20 fps | frameskip: 1 |
| SDL2 | AMD 3800X | 1200 fps | |
| SDL2 | AMD 3800X | 1800 fps | |
| SDL2 | Switch | 314 fps | |
| SDL2 | Apple M1 | 2300 fps | |
| SDL2 | Vita | 131 fps | frameskip: 1, overclocked |
Expand Down
Binary file removed Release/Windows/44gba.exe
Binary file not shown.
Empty file.
15 changes: 10 additions & 5 deletions port-sdl2/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <3ds.h>
#endif

int showAudioDebug = 1;
int showAudioDebug = 0;

int isQuitting = 0;
int autoSaveEnabled = 0;
Expand Down Expand Up @@ -173,7 +173,12 @@ void systemDrawScreen(void) {
}
}
if (turboMode) {
if (frameCount % 200 != 0) {
#ifdef __SWITCH__
const int turboModeSkipFactor = 6;
#else
const int turboModeSkipFactor = 60;
#endif
if (frameCount % turboModeSkipFactor != 0) {
return;
}
}
Expand Down Expand Up @@ -207,7 +212,7 @@ void systemOnWriteDataToSoundBuffer(int16_t *finalWave, int length) {

int wpos = (audioFifoHead + audioFifoLen) % AUDIO_FIFO_CAP;
if (audioFifoLen + length >= AUDIO_FIFO_CAP) {
//printf("audio fifo overflow: %d\n", audioFifoLen);
// printf("audio fifo overflow: %d\n", audioFifoLen);
goto bed;
}
length = (length / 2) * 2;
Expand All @@ -231,7 +236,7 @@ void audioCallback(void *userdata, Uint8 *stream, int len) {
uint16_t *wptr = (uint16_t *)stream;
int samples = len / 2;
if (audioFifoLen < samples) {
//printf("audio underrun: %d < %d\n", audioFifoLen, samples);
// printf("audio underrun: %d < %d\n", audioFifoLen, samples);
} else {
for (int i = 0; i < samples; i++) {
int16_t sample = audioFifo[audioFifoHead];
Expand Down Expand Up @@ -428,7 +433,7 @@ int main(int argc, char *argv[]) {
emuKeyState[7][1] |= yaxis > emuJoystickDeadzone;
#ifdef __3DS__
Uint8 hat = SDL_JoystickGetHat(joystick, 0);
//printf("hat: %d\n", hat);
// printf("hat: %d\n", hat);
emuKeyState[4][1] |= hat & SDL_HAT_RIGHT;
emuKeyState[5][1] |= hat & SDL_HAT_LEFT;
emuKeyState[6][1] |= hat & SDL_HAT_UP;
Expand Down

0 comments on commit f2d59b1

Please sign in to comment.