mirror of
https://github.com/alexbatalov/fallout2-ce.git
synced 2024-09-04 05:49:11 +00:00
Add worldmap opcodes
This commit is contained in:
parent
0bb07dbd50
commit
9b02f600de
@ -14,6 +14,7 @@
|
||||
#include "sfall_lists.h"
|
||||
#include "stat.h"
|
||||
#include "svga.h"
|
||||
#include "worldmap.h"
|
||||
|
||||
namespace fallout {
|
||||
|
||||
@ -79,6 +80,20 @@ static void opGetPcBonusStat(Program* program)
|
||||
programStackPushInteger(program, value);
|
||||
}
|
||||
|
||||
// in_world_map
|
||||
static void op_in_world_map(Program* program)
|
||||
{
|
||||
programStackPushInteger(program, GameMode::isInGameMode(GameMode::kWorldmap) ? 1 : 0);
|
||||
}
|
||||
|
||||
// set_world_map_pos
|
||||
static void op_set_world_map_pos(Program* program)
|
||||
{
|
||||
int y = programStackPopInteger(program);
|
||||
int x = programStackPopInteger(program);
|
||||
wmSetPartyWorldPos(x, y);
|
||||
}
|
||||
|
||||
// active_hand
|
||||
static void opGetCurrentHand(Program* program)
|
||||
{
|
||||
@ -121,6 +136,13 @@ static void opGetGameMode(Program* program)
|
||||
programStackPushInteger(program, GameMode::getCurrentGameMode());
|
||||
}
|
||||
|
||||
// set_car_current_town
|
||||
static void op_set_car_current_town(Program* program)
|
||||
{
|
||||
int area = programStackPopInteger(program);
|
||||
wmCarSetCurrentArea(area);
|
||||
}
|
||||
|
||||
// list_begin
|
||||
static void opListBegin(Program* program)
|
||||
{
|
||||
@ -333,10 +355,13 @@ void sfallOpcodesInit()
|
||||
interpreterRegisterOpcode(0x815B, opSetPcBonusStat);
|
||||
interpreterRegisterOpcode(0x815C, op_get_pc_base_stat);
|
||||
interpreterRegisterOpcode(0x815D, opGetPcBonusStat);
|
||||
interpreterRegisterOpcode(0x8170, op_in_world_map);
|
||||
interpreterRegisterOpcode(0x8172, op_set_world_map_pos);
|
||||
interpreterRegisterOpcode(0x8193, opGetCurrentHand);
|
||||
interpreterRegisterOpcode(0x819D, opSetGlobalVar);
|
||||
interpreterRegisterOpcode(0x819E, opGetGlobalInt);
|
||||
interpreterRegisterOpcode(0x81AF, opGetGameMode);
|
||||
interpreterRegisterOpcode(0x81B6, op_set_car_current_town);
|
||||
interpreterRegisterOpcode(0x820D, opListBegin);
|
||||
interpreterRegisterOpcode(0x820E, opListNext);
|
||||
interpreterRegisterOpcode(0x820F, opListEnd);
|
||||
|
@ -6592,4 +6592,15 @@ void wmBlinkRndEncounterIcon(bool special)
|
||||
wmGenData.encounterIconIsVisible = false;
|
||||
}
|
||||
|
||||
void wmSetPartyWorldPos(int x, int y)
|
||||
{
|
||||
wmGenData.worldPosX = x;
|
||||
wmGenData.worldPosY = y;
|
||||
}
|
||||
|
||||
void wmCarSetCurrentArea(int area)
|
||||
{
|
||||
wmGenData.currentCarAreaId = area;
|
||||
}
|
||||
|
||||
} // namespace fallout
|
||||
|
@ -277,6 +277,9 @@ int wmSetMapMusic(int mapIdx, const char* name);
|
||||
int wmMatchAreaContainingMapIdx(int mapIdx, int* areaIdxPtr);
|
||||
int wmTeleportToArea(int areaIdx);
|
||||
|
||||
void wmSetPartyWorldPos(int x, int y);
|
||||
void wmCarSetCurrentArea(int area);
|
||||
|
||||
} // namespace fallout
|
||||
|
||||
#endif /* WORLD_MAP_H */
|
||||
|
Loading…
Reference in New Issue
Block a user