diff --git a/desmume/src/common.cpp b/desmume/src/common.cpp index 7b32f925a..0ef65b71d 100644 --- a/desmume/src/common.cpp +++ b/desmume/src/common.cpp @@ -420,12 +420,12 @@ static int WritePNGChunk(FILE *fp, uint32 size, const char *type, const uint8 *d return 1; } -int NDS_WritePNG(const char *fname, u8 *data) +int NDS_WritePNG(const char *fname, u16 *data) { int x, y; int width=256; int height=192*2; - u16 * bmp = (u16 *)data; + u16 * bmp = data; FILE *pp=NULL; uint8 *compmem = NULL; uLongf compmemsize = (uLongf)( (height * (width + 1) * 3 * 1.001 + 1) + 12 ); @@ -545,13 +545,13 @@ typedef struct } bmpfileheader_struct; #include "PACKED_END.h" -int NDS_WriteBMP(const char *filename, u8 *data) +int NDS_WriteBMP(const char *filename, u16 *data) { bmpfileheader_struct fileheader; bmpimgheader_struct imageheader; FILE *file; int i,j; - u16 * bmp = (u16 *)data; + u16 * bmp = data; size_t elems_written = 0; memset(&fileheader, 0, sizeof(fileheader)); diff --git a/desmume/src/common.h b/desmume/src/common.h index d2213ba18..66d229949 100644 --- a/desmume/src/common.h +++ b/desmume/src/common.h @@ -87,8 +87,8 @@ struct MAKER std::string getDeveloperNameByID(u16 id); -extern int NDS_WritePNG(const char *fname, u8 *data); -extern int NDS_WriteBMP(const char *filename, u8 *data); +extern int NDS_WritePNG(const char *fname, u16 *data); +extern int NDS_WriteBMP(const char *filename, u16 *data); extern int NDS_WriteBMP_32bppBuffer(int width, int height, const void* buf, const char *filename); #endif diff --git a/desmume/src/windows/mapView.cpp b/desmume/src/windows/mapView.cpp index b51b2ece0..45140ef21 100644 --- a/desmume/src/windows/mapView.cpp +++ b/desmume/src/windows/mapView.cpp @@ -62,7 +62,7 @@ struct mapview_struct for(u32 i = 0; i < gpu.BGSize[map][1]; ++i) { - gpu.currDst = (u8 *)bitmap + i*gpu.BGSize[map][0]*2; + gpu.currDst = bitmap + i*gpu.BGSize[map][0]; gpu.currLine = i; gpu.modeRender(map); }