diff --git a/EarthboundBattleBackgrounds/EarthboundBattleBackgrounds/main.cpp b/EarthboundBattleBackgrounds/EarthboundBattleBackgrounds/main.cpp index 55c7d33..7820f38 100644 --- a/EarthboundBattleBackgrounds/EarthboundBattleBackgrounds/main.cpp +++ b/EarthboundBattleBackgrounds/EarthboundBattleBackgrounds/main.cpp @@ -60,17 +60,17 @@ struct Rom{ int32_t bpos2{}; while(data[pos]!=0xFF){ if(pos>=data.length())throw std::runtime_error{"Unexpected end of data."}; - char commandType{data[pos]>>5}; - char length{(data[pos]&0x1F)+1}; + int commandType{data[pos]>>5}; + int length{(data[pos]&0x1F)+1}; if(commandType==7){ commandType=(data[pos]&0x1C)>>2; - length=((data[pos]&3)<<8)+(data[pos+1])+1; + length=((int(data[pos])&3)<<8)+int(data[pos+1])+1; ++pos; } if(bpos+length<0)throw std::runtime_error("Length ended up negative."); pos++; if(commandType>=4){ - bpos2=(data[pos]<<8)+data[pos+1]; + bpos2=(int(data[pos])<<8)+int(data[pos+1]); if(bpos2<0)throw std::runtime_error("Reading negative data."); pos+=2; } @@ -127,17 +127,17 @@ struct Rom{ int read{}; while(data[pos]!=0xFF){ if (pos >= data.length())return; - char commandType{data[pos]>>5}; - char len{data[pos]&0x1F+1}; + int commandType{data[pos]>>5}; + int len{data[pos]&0x1F+1}; if(commandType==7){ - commandType=(data[pos]&0x1C)>>2; - len=((data[pos]&3)<<8)+data[pos+1]+1; + commandType=(int(data[pos])&0x1C)>>2; + len=((int(data[pos])&3)<<8)+int(data[pos+1])+1; ++pos; } if(bpos+len>maxLength||bpos+len<0)return; ++pos; if(commandType>=4) { - bpos2=(data[pos]<<8)+data[pos+1]; + bpos2=(int(data[pos])<<8)+data[pos+1]; if(bpos2>=maxLength||bpos2<0)return; pos+=2; } @@ -336,11 +336,16 @@ public: } } + void GraphicsDisplayTest(){ + + } + int yOffset{0}; 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 5897a2c..d9aac2f 100644 Binary files a/EarthboundBattleBackgrounds/x64/Debug/EarthboundBattleBackgrounds.exe and b/EarthboundBattleBackgrounds/x64/Debug/EarthboundBattleBackgrounds.exe differ