aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/pn.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agos/pn.cpp')
-rw-r--r--engines/agos/pn.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/engines/agos/pn.cpp b/engines/agos/pn.cpp
index d92efa9077..e8135f56cd 100644
--- a/engines/agos/pn.cpp
+++ b/engines/agos/pn.cpp
@@ -35,6 +35,10 @@ namespace AGOS {
AGOSEngine_PN::AGOSEngine_PN(OSystem *system)
: AGOSEngine(system) {
+ _stackbase = 0;
+ _tagOfActiveDoline = 0;
+ _dolineReturnVal = 0;
+
_dataBase = 0;
_dataBaseSize = 0;
_textBase = 0;
@@ -70,7 +74,7 @@ AGOSEngine_PN::AGOSEngine_PN(OSystem *system)
_objects = 0;
_objectCountS = 0;
- _bp = 0;
+ _bp = 0;
_xofs = 0;
_havinit = 0;
_seed = 0;
@@ -84,16 +88,12 @@ AGOSEngine_PN::AGOSEngine_PN(OSystem *system)
_linebase = 0;
_workptr = 0;
-
- _cjmpbuff = NULL;
}
AGOSEngine_PN::~AGOSEngine_PN() {
free(_dataBase);
free(_textBase);
- free(_cjmpbuff);
- free(_stackbase);
}
const byte egaPalette[48] = {
@@ -251,29 +251,33 @@ void AGOSEngine_PN::setupBoxes() {
}
void AGOSEngine_PN::processor() {
- int q;
-
setqptrs();
- q = setjmp(_loadfail);
- _variableArray[6] = 0;
+ _tagOfActiveDoline = 0;
+ int q = 0;
+ do {
+ assert(_tagOfActiveDoline == 0);
+ _dolineReturnVal = 0;
- if (getPlatform() == Common::kPlatformAtariST) {
- _variableArray[21] = 2;
- } else if (getPlatform() == Common::kPlatformAmiga) {
- _variableArray[21] = 0;
- } else {
- _variableArray[21] = 1;
- }
+ _variableArray[6] = 0;
+
+ if (getPlatform() == Common::kPlatformAtariST) {
+ _variableArray[21] = 2;
+ } else if (getPlatform() == Common::kPlatformAmiga) {
+ _variableArray[21] = 0;
+ } else {
+ _variableArray[21] = 1;
+ }
- _variableArray[16] = _quickshort[6];
- _variableArray[17] = _quickshort[7];
- _variableArray[19] = getptr(55L);
+ _variableArray[16] = _quickshort[6];
+ _variableArray[17] = _quickshort[7];
+ _variableArray[19] = getptr(55L);
- // q indicates the process to run and is 0 the first time,
- // but 1 later on (i.e., when we are "called" from badload()).
- setposition(q, 0);
- doline(0);
+ // q indicates the process to run and is 0 the first time,
+ // but 1 later on (i.e., when we are "called" from badload()).
+ setposition(0, 0);
+ q = doline(0);
+ } while (q);
}
void AGOSEngine_PN::setqptrs() {