diff options
Diffstat (limited to 'sky')
-rw-r--r-- | sky/disk.cpp | 11 | ||||
-rw-r--r-- | sky/rnc_deco.cpp | 3 | ||||
-rw-r--r-- | sky/rnc_deco.h | 1 | ||||
-rw-r--r-- | sky/text.cpp | 19 |
4 files changed, 8 insertions, 26 deletions
diff --git a/sky/disk.cpp b/sky/disk.cpp index 73242da4a2..0b18056c12 100644 --- a/sky/disk.cpp +++ b/sky/disk.cpp @@ -115,10 +115,6 @@ uint8 *Disk::loadFile(uint16 fileNr, uint8 *dest) { } } - #ifdef file_order_chk - warning("File order checking not implemented yet"); - #endif - _compFile = fileNr; debug(2, "load file %d,%d (%d)", (fileNr >> 11), (fileNr & 2047), fileNr); @@ -153,10 +149,6 @@ uint8 *Disk::loadFile(uint16 fileNr, uint8 *dest) { _dataDiskHandle->seek(_fileOffset, SEEK_SET); - #ifdef file_order_chk - warning("File order checking not implemented yet"); - #endif - //now read in the data bytesRead = _dataDiskHandle->read(_fileDest, 1 * _fileSize); @@ -286,8 +278,7 @@ uint8 *Disk::getFileInfo(uint16 fileNr) { dnrTbl16Ptr += 4; } - // if file not found return 0 - return 0; + return 0; //not found } void Disk::fnCacheChip(uint32 list) { diff --git a/sky/rnc_deco.cpp b/sky/rnc_deco.cpp index 03b2a76f79..9523156a7b 100644 --- a/sky/rnc_deco.cpp +++ b/sky/rnc_deco.cpp @@ -75,8 +75,7 @@ uint16 RncDecoder::crcBlock(const uint8 *block, uint32 size) { crc ^= tmp; tmp = (uint8)((crc >> 8) & 0x00FF); crc &= 0x00FF; - crc = crc << 1; - crc = *(uint16 *)&crcTable8[crc]; + crc = *(uint16 *)&crcTable8[crc << 1]; crc ^= tmp; } diff --git a/sky/rnc_deco.h b/sky/rnc_deco.h index 8146dc92af..d5df4ec1cb 100644 --- a/sky/rnc_deco.h +++ b/sky/rnc_deco.h @@ -32,7 +32,6 @@ protected: uint16 _rawTable[64]; uint16 _posTable[64]; uint16 _lenTable[64]; - uint16 _crcTable[256]; uint16 _bitBuffl; diff --git a/sky/text.cpp b/sky/text.cpp index 2782366347..3bbab50a5d 100644 --- a/sky/text.cpp +++ b/sky/text.cpp @@ -463,23 +463,18 @@ displayText_t Text::displayText(char *textPtr, uint8 *dest, bool centre, uint16 do { if (_dtCentre) { - uint32 width = _dtLineWidth; - width -= READ_LE_UINT32(centerTblPtr); + uint32 width = (_dtLineWidth - READ_LE_UINT32(centerTblPtr)) >> 1; centerTblPtr += 4; - width >>=1; curDest += width; } textChar = (uint8)*curPos++; while (textChar >= 0x20) { - textChar -= 0x20; - makeGameCharacter(textChar, _characterSet, curDest, color); + makeGameCharacter(textChar - 0x20, _characterSet, curDest, color); textChar = *curPos++; } - curDest = prevDest; //start of last line - curDest += _dtLineSize; //start of next - prevDest = curDest; + prevDest = curDest = prevDest + _dtLineSize; //start of last line + start of next } while (textChar >= 10); @@ -517,19 +512,17 @@ void Text::makeGameCharacter(uint8 textChar, uint8 *charSetPtr, uint8 *&dest, ui if (dataBit) *curPos = color; else - //black edge - *curPos = 240; + *curPos = 240; //black edge curPos++; } //advance a line - curPos = prevPos; - curPos += _dtLineWidth; + curPos = prevPos + _dtLineWidth; } //update position - dest = startPos + charWidth + _dtCharSpacing*2 - 1; + dest = startPos + charWidth + _dtCharSpacing * 2 - 1; } |