diff --git a/ext/dmddevice/Demo/dmddevice_dll/dmddevice.cpp b/ext/dmddevice/Demo/dmddevice_dll/dmddevice.cpp index 7ac0e9ce7..b414a8714 100644 --- a/ext/dmddevice/Demo/dmddevice_dll/dmddevice.cpp +++ b/ext/dmddevice/Demo/dmddevice_dll/dmddevice.cpp @@ -80,7 +80,7 @@ DMDDEV void Set_16_Colors_Palette(rgb24 *color) DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) { if (isOpen) { - for (int i = 0; i < width*height; i++){ + for (int i = 0; i < (int)width*height; i++){ switch (currbuffer[i]) { case 0: arr[i] = colors[0]; @@ -111,7 +111,7 @@ DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) DMDDEV void Render_16_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) { if (isOpen) { - for (int i = 0; i < width*height; i++) + for (int i = 0; i < (int)width*height; i++) arr[i] = colors[currbuffer[i]]; HBITMAP map = CreateBitmap(width, height, 1, 32, (void*)arr); HDC src = CreateCompatibleDC(hdc); @@ -202,7 +202,7 @@ DMDDEV void Render_PM_Alphanumeric_Frame(layout_t layout, const UINT16 *const se DMDDEV void Render_RGB24(UINT16 width, UINT16 height, rgb24 *currbuffer) { if (isOpen) { - for (int i = 0; i < width*height; i++){ + for (int i = 0; i < (int)width*height; i++){ arr[i] = ((int)currbuffer[i].red << 16) | ((int)currbuffer[i].green << 8) | ((int)currbuffer[i].blue /*<< 0*/); } HBITMAP map = CreateBitmap(width, height, 1, 32, (void*)arr); diff --git a/ext/dmddevice/pinDMDv1/dmddevice_dll/dmddevice.cpp b/ext/dmddevice/pinDMDv1/dmddevice_dll/dmddevice.cpp index 0eecdb989..a9abfa121 100644 --- a/ext/dmddevice/pinDMDv1/dmddevice_dll/dmddevice.cpp +++ b/ext/dmddevice/pinDMDv1/dmddevice_dll/dmddevice.cpp @@ -25,7 +25,7 @@ bool slowUSB = false; void Send_Clear_Screen() { memset(OutputPacketBuffer,0x00, 2052); - const UINT8 tmp[4] = { + static const UINT8 tmp[4] = { 0x81, 0xC3, 0xE7, 0x00 //header }; memcpy(OutputPacketBuffer, tmp, sizeof(tmp)); @@ -120,10 +120,10 @@ DMDDEV void PM_GameSettings(const char* GameName, UINT64 HardwareGeneration, con DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) { - if (!memcmp(oldbuffer, currbuffer, width*height)) //check if same frame again + if (!memcmp(oldbuffer, currbuffer, (size_t)width*height)) //check if same frame again return; - memcpy(oldbuffer, currbuffer, width*height); + memcpy(oldbuffer, currbuffer, (size_t)width*height); if (isOpen) { int byteIdx=4; @@ -162,7 +162,7 @@ DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) tempbuffer[o] = (UINT8)(((int)currbuffer[offs] + (int)currbuffer[offs+256] + (int)currbuffer[offs+1] + (int)currbuffer[offs+257])/4); } } else - memcpy(tempbuffer,currbuffer,width*height); + memcpy(tempbuffer,currbuffer,(size_t)width*height); // dmd height @@ -218,10 +218,10 @@ DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) DMDDEV void Render_16_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) { - if (!memcmp(oldbuffer, currbuffer, width*height)) //check if same frame again + if (!memcmp(oldbuffer, currbuffer, (size_t)width*height)) //check if same frame again return; - memcpy(oldbuffer, currbuffer, width*height); + memcpy(oldbuffer, currbuffer, (size_t)width*height); if (isOpen) { int byteIdx=4; @@ -230,7 +230,7 @@ DMDDEV void Render_16_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) OutputPacketBuffer[0] = 0x81; // frame sync bytes OutputPacketBuffer[1] = 0xC3; OutputPacketBuffer[2] = 0xE7; - OutputPacketBuffer[3] = 0x0; // command byte + OutputPacketBuffer[3] = 0x0; // command byte // 128x16 = display centered vert // 128x32 = no change @@ -260,7 +260,7 @@ DMDDEV void Render_16_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) tempbuffer[o] = (UINT8)(((int)currbuffer[offs] + (int)currbuffer[offs+256] + (int)currbuffer[offs+1] + (int)currbuffer[offs+257])/4); } } else - memcpy(tempbuffer,currbuffer,width*height); + memcpy(tempbuffer,currbuffer,(size_t)width*height); // dmd height diff --git a/ext/dmddevice/pinDMDv2/dmddevice_dll/dmddevice.cpp b/ext/dmddevice/pinDMDv2/dmddevice_dll/dmddevice.cpp index e8f950960..bbc1ef370 100644 --- a/ext/dmddevice/pinDMDv2/dmddevice_dll/dmddevice.cpp +++ b/ext/dmddevice/pinDMDv2/dmddevice_dll/dmddevice.cpp @@ -200,10 +200,10 @@ DMDDEV void PM_GameSettings(const char* GameName, UINT64 HardwareGeneration, con DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) { - if (!memcmp(oldbuffer, currbuffer, width*height)) //check if same frame again + if (!memcmp(oldbuffer, currbuffer, (size_t)width*height)) //check if same frame again return; - memcpy(oldbuffer, currbuffer, width*height); + memcpy(oldbuffer, currbuffer, (size_t)width*height); if (isOpen) { int byteIdx=4; @@ -242,7 +242,7 @@ DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) tempbuffer[o] = (UINT8)(((int)currbuffer[offs] + (int)currbuffer[offs+256] + (int)currbuffer[offs+1] + (int)currbuffer[offs+257])/4); } } else - memcpy(tempbuffer,currbuffer,width*height); + memcpy(tempbuffer,currbuffer,(size_t)width*height); // dmd height @@ -295,10 +295,10 @@ DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) DMDDEV void Render_16_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) { - if (!memcmp(oldbuffer, currbuffer, width*height)) //check if same frame again + if (!memcmp(oldbuffer, currbuffer, (size_t)width*height)) //check if same frame again return; - memcpy(oldbuffer, currbuffer, width*height); + memcpy(oldbuffer, currbuffer, (size_t)width*height); if (isOpen) { int byteIdx=4; @@ -337,7 +337,7 @@ DMDDEV void Render_16_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) tempbuffer[o] = (UINT8)(((int)currbuffer[offs] + (int)currbuffer[offs+256] + (int)currbuffer[offs+1] + (int)currbuffer[offs+257])/4); } } else - memcpy(tempbuffer,currbuffer,width*height); + memcpy(tempbuffer,currbuffer,(size_t)width*height); // dmd height diff --git a/ext/dmddevice/pinDMDv3/dmddevice_dll/dmddevice.cpp b/ext/dmddevice/pinDMDv3/dmddevice_dll/dmddevice.cpp index ec2e49338..cb5dd4a4b 100644 --- a/ext/dmddevice/pinDMDv3/dmddevice_dll/dmddevice.cpp +++ b/ext/dmddevice/pinDMDv3/dmddevice_dll/dmddevice.cpp @@ -81,10 +81,10 @@ DMDDEV void Set_16_Colors_Palette(rgb24 *color) DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) { - if (!memcmp(oldbuffer, currbuffer, width*height)) //check if same frame again + if (!memcmp(oldbuffer, currbuffer, (size_t)width*height)) //check if same frame again return; - memcpy(oldbuffer, currbuffer, width*height); + memcpy(oldbuffer, currbuffer, (size_t)width*height); if (isOpen) { renderDMDFrame(0x00000000080, (UINT8) width, (UINT8) height, currbuffer, 0x00); @@ -93,10 +93,10 @@ DMDDEV void Render_4_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) DMDDEV void Render_16_Shades(UINT16 width, UINT16 height, UINT8 *currbuffer) { - if (!memcmp(oldbuffer, currbuffer, width*height)) //check if same frame again + if (!memcmp(oldbuffer, currbuffer, (size_t)width*height)) //check if same frame again return; - memcpy(oldbuffer, currbuffer, width*height); + memcpy(oldbuffer, currbuffer, (size_t)width*height); if (isOpen) { render16ShadeFrame(currbuffer); @@ -190,10 +190,10 @@ DMDDEV void Render_PM_Alphanumeric_Frame(layout_t layout, const UINT16 *const se DMDDEV void Render_RGB24(UINT16 width, UINT16 height, rgb24 *currbuffer) { - if (!memcmp(oldbuffer, currbuffer, width*height)) //check if same frame again + if (!memcmp(oldbuffer, currbuffer, (size_t)width*height)) //check if same frame again return; - memcpy(oldbuffer, currbuffer, width*height); + memcpy(oldbuffer, currbuffer, (size_t)width*height); if (!isOpen && !useRGB) { tPMoptions Options;