added wifi init on system startup

This commit is contained in:
mightymax 2007-01-23 22:41:31 +00:00
parent 5c45934ca1
commit b4152941fa
2 changed files with 21 additions and 1 deletions

View File

@ -19,9 +19,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <string.h>
#include "NDSSystem.h"
#include <stdlib.h>
#include <string.h>
#include "ROMReader.h"
@ -45,6 +45,8 @@ int NDS_Init(void) {
if (SPU_Init(SNDCORE_DUMMY, 735) != 0)
return -1;
WIFI_Init(&wifiMac) ;
return 0;
}
@ -423,6 +425,8 @@ void NDS_Reset(void)
GPU_Reset(SubScreen.gpu, 1);
SPU_Reset();
NDS_CreateDummyFirmware() ;
execute = oldexecute;
}
@ -515,6 +519,21 @@ int NDS_WriteBMP(const char *filename)
return 1;
}
/* creates an firmware flash image, which contains all needed info to initiate a wifi connection */
int NDS_CreateDummyFirmware(void)
{
memcpy(MMU.fw.data+0x36,FW_Mac,sizeof(FW_Mac)) ;
memcpy(MMU.fw.data+0x44,FW_WIFIInit,sizeof(FW_WIFIInit)) ;
MMU.fw.data[0x41] = 18 ; /* bits per RF value */
MMU.fw.data[0x42] = 12 ; /* # of RF values to init */
memcpy(MMU.fw.data+0x64,FW_BBInit,sizeof(FW_BBInit)) ;
memcpy(MMU.fw.data+0xCE,FW_RFInit,sizeof(FW_RFInit)) ;
memcpy(MMU.fw.data+0xF2,FW_RFChannel,sizeof(FW_RFChannel)) ;
memcpy(MMU.fw.data+0x146,FW_BBChannel,sizeof(FW_BBChannel)) ;
memcpy(MMU.fw.data+0x03FA40,FW_WFCProfile,sizeof(FW_WFCProfile)) ;
}
int NDS_LoadFirmware(const char *filename)
{
int i;

View File

@ -128,6 +128,7 @@ void NDS_Reset(void);
int NDS_WriteBMP(const char *filename);
int NDS_LoadFirmware(const char *filename);
int NDS_CreateDummyFirmware(void);
static INLINE void NDS_ARM9HBlankInt(void)
{