Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ducalex committed Nov 29, 2022
2 parents caf57d1 + 83aadf3 commit 24a980e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- GBC: Fixed Pokemon Trading Card Game
- SNES: Added support for ROMs with extra headers
- SNES: Added low pass filter toggle
- GEN: Added support for interleaved ROMs
- Lynx: Changed samplerate to fix some audio issues
- Launcher: Fixed recently played list
- Wifi and WebUI improvements
Expand Down
21 changes: 17 additions & 4 deletions components/retro-go/rg_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,29 @@ static inline uint32_t gamepad_read(void)
gpio_set_level(RG_GPIO_GAMEPAD_LATCH, 1);
usleep(1);

for (int i = 0; i < 8; i++)
uint32_t buttons = 0;
for (int i = 0; i < 16; i++)
{
int pinValue = gpio_get_level(RG_GPIO_GAMEPAD_DATA);
state |= pinValue << (7 - i);

buttons |= gpio_get_level(RG_GPIO_GAMEPAD_DATA) << (15 - i);
gpio_set_level(RG_GPIO_GAMEPAD_CLOCK, 0);
usleep(1);
gpio_set_level(RG_GPIO_GAMEPAD_CLOCK, 1);
usleep(1);
}
if (buttons & RG_GAMEPAD_MAP_MENU) state |= RG_KEY_MENU;
if (buttons & RG_GAMEPAD_MAP_OPTION) state |= RG_KEY_OPTION;
if (buttons & RG_GAMEPAD_MAP_START) state |= RG_KEY_START;
if (buttons & RG_GAMEPAD_MAP_SELECT) state |= RG_KEY_SELECT;
if (buttons & RG_GAMEPAD_MAP_UP) state |= RG_KEY_UP;
if (buttons & RG_GAMEPAD_MAP_RIGHT) state |= RG_KEY_RIGHT;
if (buttons & RG_GAMEPAD_MAP_DOWN) state |= RG_KEY_DOWN;
if (buttons & RG_GAMEPAD_MAP_LEFT) state |= RG_KEY_LEFT;
if (buttons & RG_GAMEPAD_MAP_A) state |= RG_KEY_A;
if (buttons & RG_GAMEPAD_MAP_B) state |= RG_KEY_B;
if (buttons & RG_GAMEPAD_MAP_X) state |= RG_KEY_X;
if (buttons & RG_GAMEPAD_MAP_Y) state |= RG_KEY_Y;
if (buttons & RG_GAMEPAD_MAP_L) state |= RG_KEY_L;
if (buttons & RG_GAMEPAD_MAP_R) state |= RG_KEY_R;

#elif RG_GAMEPAD_DRIVER == 3 // I2C

Expand Down
4 changes: 2 additions & 2 deletions components/retro-go/targets/esplay-s3/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os

os.putenv("IDF_TARGET", "esp32s3")
os.putenv("FW_FORMAT", "esplay")
os.environ["IDF_TARGET"] = "esp32"
os.environ["FW_FORMAT"] = "esplay"
4 changes: 2 additions & 2 deletions components/retro-go/targets/mrgc-g32/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os

os.putenv("IDF_TARGET", "esp32")
os.putenv("FW_FORMAT", "esplay")
os.environ["IDF_TARGET"] = "esp32"
os.environ["FW_FORMAT"] = "esplay"
4 changes: 2 additions & 2 deletions components/retro-go/targets/mrgc-gbm/env.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os

os.putenv("IDF_TARGET", "esp32")
os.putenv("FW_FORMAT", "esplay")
os.environ["IDF_TARGET"] = "esp32"
os.environ["FW_FORMAT"] = "esplay"
2 changes: 1 addition & 1 deletion snes9x-go/components/snes9x/memmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ bool LoadROM(const char* filename)
bool Tales = false;
FILE *fp;

printf("Loading ROM: '%s'\n", filename ?: '(null)');
printf("Loading ROM: '%s'\n", filename ?: "(null)");

Memory.ExtendedFormat = NOPE;

Expand Down

0 comments on commit 24a980e

Please sign in to comment.