diff --git a/source/vba/gb/gbSGB.cpp b/source/vba/gb/gbSGB.cpp index b6bef19..c593526 100644 --- a/source/vba/gb/gbSGB.cpp +++ b/source/vba/gb/gbSGB.cpp @@ -245,22 +245,22 @@ void gbSgbDrawBorderTile(int x, int y, int tile, int attr) else xxx = 7 - xx; - u16 c; + u16 cc; if (color) { - c = gbPalette[palette + color]; + cc = gbPalette[palette + color]; } else { - c = gbPalette[0]; + cc = gbPalette[0]; } switch(systemColorDepth) { case 16: - gbSgbDraw16Bit(dest + yyy*(256+2) + xxx, c); + gbSgbDraw16Bit(dest + yyy*(256+2) + xxx, cc); break; case 24: - gbSgbDraw24Bit(dest8 + (yyy*256+xxx)*3, c); + gbSgbDraw24Bit(dest8 + (yyy*256+xxx)*3, cc); break; case 32: - gbSgbDraw32Bit(dest32 + yyy*(256+1)+xxx, c); + gbSgbDraw32Bit(dest32 + yyy*(256+1)+xxx, cc); break; } } diff --git a/source/vba/gba/GBA.cpp b/source/vba/gba/GBA.cpp index 70a2d54..dd141db 100644 --- a/source/vba/gba/GBA.cpp +++ b/source/vba/gba/GBA.cpp @@ -1025,7 +1025,7 @@ bool CPUWriteGSASnapshot(const char *fileName, utilPutDword(buffer, totalSize); // length of remainder of save - CRC fwrite(buffer, 1, 4, file); - char temp[0x2001c]; + char *temp = new char[0x2001c]; memset(temp, 0, 28); memcpy(temp, &rom[0xa0], 16); // copy internal name temp[0x10] = rom[0xbe]; // reserved area (old checksum) @@ -1045,6 +1045,7 @@ bool CPUWriteGSASnapshot(const char *fileName, fwrite(buffer, 1, 4, file); // CRC? fclose(file); + delete [] temp; return true; } diff --git a/source/vba/gba/GBA.h b/source/vba/gba/GBA.h index bcfa7e7..33dee51 100644 --- a/source/vba/gba/GBA.h +++ b/source/vba/gba/GBA.h @@ -73,7 +73,7 @@ extern u8 freezeVRAM[0x18000]; extern u8 freezeOAM[0x400]; extern u8 freezePRAM[0x400]; extern bool debugger_last; -extern int oldreg[17]; +extern int oldreg[18]; extern char oldbuffer[10]; #endif diff --git a/source/vba/gba/Globals.cpp b/source/vba/gba/Globals.cpp index e7cd70e..2ba581b 100644 --- a/source/vba/gba/Globals.cpp +++ b/source/vba/gba/Globals.cpp @@ -1,7 +1,7 @@ #include "GBA.h" #ifdef BKPT_SUPPORT -int oldreg[17]; +int oldreg[18]; char oldbuffer[10]; #endif diff --git a/source/vba/gba/bios.cpp b/source/vba/gba/bios.cpp index 46a12a4..efdb46d 100644 --- a/source/vba/gba/bios.cpp +++ b/source/vba/gba/bios.cpp @@ -696,7 +696,7 @@ void BIOS_LZ77UnCompVram() int length = (data >> 12) + 3; int offset = (data & 0x0FFF); u32 windowOffset = dest + byteCount - offset - 1; - for(int i = 0; i < length; i++) { + for(int i2 = 0; i2 < length; i2++) { writeValue |= (CPUReadByte(windowOffset++) << byteShift); byteShift += 8; byteCount++;