DREAMWEB: 'roomname' ported to C++

This commit is contained in:
Bertrand Augereau 2011-11-14 19:49:19 +01:00
parent c2ec285175
commit bc509e9e08
5 changed files with 17 additions and 39 deletions

View File

@ -207,6 +207,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'convicons',
'examineob',
'showwatch',
'roomname',
], skip_output = [
# These functions are processed but not output
'dreamweb',

View File

@ -14550,42 +14550,6 @@ void DreamGenContext::showman() {
showframe();
}
void DreamGenContext::roomname() {
STACK_CHECK;
di = 88;
bx = 18;
al = 53;
dl = 240;
printmessage();
bl = data.byte(kRoomnum);
_cmp(bl, 32);
if (flags.c())
goto notover32;
_sub(bl, 32);
notover32:
bh = 0;
_add(bx, bx);
es = data.word(kRoomdesc);
_add(bx, (0));
ax = es.word(bx);
_add(ax, (0+(38*2)));
si = ax;
data.word(kLinespacing) = 7;
di = 88;
bx = 25;
dl = 120;
_cmp(data.byte(kWatchon), 1);
if (flags.z())
goto gotpl;
dl = 160;
gotpl:
al = 0;
ah = 0;
printdirect();
data.word(kLinespacing) = 10;
usecharset1();
}
void DreamGenContext::usecharset1() {
STACK_CHECK;
ax = data.word(kCharset1);
@ -16856,7 +16820,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_workoutframes: workoutframes(); break;
case addr_middlepanel: middlepanel(); break;
case addr_showman: showman(); break;
case addr_roomname: roomname(); break;
case addr_usecharset1: usecharset1(); break;
case addr_usetempcharset: usetempcharset(); break;
case addr_showexit: showexit(); break;

View File

@ -93,7 +93,6 @@ public:
static const uint16 addr_showexit = 0xca80;
static const uint16 addr_usetempcharset = 0xca7c;
static const uint16 addr_usecharset1 = 0xca78;
static const uint16 addr_roomname = 0xca74;
static const uint16 addr_showman = 0xca6c;
static const uint16 addr_middlepanel = 0xca68;
static const uint16 addr_workoutframes = 0xca54;
@ -1873,7 +1872,7 @@ public:
void clearrest();
//void getreelframeax();
void barwoman();
void roomname();
//void roomname();
void credits();
void madmanrun();
void randomnum1();

View File

@ -1959,5 +1959,19 @@ void DreamGenContext::showwatch() {
}
}
void DreamGenContext::roomname() {
printmessage(88, 18, 53, 240, false);
uint16 textIndex = data.byte(kRoomnum);
if (textIndex >= 32)
textIndex -= 32;
data.word(kLinespacing) = 7;
uint8 maxWidth = (data.byte(kWatchon) == 1) ? 120 : 160;
uint16 descOffset = segRef(data.word(kRoomdesc)).word(kIntextdat + textIndex * 2);
const uint8 *string = segRef(data.word(kRoomdesc)).ptr(kIntext + descOffset, 0);
printdirect(string, 88, 25, maxWidth, false);
data.word(kLinespacing) = 10;
usecharset1();
}
} /*namespace dreamgen */

View File

@ -251,4 +251,5 @@
void convicons();
void examineob(bool examineAgain = true);
void showwatch();
void roomname();