Revert NDSSystem.c which I overwrote earlier when i was goofing up cvs

This commit is contained in:
zeromus 2008-08-26 05:56:40 +00:00
parent 4d4bebc1fe
commit d27e959a69
2 changed files with 8 additions and 37 deletions

View File

@ -181,6 +181,7 @@ void NDS_DeInit(void) {
SPU_DeInit(); SPU_DeInit();
Screen_DeInit(); Screen_DeInit();
MMU_DeInit(); MMU_DeInit();
NDS_3D_Close();
} }
BOOL NDS_SetROM(u8 * rom, u32 mask) BOOL NDS_SetROM(u8 * rom, u32 mask)
@ -533,6 +534,7 @@ void NDS_Reset( void)
GPU_Reset(MainScreen.gpu, 0); GPU_Reset(MainScreen.gpu, 0);
GPU_Reset(SubScreen.gpu, 1); GPU_Reset(SubScreen.gpu, 1);
NDS_3D_Reset();
SPU_Reset(); SPU_Reset();
execute = oldexecute; execute = oldexecute;
@ -586,40 +588,6 @@ typedef struct
} bmpfileheader_struct; } bmpfileheader_struct;
#endif #endif
int NDS_WriteBMP_32bppBuffer(int width, int height, const void* buf, const char *filename)
{
bmpfileheader_struct fileheader;
bmpimgheader_struct imageheader;
FILE *file;
int i,j,k;
u16 * bmp = (u16 *)GPU_screen;
memset(&fileheader, 0, sizeof(fileheader));
fileheader.size = sizeof(fileheader);
fileheader.id = 'B' | ('M' << 8);
fileheader.imgoffset = sizeof(fileheader)+sizeof(imageheader);
memset(&imageheader, 0, sizeof(imageheader));
imageheader.size = sizeof(imageheader);
imageheader.width = width;
imageheader.height = height;
imageheader.planes = 1;
imageheader.bpp = 32;
imageheader.cmptype = 0; // None
imageheader.imgsize = imageheader.width * imageheader.height * 4;
if ((file = fopen(filename,"wb")) == NULL)
return 0;
fwrite(&fileheader, 1, sizeof(fileheader), file);
fwrite(&imageheader, 1, sizeof(imageheader), file);
fwrite(buf,1,imageheader.imgsize,file);
fclose(file);
return 1;
}
int NDS_WriteBMP(const char *filename) int NDS_WriteBMP(const char *filename)
{ {
bmpfileheader_struct fileheader; bmpfileheader_struct fileheader;

View File

@ -280,8 +280,6 @@ char NDS_glInit(void)
MatrixInit (mtxCurrent[3]); MatrixInit (mtxCurrent[3]);
MatrixInit (mtxTemporal); MatrixInit (mtxTemporal);
NDS_3D_Reset();
return 1; return 1;
} }
@ -1287,7 +1285,12 @@ __forceinline void NDS_glPolygonAttrib (unsigned long val)
// Alpha value, actually not well handled, 0 should be wireframe // Alpha value, actually not well handled, 0 should be wireframe
colorAlpha = ((val>>16)&0x1F)<<26; colorAlpha = ((val>>16)&0x1F)<<26;
//printlog("PolygonID=%i;\n",val>>24);
//zero - this is sort of a crazy idea but we need to cover the whole range of alpha values
//colorAlpha = ((val>>16)&0x1F)<<26;
//colorAlpha |= (((unsigned int)colorAlpha)>>5);
//colorAlpha |= (((unsigned int)colorAlpha)>>10);
//colorAlpha |= (((unsigned int)colorAlpha)>>20);
// polyID // polyID
polyID = (val>>24)&0x1F; polyID = (val>>24)&0x1F;