-files now compile in VC++

This commit is contained in:
cyberwarriorx 2006-11-30 20:34:02 +00:00
parent c179a9d1ff
commit 63614f864e
2 changed files with 27 additions and 9 deletions

View File

@ -25,7 +25,7 @@
NDSSystem nds;
void NDS_Init(void) {
int NDS_Init(void) {
nds.ARM9Cycle = 0;
nds.ARM7Cycle = 0;
nds.cycles = 0;
@ -86,15 +86,18 @@ void NDS_DeInit(void) {
BOOL NDS_SetROM(u8 * rom, u32 mask)
{
u32 i;
NDS_header * header;
u32 src;
u32 dst;
MMU_clearMem();
MMU_setRom(rom, mask);
NDS_header * header = NDS_getROMHeader();
header = NDS_getROMHeader();
u32 src = header->ARM9src;
u32 dst = header->ARM9cpy;
src = header->ARM9src;
dst = header->ARM9cpy;
for(i = 0; i < (header->ARM9binSize>>2); ++i)
{
@ -415,6 +418,18 @@ typedef struct
u32 numimpcol;
} bmpimgheader_struct;
#ifdef _MSC_VER
#pragma pack(push, 1)
typedef struct
{
u16 id;
u32 size;
u16 reserved1;
u16 reserved2;
u32 imgoffset;
} bmpfileheader_struct;
#pragma pack(pop)
#else
typedef struct
{
u16 id __PACKED;
@ -423,6 +438,7 @@ typedef struct
u16 reserved2 __PACKED;
u32 imgoffset __PACKED;
} bmpfileheader_struct;
#endif
int NDS_WriteBMP(const char *filename)
{

View File

@ -128,7 +128,7 @@ typedef struct
extern NDSSystem nds;
void NDSInit(void);
int NDSInit(void);
void NDSDeInit(void);
BOOL NDS_SetROM(u8 * rom, u32 mask);
@ -247,8 +247,8 @@ int NDS_LoadFirmware(const char *filename);
{
if(nds.VCount<192)
{
GPU_ligne(&MainScreen, nds.VCount);
GPU_ligne(&SubScreen, nds.VCount);
GPU_ligne(&MainScreen, nds.VCount);
GPU_ligne(&SubScreen, nds.VCount);
T1WriteWord(ARM9Mem.ARM9_REG, 4, T1ReadWord(ARM9Mem.ARM9_REG, 4) | 2);
T1WriteWord(MMU.ARM7_REG, 4, T1ReadWord(MMU.ARM7_REG, 4) | 2);
NDS_ARM9HBlankInt();
@ -266,6 +266,8 @@ int NDS_LoadFirmware(const char *filename);
}
if(nds.cycles>=nds.nextHBlank+1092)
{
u32 vmatch;
++nds.VCount;
nds.nextHBlank += 4260;
T1WriteWord(ARM9Mem.ARM9_REG, 4, T1ReadWord(ARM9Mem.ARM9_REG, 4) & 0xFFFD);
@ -356,7 +358,7 @@ int NDS_LoadFirmware(const char *filename);
T1WriteWord(ARM9Mem.ARM9_REG, 6, nds.VCount);
T1WriteWord(MMU.ARM7_REG, 6, nds.VCount);
u32 vmatch = T1ReadWord(ARM9Mem.ARM9_REG, 4);
vmatch = T1ReadWord(ARM9Mem.ARM9_REG, 4);
if((nds.VCount==(vmatch>>8)|((vmatch<<1)&(1<<8))))
{
T1WriteWord(ARM9Mem.ARM9_REG, 4, T1ReadWord(ARM9Mem.ARM9_REG, 4) | 4);