Skip to content

Commit

Permalink
- Folder icons, slider fix, ZL/ZR mappings, faster menu scrolling
Browse files Browse the repository at this point in the history
- Re-added icon for folders
- Fixed slider problem for New 3DS users
- Re-arranged order of settings when reading/writing from/to .cfg files.
- Added New 3DS Button ZL/ZR mappings (only works when launched from HBL)
- Added local / global fast-forward / open emulator menu key configuration
- Added battery level in menu
- Made the scrolling up/down in the menu faster when holding down the D-pad.
- Allow the user to scroll the left/right gauges when holding down the D-pad.
- Reversed tile.cpp/tile.h to original Snes9x v1.43 versions (maybe to allow software rendering later?)
  • Loading branch information
bubble2k16 committed Nov 11, 2017
1 parent e549dd1 commit ca4fa7a
Show file tree
Hide file tree
Showing 14 changed files with 426 additions and 1,434 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include $(DEVKITARM)/3ds_rules
# - <libctru folder>/default_icon.png
#---------------------------------------------------------------------------------
APP_TITLE := SNES9x for 3DS
APP_DESCRIPTION := High compatibility SNES emulator for 3DS. Based on SNES9x 1.43.
APP_DESCRIPTION := SNES emulator for 3DS.
APP_AUTHOR := bubble2k16
ASSETS := assets
ICON := $(ASSETS)/icon.png
Expand Down
1 change: 0 additions & 1 deletion source/3dsconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void config3dsReadWriteInt32(const char *format, int *value, int minValue, int m
*value = minValue;
if (*value > maxValue)
*value = maxValue;
//printf ("Scanned %d\n", *value);
}
else
{
Expand Down
7 changes: 5 additions & 2 deletions source/3dsfiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ static char currentDir[_MAX_PATH] = "";
void file3dsInitialize(void)
{
getcwd(currentDir, _MAX_PATH);
#ifdef RELEASE
if (currentDir[0] == '/')
{
char tempDir[_MAX_PATH];

sprintf(tempDir, "sdmc:%s", currentDir);
strcpy(currentDir, tempDir);
}
#endif
}


Expand Down Expand Up @@ -95,7 +98,7 @@ void file3dsGoToParentDirectory(void)
//----------------------------------------------------------------------
void file3dsGoToChildDirectory(const char* childDir)
{
strncat(currentDir, childDir, _MAX_PATH);
strncat(currentDir, &childDir[2], _MAX_PATH);
strncat(currentDir, "/", _MAX_PATH);
}

Expand Down Expand Up @@ -158,7 +161,7 @@ void file3dsGetFiles(std::vector<DirectoryEntry>& files, const std::vector<std::
continue;
if (dir->d_type == DT_DIR)
{
files.emplace_back(std::string(dir->d_name), FileEntryType::ChildDirectory);
files.emplace_back(std::string("\x01 ") + std::string(dir->d_name), FileEntryType::ChildDirectory);
}
if (dir->d_type == DT_REG)
{
Expand Down
9 changes: 7 additions & 2 deletions source/3dsgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,13 @@ void gpu3dsCheckSlider()
}
else if (sliderVal < 0.3)
{
gfxTopRightFramebuffers[0] = gfxOldTopRightFramebuffers[0];
gfxTopRightFramebuffers[1] = gfxOldTopRightFramebuffers[1];
u8 isNew3DS = 0;
APT_CheckNew3DS(&isNew3DS);
if (!isNew3DS)
{
gfxTopRightFramebuffers[0] = gfxOldTopRightFramebuffers[0];
gfxTopRightFramebuffers[1] = gfxOldTopRightFramebuffers[1];
}
gpu3dsSetParallaxBarrier(false);
}
else if (sliderVal < 0.6)
Expand Down
13 changes: 11 additions & 2 deletions source/3dsimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,8 @@ void S9xSyncSpeed (void)
}

uint32 prevConsoleJoyPad = 0;
u32 prevConsoleButtonPressed[8];
u32 buttons3dsPressed[8];
u32 prevConsoleButtonPressed[10];
u32 buttons3dsPressed[10];

uint32 S9xReadJoypad (int which1_0_to_4)
{
Expand Down Expand Up @@ -910,6 +910,8 @@ uint32 S9xReadJoypad (int which1_0_to_4)
SET_CONSOLE_JOYPAD(BTN3DS_Y, KEY_Y, settings3DS.GlobalButtonMapping)
SET_CONSOLE_JOYPAD(BTN3DS_SELECT, KEY_SELECT, settings3DS.GlobalButtonMapping);
SET_CONSOLE_JOYPAD(BTN3DS_START, KEY_START, settings3DS.GlobalButtonMapping);
SET_CONSOLE_JOYPAD(BTN3DS_ZL, KEY_ZL, settings3DS.GlobalButtonMapping)
SET_CONSOLE_JOYPAD(BTN3DS_ZR, KEY_ZR, settings3DS.GlobalButtonMapping)
}
else
{
Expand All @@ -921,8 +923,11 @@ uint32 S9xReadJoypad (int which1_0_to_4)
SET_CONSOLE_JOYPAD(BTN3DS_Y, KEY_Y, settings3DS.ButtonMapping)
SET_CONSOLE_JOYPAD(BTN3DS_SELECT, KEY_SELECT, settings3DS.ButtonMapping);
SET_CONSOLE_JOYPAD(BTN3DS_START, KEY_START, settings3DS.ButtonMapping);
SET_CONSOLE_JOYPAD(BTN3DS_ZL, KEY_ZL, settings3DS.ButtonMapping)
SET_CONSOLE_JOYPAD(BTN3DS_ZR, KEY_ZR, settings3DS.ButtonMapping)
}


// Handle turbo / rapid fire buttons.
//
int *turbo = settings3DS.Turbo;
Expand Down Expand Up @@ -956,6 +961,8 @@ uint32 S9xReadJoypad (int which1_0_to_4)
HANDLE_TURBO(BTN3DS_Y, settings3DS.GlobalButtonMapping);
HANDLE_TURBO(BTN3DS_L, settings3DS.GlobalButtonMapping);
HANDLE_TURBO(BTN3DS_R, settings3DS.GlobalButtonMapping);
HANDLE_TURBO(BTN3DS_ZL, settings3DS.GlobalButtonMapping);
HANDLE_TURBO(BTN3DS_ZR, settings3DS.GlobalButtonMapping);
}
else
{
Expand All @@ -965,6 +972,8 @@ uint32 S9xReadJoypad (int which1_0_to_4)
HANDLE_TURBO(BTN3DS_Y, settings3DS.ButtonMapping);
HANDLE_TURBO(BTN3DS_L, settings3DS.ButtonMapping);
HANDLE_TURBO(BTN3DS_R, settings3DS.ButtonMapping);
HANDLE_TURBO(BTN3DS_ZL, settings3DS.ButtonMapping);
HANDLE_TURBO(BTN3DS_ZR, settings3DS.ButtonMapping);
}

prevConsoleJoyPad = consoleJoyPad;
Expand Down
6 changes: 4 additions & 2 deletions source/3dsimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
#define BTN3DS_Y 3
#define BTN3DS_L 4
#define BTN3DS_R 5
#define BTN3DS_SELECT 6
#define BTN3DS_START 7
#define BTN3DS_ZL 6
#define BTN3DS_ZR 7
#define BTN3DS_SELECT 8
#define BTN3DS_START 9

//---------------------------------------------------------
// 3DS textures
Expand Down
2 changes: 2 additions & 0 deletions source/3dsimpl_gpu.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

#include "snes9x.h"
#include "ppu.h"
#include "3dssettings.h"

#include <3ds.h>
#include "3dsgpu.h"
#include "3dsimpl.h"
#include "3dsimpl_gpu.h"

SGPU3DSExtended GPU3DSExt;
extern S9xSettings3DS settings3DS;

void gpu3dsSetMode7UpdateFrameCountUniform();

Expand Down
5 changes: 4 additions & 1 deletion source/3dsinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ u32 input3dsScanInputForEmulation()
// -----------------------------------------------
#endif

if (keysDown & KEY_TOUCH || settings3DS.ButtonHotkeyOpenMenu.IsHeld(keysDown))
if (keysDown & KEY_TOUCH ||
(!settings3DS.UseGlobalEmuControlKeys && settings3DS.ButtonHotkeyOpenMenu.IsHeld(keysDown)) ||
(settings3DS.UseGlobalEmuControlKeys && settings3DS.GlobalButtonHotkeyOpenMenu.IsHeld(keysDown))
)
{
impl3dsTouchScreenPressed();

Expand Down
Loading

0 comments on commit ca4fa7a

Please sign in to comment.