NDSSystem - Made it load the firmware settings from struct

matrix - Fixed compiler warnings
This commit is contained in:
normmatt234 2007-03-25 04:44:02 +00:00
parent 62248f17da
commit 54b74b114c
4 changed files with 36 additions and 26 deletions

View File

@ -26,6 +26,7 @@
#include "ROMReader.h" #include "ROMReader.h"
NDSSystem nds; NDSSystem nds;
NDSFirmware firmware;
int NDS_Init(void) { int NDS_Init(void) {
nds.ARM9Cycle = 0; nds.ARM9Cycle = 0;
@ -44,6 +45,15 @@ int NDS_Init(void) {
if (SPU_Init(SNDCORE_DUMMY, 735) != 0) if (SPU_Init(SNDCORE_DUMMY, 735) != 0)
return -1; return -1;
sprintf(firmware.nickName,"yopyop");
firmware.nickLen = strlen(firmware.nickName);
sprintf(firmware.message,"Hi,it/s me!");
firmware.msgLen = strlen(firmware.message);
firmware.bDay = 15;
firmware.bMonth = 7;
firmware.favColor = 10;
firmware.language = 2;
#ifdef EXPERIMENTAL_WIFI #ifdef EXPERIMENTAL_WIFI
WIFI_Init(&wifiMac) ; WIFI_Init(&wifiMac) ;
@ -365,32 +375,19 @@ void NDS_Reset(void)
// logcount = 0; // logcount = 0;
MMU_writeByte(0, 0x023FFC80, 1); MMU_writeByte(0, 0x023FFC80, 1);
MMU_writeByte(0, 0x023FFC82, 10); MMU_writeByte(0, 0x023FFC82, firmware.favColor);
MMU_writeByte(0, 0x023FFC83, 7); MMU_writeByte(0, 0x023FFC83, firmware.bMonth);
MMU_writeByte(0, 0x023FFC84, 15); MMU_writeByte(0, 0x023FFC84, firmware.bDay);
MMU_writeHWord(0, 0x023FFC86, 'y'); for(i=0; i<firmware.nickLen; i++)
MMU_writeHWord(0, 0x023FFC88, 'o'); MMU_writeHWord(0, 0x023FFC86+(2*i), firmware.nickName[i]);
MMU_writeHWord(0, 0x023FFC8A, 'p'); MMU_writeHWord(0, 0x023FFC9A, firmware.nickLen);
MMU_writeHWord(0, 0x023FFC8C, 'y');
MMU_writeHWord(0, 0x023FFC8E, 'o');
MMU_writeHWord(0, 0x023FFC90, 'p');
MMU_writeHWord(0, 0x023FFC9A, 6);
MMU_writeHWord(0, 0x023FFC9C, 'H'); for(i=0; i<firmware.msgLen; i++)
MMU_writeHWord(0, 0x023FFC9E, 'i'); MMU_writeHWord(0, 0x023FFC9C+(2*i), firmware.message[i]);
MMU_writeHWord(0, 0x023FFCA0, ','); MMU_writeHWord(0, 0x023FFCD0, firmware.msgLen);
MMU_writeHWord(0, 0x023FFCA2, 'i');
MMU_writeHWord(0, 0x023FFCA4, 't');
MMU_writeHWord(0, 0x023FFCA6, '\'');
MMU_writeHWord(0, 0x023FFCA8, 's');
MMU_writeHWord(0, 0x023FFCAA, ' ');
MMU_writeHWord(0, 0x023FFCAC, 'm');
MMU_writeHWord(0, 0x023FFCAE, 'e');
MMU_writeHWord(0, 0x023FFCB0, '!');
MMU_writeHWord(0, 0x023FFCD0, 11);
MMU_writeHWord(0, 0x023FFCE4, 2); MMU_writeHWord(0, 0x023FFCE4, firmware.language); //Language 1=English 2=French
MMU_writeWord(0, 0x027FFE40, header->FNameTblOff); MMU_writeWord(0, 0x027FFE40, header->FNameTblOff);
MMU_writeWord(0, 0x027FFE44, header->FNameTblSize); MMU_writeWord(0, 0x027FFE44, header->FNameTblSize);
@ -560,7 +557,6 @@ int NDS_WriteBMP(const char *filename)
int NDS_CreateDummyFirmware(void) int NDS_CreateDummyFirmware(void)
{ {
#ifdef EXPERIMENTAL_WIFI #ifdef EXPERIMENTAL_WIFI
memcpy(MMU.fw.data+0x36,FW_Mac,sizeof(FW_Mac)) ; memcpy(MMU.fw.data+0x36,FW_Mac,sizeof(FW_Mac)) ;
memcpy(MMU.fw.data+0x44,FW_WIFIInit,sizeof(FW_WIFIInit)) ; memcpy(MMU.fw.data+0x44,FW_WIFIInit,sizeof(FW_WIFIInit)) ;
MMU.fw.data[0x41] = 18 ; /* bits per RF value */ MMU.fw.data[0x41] = 18 ; /* bits per RF value */

View File

@ -111,7 +111,21 @@ typedef struct
u16 touchY; u16 touchY;
} NDSSystem; } NDSSystem;
typedef struct
{
u8 favColor;
u8 bMonth;
u8 bDay;
char nickName[10];
u8 nickLen;
char message[26];
u8 msgLen;
u8 language;
} NDSFirmware;
extern NDSSystem nds; extern NDSSystem nds;
extern NDSFirmware firmware;
int NDSInit(void); int NDSInit(void);
void NDSDeInit(void); void NDSDeInit(void);

View File

@ -243,4 +243,4 @@ float * MatrixStackGet (MatrixStack *stack)
void MatrixStackLoadMatrix (MatrixStack *stack, int pos, float *ptr) void MatrixStackLoadMatrix (MatrixStack *stack, int pos, float *ptr)
{ {
MatrixCopy (&stack->matrix[pos*16], ptr); MatrixCopy (&stack->matrix[pos*16], ptr);
} }

View File

@ -47,4 +47,4 @@ float* MatrixStackGetPos (MatrixStack *stack, int pos);
float* MatrixStackGet (MatrixStack *stack); float* MatrixStackGet (MatrixStack *stack);
void MatrixStackLoadMatrix (MatrixStack *stack, int pos, float *ptr); void MatrixStackLoadMatrix (MatrixStack *stack, int pos, float *ptr);
#endif #endif