mirror of
https://github.com/wavemotion-dave/GimliDS.git
synced 2025-06-18 22:05:33 -04:00
Version 1.2a with new global options and ability to dim the lower screen.
This commit is contained in:
parent
7a9ad994e5
commit
21e82c523e
BIN
GimliDS.nds
BIN
GimliDS.nds
Binary file not shown.
2
Makefile
2
Makefile
@ -9,7 +9,7 @@ include $(DEVKITARM)/ds_rules
|
|||||||
|
|
||||||
export TARGET := GimliDS
|
export TARGET := GimliDS
|
||||||
export TOPDIR := $(CURDIR)
|
export TOPDIR := $(CURDIR)
|
||||||
export VERSION := 1.2
|
export VERSION := 1.2a
|
||||||
|
|
||||||
ICON := -b $(CURDIR)/C64_icon.bmp "GimliDS $(VERSION);wavemotion-dave;https://github.com/wavemotion-dave/GimliDS"
|
ICON := -b $(CURDIR)/C64_icon.bmp "GimliDS $(VERSION);wavemotion-dave;https://github.com/wavemotion-dave/GimliDS"
|
||||||
|
|
||||||
|
@ -26,12 +26,12 @@ BACKGRD := gfx_data
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
ARCH := -marm -mthumb-interwork
|
ARCH := -marm -mthumb-interwork
|
||||||
|
|
||||||
CFLAGS := -g -O3 -flto -Wall -Wformat=0 -Wno-sequence-point -Wno-delete-non-virtual-dtor -Wno-pointer-arith -Wno-register -Wno-narrowing -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math $(ARCH) -falign-functions=4 -frename-registers -finline-functions $(ARCH)
|
CFLAGS := -O3 -flto -Wall -Wformat=0 -Wno-sequence-point -Wno-delete-non-virtual-dtor -Wno-pointer-arith -Wno-register -Wno-narrowing -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math $(ARCH) -falign-functions=4 -frename-registers -finline-functions $(ARCH)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE) -DARM9 -D__NDS__=1 -DPRECISE_CPU_CYCLES=1 -DGLOBAL_VARS=1
|
CFLAGS += $(INCLUDE) -DARM9 -D__NDS__=1 -DPRECISE_CPU_CYCLES=1 -DGLOBAL_VARS=1
|
||||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
|
||||||
|
|
||||||
ASFLAGS := -g $(ARCH) -march=armv5te -mtune=arm946e-s
|
ASFLAGS := $(ARCH) -march=armv5te -mtune=arm946e-s
|
||||||
|
|
||||||
LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
LDFLAGS = -specs=ds_arm9.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 42 KiB |
Binary file not shown.
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Binary file not shown.
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
@ -212,9 +212,9 @@ void C64::Reset(void)
|
|||||||
if (myConfig.reuType) TheREU->Reset();
|
if (myConfig.reuType) TheREU->Reset();
|
||||||
|
|
||||||
bTurboWarp = 0;
|
bTurboWarp = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NMI C64
|
* NMI C64
|
||||||
*/
|
*/
|
||||||
@ -256,7 +256,6 @@ void C64::LoadPRG(char *filename)
|
|||||||
* preferences, ThePrefs still holds the previous ones.
|
* preferences, ThePrefs still holds the previous ones.
|
||||||
* The emulation must be in the paused state!
|
* The emulation must be in the paused state!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void C64::NewPrefs(Prefs *prefs)
|
void C64::NewPrefs(Prefs *prefs)
|
||||||
{
|
{
|
||||||
PatchKernal(prefs->FastReset, prefs->TrueDrive);
|
PatchKernal(prefs->FastReset, prefs->TrueDrive);
|
||||||
|
@ -93,6 +93,7 @@ public:
|
|||||||
void InsertCart(char *filename);
|
void InsertCart(char *filename);
|
||||||
void RemoveCart(void);
|
void RemoveCart(void);
|
||||||
void LoadPRG(char *filename);
|
void LoadPRG(char *filename);
|
||||||
|
void SetBrightness(void);
|
||||||
|
|
||||||
uint8 *RAM, *Basic, *Kernal, *Char, *Color; // C64
|
uint8 *RAM, *Basic, *Kernal, *Char, *Color; // C64
|
||||||
uint8 *RAM1541, *ROM1541; // 1541
|
uint8 *RAM1541, *ROM1541; // 1541
|
||||||
|
@ -63,6 +63,7 @@ uint8_t palette_blue[16] = {
|
|||||||
0x00, 0xff, 0x38, 0xc8, 0x97, 0x4d, 0x9b, 0x71, 0x29, 0x00, 0x71, 0x4a, 0x7b, 0x9f, 0xeb, 0xb2
|
0x00, 0xff, 0x38, 0xc8, 0x97, 0x4d, 0x9b, 0x71, 0x29, 0x00, 0x71, 0x4a, 0x7b, 0x9f, 0xeb, 0xb2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static uint16 dimDampen = 0;
|
||||||
|
|
||||||
u8 last_drive_access_type = 0;
|
u8 last_drive_access_type = 0;
|
||||||
void floppy_soundfx(u8 type)
|
void floppy_soundfx(u8 type)
|
||||||
@ -252,6 +253,7 @@ C64Display::~C64Display()
|
|||||||
void C64Display::NewPrefs(Prefs *prefs)
|
void C64Display::NewPrefs(Prefs *prefs)
|
||||||
{
|
{
|
||||||
floppy_sound_counter = 50; // One seconds of no floppy sound...
|
floppy_sound_counter = 50; // One seconds of no floppy sound...
|
||||||
|
dimDampen = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 JITTER[] __attribute__((section(".dtcm"))) = {0, 64, 128};
|
u8 JITTER[] __attribute__((section(".dtcm"))) = {0, 64, 128};
|
||||||
@ -259,7 +261,22 @@ s16 temp_offset __attribute__((section(".dtcm"))) = 0;
|
|||||||
u16 slide_dampen __attribute__((section(".dtcm"))) = 0;
|
u16 slide_dampen __attribute__((section(".dtcm"))) = 0;
|
||||||
u16 DSIvBlanks __attribute__((section(".dtcm"))) = 0;
|
u16 DSIvBlanks __attribute__((section(".dtcm"))) = 0;
|
||||||
|
|
||||||
ITCM_CODE void vblankIntr(void)
|
int8 currentBrightness = 0;
|
||||||
|
const int8 brightness[] = {0, -6, -12, -15};
|
||||||
|
|
||||||
|
__attribute__ ((noinline)) void HandleBrightness(void)
|
||||||
|
{
|
||||||
|
if (currentBrightness == 0) setBrightness(2, currentBrightness);
|
||||||
|
if (++dimDampen > ((currentBrightness == 0) ? 400 : 15))
|
||||||
|
{
|
||||||
|
if (currentBrightness < brightness[myGlobalConfig.keyboardDim]) currentBrightness++; else currentBrightness--;
|
||||||
|
setBrightness(2, currentBrightness); // Subscreen Brightness
|
||||||
|
dimDampen = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ITCM_CODE void vblankDS(void)
|
||||||
{
|
{
|
||||||
DSIvBlanks++;
|
DSIvBlanks++;
|
||||||
int cxBG = ((s16)myConfig.offsetX << 8);
|
int cxBG = ((s16)myConfig.offsetX << 8);
|
||||||
@ -298,6 +315,11 @@ ITCM_CODE void vblankIntr(void)
|
|||||||
}
|
}
|
||||||
floppy_sound_counter--;
|
floppy_sound_counter--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentBrightness != brightness[myGlobalConfig.keyboardDim])
|
||||||
|
{
|
||||||
|
HandleBrightness();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle full 320x256
|
// Toggle full 320x256
|
||||||
@ -385,7 +407,7 @@ int init_graphics(void)
|
|||||||
REG_BG3PD = ydyBG;
|
REG_BG3PD = ydyBG;
|
||||||
|
|
||||||
SetYtrigger(190); //trigger 2 lines before vsync
|
SetYtrigger(190); //trigger 2 lines before vsync
|
||||||
irqSet(IRQ_VBLANK, vblankIntr);
|
irqSet(IRQ_VBLANK, vblankDS);
|
||||||
irqEnable(IRQ_VBLANK);
|
irqEnable(IRQ_VBLANK);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -640,6 +662,7 @@ void C64Display::PollKeyboard(uint8 *key_matrix, uint8 *rev_matrix, uint8 *joyst
|
|||||||
else
|
else
|
||||||
if ((m_tpActive == false) && (keysCurrent() & KEY_TOUCH))
|
if ((m_tpActive == false) && (keysCurrent() & KEY_TOUCH))
|
||||||
{
|
{
|
||||||
|
currentBrightness = 0;
|
||||||
touchRead(&m_tp);
|
touchRead(&m_tp);
|
||||||
m_tpActive = true;
|
m_tpActive = true;
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@ public:
|
|||||||
// Exported functions
|
// Exported functions
|
||||||
extern long ShowRequester(const char *str, const char *button1, const char *button2 = NULL);
|
extern long ShowRequester(const char *str, const char *button1, const char *button2 = NULL);
|
||||||
extern u8 issue_commodore_key;
|
extern u8 issue_commodore_key;
|
||||||
|
extern int8 currentBrightness;
|
||||||
extern void toggle_zoom(void);
|
extern void toggle_zoom(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -941,7 +941,7 @@ __attribute__ ((noinline)) ITCM_CODE void MOS6569::el_mc_text(uint8 *p, uint8 *
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__attribute__ ((noinline)) ITCM_CODE void MOS6569::el_std_bitmap(uint8 *p, uint8 *q, uint8 *r)
|
void MOS6569::el_std_bitmap(uint8 *p, uint8 *q, uint8 *r)
|
||||||
{
|
{
|
||||||
uint32 *lp = (uint32 *)p;
|
uint32 *lp = (uint32 *)p;
|
||||||
uint8 *mp = matrix_line;
|
uint8 *mp = matrix_line;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/dir.h>
|
#include <sys/dir.h>
|
||||||
#include "diskmenu.h"
|
#include "diskmenu.h"
|
||||||
|
#include "Display.h"
|
||||||
#include "mainmenu.h"
|
#include "mainmenu.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "mainmenu_bg.h"
|
#include "mainmenu_bg.h"
|
||||||
@ -208,7 +209,10 @@ u8 gimliDSLoadFile(u8 bCartOnly)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show the menu...
|
// Show the menu...
|
||||||
while ((keysCurrent() & (KEY_TOUCH | KEY_START | KEY_SELECT | KEY_A | KEY_B))!=0);
|
while ((keysCurrent() & (KEY_TOUCH | KEY_START | KEY_SELECT | KEY_A | KEY_B))!=0)
|
||||||
|
{
|
||||||
|
currentBrightness = 0;
|
||||||
|
}
|
||||||
|
|
||||||
gimliDSFindFiles(bCartOnly);
|
gimliDSFindFiles(bCartOnly);
|
||||||
|
|
||||||
@ -237,6 +241,7 @@ u8 gimliDSLoadFile(u8 bCartOnly)
|
|||||||
// -----------------------------------------------------
|
// -----------------------------------------------------
|
||||||
while (!bDone)
|
while (!bDone)
|
||||||
{
|
{
|
||||||
|
currentBrightness = 0;
|
||||||
if (keysCurrent() & KEY_UP)
|
if (keysCurrent() & KEY_UP)
|
||||||
{
|
{
|
||||||
if (!ucHaut)
|
if (!ucHaut)
|
||||||
@ -643,6 +648,7 @@ u8 DisketteMenu(C64 *the_c64)
|
|||||||
u8 bExitMenu = false;
|
u8 bExitMenu = false;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
currentBrightness = 0;
|
||||||
nds_key = keysCurrent();
|
nds_key = keysCurrent();
|
||||||
if (nds_key)
|
if (nds_key)
|
||||||
{
|
{
|
||||||
@ -825,6 +831,7 @@ u8 CartMenu(C64 *the_c64)
|
|||||||
u8 bExitMenu = false;
|
u8 bExitMenu = false;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
currentBrightness = 0;
|
||||||
nds_key = keysCurrent();
|
nds_key = keysCurrent();
|
||||||
if (nds_key)
|
if (nds_key)
|
||||||
{
|
{
|
||||||
|
@ -31,12 +31,19 @@
|
|||||||
#include "mainmenu.h"
|
#include "mainmenu.h"
|
||||||
#include "mainmenu_bg.h"
|
#include "mainmenu_bg.h"
|
||||||
#include "Prefs.h"
|
#include "Prefs.h"
|
||||||
|
#include "Display.h"
|
||||||
|
|
||||||
extern C64 *TheC64;
|
extern C64 *TheC64;
|
||||||
extern int bg0b, bg1b;
|
extern int bg0b, bg1b;
|
||||||
static u16 nds_key;
|
static u16 nds_key;
|
||||||
|
extern char strBuf[];
|
||||||
|
u32 file_crc = 0x00000000;
|
||||||
|
u8 option_table = 0;
|
||||||
extern void BottomScreenMainMenu(void);
|
extern void BottomScreenMainMenu(void);
|
||||||
|
|
||||||
|
// Used with myConfig.cpuCycles and myConfig.badCycles
|
||||||
|
s16 CycleDeltas[] = {0,1,2,3,4,5,6,7,8,9,-9,-8,-7,-6,-5,-4,-3,-2,-1};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// The Disk Menu can be called up directly from the keyboard graphic
|
// The Disk Menu can be called up directly from the keyboard graphic
|
||||||
// and allows the user to rewind the tape, swap in a new tape, etc.
|
// and allows the user to rewind the tape, swap in a new tape, etc.
|
||||||
@ -47,7 +54,9 @@ extern void BottomScreenMainMenu(void);
|
|||||||
#define MENU_ACTION_SAVE_STATE 2 // Save State
|
#define MENU_ACTION_SAVE_STATE 2 // Save State
|
||||||
#define MENU_ACTION_LOAD_STATE 3 // Load State
|
#define MENU_ACTION_LOAD_STATE 3 // Load State
|
||||||
#define MENU_ACTION_CONFIG 4 // Configure Game
|
#define MENU_ACTION_CONFIG 4 // Configure Game
|
||||||
#define MENU_ACTION_QUIT_EMU 5 // Exit Emulator
|
#define MENU_ACTION_GLOBAL_CONFIG 5 // Global Config
|
||||||
|
#define MENU_ACTION_LCD_SWAP 6 // Swap upper/lower LCD
|
||||||
|
#define MENU_ACTION_QUIT_EMU 7 // Exit Emulator
|
||||||
#define MENU_ACTION_SKIP 99 // Skip this MENU choice
|
#define MENU_ACTION_SKIP 99 // Skip this MENU choice
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -60,7 +69,7 @@ typedef struct
|
|||||||
{
|
{
|
||||||
char *title;
|
char *title;
|
||||||
u8 start_row;
|
u8 start_row;
|
||||||
MenuItem_t menulist[15];
|
MenuItem_t menulist[12];
|
||||||
} MainMenu_t;
|
} MainMenu_t;
|
||||||
|
|
||||||
MainMenu_t main_menu =
|
MainMenu_t main_menu =
|
||||||
@ -70,6 +79,8 @@ MainMenu_t main_menu =
|
|||||||
{(char *)" CONFIG GAME ", MENU_ACTION_CONFIG},
|
{(char *)" CONFIG GAME ", MENU_ACTION_CONFIG},
|
||||||
{(char *)" SAVE STATE ", MENU_ACTION_SAVE_STATE},
|
{(char *)" SAVE STATE ", MENU_ACTION_SAVE_STATE},
|
||||||
{(char *)" LOAD STATE ", MENU_ACTION_LOAD_STATE},
|
{(char *)" LOAD STATE ", MENU_ACTION_LOAD_STATE},
|
||||||
|
{(char *)" GLOBAL CONFIG ", MENU_ACTION_GLOBAL_CONFIG},
|
||||||
|
{(char *)" LCD SWAP ", MENU_ACTION_LCD_SWAP},
|
||||||
{(char *)" RESET C64 ", MENU_ACTION_RESET_EMU},
|
{(char *)" RESET C64 ", MENU_ACTION_RESET_EMU},
|
||||||
{(char *)" QUIT GIMLIDS", MENU_ACTION_QUIT_EMU},
|
{(char *)" QUIT GIMLIDS", MENU_ACTION_QUIT_EMU},
|
||||||
{(char *)" EXIT MENU ", MENU_ACTION_EXIT},
|
{(char *)" EXIT MENU ", MENU_ACTION_EXIT},
|
||||||
@ -137,6 +148,7 @@ u8 MainMenu(C64 *the_c64)
|
|||||||
u8 bExitMenu = false;
|
u8 bExitMenu = false;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
currentBrightness = 0;
|
||||||
nds_key = keysCurrent();
|
nds_key = keysCurrent();
|
||||||
if (nds_key)
|
if (nds_key)
|
||||||
{
|
{
|
||||||
@ -178,6 +190,7 @@ u8 MainMenu(C64 *the_c64)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ACTION_CONFIG:
|
case MENU_ACTION_CONFIG:
|
||||||
|
option_table = 0;
|
||||||
if (file_crc != 0x00000000)
|
if (file_crc != 0x00000000)
|
||||||
{
|
{
|
||||||
u8 last_trueDrive = myConfig.trueDrive;
|
u8 last_trueDrive = myConfig.trueDrive;
|
||||||
@ -202,6 +215,18 @@ u8 MainMenu(C64 *the_c64)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MENU_ACTION_LCD_SWAP:
|
||||||
|
lcdSwap();
|
||||||
|
WAITVBL;WAITVBL;
|
||||||
|
bExitMenu = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MENU_ACTION_GLOBAL_CONFIG:
|
||||||
|
option_table = 1;
|
||||||
|
GimliDSGameOptions();
|
||||||
|
bExitMenu = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case MENU_ACTION_SAVE_STATE:
|
case MENU_ACTION_SAVE_STATE:
|
||||||
{
|
{
|
||||||
check_and_make_sav_directory();
|
check_and_make_sav_directory();
|
||||||
@ -287,7 +312,9 @@ u8 MainMenu(C64 *the_c64)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
|
// ===================
|
||||||
|
// CONFIGURATION AREA
|
||||||
|
// ===================
|
||||||
|
|
||||||
#define CRC32_POLY 0x04C11DB7
|
#define CRC32_POLY 0x04C11DB7
|
||||||
|
|
||||||
@ -341,13 +368,31 @@ u32 getCRC32(u8 *buf, int size)
|
|||||||
return ~crc;
|
return ~crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern char strBuf[];
|
|
||||||
u32 file_crc = 0x00000000;
|
|
||||||
u8 option_table=0;
|
|
||||||
|
|
||||||
struct Config_t AllConfigs[MAX_CONFIGS];
|
struct Config_t AllConfigs[MAX_CONFIGS];
|
||||||
struct Config_t myConfig __attribute((aligned(4))) __attribute__((section(".dtcm")));
|
struct Config_t myConfig __attribute((aligned(4))) __attribute__((section(".dtcm")));
|
||||||
|
struct GlobalConfig_t myGlobalConfig;
|
||||||
|
|
||||||
|
void SetDefaultGlobalConfig(void)
|
||||||
|
{
|
||||||
|
myGlobalConfig.defaultB = KEY_MAP_SPACE;
|
||||||
|
myGlobalConfig.defaultX = KEY_MAP_JOY_UP;
|
||||||
|
myGlobalConfig.defaultY = KEY_MAP_RETURN;
|
||||||
|
myGlobalConfig.defaultDiskSFX = 1;
|
||||||
|
myGlobalConfig.defaultPoundKey = 0;
|
||||||
|
myGlobalConfig.defaultJoyPort = 1;
|
||||||
|
myGlobalConfig.keyboardDim = 0;
|
||||||
|
myGlobalConfig.reserved0 = 0;
|
||||||
|
myGlobalConfig.reserved1 = 0;
|
||||||
|
myGlobalConfig.reserved2 = 0;
|
||||||
|
myGlobalConfig.reserved3 = 0;
|
||||||
|
myGlobalConfig.reserved4 = 0;
|
||||||
|
myGlobalConfig.reserved5 = 0;
|
||||||
|
myGlobalConfig.reserved6 = 0;
|
||||||
|
myGlobalConfig.reserved7 = 0;
|
||||||
|
myGlobalConfig.reserved8 = 0;
|
||||||
|
myGlobalConfig.reserved9 = 0;
|
||||||
|
myGlobalConfig.reserved10 = 1;
|
||||||
|
}
|
||||||
|
|
||||||
void SetDefaultGameConfig(void)
|
void SetDefaultGameConfig(void)
|
||||||
{
|
{
|
||||||
@ -359,19 +404,20 @@ void SetDefaultGameConfig(void)
|
|||||||
myConfig.key_map[3] = KEY_MAP_JOY_RIGHT;// D-Pad Right
|
myConfig.key_map[3] = KEY_MAP_JOY_RIGHT;// D-Pad Right
|
||||||
|
|
||||||
myConfig.key_map[4] = KEY_MAP_JOY_FIRE; // A = Fire Button
|
myConfig.key_map[4] = KEY_MAP_JOY_FIRE; // A = Fire Button
|
||||||
myConfig.key_map[5] = KEY_MAP_SPACE; // B = SPACE key
|
myConfig.key_map[5] = myGlobalConfig.defaultB; // B = Use Global - def is SPACE key
|
||||||
myConfig.key_map[6] = KEY_MAP_JOY_UP; // X = Joy Up
|
myConfig.key_map[6] = myGlobalConfig.defaultX; // X = Use Global - def is Joy Up
|
||||||
myConfig.key_map[7] = KEY_MAP_RETURN; // Y = RETURN key
|
myConfig.key_map[7] = myGlobalConfig.defaultY; // Y = Use Global - def is RETURN key
|
||||||
|
|
||||||
myConfig.key_map[8] = KEY_MAP_SPACE; // Spare 1
|
myConfig.key_map[8] = KEY_MAP_SPACE; // Spare 1
|
||||||
myConfig.key_map[9] = KEY_MAP_SPACE; // Spare 2
|
myConfig.key_map[9] = KEY_MAP_SPACE; // Spare 2
|
||||||
|
|
||||||
|
myConfig.diskSFX = myGlobalConfig.defaultDiskSFX; // Disk sound effects on
|
||||||
|
myConfig.joyPort = myGlobalConfig.defaultJoyPort; // Default to Joy2 (it's a toss-up but more than half use port 2)
|
||||||
|
myConfig.poundKey = myGlobalConfig.defaultPoundKey; // Default is Pound Key!
|
||||||
|
|
||||||
myConfig.trueDrive = 0; // Fast 1541 emulation by default
|
myConfig.trueDrive = 0; // Fast 1541 emulation by default
|
||||||
myConfig.jitter = 1; // Medium level of jitter
|
myConfig.jitter = 1; // Medium level of jitter
|
||||||
myConfig.diskSFX = 1; // Disk sound effects on
|
|
||||||
myConfig.joyPort = 0; // Default to Joy1 (it's a toss-up but feels more natural)
|
|
||||||
myConfig.joyMode = 0; // Default is normal joypad / dpad
|
myConfig.joyMode = 0; // Default is normal joypad / dpad
|
||||||
myConfig.poundKey = 0; // Default is Pound Key!
|
|
||||||
myConfig.reuType = 0; // No REU by default
|
myConfig.reuType = 0; // No REU by default
|
||||||
myConfig.reserved4 = 0;
|
myConfig.reserved4 = 0;
|
||||||
myConfig.reserved5 = 0;
|
myConfig.reserved5 = 0;
|
||||||
@ -387,8 +433,6 @@ void SetDefaultGameConfig(void)
|
|||||||
myConfig.scaleY = 200; // Scale the 200 pixels of C64 display to the DS 200 (yes, there is only 192 so this will cut... use PAN UP/DN)
|
myConfig.scaleY = 200; // Scale the 200 pixels of C64 display to the DS 200 (yes, there is only 192 so this will cut... use PAN UP/DN)
|
||||||
}
|
}
|
||||||
|
|
||||||
s16 CycleDeltas[] = {0,1,2,3,4,5,6,7,8,9,-9,-8,-7,-6,-5,-4,-3,-2,-1}; // Used with myConfig.cpuCycles and myConfig.badCycles
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Read file twice and ensure we get the same CRC... if not, do it again
|
// Read file twice and ensure we get the same CRC... if not, do it again
|
||||||
// until we get a clean read. Return the filesize to the caller...
|
// until we get a clean read. Return the filesize to the caller...
|
||||||
@ -483,8 +527,9 @@ void SaveConfig(bool bShow)
|
|||||||
if (fp != NULL)
|
if (fp != NULL)
|
||||||
{
|
{
|
||||||
u16 ver = CONFIG_VERSION;
|
u16 ver = CONFIG_VERSION;
|
||||||
fwrite(&ver, sizeof(ver), 1, fp); // Write the config version
|
fwrite(&ver, sizeof(ver), 1, fp); // Write the config version
|
||||||
fwrite(&AllConfigs, sizeof(AllConfigs), 1, fp); // Write the array of all configurations
|
fwrite(&myGlobalConfig, sizeof(myGlobalConfig), 1, fp); // Write the global configuration
|
||||||
|
fwrite(&AllConfigs, sizeof(AllConfigs), 1, fp); // Write the array of all configurations
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
} else DSPrint(4,3,0, (char*)"ERROR SAVING CONFIG FILE");
|
} else DSPrint(4,3,0, (char*)"ERROR SAVING CONFIG FILE");
|
||||||
|
|
||||||
@ -509,10 +554,25 @@ void LoadConfig(void)
|
|||||||
u16 ver = 0x0000;
|
u16 ver = 0x0000;
|
||||||
if (ReadFileCarefully((char *)"/data/GimliDS.DAT", (u8*)&ver, sizeof(ver), 0)) // Read Global Config
|
if (ReadFileCarefully((char *)"/data/GimliDS.DAT", (u8*)&ver, sizeof(ver), 0)) // Read Global Config
|
||||||
{
|
{
|
||||||
ReadFileCarefully((char *)"/data/GimliDS.DAT", (u8*)&AllConfigs, sizeof(AllConfigs), sizeof(ver)); // Read the full game array of configs
|
if (ver == 0x0006) // One time upgrade - add global config and double the size of the AllConfigs[] array
|
||||||
|
{
|
||||||
|
memset(&myGlobalConfig, 0x00, sizeof(myGlobalConfig));
|
||||||
|
SetDefaultGlobalConfig();
|
||||||
|
memset(&AllConfigs, 0x00, sizeof(AllConfigs));
|
||||||
|
ver = CONFIG_VERSION;
|
||||||
|
ReadFileCarefully((char *)"/data/GimliDS.DAT", (u8*)&AllConfigs, sizeof(AllConfigs)/2, sizeof(ver)); // Read the full game array of configs
|
||||||
|
SaveConfig(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ReadFileCarefully((char *)"/data/GimliDS.DAT", (u8*)&myGlobalConfig, sizeof(myGlobalConfig), sizeof(ver)); // Read the global config
|
||||||
|
ReadFileCarefully((char *)"/data/GimliDS.DAT", (u8*)&AllConfigs, sizeof(AllConfigs), sizeof(myGlobalConfig)); // Read the full game array of configs
|
||||||
|
}
|
||||||
|
|
||||||
if (ver != CONFIG_VERSION)
|
if (ver != CONFIG_VERSION)
|
||||||
{
|
{
|
||||||
|
memset(&myGlobalConfig, 0x00, sizeof(myGlobalConfig));
|
||||||
|
SetDefaultGlobalConfig();
|
||||||
memset(&AllConfigs, 0x00, sizeof(AllConfigs));
|
memset(&AllConfigs, 0x00, sizeof(AllConfigs));
|
||||||
SetDefaultGameConfig();
|
SetDefaultGameConfig();
|
||||||
SaveConfig(FALSE);
|
SaveConfig(FALSE);
|
||||||
@ -520,6 +580,8 @@ void LoadConfig(void)
|
|||||||
}
|
}
|
||||||
else // Not found... init the entire database...
|
else // Not found... init the entire database...
|
||||||
{
|
{
|
||||||
|
memset(&myGlobalConfig, 0x00, sizeof(myGlobalConfig));
|
||||||
|
SetDefaultGlobalConfig();
|
||||||
memset(&AllConfigs, 0x00, sizeof(AllConfigs));
|
memset(&AllConfigs, 0x00, sizeof(AllConfigs));
|
||||||
SetDefaultGameConfig();
|
SetDefaultGameConfig();
|
||||||
SaveConfig(FALSE);
|
SaveConfig(FALSE);
|
||||||
@ -574,7 +636,7 @@ struct options_t
|
|||||||
"PAN-UP 16", "PAN-UP 24", "PAN-DOWN 16", "PAN-DOWN 24", "ZOOM TOGGLE"
|
"PAN-UP 16", "PAN-UP 24", "PAN-DOWN 16", "PAN-DOWN 24", "ZOOM TOGGLE"
|
||||||
|
|
||||||
|
|
||||||
const struct options_t Option_Table[1][20] =
|
const struct options_t Option_Table[2][20] =
|
||||||
{
|
{
|
||||||
// Game Specific Configuration
|
// Game Specific Configuration
|
||||||
{
|
{
|
||||||
@ -598,8 +660,21 @@ const struct options_t Option_Table[1][20] =
|
|||||||
{"X BUTTON", {KEY_MAP_OPTIONS}, &myConfig.key_map[6], 65},
|
{"X BUTTON", {KEY_MAP_OPTIONS}, &myConfig.key_map[6], 65},
|
||||||
{"Y BUTTON", {KEY_MAP_OPTIONS}, &myConfig.key_map[7], 65},
|
{"Y BUTTON", {KEY_MAP_OPTIONS}, &myConfig.key_map[7], 65},
|
||||||
|
|
||||||
{NULL, {"", ""}, NULL, 1},
|
{NULL, {"", ""}, NULL, 1}
|
||||||
}
|
},
|
||||||
|
// Global Configuration
|
||||||
|
{
|
||||||
|
{"DEF JOY PORT", {"PORT 1", "PORT 2"}, &myGlobalConfig.defaultJoyPort, 2},
|
||||||
|
{"DEF DSK SFX", {"SFX OFF", "SFX ON"}, &myGlobalConfig.defaultDiskSFX, 2},
|
||||||
|
{"DEF PND KEY", {"POUND", "LEFT ARROW", "UP ARROW", "C= COMMODORE"}, &myGlobalConfig.defaultPoundKey, 4},
|
||||||
|
{"KEYBD BRIGHT", {"MAX BRIGHT", "DIM", "DIMMER", "DIMMEST"}, &myGlobalConfig.keyboardDim, 4},
|
||||||
|
|
||||||
|
{"DEF KEY B", {KEY_MAP_OPTIONS}, &myGlobalConfig.defaultB, 65},
|
||||||
|
{"DEF KEY X", {KEY_MAP_OPTIONS}, &myGlobalConfig.defaultX, 65},
|
||||||
|
{"DEF KEY Y", {KEY_MAP_OPTIONS}, &myGlobalConfig.defaultY, 65},
|
||||||
|
|
||||||
|
{NULL, {"", ""}, NULL, 1}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -643,16 +718,16 @@ void GimliDSGameOptions(void)
|
|||||||
int keys_pressed;
|
int keys_pressed;
|
||||||
int last_keys_pressed = 999;
|
int last_keys_pressed = 999;
|
||||||
|
|
||||||
option_table = 0;
|
|
||||||
|
|
||||||
idx=display_options_list(true);
|
idx=display_options_list(true);
|
||||||
optionHighlighted = 0;
|
optionHighlighted = 0;
|
||||||
while (keysCurrent() != 0)
|
while (keysCurrent() != 0)
|
||||||
{
|
{
|
||||||
|
currentBrightness = 0;
|
||||||
WAITVBL;
|
WAITVBL;
|
||||||
}
|
}
|
||||||
while (!bDone)
|
while (!bDone)
|
||||||
{
|
{
|
||||||
|
currentBrightness = 0;
|
||||||
keys_pressed = keysCurrent();
|
keys_pressed = keysCurrent();
|
||||||
if (keys_pressed != last_keys_pressed)
|
if (keys_pressed != last_keys_pressed)
|
||||||
{
|
{
|
||||||
@ -701,7 +776,7 @@ void GimliDSGameOptions(void)
|
|||||||
}
|
}
|
||||||
swiWaitForVBlank();
|
swiWaitForVBlank();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Give a third of a second time delay...
|
// Give a third of a second time delay...
|
||||||
for (int i=0; i<20; i++)
|
for (int i=0; i<20; i++)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#define MAX_CONFIGS 960
|
#define MAX_CONFIGS 1920
|
||||||
#define CONFIG_VERSION 0x0006
|
#define CONFIG_VERSION 0x0007
|
||||||
|
|
||||||
extern s16 CycleDeltas[];
|
extern s16 CycleDeltas[];
|
||||||
|
|
||||||
@ -28,7 +28,30 @@ struct __attribute__((__packed__)) Config_t
|
|||||||
s16 scaleY;
|
s16 scaleY;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct Config_t myConfig;
|
struct __attribute__((__packed__)) GlobalConfig_t
|
||||||
|
{
|
||||||
|
u8 defaultX;
|
||||||
|
u8 defaultY;
|
||||||
|
u8 defaultB;
|
||||||
|
u8 defaultDiskSFX;
|
||||||
|
u8 defaultJoyPort;
|
||||||
|
u8 defaultPoundKey;
|
||||||
|
u8 keyboardDim;
|
||||||
|
u8 reserved0;
|
||||||
|
u8 reserved1;
|
||||||
|
u8 reserved2;
|
||||||
|
u8 reserved3;
|
||||||
|
u8 reserved4;
|
||||||
|
u8 reserved5;
|
||||||
|
u8 reserved6;
|
||||||
|
u8 reserved7;
|
||||||
|
u8 reserved8;
|
||||||
|
u8 reserved9;
|
||||||
|
u8 reserved10;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct Config_t myConfig;
|
||||||
|
extern struct GlobalConfig_t myGlobalConfig;
|
||||||
|
|
||||||
#define KEY_MAP_JOY_FIRE 0
|
#define KEY_MAP_JOY_FIRE 0
|
||||||
#define KEY_MAP_JOY_UP 1
|
#define KEY_MAP_JOY_UP 1
|
||||||
|
Loading…
Reference in New Issue
Block a user