Firmware: Replace the old NDS_fw_config_data struct with the new FirmwareConfig struct, which allows for easy modification of all the user-related settings, including all the WiFi settings. Also do a massive refactor and cleanup of the firmware-related code.
- Also exposes all of the WiFi-related firmware settings in the Cocoa port UI.
This commit is contained in:
parent
da3970d817
commit
bb38022873
|
@ -127,7 +127,7 @@ int NDS_GetCPUCoreCount()
|
|||
|
||||
void NDS_SetupDefaultFirmware()
|
||||
{
|
||||
NDS_FillDefaultFirmwareConfigData(&CommonSettings.fw_config);
|
||||
NDS_GetDefaultFirmwareConfig(CommonSettings.fwConfig);
|
||||
}
|
||||
|
||||
void NDS_RunAdvansceneAutoImport()
|
||||
|
@ -2161,7 +2161,7 @@ static void PrepareBiosARM7()
|
|||
NDS_ARM7.BIOS_loaded = false;
|
||||
memset(MMU.ARM7_BIOS, 0, sizeof(MMU.ARM7_BIOS));
|
||||
|
||||
if(CommonSettings.UseExtBIOS == true)
|
||||
if(CommonSettings.UseExtBIOS)
|
||||
{
|
||||
//read arm7 bios from inputfile and flag it if it succeeds
|
||||
FILE *arm7inf = fopen(CommonSettings.ARM7BIOS,"rb");
|
||||
|
@ -2219,7 +2219,7 @@ static void PrepareBiosARM9()
|
|||
memset(MMU.ARM9_BIOS, 0, sizeof(MMU.ARM9_BIOS));
|
||||
NDS_ARM9.BIOS_loaded = false;
|
||||
|
||||
if(CommonSettings.UseExtBIOS == true)
|
||||
if(CommonSettings.UseExtBIOS)
|
||||
{
|
||||
//read arm9 bios from inputfile and flag it if it succeeds
|
||||
FILE* arm9inf = fopen(CommonSettings.ARM9BIOS,"rb");
|
||||
|
@ -2434,7 +2434,7 @@ bool NDS_FakeBoot()
|
|||
// Create the dummy firmware
|
||||
//EDIT - whats dummy firmware and how is relating to the above?
|
||||
//it seems to be emplacing basic firmware data into MMU.fw.data
|
||||
NDS_CreateDummyFirmware(&CommonSettings.fw_config);
|
||||
NDS_InitFirmwareWithConfig(CommonSettings.fwConfig);
|
||||
|
||||
//firmware loads the game card arm9 and arm7 programs as specified in rom header
|
||||
{
|
||||
|
@ -2473,7 +2473,7 @@ bool NDS_FakeBoot()
|
|||
//TBD - this code is really clunky
|
||||
//it seems to be copying the MMU.fw.data data into RAM in the user memory stash locations
|
||||
u8 temp_buffer[NDS_FW_USER_SETTINGS_MEM_BYTE_COUNT];
|
||||
if ( copy_firmware_user_data( temp_buffer, MMU.fw.data)) {
|
||||
if ( copy_firmware_user_data( temp_buffer, MMU.fw.data._raw)) {
|
||||
for ( int fw_index = 0; fw_index < NDS_FW_USER_SETTINGS_MEM_BYTE_COUNT; fw_index++)
|
||||
_MMU_write08<ARMCPU_ARM9>(0x027FFC80 + fw_index, temp_buffer[fw_index]);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "types.h"
|
||||
#include "ROMReader.h"
|
||||
#include "firmware.h"
|
||||
#include "wifi.h"
|
||||
|
||||
class CFIRMWARE;
|
||||
|
@ -213,7 +214,7 @@ enum NDS_CONSOLE_TYPE
|
|||
NDS_CONSOLE_TYPE_FAT = 0xFF,
|
||||
NDS_CONSOLE_TYPE_LITE = 0x20,
|
||||
NDS_CONSOLE_TYPE_IQUE = 0x43,
|
||||
NDS_CONSOLE_TYPE_IQUE_LIE = 0x63,
|
||||
NDS_CONSOLE_TYPE_IQUE_LITE = 0x63,
|
||||
NDS_CONSOLE_TYPE_DSI = 0xFE
|
||||
};
|
||||
|
||||
|
@ -291,39 +292,6 @@ struct NDSSystem
|
|||
bool isIn3dVblank() const { return VCount >= 192 && VCount<215; }
|
||||
};
|
||||
|
||||
/** /brief A touchscreen calibration point.
|
||||
*/
|
||||
struct NDS_fw_touchscreen_cal {
|
||||
u16 adc_x;
|
||||
u16 adc_y;
|
||||
|
||||
u8 screen_x;
|
||||
u8 screen_y;
|
||||
};
|
||||
|
||||
#define MAX_FW_NICKNAME_LENGTH 10
|
||||
#define MAX_FW_MESSAGE_LENGTH 26
|
||||
|
||||
struct NDS_fw_config_data
|
||||
{
|
||||
NDS_CONSOLE_TYPE ds_type;
|
||||
|
||||
u8 fav_colour;
|
||||
u8 birth_month;
|
||||
u8 birth_day;
|
||||
|
||||
u16 nickname[MAX_FW_NICKNAME_LENGTH];
|
||||
u8 nickname_len;
|
||||
|
||||
u16 message[MAX_FW_MESSAGE_LENGTH];
|
||||
u8 message_len;
|
||||
|
||||
u8 language;
|
||||
|
||||
//touchscreen calibration
|
||||
NDS_fw_touchscreen_cal touch_cal[2];
|
||||
};
|
||||
|
||||
extern NDSSystem nds;
|
||||
|
||||
int NDS_Init();
|
||||
|
@ -608,7 +576,7 @@ extern struct TCommonSettings
|
|||
bool UseExtFirmwareSettings;
|
||||
char Firmware[256];
|
||||
bool BootFromFirmware;
|
||||
NDS_fw_config_data fw_config;
|
||||
FirmwareConfig fwConfig;
|
||||
|
||||
NDS_CONSOLE_TYPE ConsoleType;
|
||||
bool DebugConsole;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2009-2015 DeSmuME Team
|
||||
Copyright (C) 2009-2018 DeSmuME Team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,24 +30,387 @@
|
|||
//extension of the firmware user settings file
|
||||
#define FW_CONFIG_FILE_EXT "dfc"
|
||||
|
||||
struct NDS_fw_config_data;
|
||||
#define MAX_FW_NICKNAME_LENGTH 10
|
||||
#define MAX_FW_MESSAGE_LENGTH 26
|
||||
|
||||
struct FirmwareConfig
|
||||
{
|
||||
u8 consoleType;
|
||||
|
||||
u8 favoriteColor;
|
||||
u8 birthdayMonth;
|
||||
u8 birthdayDay;
|
||||
|
||||
// Add one character to these string buffers just in case clients
|
||||
// try to terminate a max length string with a null character.
|
||||
u16 nickname[MAX_FW_NICKNAME_LENGTH+1];
|
||||
u8 nicknameLength;
|
||||
u16 message[MAX_FW_MESSAGE_LENGTH+1];
|
||||
u8 messageLength;
|
||||
|
||||
u8 language;
|
||||
u8 backlightLevel;
|
||||
|
||||
u16 tscADC_x1;
|
||||
u16 tscADC_y1;
|
||||
u8 tscPixel_x1;
|
||||
u8 tscPixel_y1;
|
||||
u16 tscADC_x2;
|
||||
u16 tscADC_y2;
|
||||
u8 tscPixel_x2;
|
||||
u8 tscPixel_y2;
|
||||
|
||||
u8 MACAddress[6];
|
||||
|
||||
u8 ipv4Address_AP1[4];
|
||||
u8 ipv4Gateway_AP1[4];
|
||||
u8 ipv4PrimaryDNS_AP1[4];
|
||||
u8 ipv4SecondaryDNS_AP1[4];
|
||||
u8 subnetMask_AP1;
|
||||
|
||||
u8 ipv4Address_AP2[4];
|
||||
u8 ipv4Gateway_AP2[4];
|
||||
u8 ipv4PrimaryDNS_AP2[4];
|
||||
u8 ipv4SecondaryDNS_AP2[4];
|
||||
u8 subnetMask_AP2;
|
||||
|
||||
u8 ipv4Address_AP3[4];
|
||||
u8 ipv4Gateway_AP3[4];
|
||||
u8 ipv4PrimaryDNS_AP3[4];
|
||||
u8 ipv4SecondaryDNS_AP3[4];
|
||||
u8 subnetMask_AP3;
|
||||
};
|
||||
typedef FirmwareConfig FirmwareConfig;
|
||||
|
||||
#include "PACKED.h"
|
||||
typedef union __PACKED
|
||||
{
|
||||
u64 encryption;
|
||||
|
||||
struct
|
||||
{
|
||||
u64 timestamp:40;
|
||||
u64 consoleType:8;
|
||||
u64 unused:16;
|
||||
};
|
||||
} FW_HEADER_KEY;
|
||||
|
||||
typedef union __PACKED
|
||||
{
|
||||
u16 value;
|
||||
|
||||
struct
|
||||
{
|
||||
u16 language:3;
|
||||
u16 gbaModeScreenSelection:1;
|
||||
u16 backlightLevel:2;
|
||||
u16 bootmenuDisable:1;
|
||||
u16 :1;
|
||||
|
||||
u16 :1;
|
||||
u16 settingsLost:1;
|
||||
u16 settingsOkay1:1;
|
||||
u16 :1;
|
||||
u16 settingsOkay2:1;
|
||||
u16 settingsOkay3:1;
|
||||
u16 settingsOkay4:1;
|
||||
u16 settingsOkay5:1;
|
||||
};
|
||||
} FW_USERSETTINGS_LANGUAGE_FLAGS;
|
||||
|
||||
typedef struct __PACKED
|
||||
{
|
||||
u16 part3_rom_gui9_addr; // 0x0000
|
||||
u16 part4_rom_wifi7_addr; // 0x0002
|
||||
u16 part34_gui_wifi_crc16; // 0x0004
|
||||
u16 part12_boot_crc16; // 0x0006
|
||||
|
||||
union
|
||||
{
|
||||
u32 identifierValue; // 0x0008
|
||||
u8 identifier[4]; // 0x0008
|
||||
};
|
||||
|
||||
u16 part1_rom_boot9_addr; // 0x000C
|
||||
u16 part1_ram_boot9_addr; // 0x000E
|
||||
u16 part2_rom_boot7_addr; // 0x0010
|
||||
u16 part2_ram_boot7_addr; // 0x0012
|
||||
u16 shift; // 0x0014
|
||||
u16 part5_data_gfx_addr; // 0x0016
|
||||
|
||||
FW_HEADER_KEY key; // 0x0018
|
||||
|
||||
u16 userSettingsOffset; // 0x0020
|
||||
u16 UNKNOWN1; // 0x0022
|
||||
u16 UNKNOWN2; // 0x0024
|
||||
u16 part5_crc16; // 0x0026
|
||||
u16 unused2; // 0x0028
|
||||
} FWHeader;
|
||||
|
||||
typedef struct __PACKED
|
||||
{
|
||||
u16 crc16; // 0x002A
|
||||
u16 length; // 0x002C
|
||||
u8 unused1; // 0x002E
|
||||
u8 version; // 0x002F
|
||||
u8 unused2[6]; // 0x0030
|
||||
u8 MACAddr[6]; // 0x0036
|
||||
u16 channels; // 0x003C
|
||||
u16 flags; // 0x003E
|
||||
u8 rfType; // 0x0040
|
||||
u8 rfBits; // 0x0041
|
||||
u8 rfEntries; // 0x0042
|
||||
u8 UNKNOWN1; // 0x0043
|
||||
|
||||
u16 wifiConfig146; // 0x0044
|
||||
u16 wifiConfig148; // 0x0046
|
||||
u16 wifiConfig14A; // 0x0048
|
||||
u16 wifiConfig14C; // 0x004A
|
||||
u16 wifiConfig120; // 0x004C
|
||||
u16 wifiConfig122; // 0x004E
|
||||
u16 wifiConfig154; // 0x0050
|
||||
u16 wifiConfig144; // 0x0052
|
||||
u16 wifiConfig130; // 0x0054
|
||||
u16 wifiConfig132; // 0x0056
|
||||
u16 wifiConfig140; // 0x0058
|
||||
u16 wifiConfig142; // 0x005A
|
||||
u16 wifiConfigPowerTX; // 0x005C
|
||||
u16 wifiConfig124; // 0x005E
|
||||
u16 wifiConfig128; // 0x0060
|
||||
u16 wifiConfig150; // 0x0062
|
||||
|
||||
u8 bbData[105]; // 0x0064
|
||||
u8 unused3; // 0x00CD
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u8 rfValue[36]; // 0x00CE
|
||||
u8 rfChannelValue24[84]; // 0x00F2
|
||||
u8 bbChannelValue8[14]; // 0x0146
|
||||
u8 rfChannelValue8[14]; // 0x0154
|
||||
} Type2;
|
||||
|
||||
struct
|
||||
{
|
||||
u8 type3Data[148]; // 0x00CE
|
||||
} Type3;
|
||||
};
|
||||
|
||||
u8 UNKNOWN2; // 0x0162
|
||||
u8 unused4; // 0x0163
|
||||
u8 unused5[156]; // 0x0164
|
||||
} FWWifiInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 UNKNOWN1[64];
|
||||
u8 SSID[32];
|
||||
u8 SSID_WEP[32];
|
||||
u8 wepKey1[16];
|
||||
u8 wepKey2[16];
|
||||
u8 wepKey3[16];
|
||||
u8 wepKey4[16];
|
||||
u8 ipv4Address[4];
|
||||
u8 ipv4Gateway[4];
|
||||
u8 ipv4PrimaryDNS[4];
|
||||
u8 ipv4SecondaryDNS[4];
|
||||
u8 subnetMask;
|
||||
u8 wepKeyAOSS[20];
|
||||
u8 UNKNOWN2;
|
||||
u8 wepMode;
|
||||
u8 configureMode;
|
||||
u8 zero;
|
||||
u8 UNKNOWN3;
|
||||
u16 mtuSize;
|
||||
u8 UNKNOWN4[3];
|
||||
u8 connectStatus;
|
||||
u8 wfcUserID[6];
|
||||
u8 UNKNOWN5[8];
|
||||
u16 crc16;
|
||||
} FWAccessPointSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 proxyAuthenticationUsername[32];
|
||||
u8 proxyAuthenticationPassword[32];
|
||||
u8 SSID[32];
|
||||
u8 SSID_WEP[32];
|
||||
u8 wepKey1[16];
|
||||
u8 wepKey2[16];
|
||||
u8 wepKey3[16];
|
||||
u8 wepKey4[16];
|
||||
u8 ipv4Address[4];
|
||||
u8 ipv4Gateway[4];
|
||||
u8 ipv4PrimaryDNS[4];
|
||||
u8 ipv4SecondaryDNS[4];
|
||||
u8 subnetMask;
|
||||
u8 wepKeyAOSS[20];
|
||||
u8 UNKNOWN2;
|
||||
u8 wepMode;
|
||||
u8 configureMode;
|
||||
u8 ssidLength;
|
||||
u8 UNKNOWN3;
|
||||
u16 mtuSize;
|
||||
u8 UNKNOWN4[3];
|
||||
u8 connectStatus;
|
||||
u8 unused1[14];
|
||||
u16 crc16_1;
|
||||
u8 UNKNOWN5[32];
|
||||
u8 wpaKey[16];
|
||||
u8 unused2[82];
|
||||
u8 securityMode;
|
||||
u8 proxyEnable;
|
||||
u8 proxyAuthentication;
|
||||
u8 proxyName[32];
|
||||
u8 unused3[65];
|
||||
u16 proxyPort;
|
||||
u8 unused4[21];
|
||||
u16 crc16_2;
|
||||
} FWExtAccessPointSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u16 version;
|
||||
u8 favoriteColor;
|
||||
u8 birthdayMonth;
|
||||
u8 birthdayDay;
|
||||
u8 unused1;
|
||||
u16 nickname[10];
|
||||
u16 nicknameLength;
|
||||
u16 message[26];
|
||||
u16 messageLength;
|
||||
u8 alarmHour;
|
||||
u8 alarmMinute;
|
||||
u16 unused2;
|
||||
u8 alarmEnable;
|
||||
u8 unused3;
|
||||
u16 tscADC_x1;
|
||||
u16 tscADC_y1;
|
||||
u8 tscPixel_x1;
|
||||
u8 tscPixel_y1;
|
||||
u16 tscADC_x2;
|
||||
u16 tscADC_y2;
|
||||
u8 tscPixel_x2;
|
||||
u8 tscPixel_y2;
|
||||
FW_USERSETTINGS_LANGUAGE_FLAGS languageFlags;
|
||||
u8 year;
|
||||
u8 UNKNOWN1;
|
||||
u32 rtcOffset;
|
||||
u32 unused4;
|
||||
|
||||
u16 updateCounter;
|
||||
u16 crc16;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u8 unused5[140];
|
||||
} nds;
|
||||
|
||||
struct
|
||||
{
|
||||
u8 UNKNOWN2;
|
||||
u8 extendedLanguage;
|
||||
u16 supportedLanguage;
|
||||
u8 unused6[134];
|
||||
u16 crc16Extended;
|
||||
} dsi;
|
||||
};
|
||||
|
||||
} FWUserSettings;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
union
|
||||
{
|
||||
u64 identifierValue;
|
||||
u8 identifier[8];
|
||||
};
|
||||
|
||||
u16 crc16Value;
|
||||
u16 crc16Length;
|
||||
u8 version;
|
||||
u8 updateCount;
|
||||
u8 bootMenuFlags;
|
||||
u8 gbaBorder;
|
||||
u16 tempCalibrationTP0;
|
||||
u16 tempCalibrationTP1;
|
||||
u16 tempCalibrationDegrees;
|
||||
u8 tempFlags;
|
||||
u8 backlightIntensity;
|
||||
u32 dateCenturyOffset;
|
||||
u8 dateMonthRecoveryValue;
|
||||
u8 dateDayRecoveryValue;
|
||||
u8 dateYearRecoveryValue;
|
||||
u8 dateTimeFlags;
|
||||
u8 dateSeparator;
|
||||
u8 timeSeparator;
|
||||
u8 decimalSeparator;
|
||||
u8 thousandsSeparator;
|
||||
u8 daylightSavingsTimeNth;
|
||||
u8 daylightSavingsTimeDay;
|
||||
u8 daylightSavingsTimeMonth;
|
||||
u8 daylightSavingsTimeFlags;
|
||||
} FWExtUserSettings;
|
||||
|
||||
typedef union
|
||||
{
|
||||
u8 _raw[262144];
|
||||
|
||||
struct
|
||||
{
|
||||
FWHeader header;
|
||||
FWWifiInfo wifiInfo;
|
||||
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
u8 codeAndData[260096];
|
||||
} nds;
|
||||
|
||||
struct
|
||||
{
|
||||
u8 zeroBuffer[255];
|
||||
u8 value0x80;
|
||||
u8 ffBuffer[127231];
|
||||
u8 bootFlags;
|
||||
FWExtAccessPointSettings wifiAP4;
|
||||
FWExtAccessPointSettings wifiAP5;
|
||||
FWExtAccessPointSettings wifiAP6;
|
||||
u8 UNKNOWN1[131072];
|
||||
} dsi;
|
||||
};
|
||||
|
||||
FWAccessPointSettings wifiAP1;
|
||||
FWAccessPointSettings wifiAP2;
|
||||
FWAccessPointSettings wifiAP3;
|
||||
|
||||
u8 unused[256];
|
||||
|
||||
FWUserSettings userSettings0;
|
||||
FWUserSettings userSettings1;
|
||||
};
|
||||
|
||||
} NDSFirmwareData;
|
||||
#include "PACKED_END.h"
|
||||
|
||||
class CFIRMWARE
|
||||
{
|
||||
private:
|
||||
u8 *tmp_data9;
|
||||
u8 *tmp_data7;
|
||||
u32 size9, size7;
|
||||
u32 userDataAddr;
|
||||
FWHeader _header;
|
||||
bool _isLoaded;
|
||||
u32 _userDataAddr;
|
||||
|
||||
u16 getBootCodeCRC16();
|
||||
u32 decrypt(const u8 *in, u8* &out);
|
||||
u32 decompress(const u8 *in, u8* &out);
|
||||
|
||||
bool successLoad;
|
||||
u16 _getBootCodeCRC16(const u8 *arm9Data, const u32 arm9Size, const u8 *arm7Data, const u32 arm7Size);
|
||||
u32 _decrypt(const u8 *in, u8* &out);
|
||||
u32 _decompress(const u8 *in, u8* &out);
|
||||
|
||||
public:
|
||||
CFIRMWARE(): size9(0), size7(0), ARM9bootAddr(0), ARM7bootAddr(0), patched(0), userDataAddr(0x3FE00), successLoad(false) {};
|
||||
CFIRMWARE(): _userDataAddr(0x3FE00), _isLoaded(false) {};
|
||||
|
||||
bool load();
|
||||
bool unpack();
|
||||
|
@ -56,43 +419,15 @@ public:
|
|||
|
||||
static std::string GetExternalFilePath();
|
||||
|
||||
u32 getID() { return header.fw_identifier; }
|
||||
bool loaded() { return successLoad; }
|
||||
void *getTouchCalibrate();
|
||||
|
||||
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
|
||||
u32 fw_identifier; // 008h
|
||||
u16 part1_rom_boot9_addr; // 00Ch
|
||||
u16 part1_ram_boot9_addr; // 00Eh
|
||||
u16 part2_rom_boot7_addr; // 010h
|
||||
u16 part2_ram_boot7_addr; // 012h
|
||||
u16 shift_amounts; // 014h
|
||||
u16 part5_data_gfx_addr; // 016h
|
||||
|
||||
u8 fw_timestamp[5]; // 018h
|
||||
u8 console_type; // 01Dh
|
||||
u16 unused1; // 01Eh
|
||||
u16 user_settings_offset; // 020h
|
||||
u16 unknown1; // 022h
|
||||
u16 unknown2; // 024h
|
||||
u16 part5_crc16; // 026h
|
||||
u16 unused2; // 028h - FFh filled
|
||||
} header;
|
||||
|
||||
u32 ARM9bootAddr;
|
||||
u32 ARM7bootAddr;
|
||||
bool patched;
|
||||
bool loaded();
|
||||
void* getTouchCalibrate();
|
||||
};
|
||||
|
||||
int copy_firmware_user_data( u8 *dest_buffer, const u8 *fw_data);
|
||||
int NDS_CreateDummyFirmware(NDS_fw_config_data *user_settings);
|
||||
void NDS_FillDefaultFirmwareConfigData(NDS_fw_config_data *fw_config);
|
||||
void NDS_PatchFirmwareMAC();
|
||||
|
||||
void NDS_GetDefaultFirmwareConfig(FirmwareConfig &outConfig);
|
||||
void NDS_InitFirmwareWithConfig(const FirmwareConfig &inConfig);
|
||||
void NDS_OverrideFirmwareMAC(const u8 inMAC[6]);
|
||||
|
||||
struct fw_memory_chip
|
||||
{
|
||||
|
@ -103,7 +438,8 @@ struct fw_memory_chip
|
|||
|
||||
BOOL write_enable; //is write enabled ?
|
||||
|
||||
u8 *data; //memory data
|
||||
NDSFirmwareData data;
|
||||
|
||||
u32 size; //memory size
|
||||
BOOL writeable_buffer; //is "data" writeable ?
|
||||
int type; //type of Memory
|
||||
|
@ -125,4 +461,3 @@ void mc_load_file(fw_memory_chip *mc, const char* filename); /* load save file a
|
|||
void mc_free(fw_memory_chip *mc); /* delete mc memory */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -80,6 +80,110 @@
|
|||
<true/>
|
||||
<key>EmulationSlot1_DeviceType</key>
|
||||
<integer>1</integer>
|
||||
<key>FirmwareConfig_MACAddress</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP1_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP1_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP1_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP1_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP1_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP1_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP1_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP1_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP1_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP1_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP1_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP1_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP1_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP1_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP1_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP1_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_SubnetMask_AP1</key>
|
||||
<integer>24</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP2_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP2_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP2_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP2_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP2_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP2_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP2_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP2_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP2_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP2_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP2_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP2_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP2_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP2_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP2_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP2_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_SubnetMask_AP2</key>
|
||||
<integer>24</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP3_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP3_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP3_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Address_AP3_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP3_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP3_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP3_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4Gateway_AP3_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP3_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP3_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP3_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4PrimaryDNS_AP3_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP3_1</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP3_2</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP3_3</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_IPv4SecondaryDNS_AP3_4</key>
|
||||
<integer>0</integer>
|
||||
<key>FirmwareConfig_SubnetMask_AP3</key>
|
||||
<integer>24</integer>
|
||||
<key>FirmwareConfig_Birthday</key>
|
||||
<date>2011-06-23T07:00:00Z</date>
|
||||
<key>FirmwareConfig_FavoriteColor</key>
|
||||
|
|
|
@ -734,17 +734,7 @@ volatile bool execute = true;
|
|||
|
||||
- (void) generateFirmwareMACAddress
|
||||
{
|
||||
const uint32_t macValue = (uint32_t)random() & 0x00FFFFFF;
|
||||
|
||||
uint8_t newMACAddress[6];
|
||||
newMACAddress[0] = 0x00;
|
||||
newMACAddress[1] = 0x09;
|
||||
newMACAddress[2] = 0xBF;
|
||||
newMACAddress[3] = (macValue >> 0) & 0x000000FF;
|
||||
newMACAddress[4] = (macValue >> 8) & 0x000000FF;
|
||||
newMACAddress[5] = (macValue >> 16) & 0x000000FF;
|
||||
|
||||
[[self cdsFirmware] setMACAddress:newMACAddress];
|
||||
[[self cdsFirmware] generateRandomMACAddress];
|
||||
[self setFirmwareMACAddressSelectionString:NULL];
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
#include <pthread.h>
|
||||
|
||||
struct FirmwareConfig;
|
||||
|
||||
/********************************************************************************************
|
||||
CocoaDSFirmware - OBJECTIVE-C CLASS
|
||||
|
@ -30,76 +31,20 @@
|
|||
********************************************************************************************/
|
||||
@interface CocoaDSFirmware : NSObject
|
||||
{
|
||||
struct NDS_fw_config_data *internalData;
|
||||
FirmwareConfig *_internalData;
|
||||
NSUInteger _birth_year;
|
||||
uint8_t _MACAddress[6];
|
||||
|
||||
NSInteger ipv4Address_AP1_1;
|
||||
NSInteger ipv4Address_AP1_2;
|
||||
NSInteger ipv4Address_AP1_3;
|
||||
NSInteger ipv4Address_AP1_4;
|
||||
NSInteger ipv4Gateway_AP1_1;
|
||||
NSInteger ipv4Gateway_AP1_2;
|
||||
NSInteger ipv4Gateway_AP1_3;
|
||||
NSInteger ipv4Gateway_AP1_4;
|
||||
NSInteger ipv4PrimaryDNS_AP1_1;
|
||||
NSInteger ipv4PrimaryDNS_AP1_2;
|
||||
NSInteger ipv4PrimaryDNS_AP1_3;
|
||||
NSInteger ipv4PrimaryDNS_AP1_4;
|
||||
NSInteger ipv4SecondaryDNS_AP1_1;
|
||||
NSInteger ipv4SecondaryDNS_AP1_2;
|
||||
NSInteger ipv4SecondaryDNS_AP1_3;
|
||||
NSInteger ipv4SecondaryDNS_AP1_4;
|
||||
NSInteger subnetMask_AP1;
|
||||
NSString *MACAddressString;
|
||||
NSString *subnetMaskString_AP1;
|
||||
|
||||
NSInteger ipv4Address_AP2_1;
|
||||
NSInteger ipv4Address_AP2_2;
|
||||
NSInteger ipv4Address_AP2_3;
|
||||
NSInteger ipv4Address_AP2_4;
|
||||
NSInteger ipv4Gateway_AP2_1;
|
||||
NSInteger ipv4Gateway_AP2_2;
|
||||
NSInteger ipv4Gateway_AP2_3;
|
||||
NSInteger ipv4Gateway_AP2_4;
|
||||
NSInteger ipv4PrimaryDNS_AP2_1;
|
||||
NSInteger ipv4PrimaryDNS_AP2_2;
|
||||
NSInteger ipv4PrimaryDNS_AP2_3;
|
||||
NSInteger ipv4PrimaryDNS_AP2_4;
|
||||
NSInteger ipv4SecondaryDNS_AP2_1;
|
||||
NSInteger ipv4SecondaryDNS_AP2_2;
|
||||
NSInteger ipv4SecondaryDNS_AP2_3;
|
||||
NSInteger ipv4SecondaryDNS_AP2_4;
|
||||
NSInteger subnetMask_AP2;
|
||||
NSString *subnetMaskString_AP2;
|
||||
|
||||
NSInteger ipv4Address_AP3_1;
|
||||
NSInteger ipv4Address_AP3_2;
|
||||
NSInteger ipv4Address_AP3_3;
|
||||
NSInteger ipv4Address_AP3_4;
|
||||
NSInteger ipv4Gateway_AP3_1;
|
||||
NSInteger ipv4Gateway_AP3_2;
|
||||
NSInteger ipv4Gateway_AP3_3;
|
||||
NSInteger ipv4Gateway_AP3_4;
|
||||
NSInteger ipv4PrimaryDNS_AP3_1;
|
||||
NSInteger ipv4PrimaryDNS_AP3_2;
|
||||
NSInteger ipv4PrimaryDNS_AP3_3;
|
||||
NSInteger ipv4PrimaryDNS_AP3_4;
|
||||
NSInteger ipv4SecondaryDNS_AP3_1;
|
||||
NSInteger ipv4SecondaryDNS_AP3_2;
|
||||
NSInteger ipv4SecondaryDNS_AP3_3;
|
||||
NSInteger ipv4SecondaryDNS_AP3_4;
|
||||
NSInteger subnetMask_AP3;
|
||||
NSString *subnetMaskString_AP3;
|
||||
|
||||
NSInteger backlightLevel;
|
||||
|
||||
pthread_mutex_t mutex;
|
||||
}
|
||||
|
||||
@property (readonly) struct NDS_fw_config_data *internalData;
|
||||
|
||||
// WiFi Info
|
||||
@property (assign) NSString *MACAddressString;
|
||||
@property (assign) uint32_t MACAddressValue;
|
||||
@property (retain) NSString *MACAddressString;
|
||||
|
||||
// Access Point Settings
|
||||
@property (assign) NSInteger ipv4Address_AP1_1;
|
||||
|
@ -168,9 +113,7 @@
|
|||
@property (assign) NSInteger language;
|
||||
@property (assign) NSInteger backlightLevel;
|
||||
|
||||
- (void) setMACAddress:(const uint8_t *)inMACAddress;
|
||||
- (uint8_t *) MACAddress;
|
||||
|
||||
- (void) update;
|
||||
- (uint32_t) generateRandomMACAddress;
|
||||
|
||||
@end
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -31,6 +31,7 @@
|
|||
@class RomInfoPanel;
|
||||
@class MacScreenshotCaptureToolDelegate;
|
||||
@class MacAVCaptureToolDelegate;
|
||||
@class PreferencesWindowDelegate;
|
||||
struct ClientCommandAttributes;
|
||||
class AudioSampleBlockGenerator;
|
||||
|
||||
|
@ -47,6 +48,7 @@ class AudioSampleBlockGenerator;
|
|||
CheatWindowDelegate *cheatWindowDelegate;
|
||||
MacScreenshotCaptureToolDelegate *screenshotCaptureToolDelegate;
|
||||
MacAVCaptureToolDelegate *avCaptureToolDelegate;
|
||||
PreferencesWindowDelegate *prefWindowDelegate;
|
||||
NSObjectController *firmwarePanelController;
|
||||
NSObjectController *romInfoPanelController;
|
||||
NSObjectController *cdsCoreController;
|
||||
|
@ -132,6 +134,7 @@ class AudioSampleBlockGenerator;
|
|||
@property (readonly) IBOutlet CheatWindowDelegate *cheatWindowDelegate;
|
||||
@property (readonly) IBOutlet MacScreenshotCaptureToolDelegate *screenshotCaptureToolDelegate;
|
||||
@property (readonly) IBOutlet MacAVCaptureToolDelegate *avCaptureToolDelegate;
|
||||
@property (readonly) IBOutlet PreferencesWindowDelegate *prefWindowDelegate;
|
||||
@property (readonly) IBOutlet NSObjectController *firmwarePanelController;
|
||||
@property (readonly) IBOutlet NSObjectController *romInfoPanelController;
|
||||
@property (readonly) IBOutlet NSObjectController *cdsCoreController;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#import "Slot2WindowDelegate.h"
|
||||
#import "MacAVCaptureTool.h"
|
||||
#import "MacScreenshotCaptureTool.h"
|
||||
#import "preferencesWindowDelegate.h"
|
||||
|
||||
#import "cocoa_globals.h"
|
||||
#import "cocoa_cheat.h"
|
||||
|
@ -46,6 +47,7 @@
|
|||
@synthesize cheatWindowDelegate;
|
||||
@synthesize screenshotCaptureToolDelegate;
|
||||
@synthesize avCaptureToolDelegate;
|
||||
@synthesize prefWindowDelegate;
|
||||
@synthesize firmwarePanelController;
|
||||
@synthesize romInfoPanelController;
|
||||
@synthesize cdsCoreController;
|
||||
|
@ -982,11 +984,74 @@
|
|||
[[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagEmulateEnsata] forKey:@"Emulation_EmulateEnsata"];
|
||||
[[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagDebugConsole] forKey:@"Emulation_UseDebugConsole"];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware MACAddressValue] forKey:@"FirmwareConfig_MACAddress"];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP1_1] forKey:@"FirmwareConfig_IPv4Address_AP1_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP1_2] forKey:@"FirmwareConfig_IPv4Address_AP1_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP1_3] forKey:@"FirmwareConfig_IPv4Address_AP1_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP1_4] forKey:@"FirmwareConfig_IPv4Address_AP1_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP1_1] forKey:@"FirmwareConfig_IPv4Gateway_AP1_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP1_2] forKey:@"FirmwareConfig_IPv4Gateway_AP1_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP1_3] forKey:@"FirmwareConfig_IPv4Gateway_AP1_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP1_4] forKey:@"FirmwareConfig_IPv4Gateway_AP1_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP1_1] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP1_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP1_2] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP1_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP1_3] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP1_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP1_4] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP1_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP1_1] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP1_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP1_2] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP1_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP1_3] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP1_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP1_4] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP1_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware subnetMask_AP1] forKey:@"FirmwareConfig_SubnetMask_AP1"];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP2_1] forKey:@"FirmwareConfig_IPv4Address_AP2_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP2_2] forKey:@"FirmwareConfig_IPv4Address_AP2_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP2_3] forKey:@"FirmwareConfig_IPv4Address_AP2_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP2_4] forKey:@"FirmwareConfig_IPv4Address_AP2_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP2_1] forKey:@"FirmwareConfig_IPv4Gateway_AP2_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP2_2] forKey:@"FirmwareConfig_IPv4Gateway_AP2_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP2_3] forKey:@"FirmwareConfig_IPv4Gateway_AP2_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP2_4] forKey:@"FirmwareConfig_IPv4Gateway_AP2_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP2_1] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP2_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP2_2] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP2_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP2_3] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP2_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP2_4] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP2_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP2_1] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP2_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP2_2] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP2_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP2_3] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP2_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP2_4] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP2_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware subnetMask_AP2] forKey:@"FirmwareConfig_SubnetMask_AP2"];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP3_1] forKey:@"FirmwareConfig_IPv4Address_AP3_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP3_2] forKey:@"FirmwareConfig_IPv4Address_AP3_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP3_3] forKey:@"FirmwareConfig_IPv4Address_AP3_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Address_AP3_4] forKey:@"FirmwareConfig_IPv4Address_AP3_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP3_1] forKey:@"FirmwareConfig_IPv4Gateway_AP3_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP3_2] forKey:@"FirmwareConfig_IPv4Gateway_AP3_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP3_3] forKey:@"FirmwareConfig_IPv4Gateway_AP3_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4Gateway_AP3_4] forKey:@"FirmwareConfig_IPv4Gateway_AP3_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP3_1] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP3_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP3_2] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP3_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP3_3] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP3_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4PrimaryDNS_AP3_4] forKey:@"FirmwareConfig_IPv4PrimaryDNS_AP3_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP3_1] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP3_1"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP3_2] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP3_2"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP3_3] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP3_3"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware ipv4SecondaryDNS_AP3_4] forKey:@"FirmwareConfig_IPv4SecondaryDNS_AP3_4"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware subnetMask_AP3] forKey:@"FirmwareConfig_SubnetMask_AP3"];
|
||||
|
||||
//[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware consoleType] forKey:@"FirmwareConfig_ConsoleType"];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[writeFirmware nickname] forKey:@"FirmwareConfig_Nickname"];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[writeFirmware message] forKey:@"FirmwareConfig_Message"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware favoriteColor] forKey:@"FirmwareConfig_FavoriteColor"];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[writeFirmware birthday] forKey:@"FirmwareConfig_Birthday"];
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware language] forKey:@"FirmwareConfig_Language"];
|
||||
//[[NSUserDefaults standardUserDefaults] setInteger:[writeFirmware backlightLevel] forKey:@"FirmwareConfig_BacklightLevel"];
|
||||
|
||||
[prefWindowDelegate updateFirmwareMACAddressString:nil];
|
||||
[prefWindowDelegate updateSubnetMaskString_AP1:nil];
|
||||
[prefWindowDelegate updateSubnetMaskString_AP2:nil];
|
||||
[prefWindowDelegate updateSubnetMaskString_AP3:nil];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
|
|
@ -58,7 +58,6 @@ class ClientExecutionControl;
|
|||
@property (readonly) IBOutlet NSPopUpButton *bridgeDevicePopUpButton;
|
||||
|
||||
- (void) updateMyMACAddressStringsWithValue:(uint32_t)value;
|
||||
- (void) updateFirmwareMACAddressStringWithValue:(uint32_t)value;
|
||||
- (void) fillLibpcapDeviceMenu;
|
||||
- (void) generateRandomMyMACAddressSet;
|
||||
- (IBAction) generateNewAddresses:(id)sender;
|
||||
|
|
|
@ -51,10 +51,10 @@
|
|||
|
||||
execControl = NULL;
|
||||
|
||||
_myMACAddressValue = 0x00503412;
|
||||
const uint8_t myMAC4 = (_myMACAddressValue >> 0) & 0x000000FF;
|
||||
const uint8_t myMAC5 = (_myMACAddressValue >> 8) & 0x000000FF;
|
||||
const uint8_t myMAC6 = (_myMACAddressValue >> 16) & 0x000000F0;
|
||||
_myMACAddressValue = 0x503412BF;
|
||||
const uint8_t myMAC4 = (_myMACAddressValue >> 8) & 0x000000FF;
|
||||
const uint8_t myMAC5 = (_myMACAddressValue >> 16) & 0x000000FF;
|
||||
const uint8_t myMAC6 = (_myMACAddressValue >> 24) & 0x000000F0;
|
||||
|
||||
firmwareMACAddressString = @"Firmware 00:09:BF:FF:FF:FF";
|
||||
currentSessionMACAddressString = @"00:09:BF:FF:FF:FF";
|
||||
|
@ -99,9 +99,9 @@
|
|||
}
|
||||
else if ( (theSelection >= 1) && (theSelection <= 4) )
|
||||
{
|
||||
const uint8_t myMAC4 = (_myMACAddressValue >> 0) & 0x000000FF;
|
||||
const uint8_t myMAC5 = (_myMACAddressValue >> 8) & 0x000000FF;
|
||||
const uint8_t myMAC6 = (_myMACAddressValue >> 16) & 0x000000F0;
|
||||
const uint8_t myMAC4 = (_myMACAddressValue >> 8) & 0x000000FF;
|
||||
const uint8_t myMAC5 = (_myMACAddressValue >> 16) & 0x000000FF;
|
||||
const uint8_t myMAC6 = (_myMACAddressValue >> 24) & 0x000000F0;
|
||||
|
||||
wifiHandler->SetUserMACValues(myMAC4, myMAC5, myMAC6 + theSelection);
|
||||
//wifiHandler->SetFirmwareMACMode(FirmwareMACMode_Manual);
|
||||
|
@ -135,9 +135,9 @@
|
|||
|
||||
- (void) updateMyMACAddressStringsWithValue:(uint32_t)value
|
||||
{
|
||||
const uint8_t myMAC4 = (value >> 0) & 0x000000FF;
|
||||
const uint8_t myMAC5 = (value >> 8) & 0x000000FF;
|
||||
const uint8_t myMAC6 = (value >> 16) & 0x000000F0;
|
||||
const uint8_t myMAC4 = (value >> 8) & 0x000000FF;
|
||||
const uint8_t myMAC5 = (value >> 16) & 0x000000FF;
|
||||
const uint8_t myMAC6 = (value >> 24) & 0x000000F0;
|
||||
|
||||
[self setMyMACAddress1String:[NSString stringWithFormat:@"My Address #1 00:09:BF:%02X:%02X:%02X", myMAC4, myMAC5, myMAC6 + 1]];
|
||||
[self setMyMACAddress2String:[NSString stringWithFormat:@"My Address #2 00:09:BF:%02X:%02X:%02X", myMAC4, myMAC5, myMAC6 + 2]];
|
||||
|
@ -145,15 +145,6 @@
|
|||
[self setMyMACAddress4String:[NSString stringWithFormat:@"My Address #4 00:09:BF:%02X:%02X:%02X", myMAC4, myMAC5, myMAC6 + 4]];
|
||||
}
|
||||
|
||||
- (void) updateFirmwareMACAddressStringWithValue:(uint32_t)value
|
||||
{
|
||||
const uint8_t fwMAC4 = (value >> 0) & 0x000000FF;
|
||||
const uint8_t fwMAC5 = (value >> 8) & 0x000000FF;
|
||||
const uint8_t fwMAC6 = (value >> 16) & 0x000000FF;
|
||||
|
||||
[self setFirmwareMACAddressString:[NSString stringWithFormat:@"Firmware 00:09:BF:%02X:%02X:%02X", fwMAC4, fwMAC5, fwMAC6]];
|
||||
}
|
||||
|
||||
- (void) fillLibpcapDeviceMenu
|
||||
{
|
||||
std::vector<std::string> deviceList;
|
||||
|
@ -183,7 +174,14 @@
|
|||
|
||||
- (void) generateRandomMyMACAddressSet
|
||||
{
|
||||
_myMACAddressValue = (uint32_t)random() & 0x00FFFFFF;
|
||||
uint32_t randomMACAddressValue = 0;
|
||||
|
||||
do
|
||||
{
|
||||
randomMACAddressValue = (uint32_t)random() & 0x00FFFFFF;
|
||||
} while (randomMACAddressValue == 0);
|
||||
|
||||
_myMACAddressValue = (randomMACAddressValue << 8) | 0xBF;
|
||||
[self updateMyMACAddressStringsWithValue:_myMACAddressValue];
|
||||
|
||||
const NSInteger currentAddressSelection = [self addressSelection];
|
||||
|
@ -220,7 +218,6 @@
|
|||
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"Wifi_MyMACAddress"] != nil)
|
||||
{
|
||||
userDefaultMACAddressValue = (uint32_t)[[NSUserDefaults standardUserDefaults] integerForKey:@"Wifi_MyMACAddress"];
|
||||
userDefaultMACAddressValue &= 0x00FFFFFF;
|
||||
}
|
||||
|
||||
if (userDefaultMACAddressValue == 0)
|
||||
|
@ -231,6 +228,8 @@
|
|||
userDefaultMACAddressValue = (uint32_t)random() & 0x00FFFFFF;
|
||||
} while (userDefaultMACAddressValue == 0);
|
||||
|
||||
userDefaultMACAddressValue = ((userDefaultMACAddressValue << 8) | 0xBF);
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:userDefaultMACAddressValue forKey:@"Wifi_MyMACAddress"];
|
||||
needUserDefaultSynchronize = YES;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Copyright (C) 2011 Roger Manuel
|
||||
Copyright (C) 2011-2015 DeSmuME Team
|
||||
Copyright (C) 2011-2018 DeSmuME Team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Copyright (C) 2011 Roger Manuel
|
||||
Copyright (C) 2011-2017 DeSmuME Team
|
||||
Copyright (C) 2011-2018 DeSmuME Team
|
||||
|
||||
This file is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -468,11 +468,95 @@
|
|||
|
||||
// Set up the firmware per user preferences.
|
||||
CocoaDSFirmware *newFirmware = [[[CocoaDSFirmware alloc] init] autorelease];
|
||||
uint32_t defaultMACAddress_u32 = 0;
|
||||
|
||||
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"FirmwareConfig_MACAddress"] != nil)
|
||||
{
|
||||
defaultMACAddress_u32 = (uint32_t)[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_MACAddress"];
|
||||
}
|
||||
|
||||
if (defaultMACAddress_u32 == 0)
|
||||
{
|
||||
// Generate a new random MAC address set if one does not exist.
|
||||
do
|
||||
{
|
||||
defaultMACAddress_u32 = (uint32_t)random() & 0x00FFFFFF;
|
||||
} while (defaultMACAddress_u32 == 0);
|
||||
|
||||
defaultMACAddress_u32 = ((defaultMACAddress_u32 << 8) | 0xBF);
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:defaultMACAddress_u32 forKey:@"FirmwareConfig_MACAddress"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
[newFirmware setMACAddressValue:defaultMACAddress_u32];
|
||||
|
||||
[newFirmware setIpv4Address_AP1_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP1_1"]];
|
||||
[newFirmware setIpv4Address_AP1_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP1_2"]];
|
||||
[newFirmware setIpv4Address_AP1_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP1_3"]];
|
||||
[newFirmware setIpv4Address_AP1_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP1_4"]];
|
||||
[newFirmware setIpv4Gateway_AP1_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP1_1"]];
|
||||
[newFirmware setIpv4Gateway_AP1_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP1_2"]];
|
||||
[newFirmware setIpv4Gateway_AP1_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP1_3"]];
|
||||
[newFirmware setIpv4Gateway_AP1_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP1_4"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP1_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP1_1"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP1_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP1_2"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP1_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP1_3"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP1_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP1_4"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP1_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP1_1"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP1_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP1_2"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP1_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP1_3"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP1_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP1_4"]];
|
||||
[newFirmware setSubnetMask_AP1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_SubnetMask_AP1"]];
|
||||
|
||||
[newFirmware setIpv4Address_AP2_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP2_1"]];
|
||||
[newFirmware setIpv4Address_AP2_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP2_2"]];
|
||||
[newFirmware setIpv4Address_AP2_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP2_3"]];
|
||||
[newFirmware setIpv4Address_AP2_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP2_4"]];
|
||||
[newFirmware setIpv4Gateway_AP2_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP2_1"]];
|
||||
[newFirmware setIpv4Gateway_AP2_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP2_2"]];
|
||||
[newFirmware setIpv4Gateway_AP2_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP2_3"]];
|
||||
[newFirmware setIpv4Gateway_AP2_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP2_4"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP2_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP2_1"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP2_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP2_2"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP2_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP2_3"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP2_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP2_4"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP2_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP2_1"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP2_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP2_2"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP2_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP2_3"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP2_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP2_4"]];
|
||||
[newFirmware setSubnetMask_AP2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_SubnetMask_AP2"]];
|
||||
|
||||
[newFirmware setIpv4Address_AP3_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP3_1"]];
|
||||
[newFirmware setIpv4Address_AP3_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP3_2"]];
|
||||
[newFirmware setIpv4Address_AP3_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP3_3"]];
|
||||
[newFirmware setIpv4Address_AP3_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Address_AP3_4"]];
|
||||
[newFirmware setIpv4Gateway_AP3_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP3_1"]];
|
||||
[newFirmware setIpv4Gateway_AP3_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP3_2"]];
|
||||
[newFirmware setIpv4Gateway_AP3_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP3_3"]];
|
||||
[newFirmware setIpv4Gateway_AP3_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4Gateway_AP3_4"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP3_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP3_1"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP3_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP3_2"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP3_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP3_3"]];
|
||||
[newFirmware setIpv4PrimaryDNS_AP3_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4PrimaryDNS_AP3_4"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP3_1:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP3_1"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP3_2:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP3_2"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP3_3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP3_3"]];
|
||||
[newFirmware setIpv4SecondaryDNS_AP3_4:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_IPv4SecondaryDNS_AP3_4"]];
|
||||
[newFirmware setSubnetMask_AP3:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_SubnetMask_AP3"]];
|
||||
|
||||
//[newFirmware setConsoleType:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_ConsoleType"]];
|
||||
[newFirmware setNickname:[[NSUserDefaults standardUserDefaults] objectForKey:@"FirmwareConfig_Nickname"]];
|
||||
[newFirmware setMessage:[[NSUserDefaults standardUserDefaults] objectForKey:@"FirmwareConfig_Message"]];
|
||||
[newFirmware setFavoriteColor:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_FavoriteColor"]];
|
||||
[newFirmware setBirthday:[[NSUserDefaults standardUserDefaults] objectForKey:@"FirmwareConfig_Birthday"]];
|
||||
[newFirmware setLanguage:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_Language"]];
|
||||
//[newFirmware setBacklightLevel:[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_BacklightLevel"]];
|
||||
|
||||
[prefWindowDelegate updateFirmwareMACAddressString:nil];
|
||||
[prefWindowDelegate updateSubnetMaskString_AP1:nil];
|
||||
[prefWindowDelegate updateSubnetMaskString_AP2:nil];
|
||||
[prefWindowDelegate updateSubnetMaskString_AP3:nil];
|
||||
|
||||
[newFirmware update];
|
||||
[emuControl setCdsFirmware:newFirmware];
|
||||
|
|
|
@ -84,6 +84,11 @@ class OGLImage;
|
|||
|
||||
DisplayPreviewView *previewView;
|
||||
|
||||
NSString *firmwareMACAddressString;
|
||||
NSString *subnetMaskString_AP1;
|
||||
NSString *subnetMaskString_AP2;
|
||||
NSString *subnetMaskString_AP3;
|
||||
|
||||
NSMutableDictionary *bindings;
|
||||
}
|
||||
|
||||
|
@ -116,6 +121,11 @@ class OGLImage;
|
|||
|
||||
@property (readonly) IBOutlet DisplayPreviewView *previewView;
|
||||
|
||||
@property (retain) NSString *firmwareMACAddressString;
|
||||
@property (retain) NSString *subnetMaskString_AP1;
|
||||
@property (retain) NSString *subnetMaskString_AP2;
|
||||
@property (retain) NSString *subnetMaskString_AP3;
|
||||
|
||||
@property (readonly) NSMutableDictionary *bindings;
|
||||
|
||||
- (IBAction) changePrefView:(id)sender;
|
||||
|
@ -149,6 +159,12 @@ class OGLImage;
|
|||
- (IBAction) closeFirmwareConfigSheet:(id)sender;
|
||||
- (void) didEndFirmwareConfigSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
|
||||
|
||||
- (IBAction) generateFirmwareMACAddress:(id)sender;
|
||||
- (IBAction) updateFirmwareMACAddressString:(id)sender;
|
||||
- (IBAction) updateSubnetMaskString_AP1:(id)sender;
|
||||
- (IBAction) updateSubnetMaskString_AP2:(id)sender;
|
||||
- (IBAction) updateSubnetMaskString_AP3:(id)sender;
|
||||
|
||||
- (void) switchContentView:(NSView *)theView;
|
||||
- (void) markUnsupportedOpenGLMSAAMenuItems;
|
||||
- (void) setupUserDefaults;
|
||||
|
|
|
@ -308,6 +308,11 @@
|
|||
|
||||
@synthesize previewView;
|
||||
|
||||
@synthesize firmwareMACAddressString;
|
||||
@synthesize subnetMaskString_AP1;
|
||||
@synthesize subnetMaskString_AP2;
|
||||
@synthesize subnetMaskString_AP3;
|
||||
|
||||
@synthesize bindings;
|
||||
|
||||
- (id)init
|
||||
|
@ -326,6 +331,11 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
firmwareMACAddressString = @"00:09:BF:FF:FF:FF";
|
||||
subnetMaskString_AP1 = @"0.0.0.0";
|
||||
subnetMaskString_AP2 = @"0.0.0.0";
|
||||
subnetMaskString_AP3 = @"0.0.0.0";
|
||||
|
||||
// Load the volume icons.
|
||||
iconVolumeFull = [[NSImage imageNamed:@"Icon_VolumeFull_16x16"] retain];
|
||||
iconVolumeTwoThird = [[NSImage imageNamed:@"Icon_VolumeTwoThird_16x16"] retain];
|
||||
|
@ -347,6 +357,11 @@
|
|||
[bindings release];
|
||||
[prefViewDict release];
|
||||
|
||||
[self setFirmwareMACAddressString:nil];
|
||||
[self setSubnetMaskString_AP1:nil];
|
||||
[self setSubnetMaskString_AP2:nil];
|
||||
[self setSubnetMaskString_AP3:nil];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -878,6 +893,76 @@
|
|||
[sheet orderOut:self];
|
||||
}
|
||||
|
||||
- (IBAction) generateFirmwareMACAddress:(id)sender
|
||||
{
|
||||
uint32_t randomMACAddressValue = 0;
|
||||
|
||||
do
|
||||
{
|
||||
randomMACAddressValue = (uint32_t)random() & 0x00FFFFFF;
|
||||
} while (randomMACAddressValue == 0);
|
||||
|
||||
randomMACAddressValue = (randomMACAddressValue << 8) | 0xBF;
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:randomMACAddressValue forKey:@"FirmwareConfig_MACAddress"];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
[self updateFirmwareMACAddressString:nil];
|
||||
}
|
||||
|
||||
- (IBAction) updateFirmwareMACAddressString:(id)sender
|
||||
{
|
||||
const uint32_t defaultMACAddressValue = (uint32_t)[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_MACAddress"];
|
||||
const uint8_t mac4 = (defaultMACAddressValue >> 8) & 0x000000FF;
|
||||
const uint8_t mac5 = (defaultMACAddressValue >> 16) & 0x000000FF;
|
||||
const uint8_t mac6 = (defaultMACAddressValue >> 24) & 0x000000FF;
|
||||
|
||||
NSString *theMACAddressString = [NSString stringWithFormat:@"00:09:BF:%02X:%02X:%02X", mac4, mac5, mac6];
|
||||
[self setFirmwareMACAddressString:theMACAddressString];
|
||||
}
|
||||
|
||||
- (IBAction) updateSubnetMaskString_AP1:(id)sender
|
||||
{
|
||||
const uint32_t defaultSubnetMask = (uint8_t)[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_SubnetMask_AP1"];
|
||||
const uint32_t subnetMaskValue = (defaultSubnetMask == 0) ? 0 : (0xFFFFFFFF << (32 - defaultSubnetMask));
|
||||
|
||||
NSString *subnetMaskString = [NSString stringWithFormat:@"%d.%d.%d.%d",
|
||||
(subnetMaskValue >> 24) & 0x000000FF,
|
||||
(subnetMaskValue >> 16) & 0x000000FF,
|
||||
(subnetMaskValue >> 8) & 0x000000FF,
|
||||
(subnetMaskValue >> 0) & 0x000000FF];
|
||||
|
||||
[self setSubnetMaskString_AP1:subnetMaskString];
|
||||
}
|
||||
|
||||
- (IBAction) updateSubnetMaskString_AP2:(id)sender
|
||||
{
|
||||
const uint32_t defaultSubnetMask = (uint8_t)[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_SubnetMask_AP2"];
|
||||
const uint32_t subnetMaskValue = (defaultSubnetMask == 0) ? 0 : (0xFFFFFFFF << (32 - defaultSubnetMask));
|
||||
|
||||
NSString *subnetMaskString = [NSString stringWithFormat:@"%d.%d.%d.%d",
|
||||
(subnetMaskValue >> 24) & 0x000000FF,
|
||||
(subnetMaskValue >> 16) & 0x000000FF,
|
||||
(subnetMaskValue >> 8) & 0x000000FF,
|
||||
(subnetMaskValue >> 0) & 0x000000FF];
|
||||
|
||||
[self setSubnetMaskString_AP2:subnetMaskString];
|
||||
}
|
||||
|
||||
- (IBAction) updateSubnetMaskString_AP3:(id)sender
|
||||
{
|
||||
const uint32_t defaultSubnetMask = (uint8_t)[[NSUserDefaults standardUserDefaults] integerForKey:@"FirmwareConfig_SubnetMask_AP3"];
|
||||
const uint32_t subnetMaskValue = (defaultSubnetMask == 0) ? 0 : (0xFFFFFFFF << (32 - defaultSubnetMask));
|
||||
|
||||
NSString *subnetMaskString = [NSString stringWithFormat:@"%d.%d.%d.%d",
|
||||
(subnetMaskValue >> 24) & 0x000000FF,
|
||||
(subnetMaskValue >> 16) & 0x000000FF,
|
||||
(subnetMaskValue >> 8) & 0x000000FF,
|
||||
(subnetMaskValue >> 0) & 0x000000FF];
|
||||
|
||||
[self setSubnetMaskString_AP3:subnetMaskString];
|
||||
}
|
||||
|
||||
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
|
||||
{
|
||||
[self updateDisplayRotationMenu:[displayRotationField floatValue]];
|
||||
|
|
|
@ -501,12 +501,12 @@ int main(int argc, char ** argv) {
|
|||
const SDL_VideoInfo *videoInfo;
|
||||
|
||||
/* the firmware settings */
|
||||
struct NDS_fw_config_data fw_config;
|
||||
FirmwareConfig fw_config;
|
||||
|
||||
NDS_Init();
|
||||
|
||||
/* default the firmware settings, they may get changed later */
|
||||
NDS_FillDefaultFirmwareConfigData( &fw_config);
|
||||
NDS_GetDefaultFirmwareConfig(fw_config);
|
||||
|
||||
init_config( &my_config);
|
||||
|
||||
|
@ -621,7 +621,7 @@ int main(int argc, char ** argv) {
|
|||
#endif
|
||||
|
||||
/* Create the dummy firmware */
|
||||
NDS_CreateDummyFirmware( &fw_config);
|
||||
NDS_InitFirmwareWithConfig(fw_config);
|
||||
|
||||
if ( !my_config.disable_sound) {
|
||||
SPU_ChangeSoundCore(SNDCORE_SDL, 735 * 4);
|
||||
|
|
|
@ -354,12 +354,12 @@ joinThread_gdb( void *thread_handle) {
|
|||
static int
|
||||
common_gtk_glade_main( struct configured_features *my_config) {
|
||||
/* the firmware settings */
|
||||
struct NDS_fw_config_data fw_config;
|
||||
FirmwareConfig fw_config;
|
||||
gchar *uifile;
|
||||
GKeyFile *keyfile;
|
||||
|
||||
/* default the firmware settings, they may get changed later */
|
||||
NDS_FillDefaultFirmwareConfigData( &fw_config);
|
||||
NDS_GetDefaultFirmwareConfig(fw_config);
|
||||
|
||||
/* use any language set on the command line */
|
||||
if ( my_config->firmware_language != -1) {
|
||||
|
@ -384,7 +384,7 @@ common_gtk_glade_main( struct configured_features *my_config) {
|
|||
desmume_init();
|
||||
|
||||
/* Create the dummy firmware */
|
||||
NDS_CreateDummyFirmware( &fw_config);
|
||||
NDS_InitFirmwareWithConfig(fw_config);
|
||||
|
||||
/*
|
||||
* Activate the GDB stubs
|
||||
|
|
|
@ -3005,10 +3005,10 @@ common_gtk_main( class configured_features *my_config)
|
|||
GtkWidget *pToolBar;
|
||||
|
||||
/* the firmware settings */
|
||||
struct NDS_fw_config_data fw_config;
|
||||
FirmwareConfig fw_config;
|
||||
|
||||
/* default the firmware settings, they may get changed later */
|
||||
NDS_FillDefaultFirmwareConfigData( &fw_config);
|
||||
NDS_GetDefaultFirmwareConfig(fw_config);
|
||||
|
||||
/* use any language set on the command line */
|
||||
if ( my_config->firmware_language != -1) {
|
||||
|
@ -3130,7 +3130,7 @@ common_gtk_main( class configured_features *my_config)
|
|||
#endif
|
||||
|
||||
/* Create the dummy firmware */
|
||||
NDS_CreateDummyFirmware( &fw_config);
|
||||
NDS_InitFirmwareWithConfig(fw_config);
|
||||
|
||||
/* Initialize joysticks */
|
||||
if(!init_joy()) return 1;
|
||||
|
|
|
@ -42,28 +42,28 @@ const char firmDay[31][16] = {"1","2","3","4","5","6","7","8","9","10","11","1
|
|||
const char firmMonth[12][16] = {"January","Feburary","March","April","May","June","July",
|
||||
"August","September","October","November","December"};
|
||||
|
||||
static void WriteFirmConfig( struct NDS_fw_config_data *fw_config)
|
||||
static void WriteFirmConfig(const FirmwareConfig &fwConfig)
|
||||
{
|
||||
char temp_str[27];
|
||||
int i;
|
||||
|
||||
WritePrivateProfileInt("Firmware","favColor", fw_config->fav_colour,IniName);
|
||||
WritePrivateProfileInt("Firmware","bMonth", fw_config->birth_month,IniName);
|
||||
WritePrivateProfileInt("Firmware","bDay",fw_config->birth_day,IniName);
|
||||
WritePrivateProfileInt("Firmware","Language",fw_config->language,IniName);
|
||||
WritePrivateProfileInt("Firmware","favColor", fwConfig.favoriteColor,IniName);
|
||||
WritePrivateProfileInt("Firmware","bMonth", fwConfig.birthdayMonth,IniName);
|
||||
WritePrivateProfileInt("Firmware","bDay",fwConfig.birthdayDay,IniName);
|
||||
WritePrivateProfileInt("Firmware","Language",fwConfig.language,IniName);
|
||||
|
||||
/* FIXME: harshly only use the lower byte of the UTF-16 character.
|
||||
* This would cause strange behaviour if the user could set UTF-16 but
|
||||
* they cannot yet.
|
||||
*/
|
||||
for ( i = 0; i < fw_config->nickname_len; i++) {
|
||||
temp_str[i] = fw_config->nickname[i];
|
||||
for ( i = 0; i < fwConfig.nicknameLength; i++) {
|
||||
temp_str[i] = fwConfig.nickname[i];
|
||||
}
|
||||
temp_str[i] = '\0';
|
||||
WritePrivateProfileString("Firmware", "nickName", temp_str, IniName);
|
||||
|
||||
for ( i = 0; i < fw_config->message_len; i++) {
|
||||
temp_str[i] = fw_config->message[i];
|
||||
for ( i = 0; i < fwConfig.messageLength; i++) {
|
||||
temp_str[i] = fwConfig.message[i];
|
||||
}
|
||||
temp_str[i] = '\0';
|
||||
WritePrivateProfileString("Firmware","Message", temp_str, IniName);
|
||||
|
@ -71,7 +71,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 = &CommonSettings.fw_config;
|
||||
FirmwareConfig &fwConfig = CommonSettings.fwConfig;
|
||||
int i;
|
||||
char temp_str[27];
|
||||
|
||||
|
@ -82,23 +82,23 @@ BOOL CALLBACK FirmConfig_Proc(HWND dialog,UINT komunikat,WPARAM wparam,LPARAM lp
|
|||
for(i=0;i<12;i++) SendDlgItemMessage(dialog,IDC_COMBO2,CB_ADDSTRING,0,(LPARAM)&firmMonth[i]);
|
||||
for(i=0;i<16;i++) SendDlgItemMessage(dialog,IDC_COMBO1,CB_ADDSTRING,0,(LPARAM)&firmColor[i]);
|
||||
for(i=0;i<31;i++) SendDlgItemMessage(dialog,IDC_COMBO3,CB_ADDSTRING,0,(LPARAM)&firmDay[i]);
|
||||
SendDlgItemMessage(dialog,IDC_COMBO1,CB_SETCURSEL,fw_config->fav_colour,0);
|
||||
SendDlgItemMessage(dialog,IDC_COMBO2,CB_SETCURSEL,fw_config->birth_month-1,0);
|
||||
SendDlgItemMessage(dialog,IDC_COMBO3,CB_SETCURSEL,fw_config->birth_day-1,0);
|
||||
SendDlgItemMessage(dialog,IDC_COMBO4,CB_SETCURSEL,fw_config->language,0);
|
||||
SendDlgItemMessage(dialog,IDC_COMBO1,CB_SETCURSEL,fwConfig.favoriteColor,0);
|
||||
SendDlgItemMessage(dialog,IDC_COMBO2,CB_SETCURSEL,fwConfig.birthdayMonth-1,0);
|
||||
SendDlgItemMessage(dialog,IDC_COMBO3,CB_SETCURSEL,fwConfig.birthdayDay-1,0);
|
||||
SendDlgItemMessage(dialog,IDC_COMBO4,CB_SETCURSEL,fwConfig.language,0);
|
||||
SendDlgItemMessage(dialog,IDC_EDIT1,EM_SETLIMITTEXT,10,0);
|
||||
SendDlgItemMessage(dialog,IDC_EDIT2,EM_SETLIMITTEXT,26,0);
|
||||
SendDlgItemMessage(dialog,IDC_EDIT1,EM_SETSEL,0,10);
|
||||
SendDlgItemMessage(dialog,IDC_EDIT2,EM_SETSEL,0,26);
|
||||
|
||||
for ( i = 0; i < fw_config->nickname_len; i++) {
|
||||
nickname_buffer[i] = fw_config->nickname[i];
|
||||
for ( i = 0; i < fwConfig.nicknameLength; i++) {
|
||||
nickname_buffer[i] = fwConfig.nickname[i];
|
||||
}
|
||||
nickname_buffer[i] = '\0';
|
||||
SendDlgItemMessage(dialog,IDC_EDIT1,WM_SETTEXT,0,(LPARAM)nickname_buffer);
|
||||
|
||||
for ( i = 0; i < fw_config->message_len; i++) {
|
||||
message_buffer[i] = fw_config->message[i];
|
||||
for ( i = 0; i < fwConfig.messageLength; i++) {
|
||||
message_buffer[i] = fwConfig.message[i];
|
||||
}
|
||||
message_buffer[i] = '\0';
|
||||
SendDlgItemMessage(dialog,IDC_EDIT2,WM_SETTEXT,0,(LPARAM)message_buffer);
|
||||
|
@ -109,43 +109,43 @@ BOOL CALLBACK FirmConfig_Proc(HWND dialog,UINT komunikat,WPARAM wparam,LPARAM lp
|
|||
{
|
||||
int char_index;
|
||||
LRESULT res;
|
||||
fw_config->fav_colour = SendDlgItemMessage(dialog,IDC_COMBO1,CB_GETCURSEL,0,0);
|
||||
fw_config->birth_month = 1 + SendDlgItemMessage(dialog,IDC_COMBO2,CB_GETCURSEL,0,0);
|
||||
fw_config->birth_day = 1 + SendDlgItemMessage(dialog,IDC_COMBO3,CB_GETCURSEL,0,0);
|
||||
fw_config->language = SendDlgItemMessage(dialog,IDC_COMBO4,CB_GETCURSEL,0,0);
|
||||
fwConfig.favoriteColor = SendDlgItemMessage(dialog,IDC_COMBO1,CB_GETCURSEL,0,0);
|
||||
fwConfig.birthdayMonth = 1 + SendDlgItemMessage(dialog,IDC_COMBO2,CB_GETCURSEL,0,0);
|
||||
fwConfig.birthdayDay = 1 + SendDlgItemMessage(dialog,IDC_COMBO3,CB_GETCURSEL,0,0);
|
||||
fwConfig.language = SendDlgItemMessage(dialog,IDC_COMBO4,CB_GETCURSEL,0,0);
|
||||
|
||||
*(WORD *)temp_str = 10;
|
||||
res = SendDlgItemMessage(dialog,IDC_EDIT1,EM_GETLINE,0,(LPARAM)temp_str);
|
||||
|
||||
if ( res > 0) {
|
||||
temp_str[res] = '\0';
|
||||
fw_config->nickname_len = strlen( temp_str);
|
||||
fwConfig.nicknameLength = strlen( temp_str);
|
||||
}
|
||||
else {
|
||||
strcpy( temp_str, "yopyop");
|
||||
fw_config->nickname_len = strlen( temp_str);
|
||||
fwConfig.nicknameLength = strlen( temp_str);
|
||||
}
|
||||
for ( char_index = 0; char_index < fw_config->nickname_len; char_index++) {
|
||||
fw_config->nickname[char_index] = temp_str[char_index];
|
||||
for ( char_index = 0; char_index < fwConfig.nicknameLength; char_index++) {
|
||||
fwConfig.nickname[char_index] = temp_str[char_index];
|
||||
}
|
||||
|
||||
*(WORD *)temp_str = 26;
|
||||
res = SendDlgItemMessage(dialog,IDC_EDIT2,EM_GETLINE,0,(LPARAM)temp_str);
|
||||
if ( res > 0) {
|
||||
temp_str[res] = '\0';
|
||||
fw_config->message_len = strlen( temp_str);
|
||||
fwConfig.messageLength = strlen( temp_str);
|
||||
}
|
||||
else {
|
||||
fw_config->message_len = 0;
|
||||
fwConfig.messageLength = 0;
|
||||
}
|
||||
for ( char_index = 0; char_index < fw_config->message_len; char_index++) {
|
||||
fw_config->message[char_index] = temp_str[char_index];
|
||||
for ( char_index = 0; char_index < fwConfig.messageLength; char_index++) {
|
||||
fwConfig.message[char_index] = temp_str[char_index];
|
||||
}
|
||||
|
||||
WriteFirmConfig( fw_config);
|
||||
WriteFirmConfig(fwConfig);
|
||||
EndDialog(dialog,0);
|
||||
if (CommonSettings.UseExtFirmware == 0)
|
||||
NDS_CreateDummyFirmware( fw_config);
|
||||
NDS_InitFirmwareWithConfig(fwConfig);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -2247,20 +2247,36 @@ int _main()
|
|||
wifiHandler->SetPCapInterface(winpcapInterface);
|
||||
wifiHandler->SetSocketsSupported(isSocketsSupported);
|
||||
|
||||
// Get the host's IP4 address.
|
||||
char hostname[256];
|
||||
if (gethostname(hostname, 256) != 0)
|
||||
strncpy(hostname, "127.0.0.1", 256);
|
||||
// Generate the unique MAC address for Ad-hoc mode.
|
||||
{
|
||||
// Get the host's IP4 address.
|
||||
char hostname[256];
|
||||
if (gethostname(hostname, 256) != 0)
|
||||
strncpy(hostname, "127.0.0.1", 256);
|
||||
|
||||
hostent *he = gethostbyname(hostname);
|
||||
unsigned long ipaddr;
|
||||
if (he == NULL || he->h_addr_list[0] == NULL)
|
||||
ipaddr = 0x0100007F; // 127.0.0.1
|
||||
else
|
||||
ipaddr = *(unsigned long*)he->h_addr_list[0];
|
||||
hostent *he = gethostbyname(hostname);
|
||||
u32 ipaddr;
|
||||
if (he == NULL || he->h_addr_list[0] == NULL)
|
||||
ipaddr = 0x0100007F; // 127.0.0.1
|
||||
else
|
||||
ipaddr = *(u32 *)he->h_addr_list[0];
|
||||
|
||||
u32 hash = (u32)GetCurrentProcessId();
|
||||
|
||||
while ((hash & 0xFF000000) == 0)
|
||||
{
|
||||
hash <<= 1;
|
||||
}
|
||||
|
||||
hash >>= 1;
|
||||
hash += ipAddr >> 8;
|
||||
hash &= 0x00FFFFFF;
|
||||
|
||||
wifiHandler->SetUserMACValues(hash >> 16, (hash >> 8) & 0xFF, hash & 0xFF);
|
||||
wifiHandler->SetMACModeForComm(WifiCommInterfaceID_AdHoc, WifiMACMode_Manual);
|
||||
//wifiHandler->SetFirmwareMACMode(FirmwareMACMode_Manual);
|
||||
}
|
||||
|
||||
wifiHandler->SetIP4Address(ipaddr);
|
||||
wifiHandler->SetUniqueMACValue((u32)GetCurrentProcessId());
|
||||
wifiHandler->SetCommInterfaceID(CommonSettings.wifi.mode);
|
||||
wifiHandler->SetBridgeDeviceIndex(CommonSettings.wifi.infraBridgeAdapter);
|
||||
|
||||
|
@ -2425,12 +2441,12 @@ int _main()
|
|||
FilterUpdate(MainWindow->getHWnd(),false);
|
||||
|
||||
//default the firmware settings, they may get changed later
|
||||
NDS_FillDefaultFirmwareConfigData(&CommonSettings.fw_config);
|
||||
NDS_GetDefaultFirmwareConfig(CommonSettings.fwConfig);
|
||||
// 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);
|
||||
CommonSettings.fwConfig.favoriteColor = GetPrivateProfileInt("Firmware","favColor", 10, IniName);
|
||||
CommonSettings.fwConfig.birthdayMonth = GetPrivateProfileInt("Firmware","bMonth", 7, IniName);
|
||||
CommonSettings.fwConfig.birthdayDay = GetPrivateProfileInt("Firmware","bDay", 15, IniName);
|
||||
CommonSettings.fwConfig.language = GetPrivateProfileInt("Firmware","Language", 1, IniName);
|
||||
|
||||
{
|
||||
/*
|
||||
|
@ -2440,21 +2456,21 @@ int _main()
|
|||
char temp_str[27];
|
||||
int char_index;
|
||||
GetPrivateProfileString("Firmware","nickName", "yopyop", temp_str, 11, IniName);
|
||||
CommonSettings.fw_config.nickname_len = strlen( temp_str);
|
||||
CommonSettings.fwConfig.nicknameLength = strlen( temp_str);
|
||||
|
||||
if (CommonSettings.fw_config.nickname_len == 0) {
|
||||
if (CommonSettings.fwConfig.nicknameLength == 0) {
|
||||
strcpy( temp_str, "yopyop");
|
||||
CommonSettings.fw_config.nickname_len = strlen( temp_str);
|
||||
CommonSettings.fwConfig.nicknameLength = strlen( temp_str);
|
||||
}
|
||||
|
||||
for ( char_index = 0; char_index < CommonSettings.fw_config.nickname_len; char_index++) {
|
||||
CommonSettings.fw_config.nickname[char_index] = temp_str[char_index];
|
||||
for ( char_index = 0; char_index < CommonSettings.fwConfig.nicknameLength; char_index++) {
|
||||
CommonSettings.fwConfig.nickname[char_index] = temp_str[char_index];
|
||||
}
|
||||
|
||||
GetPrivateProfileString("Firmware","Message", "DeSmuME makes you happy!", temp_str, 27, IniName);
|
||||
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];
|
||||
CommonSettings.fwConfig.messageLength = strlen( temp_str);
|
||||
for ( char_index = 0; char_index < CommonSettings.fwConfig.messageLength; char_index++) {
|
||||
CommonSettings.fwConfig.message[char_index] = temp_str[char_index];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2467,7 +2483,7 @@ int _main()
|
|||
}
|
||||
|
||||
//not supported; use the GUI
|
||||
//if(cmdline.language != -1) CommonSettings.fw_config.language = cmdline.language;
|
||||
//if(cmdline.language != -1) CommonSettings.fwConfig.language = cmdline.language;
|
||||
|
||||
cmdline.process_movieCommands();
|
||||
|
||||
|
|
|
@ -264,17 +264,17 @@ MovieData::MovieData(bool fromCurrentSettings)
|
|||
bootFromFirmware = CommonSettings.BootFromFirmware;
|
||||
if (!CommonSettings.UseExtFirmware)
|
||||
{
|
||||
firmNickname.resize(CommonSettings.fw_config.nickname_len);
|
||||
for (int i = 0; i < CommonSettings.fw_config.nickname_len; i++)
|
||||
firmNickname[i] = CommonSettings.fw_config.nickname[i];
|
||||
firmMessage.resize(CommonSettings.fw_config.message_len);
|
||||
for (int i = 0; i < CommonSettings.fw_config.message_len; i++)
|
||||
firmMessage[i] = CommonSettings.fw_config.message[i];
|
||||
firmNickname.resize(CommonSettings.fwConfig.nicknameLength);
|
||||
for (int i = 0; i < CommonSettings.fwConfig.nicknameLength; i++)
|
||||
firmNickname[i] = CommonSettings.fwConfig.nickname[i];
|
||||
firmMessage.resize(CommonSettings.fwConfig.messageLength);
|
||||
for (int i = 0; i < CommonSettings.fwConfig.messageLength; i++)
|
||||
firmMessage[i] = CommonSettings.fwConfig.message[i];
|
||||
|
||||
firmFavColour = CommonSettings.fw_config.fav_colour;
|
||||
firmBirthMonth = CommonSettings.fw_config.birth_month;
|
||||
firmBirthDay = CommonSettings.fw_config.birth_day;
|
||||
firmLanguage = CommonSettings.fw_config.language;
|
||||
firmFavColour = CommonSettings.fwConfig.favoriteColor;
|
||||
firmBirthMonth = CommonSettings.fwConfig.birthdayMonth;
|
||||
firmBirthDay = CommonSettings.fwConfig.birthdayDay;
|
||||
firmLanguage = CommonSettings.fwConfig.language;
|
||||
}
|
||||
advancedTiming = CommonSettings.advanced_timing;
|
||||
jitBlockSize = CommonSettings.use_jit ? CommonSettings.jit_max_block_size : 0;
|
||||
|
@ -356,18 +356,18 @@ int MovieData::dump(EMUFILE &fp, bool binary)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::wstring wnick((wchar_t*)CommonSettings.fw_config.nickname,CommonSettings.fw_config.nickname_len);
|
||||
std::wstring wnick((wchar_t*)CommonSettings.fwConfig.nickname, CommonSettings.fwConfig.nicknameLength);
|
||||
std::string nick = wcstombs(wnick);
|
||||
|
||||
std::wstring wmessage((wchar_t*)CommonSettings.fw_config.message,CommonSettings.fw_config.message_len);
|
||||
std::wstring wmessage((wchar_t*)CommonSettings.fwConfig.message, CommonSettings.fwConfig.messageLength);
|
||||
std::string message = wcstombs(wmessage);
|
||||
|
||||
fp.fprintf("firmNickname %s\n", nick.c_str());
|
||||
fp.fprintf("firmMessage %s\n", message.c_str());
|
||||
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("firmFavColour %d\n", CommonSettings.fwConfig.favoriteColor);
|
||||
fp.fprintf("firmBirthMonth %d\n", CommonSettings.fwConfig.birthdayMonth);
|
||||
fp.fprintf("firmBirthDay %d\n", CommonSettings.fwConfig.birthdayDay);
|
||||
fp.fprintf("firmLanguage %d\n", CommonSettings.fwConfig.language);
|
||||
}
|
||||
|
||||
fp.fprintf("advancedTiming %d\n", CommonSettings.advanced_timing?1:0);
|
||||
|
@ -574,28 +574,28 @@ static void LoadSettingsFromMovie(MovieData movieData)
|
|||
{
|
||||
if (movieData.firmNickname != "")
|
||||
{
|
||||
CommonSettings.fw_config.nickname_len = movieData.firmNickname.length() > MAX_FW_NICKNAME_LENGTH ? MAX_FW_NICKNAME_LENGTH : movieData.firmNickname.length();
|
||||
for (int i = 0; i < CommonSettings.fw_config.nickname_len; i++)
|
||||
CommonSettings.fw_config.nickname[i] = movieData.firmNickname[i];
|
||||
CommonSettings.fwConfig.nicknameLength = movieData.firmNickname.length() > MAX_FW_NICKNAME_LENGTH ? MAX_FW_NICKNAME_LENGTH : movieData.firmNickname.length();
|
||||
for (int i = 0; i < CommonSettings.fwConfig.nicknameLength; i++)
|
||||
CommonSettings.fwConfig.nickname[i] = movieData.firmNickname[i];
|
||||
}
|
||||
if (movieData.firmMessage != "")
|
||||
{
|
||||
CommonSettings.fw_config.message_len = movieData.firmMessage.length() > MAX_FW_MESSAGE_LENGTH ? MAX_FW_MESSAGE_LENGTH : movieData.firmMessage.length();
|
||||
for (int i = 0; i < CommonSettings.fw_config.message_len; i++)
|
||||
CommonSettings.fw_config.message[i] = movieData.firmMessage[i];
|
||||
CommonSettings.fwConfig.messageLength = movieData.firmMessage.length() > MAX_FW_MESSAGE_LENGTH ? MAX_FW_MESSAGE_LENGTH : movieData.firmMessage.length();
|
||||
for (int i = 0; i < CommonSettings.fwConfig.messageLength; i++)
|
||||
CommonSettings.fwConfig.message[i] = movieData.firmMessage[i];
|
||||
}
|
||||
|
||||
if (movieData.firmFavColour != -1)
|
||||
CommonSettings.fw_config.fav_colour = movieData.firmFavColour;
|
||||
CommonSettings.fwConfig.favoriteColor = movieData.firmFavColour;
|
||||
if (movieData.firmBirthMonth != -1)
|
||||
CommonSettings.fw_config.birth_month = movieData.firmBirthMonth;
|
||||
CommonSettings.fwConfig.birthdayMonth = movieData.firmBirthMonth;
|
||||
if (movieData.firmBirthDay != -1)
|
||||
CommonSettings.fw_config.birth_day = movieData.firmBirthDay;
|
||||
CommonSettings.fwConfig.birthdayDay = movieData.firmBirthDay;
|
||||
if (movieData.firmLanguage != -1)
|
||||
CommonSettings.fw_config.language = movieData.firmLanguage;
|
||||
CommonSettings.fwConfig.language = movieData.firmLanguage;
|
||||
|
||||
// reset firmware (some games can write to it)
|
||||
NDS_CreateDummyFirmware(&CommonSettings.fw_config);
|
||||
NDS_InitFirmwareWithConfig(CommonSettings.fwConfig);
|
||||
}
|
||||
if (movieData.advancedTiming != -1)
|
||||
CommonSettings.advanced_timing = movieData.advancedTiming;
|
||||
|
@ -781,7 +781,7 @@ void FCEUI_SaveMovie(const char *fname, std::wstring author, START_FROM startFro
|
|||
// reset firmware (some games can write to it)
|
||||
if (!CommonSettings.UseExtFirmware)
|
||||
{
|
||||
NDS_CreateDummyFirmware(&CommonSettings.fw_config);
|
||||
NDS_InitFirmwareWithConfig(CommonSettings.fwConfig);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -504,7 +504,7 @@ static void mmu_savestate(EMUFILE &os)
|
|||
|
||||
//version 8:
|
||||
os.write_32LE(MMU.fw.size);
|
||||
os.fwrite(MMU.fw.data,MMU.fw.size);
|
||||
os.fwrite(MMU.fw.data._raw, MMU.fw.size);
|
||||
}
|
||||
|
||||
static bool mmu_loadstate(EMUFILE &is, int size)
|
||||
|
@ -594,10 +594,9 @@ static bool mmu_loadstate(EMUFILE &is, int size)
|
|||
if (version < 8) return ok;
|
||||
|
||||
//version 8:
|
||||
delete[] MMU.fw.data;
|
||||
memset(MMU.fw.data._raw, 0, sizeof(NDSFirmwareData));
|
||||
MMU.fw.size = is.read_u32LE();
|
||||
MMU.fw.data = new u8[size];
|
||||
is.fread(MMU.fw.data,MMU.fw.size);
|
||||
is.fread(MMU.fw.data._raw, MMU.fw.size);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
|
|
@ -4748,16 +4748,21 @@ bool WifiHandler::CommStart()
|
|||
{
|
||||
case WifiMACMode_Automatic:
|
||||
this->GenerateMACFromValues(FW_Mac);
|
||||
NDS_PatchFirmwareMAC();
|
||||
NDS_OverrideFirmwareMAC(FW_Mac);
|
||||
break;
|
||||
|
||||
case WifiMACMode_Manual:
|
||||
this->CopyMACFromUserValues(FW_Mac);
|
||||
NDS_PatchFirmwareMAC();
|
||||
NDS_OverrideFirmwareMAC(FW_Mac);
|
||||
break;
|
||||
|
||||
case WifiMACMode_ReadFromFirmware:
|
||||
memcpy(FW_Mac, (MMU.fw.data + 0x36), 6);
|
||||
FW_Mac[0] = MMU.fw.data.wifiInfo.MACAddr[0];
|
||||
FW_Mac[1] = MMU.fw.data.wifiInfo.MACAddr[1];
|
||||
FW_Mac[2] = MMU.fw.data.wifiInfo.MACAddr[2];
|
||||
FW_Mac[3] = MMU.fw.data.wifiInfo.MACAddr[3];
|
||||
FW_Mac[4] = MMU.fw.data.wifiInfo.MACAddr[4];
|
||||
FW_Mac[5] = MMU.fw.data.wifiInfo.MACAddr[5];
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue