SCI: Fix warnings
This commit is contained in:
parent
105fb47c89
commit
76f3f1b136
3 changed files with 11 additions and 16 deletions
|
@ -2630,11 +2630,11 @@ bool Console::cmdViewReference(int argc, const char **argv) {
|
||||||
#endif
|
#endif
|
||||||
default: {
|
default: {
|
||||||
const SegmentRef block = _engine->_gamestate->_segMan->dereference(reg);
|
const SegmentRef block = _engine->_gamestate->_segMan->dereference(reg);
|
||||||
uint32 size = block.maxSize;
|
uint16 size = block.maxSize;
|
||||||
|
|
||||||
DebugPrintf("raw data\n");
|
DebugPrintf("raw data\n");
|
||||||
|
|
||||||
if (reg_end.getSegment() != 0 && size < reg_end.getOffset() - reg.getOffset()) {
|
if (reg_end.getSegment() != 0 && (size < reg_end.getOffset() - reg.getOffset())) {
|
||||||
DebugPrintf("Block end out of bounds (size %d). Resetting.\n", size);
|
DebugPrintf("Block end out of bounds (size %d). Resetting.\n", size);
|
||||||
reg_end = NULL_REG;
|
reg_end = NULL_REG;
|
||||||
}
|
}
|
||||||
|
@ -2936,7 +2936,7 @@ bool Console::cmdDisassembleAddress(int argc, const char **argv) {
|
||||||
uint opCount = 1;
|
uint opCount = 1;
|
||||||
bool printBWTag = false;
|
bool printBWTag = false;
|
||||||
bool printBytes = false;
|
bool printBytes = false;
|
||||||
uint32 size;
|
uint16 size;
|
||||||
|
|
||||||
if (parse_reg_t(_engine->_gamestate, argv[1], &vpc, false)) {
|
if (parse_reg_t(_engine->_gamestate, argv[1], &vpc, false)) {
|
||||||
DebugPrintf("Invalid address passed.\n");
|
DebugPrintf("Invalid address passed.\n");
|
||||||
|
@ -2960,11 +2960,6 @@ bool Console::cmdDisassembleAddress(int argc, const char **argv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opCount < 0) {
|
|
||||||
DebugPrintf("Invalid op_count\n");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
vpc = disassemble(_engine->_gamestate, vpc, printBWTag, printBytes);
|
vpc = disassemble(_engine->_gamestate, vpc, printBWTag, printBytes);
|
||||||
} while ((vpc.getOffset() > 0) && (vpc.getOffset() + 6 < size) && (--opCount));
|
} while ((vpc.getOffset() > 0) && (vpc.getOffset() + 6 < size) && (--opCount));
|
||||||
|
|
|
@ -96,7 +96,7 @@ reg_t kStrAt(EngineState *s, int argc, reg_t *argv) {
|
||||||
|
|
||||||
byte value;
|
byte value;
|
||||||
byte newvalue = 0;
|
byte newvalue = 0;
|
||||||
unsigned int offset = argv[1].toUint16();
|
uint16 offset = argv[1].toUint16();
|
||||||
if (argc > 2)
|
if (argc > 2)
|
||||||
newvalue = argv[2].toSint16();
|
newvalue = argv[2].toSint16();
|
||||||
|
|
||||||
|
@ -125,19 +125,19 @@ reg_t kStrAt(EngineState *s, int argc, reg_t *argv) {
|
||||||
if (!oddOffset) {
|
if (!oddOffset) {
|
||||||
value = tmp.getOffset() & 0x00ff;
|
value = tmp.getOffset() & 0x00ff;
|
||||||
if (argc > 2) { /* Request to modify this char */
|
if (argc > 2) { /* Request to modify this char */
|
||||||
uint16 offset = tmp.toUint16();
|
uint16 tmpOffset = tmp.toUint16();
|
||||||
offset &= 0xff00;
|
offset &= 0xff00;
|
||||||
offset |= newvalue;
|
offset |= newvalue;
|
||||||
tmp.setOffset(offset);
|
tmp.setOffset(tmpOffset);
|
||||||
tmp.setSegment(0);
|
tmp.setSegment(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = tmp.getOffset() >> 8;
|
value = tmp.getOffset() >> 8;
|
||||||
if (argc > 2) { /* Request to modify this char */
|
if (argc > 2) { /* Request to modify this char */
|
||||||
uint16 offset = tmp.toUint16();
|
uint16 tmpOffset = tmp.toUint16();
|
||||||
offset &= 0x00ff;
|
offset &= 0x00ff;
|
||||||
offset |= newvalue << 8;
|
offset |= newvalue << 8;
|
||||||
tmp.setOffset(offset);
|
tmp.setOffset(tmpOffset);
|
||||||
tmp.setSegment(0);
|
tmp.setSegment(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -344,11 +344,11 @@ void SciEngine::scriptDebug() {
|
||||||
if (mobj) {
|
if (mobj) {
|
||||||
Script *scr = (Script *)mobj;
|
Script *scr = (Script *)mobj;
|
||||||
const byte *code_buf = scr->getBuf();
|
const byte *code_buf = scr->getBuf();
|
||||||
uint32 code_buf_size = scr->getBufSize();
|
uint16 code_buf_size = scr->getBufSize(); // TODO: change to a 32-bit integer for large SCI3 scripts
|
||||||
int opcode = pc.getOffset() >= code_buf_size ? 0 : code_buf[pc.getOffset()];
|
int opcode = pc.getOffset() >= code_buf_size ? 0 : code_buf[pc.getOffset()];
|
||||||
int op = opcode >> 1;
|
int op = opcode >> 1;
|
||||||
int paramb1 = pc.getOffset() + 1 >= code_buf_size ? 0 : code_buf[pc.getOffset() + 1];
|
uint16 paramb1 = pc.getOffset() + 1 >= code_buf_size ? 0 : code_buf[pc.getOffset() + 1];
|
||||||
int paramf1 = (opcode & 1) ? paramb1 : (pc.getOffset() + 2 >= code_buf_size ? 0 : (int16)READ_SCI11ENDIAN_UINT16(code_buf + pc.getOffset() + 1));
|
uint16 paramf1 = (opcode & 1) ? paramb1 : (pc.getOffset() + 2 >= code_buf_size ? 0 : (int16)READ_SCI11ENDIAN_UINT16(code_buf + pc.getOffset() + 1));
|
||||||
|
|
||||||
switch (_debugState.seeking) {
|
switch (_debugState.seeking) {
|
||||||
case kDebugSeekSpecialCallk:
|
case kDebugSeekSpecialCallk:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue