core:
- initialize fake firmware user settings on NDS reset when not using external firmware; winport: - using global structure for fake firmware user settings;
This commit is contained in:
parent
abd0aef26f
commit
0bdfe338b7
|
@ -2523,6 +2523,9 @@ void NDS_Reset()
|
|||
{
|
||||
//fake firmware boot-up process
|
||||
|
||||
// Create the dummy firmware
|
||||
NDS_CreateDummyFirmware(&CommonSettings.fw_config);
|
||||
|
||||
//copy the arm9 program to the address specified by rom header
|
||||
u32 src = header->ARM9src;
|
||||
u32 dst = header->ARM9cpy;
|
||||
|
|
|
@ -522,7 +522,7 @@ extern struct TCommonSettings {
|
|||
strcpy(ARM9BIOS, "biosnds9.bin");
|
||||
strcpy(ARM7BIOS, "biosnds7.bin");
|
||||
strcpy(Firmware, "firmware.bin");
|
||||
NDS_FillDefaultFirmwareConfigData(&InternalFirmConf);
|
||||
NDS_FillDefaultFirmwareConfigData(&fw_config);
|
||||
|
||||
/* WIFI mode: adhoc = 0, infrastructure = 1 */
|
||||
wifi.mode = 1;
|
||||
|
@ -559,7 +559,7 @@ extern struct TCommonSettings {
|
|||
bool UseExtFirmware;
|
||||
char Firmware[256];
|
||||
bool BootFromFirmware;
|
||||
struct NDS_fw_config_data InternalFirmConf;
|
||||
NDS_fw_config_data fw_config;
|
||||
|
||||
NDS_CONSOLE_TYPE ConsoleType;
|
||||
bool DebugConsole;
|
||||
|
|
|
@ -375,14 +375,13 @@ bool CFIRMWARE::load()
|
|||
}
|
||||
|
||||
memcpy(&header, data, sizeof(header));
|
||||
if ((header.fw_identifier[0] != 'M') ||
|
||||
(header.fw_identifier[1] != 'A') ||
|
||||
(header.fw_identifier[2] != 'C'))
|
||||
{
|
||||
delete [] data;
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
if ((header.fw_identifier & 0x00FFFFFF) != 0x0043414D)
|
||||
{
|
||||
delete [] data;
|
||||
data = NULL;
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
|
||||
shift1 = ((header.shift_amounts >> 0) & 0x07);
|
||||
shift2 = ((header.shift_amounts >> 3) & 0x07);
|
||||
|
@ -401,7 +400,7 @@ bool CFIRMWARE::load()
|
|||
ARM9bootAddr = part1ram;
|
||||
ARM7bootAddr = part2ram;
|
||||
|
||||
if(initKeycode(T1ReadLong(data, 0x08), 1, 0xC) == FALSE)
|
||||
if(initKeycode(header.fw_identifier, 1, 0xC) == FALSE)
|
||||
{
|
||||
delete [] data;
|
||||
fclose(fp);
|
||||
|
@ -423,7 +422,7 @@ bool CFIRMWARE::load()
|
|||
data[0x1F] = 0x00;
|
||||
#endif
|
||||
|
||||
if(initKeycode(T1ReadLong(data, 0x08), 2, 0xC) == FALSE)
|
||||
if(initKeycode(header.fw_identifier, 2, 0xC) == FALSE)
|
||||
{
|
||||
delete [] data;
|
||||
fclose(fp);
|
||||
|
@ -872,8 +871,8 @@ int NDS_CreateDummyFirmware( struct NDS_fw_config_data *user_settings)
|
|||
//Wifi settings CRC16
|
||||
(*(u16*)(MMU.fw.data + 0x2A)) = calc_CRC16(0, (MMU.fw.data + 0x2C), 0x138);
|
||||
|
||||
if (&CommonSettings.InternalFirmConf != user_settings)
|
||||
memcpy(&CommonSettings.InternalFirmConf, user_settings, sizeof(struct NDS_fw_config_data));
|
||||
if (&CommonSettings.fw_config != user_settings)
|
||||
memcpy(&CommonSettings.fw_config, user_settings, sizeof(struct NDS_fw_config_data));
|
||||
|
||||
return TRUE ;
|
||||
}
|
||||
|
|
|
@ -50,13 +50,18 @@ public:
|
|||
|
||||
static std::string GetExternalFilePath();
|
||||
|
||||
u32 getID()
|
||||
{
|
||||
return header.fw_identifier;
|
||||
}
|
||||
|
||||
struct HEADER
|
||||
{
|
||||
u16 part3_rom_gui9_addr; // 000h
|
||||
u16 part4_rom_wifi7_addr; // 002h
|
||||
u16 part34_gui_wifi_crc16; // 004h
|
||||
u16 part12_boot_crc16; // 006h
|
||||
u8 fw_identifier[4]; // 008h
|
||||
u32 fw_identifier; // 008h
|
||||
u16 part1_rom_boot9_addr; // 00Ch
|
||||
u16 part1_ram_boot9_addr; // 00Eh
|
||||
u16 part2_rom_boot7_addr; // 010h
|
||||
|
|
|
@ -321,20 +321,20 @@ int MovieData::dump(EMUFILE* fp, bool binary)
|
|||
* This would cause strange behaviour if the user could set UTF-16 but
|
||||
* they cannot yet.
|
||||
*/
|
||||
for (i = 0; i < CommonSettings.InternalFirmConf.nickname_len; i++) {
|
||||
temp_str[i] = CommonSettings.InternalFirmConf.nickname[i];
|
||||
for (i = 0; i < CommonSettings.fw_config.nickname_len; i++) {
|
||||
temp_str[i] = CommonSettings.fw_config.nickname[i];
|
||||
}
|
||||
temp_str[i] = '\0';
|
||||
fp->fprintf("firmNickname %s\n", temp_str);
|
||||
for (i = 0; i < CommonSettings.InternalFirmConf.message_len; i++) {
|
||||
temp_str[i] = CommonSettings.InternalFirmConf.message[i];
|
||||
for (i = 0; i < CommonSettings.fw_config.message_len; i++) {
|
||||
temp_str[i] = CommonSettings.fw_config.message[i];
|
||||
}
|
||||
temp_str[i] = '\0';
|
||||
fp->fprintf("firmMessage %s\n", temp_str);
|
||||
fp->fprintf("firmFavColour %d\n", CommonSettings.InternalFirmConf.fav_colour);
|
||||
fp->fprintf("firmBirthMonth %d\n", CommonSettings.InternalFirmConf.birth_month);
|
||||
fp->fprintf("firmBirthDay %d\n", CommonSettings.InternalFirmConf.birth_day);
|
||||
fp->fprintf("firmLanguage %d\n", CommonSettings.InternalFirmConf.language);
|
||||
fp->fprintf("firmFavColour %d\n", CommonSettings.fw_config.fav_colour);
|
||||
fp->fprintf("firmBirthMonth %d\n", CommonSettings.fw_config.birth_month);
|
||||
fp->fprintf("firmBirthDay %d\n", CommonSettings.fw_config.birth_day);
|
||||
fp->fprintf("firmLanguage %d\n", CommonSettings.fw_config.language);
|
||||
}
|
||||
|
||||
fp->fprintf("rtcStartNew %s\n", rtcStart.ToString().c_str());
|
||||
|
@ -577,7 +577,7 @@ const char* _CDECL_ FCEUI_LoadMovie(const char *fname, bool _read_only, bool tas
|
|||
// reset firmware (some games can write to it)
|
||||
if (CommonSettings.UseExtFirmware == false)
|
||||
{
|
||||
NDS_CreateDummyFirmware(&CommonSettings.InternalFirmConf);
|
||||
NDS_CreateDummyFirmware(&CommonSettings.fw_config);
|
||||
}
|
||||
|
||||
NDS_Reset();
|
||||
|
@ -692,7 +692,7 @@ void FCEUI_SaveMovie(const char *fname, std::wstring author, int flag, std::stri
|
|||
// reset firmware (some games can write to it)
|
||||
if (CommonSettings.UseExtFirmware == false)
|
||||
{
|
||||
NDS_CreateDummyFirmware(&CommonSettings.InternalFirmConf);
|
||||
NDS_CreateDummyFirmware(&CommonSettings.fw_config);
|
||||
}
|
||||
|
||||
NDS_Reset();
|
||||
|
|
|
@ -74,7 +74,7 @@ static void WriteFirmConfig( struct NDS_fw_config_data *fw_config)
|
|||
|
||||
BOOL CALLBACK FirmConfig_Proc(HWND dialog,UINT komunikat,WPARAM wparam,LPARAM lparam)
|
||||
{
|
||||
struct NDS_fw_config_data *fw_config = &win_fw_config;
|
||||
struct NDS_fw_config_data *fw_config = &CommonSettings.fw_config;
|
||||
int i;
|
||||
char temp_str[27];
|
||||
|
||||
|
@ -147,7 +147,8 @@ BOOL CALLBACK FirmConfig_Proc(HWND dialog,UINT komunikat,WPARAM wparam,LPARAM lp
|
|||
|
||||
WriteFirmConfig( fw_config);
|
||||
EndDialog(dialog,0);
|
||||
NDS_CreateDummyFirmware( fw_config);
|
||||
if (CommonSettings.UseExtFirmware == 0)
|
||||
NDS_CreateDummyFirmware( fw_config);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
|
||||
#ifndef FIRMCONFIG_H
|
||||
#define FIRMCONFIG_H
|
||||
|
||||
extern struct NDS_fw_config_data win_fw_config;
|
||||
#include <windows.h>
|
||||
|
||||
BOOL CALLBACK FirmConfig_Proc(HWND dialog,UINT komunikat,WPARAM wparam,LPARAM lparam);
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ LRESULT GInfo_Paint(HWND hDlg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
const RomBanner& banner = gameInfo.getRomBanner();
|
||||
|
||||
sprintf(text, "%ws", banner.titles[win_fw_config.language]);
|
||||
sprintf(text, "%ws", banner.titles[CommonSettings.fw_config.language]); // TODO: langID from real/fake fw
|
||||
SetWindowText(GetDlgItem(hDlg, IDC_GI_TITLE), text);
|
||||
|
||||
sprintf(text, "%ws", banner.titles[0]);
|
||||
|
|
|
@ -544,9 +544,6 @@ bool staterewindingenabled = false;
|
|||
|
||||
unsigned short windowSize = 0;
|
||||
|
||||
/* the firmware settings */
|
||||
struct NDS_fw_config_data win_fw_config;
|
||||
|
||||
/*const u32 gapColors[16] = {
|
||||
Color::Gray,
|
||||
Color::Brown,
|
||||
|
@ -3131,9 +3128,6 @@ int _main()
|
|||
|
||||
gpu_SetRotateScreen(video.rotation);
|
||||
|
||||
//default the firmware settings, they may get changed later
|
||||
NDS_FillDefaultFirmwareConfigData( &win_fw_config);
|
||||
|
||||
//GetPrivateProfileString("General", "Language", "0", text, 80, IniName);
|
||||
//SetLanguage(atoi(text));
|
||||
//zero 09-feb-2013 - all the translations are out of date. this is dumb. lets just take out the translations. you cant expect translations in a project with our staff size using our tech
|
||||
|
@ -3387,11 +3381,13 @@ int _main()
|
|||
video.setfilter(GetPrivateProfileInt("Video", "Filter", video.NONE, IniName));
|
||||
FilterUpdate(MainWindow->getHWnd(),false);
|
||||
|
||||
/* Read the firmware settings from the init file */
|
||||
win_fw_config.fav_colour = GetPrivateProfileInt("Firmware","favColor", 10, IniName);
|
||||
win_fw_config.birth_month = GetPrivateProfileInt("Firmware","bMonth", 7, IniName);
|
||||
win_fw_config.birth_day = GetPrivateProfileInt("Firmware","bDay", 15, IniName);
|
||||
win_fw_config.language = GetPrivateProfileInt("Firmware","Language", 1, IniName);
|
||||
//default the firmware settings, they may get changed later
|
||||
NDS_FillDefaultFirmwareConfigData(&CommonSettings.fw_config);
|
||||
// Read the firmware settings from the init file
|
||||
CommonSettings.fw_config.fav_colour = GetPrivateProfileInt("Firmware","favColor", 10, IniName);
|
||||
CommonSettings.fw_config.birth_month = GetPrivateProfileInt("Firmware","bMonth", 7, IniName);
|
||||
CommonSettings.fw_config.birth_day = GetPrivateProfileInt("Firmware","bDay", 15, IniName);
|
||||
CommonSettings.fw_config.language = GetPrivateProfileInt("Firmware","Language", 1, IniName);
|
||||
|
||||
{
|
||||
/*
|
||||
|
@ -3401,28 +3397,24 @@ int _main()
|
|||
char temp_str[27];
|
||||
int char_index;
|
||||
GetPrivateProfileString("Firmware","nickName", "yopyop", temp_str, 11, IniName);
|
||||
win_fw_config.nickname_len = strlen( temp_str);
|
||||
CommonSettings.fw_config.nickname_len = strlen( temp_str);
|
||||
|
||||
if ( win_fw_config.nickname_len == 0) {
|
||||
if (CommonSettings.fw_config.nickname_len == 0) {
|
||||
strcpy( temp_str, "yopyop");
|
||||
win_fw_config.nickname_len = strlen( temp_str);
|
||||
CommonSettings.fw_config.nickname_len = strlen( temp_str);
|
||||
}
|
||||
|
||||
for ( char_index = 0; char_index < win_fw_config.nickname_len; char_index++) {
|
||||
win_fw_config.nickname[char_index] = temp_str[char_index];
|
||||
for ( char_index = 0; char_index < CommonSettings.fw_config.nickname_len; char_index++) {
|
||||
CommonSettings.fw_config.nickname[char_index] = temp_str[char_index];
|
||||
}
|
||||
|
||||
GetPrivateProfileString("Firmware","Message", "DeSmuME makes you happy!", temp_str, 27, IniName);
|
||||
win_fw_config.message_len = strlen( temp_str);
|
||||
for ( char_index = 0; char_index < win_fw_config.message_len; char_index++) {
|
||||
win_fw_config.message[char_index] = temp_str[char_index];
|
||||
CommonSettings.fw_config.message_len = strlen( temp_str);
|
||||
for ( char_index = 0; char_index < CommonSettings.fw_config.message_len; char_index++) {
|
||||
CommonSettings.fw_config.message[char_index] = temp_str[char_index];
|
||||
}
|
||||
}
|
||||
|
||||
// Create the dummy firmware
|
||||
NDS_CreateDummyFirmware( &win_fw_config);
|
||||
|
||||
|
||||
if (cmdline.nds_file != "")
|
||||
{
|
||||
if(OpenCore(cmdline.nds_file.c_str()))
|
||||
|
|
|
@ -633,10 +633,12 @@ INT_PTR CALLBACK MemView_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
|
|||
|
||||
case IDC_BIG_ENDIAN:
|
||||
wnd->Refresh();
|
||||
wnd->SetFocus();
|
||||
return 1;
|
||||
|
||||
case IDC_FULL_CHARS:
|
||||
wnd->Refresh();
|
||||
wnd->SetFocus();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue