Add opGetGameMode (#200)

This commit is contained in:
Alexander Batalov 2022-12-06 17:46:52 +03:00
parent dc90beb696
commit f056f0e131
1 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,7 @@
#include "art.h" #include "art.h"
#include "combat.h" #include "combat.h"
#include "debug.h" #include "debug.h"
#include "game.h"
#include "interface.h" #include "interface.h"
#include "interpreter.h" #include "interpreter.h"
#include "item.h" #include "item.h"
@ -89,6 +90,12 @@ static void opGetGlobalInt(Program* program)
programStackPushInteger(program, value); programStackPushInteger(program, value);
} }
// get_game_mode
static void opGetGameMode(Program* program)
{
programStackPushInteger(program, GameMode::getCurrentGameMode());
}
// list_begin // list_begin
static void opListBegin(Program* program) static void opListBegin(Program* program)
{ {
@ -260,6 +267,7 @@ void sfallOpcodesInit()
interpreterRegisterOpcode(0x8193, opGetCurrentHand); interpreterRegisterOpcode(0x8193, opGetCurrentHand);
interpreterRegisterOpcode(0x819D, opSetGlobalVar); interpreterRegisterOpcode(0x819D, opSetGlobalVar);
interpreterRegisterOpcode(0x819E, opGetGlobalInt); interpreterRegisterOpcode(0x819E, opGetGlobalInt);
interpreterRegisterOpcode(0x81AF, opGetGameMode);
interpreterRegisterOpcode(0x820D, opListBegin); interpreterRegisterOpcode(0x820D, opListBegin);
interpreterRegisterOpcode(0x820E, opListNext); interpreterRegisterOpcode(0x820E, opListNext);
interpreterRegisterOpcode(0x820F, opListEnd); interpreterRegisterOpcode(0x820F, opListEnd);