aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sky/autoroute.cpp4
-rw-r--r--sky/compacts/75comp.h34
-rw-r--r--sky/control.cpp10
-rw-r--r--sky/control.h2
-rw-r--r--sky/logic.cpp7
-rw-r--r--sky/sky.cpp21
-rw-r--r--sky/sky.h1
7 files changed, 64 insertions, 15 deletions
diff --git a/sky/autoroute.cpp b/sky/autoroute.cpp
index 2663ff3d5b..14230ef89f 100644
--- a/sky/autoroute.cpp
+++ b/sky/autoroute.cpp
@@ -362,11 +362,11 @@ uint16 SkyAutoRoute::autoRoute(Compact *cpt, uint16 **pSaveRoute) {
#endif
// the route is done. if there was an initial x/y movement tag it onto the start
if (initX < 0) {
- saveRoute -= 4;
+ saveRoute -= 2;
saveRoute[1] = RIGHTY;
saveRoute[0] = ((-initX) + 7) & 0xFFF8;
} else if (initX > 0) {
- saveRoute -= 4;
+ saveRoute -= 2;
saveRoute[1] = LEFTY;
saveRoute[0] = (initX + 7) & 0xFFF8;
}
diff --git a/sky/compacts/75comp.h b/sky/compacts/75comp.h
index 62b3b58455..fc2ac0f70e 100644
--- a/sky/compacts/75comp.h
+++ b/sky/compacts/75comp.h
@@ -83,6 +83,38 @@ uint16 sc75_usecard[] = {
0
};
+ExtCompact sc75_console_ext = {
+ 0, // actionSub
+ 0, // actionSub_off
+ 0, // getToSub
+ 0, // getToSub_off
+ 0, // extraSub
+ 0, // extraSub_off
+ 0, // dir
+ 0, // stopScript
+ 0, // miniBump
+ 0, // leaving
+ 0, // atWatch
+ 0, // atWas
+ 0, // alt
+ 0, // request
+ 0, // spWidth_xx
+ 0, // spColour
+ 0, // spTextId
+ 0, // spTime
+ 0, // arAnimIndex
+ 0, // turnProg
+ 0, // waitingFor
+ 0, // arTarget_x
+ 0, // arTarget_y
+ 0, // animScratch
+ 0, // megaSet
+ 0,
+ 0,
+ 0,
+ 0
+};
+
Compact sc75_console = {
L_SCRIPT, // logic
ST_MOUSE+ST_LOGIC+ST_BACKGROUND, // status
@@ -112,7 +144,7 @@ Compact sc75_console = {
C_BASE_MODE, // mode
SC75_CONSOLE_LOGIC, // baseSub
0, // baseSub_off
- 0
+ &sc75_console_ext
};
uint16 sc75_get_tongs[] = {
diff --git a/sky/control.cpp b/sky/control.cpp
index 08b94c31c2..a5c8c0d63d 100644
--- a/sky/control.cpp
+++ b/sky/control.cpp
@@ -176,7 +176,10 @@ void SkyControl::initPanel(void) {
_sprites.slode = _skyDisk->loadFile(60506, NULL);
_sprites.slode2 = _skyDisk->loadFile(60507, NULL);
_sprites.slide2 = _skyDisk->loadFile(60508, NULL);
- _sprites.musicBodge = _skyDisk->loadFile(60509, NULL);
+ if (SkyState::_systemVars.gameVersion < 368)
+ _sprites.musicBodge = NULL;
+ else
+ _sprites.musicBodge = _skyDisk->loadFile(60509, NULL);
//Main control panel: X Y Text OnClick
_controlPanel = createResource(_sprites.controlPanel, 1, 0, 0, 0, 0, DO_NOTHING, MAINPANEL);
@@ -297,7 +300,10 @@ void SkyControl::doControlPanel(void) {
initPanel();
_skyScreen->clearScreen();
- _skyScreen->setPalette(60510);
+ if (SkyState::_systemVars.gameVersion < 368)
+ _skyScreen->setPalette(60509);
+ else
+ _skyScreen->setPalette(60510);
drawMainPanel();
diff --git a/sky/control.h b/sky/control.h
index 474ec8f71c..a4817f7f36 100644
--- a/sky/control.h
+++ b/sky/control.h
@@ -106,7 +106,7 @@ class SkyMouse;
#define SAVE_GRAFX 32
#define SAVE_TURNP 64
-#define SAVE_FILE_REVISION 1
+#define SAVE_FILE_REVISION 2
struct AllocedMem {
uint16 *mem;
diff --git a/sky/logic.cpp b/sky/logic.cpp
index f6c3ebef18..29dfb264f9 100644
--- a/sky/logic.cpp
+++ b/sky/logic.cpp
@@ -1127,7 +1127,7 @@ script:
else
scriptData += READ_LE_UINT16(scriptData + (scriptNo & 0x0fff));
- uint32 a, b, c;
+ uint32 a = 0, b = 0, c = 0;
uint16 command, s;
for (;;) {
@@ -1173,7 +1173,7 @@ script:
scriptData += s/2;
break;
case 6: // pop_var
- _scriptVariables[READ_LE_UINT16(scriptData++)/4] = pop();
+ b = _scriptVariables[READ_LE_UINT16(scriptData++)/4] = pop();
break;
case 7: // minus
a = pop();
@@ -1200,7 +1200,6 @@ script:
case 11: // call_mcode
{
a = READ_LE_UINT16(scriptData++);
- b = c = 0;
assert(a <= 3);
// No, I did not forget the "break"s
switch (a) {
@@ -1232,7 +1231,7 @@ script:
push(0);
break;
case 14: // switch
- s = READ_LE_UINT16(scriptData++); // get number of cases
+ c = s = READ_LE_UINT16(scriptData++); // get number of cases
a = pop(); // and value to switch on
diff --git a/sky/sky.cpp b/sky/sky.cpp
index 9228b66616..a1278a5492 100644
--- a/sky/sky.cpp
+++ b/sky/sky.cpp
@@ -103,25 +103,36 @@ void SkyState::go() {
loadBase0();
+ _paintGrid = false;
+
while (1) {
delay(_systemVars.gameSpeed);
- /*if (_key_pressed == 'g') {
+ if (_key_pressed == 'r') {
warning("loading grid");
_skyLogic->_skyGrid->loadGrids();
_key_pressed = 0;
- }*/
- if ((_key_pressed == 27) || (_key_pressed == 63)) { // 27 = escape, 63 = F5
+ }
+ if (_key_pressed == 'g') {
+ _paintGrid = !_paintGrid;
+ warning("Grid paint: %s",(_paintGrid)?("ON"):("OFF"));
+ if (!_paintGrid)
+ _skyScreen->forceRefresh();
+ _key_pressed = 0;
+ }
+ if (_key_pressed == 63) {
_key_pressed = 0;
_skyControl->doControlPanel();
}
_skyMouse->mouseEngine((uint16)_sdl_mouse_x, (uint16)_sdl_mouse_y);
_skyLogic->engine();
if (!_skyLogic->checkProtection()) { // don't let copy prot. screen flash up
- //_skyScreen->forceRefresh();
+ if (_paintGrid)
+ _skyScreen->forceRefresh();
_skyScreen->recreate();
_skyScreen->spriteEngine();
_skyScreen->flip();
- //_skyScreen->showGrid(_skyLogic->_skyGrid->giveGrid(SkyLogic::_scriptVariables[SCREEN]));
+ if (_paintGrid)
+ _skyScreen->showGrid(_skyLogic->_skyGrid->giveGrid(SkyLogic::_scriptVariables[SCREEN]));
_system->update_screen();
}
}
diff --git a/sky/sky.h b/sky/sky.h
index dc55f9e53b..3778959775 100644
--- a/sky/sky.h
+++ b/sky/sky.h
@@ -66,6 +66,7 @@ protected:
uint16 _debugMode;
uint16 _debugLevel;
+ bool _paintGrid;
int _numScreenUpdates;