DREAMWEB: Move 'readKey' from dreamgen

This commit is contained in:
Willem Jan Palenstijn 2011-12-04 10:01:37 +01:00
parent 98d3a6cc88
commit d4646c335a
3 changed files with 19 additions and 18 deletions

View File

@ -98,6 +98,7 @@ p = parser(skip_binary_data = [
'monitorfile22', 'monitorfile22',
'monitorfile23', 'monitorfile23',
'monitorfile24', 'monitorfile24',
'introtextfile',
]) ])
p.strip_path = 3 p.strip_path = 3
context = p.parse('dreamweb/dreamweb.asm') context = p.parse('dreamweb/dreamweb.asm')
@ -475,6 +476,7 @@ generator = cpp(context, "DreamGen", blacklist = [
], skip_output = [ ], skip_output = [
# These functions are processed but not output # These functions are processed but not output
'dreamweb', 'dreamweb',
'readkey',
], skip_dispatch_call = True, skip_addr_constants = True, ], skip_dispatch_call = True, skip_addr_constants = True,
header_omit_blacklisted = True, header_omit_blacklisted = True,
function_name_remapping = { function_name_remapping = {

View File

@ -11096,24 +11096,6 @@ _tmp1:
multiGet(); multiGet();
} }
void DreamGenContext::readKey() {
STACK_CHECK;
bx = data.word(kBufferout);
_cmp(bx, data.word(kBufferin));
if (flags.z())
goto nokey;
_inc(bx);
_and(bx, 15);
data.word(kBufferout) = bx;
di = offset_keybuffer;
_add(di, bx);
al = cs.byte(di);
data.byte(kCurrentkey) = al;
return;
nokey:
data.byte(kCurrentkey) = 0;
}
void DreamGenContext::getRidOfReels() { void DreamGenContext::getRidOfReels() {
STACK_CHECK; STACK_CHECK;
_cmp(data.byte(kRoomloaded), 0); _cmp(data.byte(kRoomloaded), 0);

View File

@ -3056,6 +3056,23 @@ void DreamGenContext::atmospheres() {
cancelCh0(); cancelCh0();
} }
void DreamGenContext::readKey() {
STACK_CHECK;
bx = data.word(kBufferout);
_cmp(bx, data.word(kBufferin));
if (flags.z())
goto nokey;
_inc(bx);
_and(bx, 15);
data.word(kBufferout) = bx;
di = offset_keybuffer;
_add(di, bx);
al = cs.byte(di);
data.byte(kCurrentkey) = al;
return;
nokey:
data.byte(kCurrentkey) = 0;
}
} /*namespace dreamgen */ } /*namespace dreamgen */