Pseudocode decompialtion improvements and docs

This commit is contained in:
MaddoScientisto 2026-03-26 22:10:48 +01:00
commit 589bfc31ef
1898 changed files with 60634 additions and 6597 deletions

View file

@ -0,0 +1,26 @@
function watchns_use() /* entry=273 class_id=0x04C6 slot=0x01 */
{
set_info(0x0207, *(arg_06));
process_exclude();
if (!(Item.getStatus(arg_06) & 0x1000)) {
}
else if (Item.getFrame(arg_06) == 1) {
spawn FREE.slot_21(pid, 0x01A7, 0x00000000);
suspend;
}
else {
ITEM.slot_26((World.getAlertActive() != 1), 4, arg_06);
if (retval == 1) {
/* free_local_string bp_offset=0xFE target=[BP-02h] */
local_02 = "SECURITY OPS^_____________^^CODE RED IN PROGRESS.^UNABLE TO ACCESS CENTRAL SECURITY.";
spawn TEXTFILE.slot_20(pid, local_02, arg_06);
/* free_stack_string value_u8=0x0 target=[SP+00h] */
suspend;
}
else {
spawn WATCHNS.slot_20(arg_06);
}
}
/* free_local_string bp_offset=0xFE target=[BP-02h] */
return;
}

View file

@ -0,0 +1,18 @@
function watchns_equip() /* entry=273 class_id=0x04C6 slot=0x0A */
{
set_info(0x0211, *(arg_06));
process_exclude();
if (!(Item.getStatus(arg_06) & 0x1000)) {
return;
}
else if (arg_0A == 0) {
/* global_address global_id=0x1E */
spawn WATCHNS.slot_21(arg_06);
return;
}
else {
/* global_address global_id=0x1E */
spawn WATCHNS.slot_20(arg_06);
}
return;
}

View file

@ -0,0 +1,83 @@
function watchns_slot_20() /* entry=273 class_id=0x04C6 slot=0x20 */
{
entry:
set_info(0x021B, 0);
local_0A = Item.getQLo(arg_06);
if (Item.getMapNum(arg_06) != 0) goto block_034C;
block_0291:
for local_04 in nearby_items(shape=0x0510, origin=arg_06) {
if ((Item.getQLo(local_04) == local_0A) || (local_0A != 0)) {
if (!Item.getQHi(local_04)) {
TEXTFILE.slot_21(Item.getQHi(local_04), Item.getQLo(local_04), arg_06);
/* free_local_string bp_offset=0xFE target=[BP-02h] */
local_02 = retval;
spawn TEXTFILE.slot_20(pid, local_02, arg_06);
/* free_stack_string value_u8=0x0 target=[SP+00h] */
suspend;
}
}
/* loopnext */
}
block_0307:
spawn TRIGGER.slot_20(pid, 0, *(arg_06), arg_06);
suspend;
spawn WATCHNS.slot_21(pid, arg_06);
suspend;
spawn TRIGGER.slot_20(pid, 1, *(arg_06), arg_06);
suspend;
goto block_0412;
block_034C:
local_0B = 0;
if Item.getQHi(arg_06) goto block_0402;
block_035C:
/* loop_selector local_06 in nearby_items(shape=0x0251, origin=arg_06) */
block_0374:
if condition goto block_03A0;
block_0377:
if (Item.getQLo(local_06) != local_0A) goto block_039C;
block_0386:
VALBOX.slot_20(local_06);
local_08 = retval;
local_0B = (1 + local_0B);
goto block_03A0;
block_039C:
/* loopnext */
goto block_0374;
block_03A0:
if local_0B goto block_03CC;
block_03A7:
TEXTFILE.slot_23(local_08, Item.getQHi(arg_06), Item.getQLo(arg_06), arg_06);
/* free_local_string bp_offset=0xFE target=[BP-02h] */
local_02 = retval;
goto block_03EC;
block_03CC:
TEXTFILE.slot_21(Item.getQHi(arg_06), Item.getQLo(arg_06), arg_06);
/* free_local_string bp_offset=0xFE target=[BP-02h] */
local_02 = retval;
block_03EC:
spawn TEXTFILE.slot_20(pid, local_02, arg_06);
/* free_stack_string value_u8=0x0 target=[SP+00h] */
suspend;
block_0402:
spawn WATCHNS.slot_21(pid, arg_06);
suspend;
block_0412:
/* bit_not */
/* free_local_string bp_offset=0xFE target=[BP-02h] */
return;
}

View file

@ -0,0 +1,71 @@
function watchns_slot_21() /* entry=273 class_id=0x04C6 slot=0x21 */
{
entry:
local_04 = *(arg_06);
set_info(0x021B, 0);
spawn FREE.slot_3B(pid, 60, 0x00000000);
suspend;
local_06 = Camera.getX();
local_08 = Camera.getY();
local_0A = Camera.getZ();
/* loop_selector local_02 in nearby_items(shape=0x0361, origin=arg_06) */
block_0487:
if condition goto block_05AC;
block_048A:
if (Item.getQLo(local_02) != Item.getQLo(arg_06)) goto block_05A8;
block_04A0:
if (Item.getQLo(arg_06) > 0x00F9) goto block_04CB;
block_04B0:
spawn WATCHNS.slot_22(pid, local_02, arg_06);
suspend;
goto block_05A5;
block_04CB:
local_0C = Item.getX(local_02);
local_0E = Item.getY(local_02);
local_10 = Item.getZ(local_02);
/* global_address global_id=0x1E */
spawn FREE.slot_3B(pid, 10, 0x00000000);
suspend;
/* pop_global global_id=0x5 size=0x1 */
spawn FREE.slot_3B(1, pid, 60, 0x00000000);
suspend;
if (Item.getMapNum(local_02) != 0) goto block_0567;
block_0551:
spawn TRIGGER.slot_20(pid, 0, local_02, arg_06);
suspend;
block_0567:
spawn FREE.slot_3B(pid, 120, 0x00000000);
suspend;
block_057E:
if (!Ultima8Engine.moveKeyDownRecently()) goto block_05A1;
block_0587:
spawn FREE.slot_3B(pid, 2, 0x00000000);
suspend;
goto block_057E;
block_05A1:
block_05A5:
goto block_05AC;
block_05A8:
/* loopnext */
goto block_0487;
block_05AC:
/* global_address global_id=0x1E */
spawn FREE.slot_3B(pid, 10, 0x00000000);
suspend;
/* pop_global global_id=0x5 size=0x1 */
return;
}

View file

@ -0,0 +1,46 @@
function watchns_slot_22() /* entry=273 class_id=0x04C6 slot=0x22 */
{
set_info(0x020A, 0);
/* global_address global_id=0x1E */
spawn FREE.slot_3B(pid, 5, 0x00000000);
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x44 */
/* loop current_var=0xFE string_bytes=0xA loop_type=0x2 */
while (!condition) {
/* global_address global_id=0x1E */
if (Actor.getMap() == 14) {
if (!Item.isNpc(local_02)) {
local_03 = 1;
}
else {
ITEM.slot_24(2, local_05);
suspend;
local_03 = 1;
}
}
else if (!Item.isNpc(local_02)) {
if (Item.getQLo(arg_06) == Intrinsic000D(local_02)) {
ITEM.slot_24(2, local_02);
local_03 = 1;
}
}
/* loopnext */
}
/* global_address global_id=0x1E */
spawn FREE.slot_3B(pid, 10, 0x00000000);
suspend;
/* pop_global global_id=0x5 size=0x1 */
if (!local_03) {
while (World.getControlledNPCNum() == 1) {
spawn FREE.slot_3B(pid, 5, 0x00000000);
suspend;
}
return;
}
else {
spawn FREE.slot_3B(pid, 0x00C8, 0x00000000);
suspend;
}
return;
}