diff --git a/EarthboundBattleBackgrounds/EarthboundBattleBackgrounds/main.cpp b/EarthboundBattleBackgrounds/EarthboundBattleBackgrounds/main.cpp index 7820f38..8458fa0 100644 --- a/EarthboundBattleBackgrounds/EarthboundBattleBackgrounds/main.cpp +++ b/EarthboundBattleBackgrounds/EarthboundBattleBackgrounds/main.cpp @@ -128,7 +128,7 @@ struct Rom{ while(data[pos]!=0xFF){ if (pos >= data.length())return; int commandType{data[pos]>>5}; - int len{data[pos]&0x1F+1}; + int len{(data[pos]&0x1F)+1}; if(commandType==7){ commandType=(int(data[pos])&0x1C)>>2; len=((int(data[pos])&3)<<8)+int(data[pos+1])+1; @@ -155,6 +155,7 @@ struct Rom{ block[bpos++]=data[pos]; block[bpos++]=data[pos+1]; } + pos+=2; }break; case INCREMENTAL_SEQUENCE:{ tmp=data[pos++]; @@ -223,9 +224,9 @@ struct Rom{ if(bpp!=2&&bpp!=4)throw std::invalid_argument{std::format("Palette Error: Incorrect color depth specified. Must be 2 or 4, provided {}",bpp)}; for(uint8_t i:std::views::iota(0,pow(2,bpp))){ uint16_t clr16{dataBlock.readShort()}; - uint8_t b{((clr16>>10)&31)*8U}; + uint8_t r{((clr16>>10)&31)*8U}; uint8_t g{((clr16>>5)&31)*8U}; - uint8_t r{(clr16&31)*8U}; + uint8_t b{(clr16&31)*8U}; colors.emplace_back(r,g,b); } } @@ -344,7 +345,7 @@ public: bool OnUserUpdate(float fElapsedTime) override { - //PaletteDisplayTest(); + PaletteDisplayTest(); GraphicsDisplayTest(); return true; } diff --git a/EarthboundBattleBackgrounds/x64/Debug/EarthboundBattleBackgrounds.exe b/EarthboundBattleBackgrounds/x64/Debug/EarthboundBattleBackgrounds.exe index d9aac2f..70569df 100644 Binary files a/EarthboundBattleBackgrounds/x64/Debug/EarthboundBattleBackgrounds.exe and b/EarthboundBattleBackgrounds/x64/Debug/EarthboundBattleBackgrounds.exe differ