1
0
mirror of https://github.com/TASVideos/desmume synced 2024-07-01 07:14:37 +00:00

Compare commits

...

8 Commits

4 changed files with 30 additions and 4 deletions

View File

@ -39,6 +39,7 @@
#define SCREENS_PIXEL_SIZE 98304
volatile bool execute = false;
static bool rom_opened = false;
TieredRegion hooked_regions [HOOK_COUNT];
std::map<unsigned int, memory_cb_fnc> hooks[HOOK_COUNT];
@ -97,11 +98,23 @@ EXPORTED void desmume_set_language(u8 lang)
EXPORTED int desmume_open(const char *filename)
{
int i;
if (rom_opened) {
NDS_FreeROM();
}
clear_savestates();
i = NDS_LoadROM(filename);
if (i > 0) {
rom_opened = true;
}
return i;
}
EXPORTED void desmume_close()
{
NDS_FreeROM();
rom_opened = false;
}
EXPORTED void desmume_set_savetype(int type) {
backup_setManualBackupType(type);
}

View File

@ -71,7 +71,10 @@ EXPORTED void desmume_free(void);
// 0 = Japanese, 1 = English, 2 = French, 3 = German, 4 = Italian, 5 = Spanish
EXPORTED void desmume_set_language(u8 language);
// Opens a new ROM, if a ROM was already opened, a new one is opened and the old was is automatically free'd.
EXPORTED int desmume_open(const char *filename);
// Frees and closes a ROM opened with desmume_open.
EXPORTED void desmume_close();
EXPORTED void desmume_set_savetype(int type);
EXPORTED void desmume_pause(void);
EXPORTED void desmume_resume(void);

View File

@ -51,6 +51,13 @@
#include "main.h"
#include "winutil.h"
//60 is a poor choice for a threshold; the theoretical maximum you can get even at an exact 45 degree angle is 70
//Sloshy sticks or slightly-off angles make it impossible to reach 60, as it's far too close to 70.
//Too-small values feel bad, too
//50 is a more normal choice
//#define S9X_JOY_NEUTRAL 60
int S9X_JOY_NEUTRAL = 50;
// Gamepad Dialog Strings
// Support Unicode display
//#define INPUTCONFIG_TITLE "Input Configuration"
@ -520,6 +527,9 @@ BOOL di_init()
{
HWND hParentWnd = MainWindow->getHWnd();
S9X_JOY_NEUTRAL = GetPrivateProfileInt("Controls", "DigitalizationThreshold", S9X_JOY_NEUTRAL, IniName);
pDI = NULL;
memset(cDIBuf, 0, sizeof(cDIBuf));
@ -669,10 +679,6 @@ int FunkyNormalize(int cur, int min, int max)
return Result;
}
#define S9X_JOY_NEUTRAL 60
void CheckAxis (short joy, short control, int val,
int min, int max,
bool &first, bool &second)

View File

@ -20,7 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifdef __MACH__
#define _DARWIN_C_SOURCE /* As below, plus strl* functions */
#else
#define _XOPEN_SOURCE 500 /* For strdup, realpath */
#endif
#include <stdlib.h>
#include <boolean.h>