Fix some debugging and typo in decompression.
This commit is contained in:
parent
6db778d6a8
commit
5f0a728fd8
@ -128,7 +128,7 @@ struct Rom{
|
|||||||
while(data[pos]!=0xFF){
|
while(data[pos]!=0xFF){
|
||||||
if (pos >= data.length())return;
|
if (pos >= data.length())return;
|
||||||
int commandType{data[pos]>>5};
|
int commandType{data[pos]>>5};
|
||||||
int len{data[pos]&0x1F+1};
|
int len{(data[pos]&0x1F)+1};
|
||||||
if(commandType==7){
|
if(commandType==7){
|
||||||
commandType=(int(data[pos])&0x1C)>>2;
|
commandType=(int(data[pos])&0x1C)>>2;
|
||||||
len=((int(data[pos])&3)<<8)+int(data[pos+1])+1;
|
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];
|
||||||
block[bpos++]=data[pos+1];
|
block[bpos++]=data[pos+1];
|
||||||
}
|
}
|
||||||
|
pos+=2;
|
||||||
}break;
|
}break;
|
||||||
case INCREMENTAL_SEQUENCE:{
|
case INCREMENTAL_SEQUENCE:{
|
||||||
tmp=data[pos++];
|
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)};
|
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))){
|
for(uint8_t i:std::views::iota(0,pow(2,bpp))){
|
||||||
uint16_t clr16{dataBlock.readShort()};
|
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 g{((clr16>>5)&31)*8U};
|
||||||
uint8_t r{(clr16&31)*8U};
|
uint8_t b{(clr16&31)*8U};
|
||||||
colors.emplace_back(r,g,b);
|
colors.emplace_back(r,g,b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,7 +345,7 @@ public:
|
|||||||
|
|
||||||
bool OnUserUpdate(float fElapsedTime) override
|
bool OnUserUpdate(float fElapsedTime) override
|
||||||
{
|
{
|
||||||
//PaletteDisplayTest();
|
PaletteDisplayTest();
|
||||||
GraphicsDisplayTest();
|
GraphicsDisplayTest();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user