DREAMWEB: 'obpicture' ported to C++

This commit is contained in:
Bertrand Augereau
2011-08-30 03:01:40 +02:00
parent 5bfe1f22d5
commit aefdf240fb
5 changed files with 15 additions and 35 deletions
+1
View File
@@ -167,6 +167,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'addtopeoplelist',
'getexpos',
'paneltomap',
'obpicture',
], skip_output = [
# These functions are processed but not output
'dreamweb',
-33
View File
@@ -4487,38 +4487,6 @@ void DreamGenContext::examicon() {
showframe();
}
void DreamGenContext::obpicture() {
STACK_CHECK;
al = data.byte(kCommand);
ah = data.byte(kObjecttype);
_cmp(ah, 1);
if (flags.z())
return /* (setframe) */;
_cmp(ah, 4);
if (flags.z())
goto exframe;
ds = data.word(kFreeframes);
di = 160;
bx = 68;
cl = al;
_add(al, al);
_add(al, cl);
_inc(al);
ah = 128;
showframe();
return;
exframe:
ds = data.word(kExtras);
di = 160;
bx = 68;
cl = al;
_add(al, al);
_add(al, cl);
_inc(al);
ah = 128;
showframe();
}
void DreamGenContext::describeob() {
STACK_CHECK;
getobtextstart();
@@ -17908,7 +17876,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_openob: openob(); break;
case addr_obicons: obicons(); break;
case addr_examicon: examicon(); break;
case addr_obpicture: obpicture(); break;
case addr_describeob: describeob(); break;
case addr_additionaltext: additionaltext(); break;
case addr_obsthatdothings: obsthatdothings(); break;
+1 -2
View File
@@ -495,7 +495,6 @@ public:
static const uint16 addr_obsthatdothings = 0xc36c;
static const uint16 addr_additionaltext = 0xc368;
static const uint16 addr_describeob = 0xc364;
static const uint16 addr_obpicture = 0xc360;
static const uint16 addr_examicon = 0xc35c;
static const uint16 addr_obicons = 0xc358;
static const uint16 addr_openob = 0xc354;
@@ -1871,7 +1870,7 @@ public:
void settopleft();
void searchforstring();
//void clearsprites();
void obpicture();
//void obpicture();
void selectopenob();
//void widedoor();
void security();
+12
View File
@@ -1643,6 +1643,18 @@ void DreamGenContext::printmessage(uint16 x, uint16 y, uint8 index, uint8 maxWid
printdirect(&string, x, &y, maxWidth, centered);
}
void DreamGenContext::obpicture() {
if (data.byte(kObjecttype) == 1)
return;
Frame *frames;
if (data.byte(kObjecttype) == 4)
frames = (Frame *)segRef(data.word(kExtras)).ptr(0, 0);
else
frames = (Frame *)segRef(data.word(kFreeframes)).ptr(0, 0);
uint8 frame = 3 * data.byte(kCommand) + 1;
showframe(frames, 160, 68, frame, 0x80);
}
bool DreamGenContext::isCD() {
// The original sources has two codepaths depending if the game is 'if cd' or not
// This is a hack to guess which version to use with the assumption that if we have a cd version
+1
View File
@@ -199,4 +199,5 @@
void addtopeoplelist(ReelRoutine *routine);
void getexpos();
void paneltomap();
void obpicture();