Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
script_list.c File Reference

Go to the source code of this file.

Functions

s32 evt_execute_next_command (Evt *script)
 
void sort_scripts (void)
 
void find_script_labels (Evt *script)
 
void clear_script_list (void)
 
void init_script_list (void)
 
void suspend_frozen_scripts (Evt *script)
 
Evtstart_script (EvtScript *source, s32 priority, s32 flags)
 
Evtstart_script_in_group (EvtScript *source, u8 priority, u8 flags, u8 groupFlags)
 
Evtstart_child_script (Evt *parentScript, EvtScript *source, s32 flags)
 
Evtfunc_802C39F8 (Evt *parentScript, Bytecode *nextLine, s32 newState)
 
Evtfunc_802C3C10 (Evt *script, Bytecode *line, s32 arg2)
 
Evtrestart_script (Evt *script)
 
void update_scripts (void)
 
void func_802C3EE4 (void)
 
void kill_script (Evt *instanceToKill)
 
void kill_script_by_ID (s32 id)
 
void kill_all_scripts (void)
 
s32 does_script_exist (s32 id)
 
s32 does_script_exist_by_ref (Evt *script)
 
void set_script_priority (Evt *script, s32 priority)
 
void set_script_timescale (Evt *script, f32 timescale)
 
void set_global_timespace (f32 timeScale)
 
f32 get_global_timespace (void)
 
void set_script_group (Evt *script, s32 groupFlags)
 
Triggerbind_trigger (EvtScript *script, s32 flags, s32 triggerFlagIndex, s32 triggerVar0, s32 triggerVar1, s32 priority, s32 arg6)
 
Triggerbind_trigger_1 (EvtScript *script, s32 flags, s32 triggerFlagIndex, s32 triggerVar0, s32 triggerVar1, s32 priority)
 
void suspend_group_script (Evt *script, s32 groupFlags)
 
void resume_group_script (Evt *script, s32 groupFlags)
 
s32 suspend_all_script (s32 id)
 
s32 resume_all_script (s32 id)
 
void suspend_group_script_index (s32 id, s32 groupFlags)
 
void resume_group_script_index (s32 id, s32 groupFlags)
 
void suspend_all_group (s32 groupFlags)
 
s32 resume_all_group (s32 groupFlags)
 
void suspend_group_others (Evt *script, s32 groupFlags)
 
void resume_group_others (Evt *script, s32 groupFlags)
 
Evtget_script_by_index (s32 index)
 
Evtget_script_by_id (s32 id)
 
void set_script_flags (Evt *script, s32 flags)
 
void clear_script_flags (Evt *script, s32 flags)
 

Variables

s32 UniqueScriptCounter = 1
 
s32 IsUpdatingScripts = FALSE
 
f32 GlobalTimeRate = 1.0f
 
BSS u32 * gMapFlags
 
BSS s32 * gMapVars
 
BSS s32 gNumScripts
 
BSS ScriptList gWorldScriptList
 
BSS ScriptList gBattleScriptList
 
BSS ScriptListgCurrentScriptListPtr
 
BSS s32 gScriptIndexList [MAX_SCRIPTS]
 
BSS s32 gScriptIdList [MAX_SCRIPTS]
 
BSS s32 gScriptListCount
 
BSS char evtDebugPrintBuffer [0x100]
 
BSS struct LavaResetgLavaResetList
 
BSS s32 LastSafeFloor
 
BSS AnimatedModelList gBattleMeshAnimationList
 
BSS AnimatedModelList gWorldMeshAnimationList
 
BSS AnimatedModelListgCurrentMeshAnimationListPtr
 
BSS s32 wExtraPartnerID
 
BSS s32 wExtraPartnerNpcID
 
BSS s32 ShowMessageScreenOffsetX
 
BSS s32 ShowMessageScreenOffsetY
 
BSS MessagePrintStategCurrentPrintContext
 
BSS MessagePrintStateD_802DB268
 
BSS s32 D_802DB264
 
BSS Npc playerNpcData
 
BSS u16 PlayerImgFXFlags
 
BSS VirtualEntityList bBattleVirtualEntityList
 
BSS VirtualEntityList wWorldVirtualEntityList
 
BSS VirtualEntityListgCurrentVirtualEntityListPtr
 
BSS MusicEventMusicEventList
 
BSS EvtRunningMusicEvents [10]
 
BSS s32 RunningMusicEventIDs [10]
 
BSS PopupMenu gItemChoicePopupMenu
 
BSS u32 gWorldMapFlags [MAX_MAPFLAGS]
 
BSS u32 gBattleMapFlags [MAX_MAPFLAGS]
 
BSS u32 gWorldMapVars [MAX_MAPVARS]
 
BSS u32 gBattleMapVars [MAX_MAPVARS]
 
BSS PushBlockGridwPushBlockGrids [8]
 
BSS s32 DoorModelsSwingCW [3]
 
BSS s32 DoorModelsSwingCCW [3]
 

Function Documentation

◆ evt_execute_next_command()

s32 evt_execute_next_command ( Evt * script)

Definition at line 1351 of file evt.c.

1351 {
1352 s32 commandsExecuted = 0;
1353
1354 while (TRUE) {
1355 s32 status = ApiStatus_DONE2;
1356 s32* lines;
1357 s32 nargs;
1358
1359 commandsExecuted++;
1360 ASSERT_MSG(commandsExecuted < 10000, "Script %x is blocking for ages (infinite loop?)", script->ptrFirstLine);
1361
1362 switch (script->curOpcode) {
1364 script->ptrCurLine = script->ptrNextLine;
1365 lines = script->ptrNextLine;
1366 script->curOpcode = *lines++;
1367 nargs = *lines++;
1368 script->ptrReadPos = lines;
1369 script->blocked = FALSE;
1370 script->curArgc = nargs;
1371 lines = &lines[nargs];
1372 script->ptrNextLine = lines;
1373 status = ApiStatus_REPEAT;
1374 break;
1375 case EVT_OP_RETURN:
1376 status = evt_handle_return(script);
1377 break;
1378 case EVT_OP_LABEL:
1379 status = evt_handle_label(script);
1380 break;
1381 case EVT_OP_GOTO:
1382 status = evt_handle_goto(script);
1383 break;
1384 case EVT_OP_LOOP:
1385 status = evt_handle_loop(script);
1386 break;
1387 case EVT_OP_END_LOOP:
1388 status = evt_handle_end_loop(script);
1389 break;
1390 case EVT_OP_BREAK_LOOP:
1391 status = evt_handle_break_loop(script);
1392 break;
1393 case EVT_OP_WAIT_FRAMES:
1394 status = evt_handle_wait(script);
1395 break;
1396 case EVT_OP_WAIT_SECS:
1397 status = evt_handle_wait_seconds(script);
1398 break;
1399 case EVT_OP_IF_EQ:
1400 status = evt_handle_if_equal(script);
1401 break;
1402 case EVT_OP_IF_NE:
1403 status = evt_handle_if_not_equal(script);
1404 break;
1405 case EVT_OP_IF_LT:
1406 status = evt_handle_if_less(script);
1407 break;
1408 case EVT_OP_IF_GT:
1409 status = evt_handle_if_greater(script);
1410 break;
1411 case EVT_OP_IF_LE:
1412 status = evt_handle_if_less_equal(script);
1413 break;
1414 case EVT_OP_IF_GE:
1415 status = evt_handle_if_greater_equal(script);
1416 break;
1417 case EVT_OP_IF_FLAG:
1418 status = evt_handle_if_AND(script);
1419 break;
1420 case EVT_OP_IF_NOT_FLAG:
1421 status = evt_handle_if_not_AND(script);
1422 break;
1423 case EVT_OP_ELSE:
1424 status = evt_handle_else(script);
1425 break;
1426 case EVT_OP_END_IF:
1427 status = evt_handle_end_if(script);
1428 break;
1429 case EVT_OP_SWITCH:
1430 status = evt_handle_switch(script);
1431 break;
1433 status = evt_handle_switch_const(script);
1434 break;
1435 case EVT_OP_CASE_EQ:
1436 status = evt_handle_case_equal(script);
1437 break;
1438 case EVT_OP_CASE_NE:
1439 status = evt_handle_case_not_equal(script);
1440 break;
1441 case EVT_OP_CASE_LT:
1442 status = evt_handle_case_less(script);
1443 break;
1444 case EVT_OP_CASE_LE:
1445 status = evt_handle_case_less_equal(script);
1446 break;
1447 case EVT_OP_CASE_GT:
1448 status = evt_handle_case_greater(script);
1449 break;
1450 case EVT_OP_CASE_GE:
1451 status = evt_handle_case_greater_equal(script);
1452 break;
1454 status = evt_handle_case_default(script);
1455 break;
1457 status = evt_handle_break_case(script);
1458 break;
1459 case EVT_OP_CASE_OR_EQ:
1460 status = evt_handle_case_equal_OR(script);
1461 break;
1463 status = evt_handle_end_case_group(script);
1464 break;
1465 case EVT_OP_CASE_AND_EQ:
1466 status = evt_handle_case_equal_AND(script);
1467 break;
1468 case EVT_OP_CASE_FLAG:
1469 status = evt_handle_case_AND(script);
1470 break;
1471 case EVT_OP_CASE_RANGE:
1472 status = evt_handle_case_range(script);
1473 break;
1474 case EVT_OP_END_SWITCH:
1475 status = evt_handle_end_switch(script);
1476 break;
1477 case EVT_OP_SET:
1478 status = evt_handle_set_var(script);
1479 break;
1480 case EVT_OP_SET_CONST:
1481 status = evt_handle_set_const(script);
1482 break;
1483 case EVT_OP_SETF:
1484 status = evt_handle_set_float(script);
1485 break;
1486 case EVT_OP_ADD:
1487 status = evt_handle_add(script);
1488 break;
1489 case EVT_OP_SUB:
1490 status = evt_handle_subtract(script);
1491 break;
1492 case EVT_OP_MUL:
1493 status = evt_handle_multiply(script);
1494 break;
1495 case EVT_OP_DIV:
1496 status = evt_handle_divide(script);
1497 break;
1498 case EVT_OP_MOD:
1499 status = evt_handle_mod(script);
1500 break;
1501 case EVT_OP_ADDF:
1502 status = evt_handle_addF(script);
1503 break;
1504 case EVT_OP_SUBF:
1505 status = evt_handle_subtractF(script);
1506 break;
1507 case EVT_OP_MULF:
1508 status = evt_handle_multiplyF(script);
1509 break;
1510 case EVT_OP_DIVF:
1511 status = evt_handle_divideF(script);
1512 break;
1513 case EVT_OP_USE_BUF:
1514 status = evt_handle_set_int_buffer_ptr(script);
1515 break;
1516 case EVT_OP_BUF_READ1:
1517 status = evt_handle_get_1_word(script);
1518 break;
1519 case EVT_OP_BUF_READ2:
1520 status = evt_handle_get_2_word(script);
1521 break;
1522 case EVT_OP_BUF_READ3:
1523 status = evt_handle_get_3_word(script);
1524 break;
1525 case EVT_OP_BUF_READ4:
1526 status = evt_handle_get_4_word(script);
1527 break;
1528 case EVT_OP_BUF_PEEK:
1529 status = evt_handle_get_Nth_word(script);
1530 break;
1531 case EVT_OP_USE_FBUF:
1532 status = evt_handle_set_float_buffer_ptr(script);
1533 break;
1534 case EVT_OP_FBUF_READ1:
1535 status = evt_handle_get_1_float(script);
1536 break;
1537 case EVT_OP_FBUF_READ2:
1538 status = evt_handle_get_2_float(script);
1539 break;
1540 case EVT_OP_FBUF_READ3:
1541 status = evt_handle_get_3_float(script);
1542 break;
1543 case EVT_OP_FBUF_READ4:
1544 status = evt_handle_get_4_float(script);
1545 break;
1546 case EVT_OP_FBUF_PEEK:
1547 status = evt_handle_get_Nth_float(script);
1548 break;
1549 case EVT_OP_USE_ARRAY:
1550 status = evt_handle_set_array(script);
1551 break;
1552 case EVT_OP_USE_FLAGS:
1553 status = evt_handle_set_flag_array(script);
1554 break;
1556 status = evt_handle_allocate_array(script);
1557 break;
1558 case EVT_OP_KILL_THREAD:
1559 status = evt_handle_kill(script);
1560 break;
1561 case EVT_OP_BITWISE_AND:
1562 status = evt_handle_AND(script);
1563 break;
1565 status = evt_handle_AND_const(script);
1566 break;
1567 case EVT_OP_BITWISE_OR:
1568 status = evt_handle_OR(script);
1569 break;
1571 status = evt_handle_OR_const(script);
1572 break;
1573 case EVT_OP_CALL:
1574 status = evt_handle_call(script);
1575 break;
1576 case EVT_OP_EXEC:
1577 status = evt_handle_exec1(script);
1578 break;
1580 status = evt_handle_exec1_get_id(script);
1581 break;
1582 case EVT_OP_EXEC_WAIT:
1583 status = evt_handle_exec_wait(script);
1584 break;
1586 status = evt_handle_bind(script);
1587 break;
1588 case EVT_OP_UNBIND:
1589 status = evt_handle_unbind(script);
1590 break;
1592 status = evt_handle_set_priority(script);
1593 break;
1595 status = evt_handle_set_timescale(script);
1596 break;
1597 case EVT_OP_SET_GROUP:
1598 status = evt_handle_set_group(script);
1599 break;
1600 case EVT_OP_JUMP:
1601 status = evt_handle_jump(script);
1602 break;
1604 status = evt_handle_bind_lock(script);
1605 break;
1607 status = evt_handle_suspend_all(script);
1608 break;
1610 status = evt_handle_resume_all(script);
1611 break;
1613 status = evt_handle_suspend_others(script);
1614 break;
1616 status = evt_handle_resume_others(script);
1617 break;
1619 status = evt_handle_suspend(script);
1620 break;
1622 status = evt_handle_resume(script);
1623 break;
1625 status = evt_handle_does_script_exist(script);
1626 break;
1627 case EVT_OP_THREAD:
1628 status = evt_handle_thread(script);
1629 break;
1630 case EVT_OP_END_THREAD:
1631 status = evt_handle_end_thread(script);
1632 break;
1634 status = evt_handle_child_thread(script);
1635 break;
1637 status = evt_handle_end_child_thread(script);
1638 break;
1639 case EVT_OP_DEBUG_LOG:
1640 status = evt_handle_debug_log(script);
1641 break;
1643 status = evt_handle_print_debug_var(script);
1644 break;
1645 case EVT_OP_92:
1646 status = func_802C739C(script);
1647 break;
1648 case EVT_OP_93:
1649 status = func_802C73B0(script);
1650 break;
1651 case EVT_OP_94:
1652 status = func_802C73B8(script);
1653 case EVT_OP_END:
1654 break;
1655 default:
1656 PANIC();
1657 }
1658
1659 if (status == ApiStatus_REPEAT) {
1660 continue;
1661 }
1662
1663 if (status == ApiStatus_FINISH) {
1664 return EVT_CMD_RESULT_YIELD;
1665 }
1666
1667 if (status < 0) {
1668 return EVT_CMD_RESULT_ERROR;
1669 }
1670
1671 // TODO: this may be able to be a switch but I couldn't get it
1672 if (status == ApiStatus_BLOCK) {
1673 // return 0
1674 } else if (status == ApiStatus_DONE1) {
1676 // return 0
1677 } else if (status == ApiStatus_DONE2) {
1680 continue;
1681 }
1682 // return 0
1683 } else {
1684 continue;
1685 }
1687 }
1688}
Bytecode * ptrNextLine
u8 curOpcode
Bytecode * ptrReadPos
Bytecode * ptrCurLine
Bytecode * ptrFirstLine
@ DEBUG_SCRIPTS_BLOCK_FUNC_DONE
Definition enums.h:4277
ApiStatus func_802C739C(Evt *script)
Definition evt.c:1331
ApiStatus evt_handle_OR(Evt *script)
Definition evt.c:866
ApiStatus func_802C73B0(Evt *script)
Definition evt.c:1336
ApiStatus evt_handle_set_int_buffer_ptr(Evt *script)
Definition evt.c:676
ApiStatus evt_handle_break_loop(Evt *script)
Definition evt.c:88
ApiStatus evt_handle_AND(Evt *script)
Definition evt.c:846
ApiStatus evt_handle_set_float(Evt *script)
Definition evt.c:560
ApiStatus evt_handle_switch_const(Evt *script)
Definition evt.c:243
ApiStatus evt_handle_call(Evt *script)
Definition evt.c:886
ApiStatus evt_handle_case_greater(Evt *script)
Definition evt.c:348
ApiStatus evt_handle_end_thread(Evt *script)
Definition evt.c:1190
ApiStatus evt_handle_case_equal_OR(Evt *script)
Definition evt.c:460
ApiStatus evt_handle_get_3_word(Evt *script)
Definition evt.c:713
ApiStatus evt_handle_divideF(Evt *script)
Definition evt.c:664
ApiStatus evt_handle_multiply(Evt *script)
Definition evt.c:592
ApiStatus evt_handle_switch(Evt *script)
Definition evt.c:230
ApiStatus evt_handle_AND_const(Evt *script)
Definition evt.c:856
ApiStatus evt_handle_break_case(Evt *script)
Definition evt.c:530
ApiStatus evt_handle_jump(Evt *script)
Definition evt.c:974
ApiStatus evt_handle_suspend_all(Evt *script)
Definition evt.c:1071
ApiStatus evt_handle_case_less(Evt *script)
Definition evt.c:302
ApiStatus evt_handle_set_timescale(Evt *script)
Definition evt.c:1061
ApiStatus evt_handle_set_const(Evt *script)
Definition evt.c:555
ApiStatus evt_handle_subtract(Evt *script)
Definition evt.c:580
ApiStatus evt_handle_if_greater(Evt *script)
Definition evt.c:163
ApiStatus evt_handle_exec_wait(Evt *script)
Definition evt.c:965
ApiStatus evt_handle_set_array(Evt *script)
Definition evt.c:826
ApiStatus evt_handle_if_less(Evt *script)
Definition evt.c:151
ApiStatus evt_handle_case_default(Evt *script)
Definition evt.c:420
ApiStatus evt_handle_exec1(Evt *script)
Definition evt.c:911
ApiStatus evt_handle_add(Evt *script)
Definition evt.c:568
ApiStatus evt_handle_loop(Evt *script)
Definition evt.c:45
ApiStatus evt_handle_return(Evt *script)
Definition evt.c:31
ApiStatus evt_handle_mod(Evt *script)
Definition evt.c:616
ApiStatus evt_handle_thread(Evt *script)
Definition evt.c:1157
ApiStatus evt_handle_case_equal_AND(Evt *script)
Definition evt.c:485
ApiStatus evt_handle_case_range(Evt *script)
Definition evt.c:394
ApiStatus evt_handle_goto(Evt *script)
Definition evt.c:40
ApiStatus evt_handle_OR_const(Evt *script)
Definition evt.c:876
ApiStatus evt_handle_bind(Evt *script)
Definition evt.c:1009
ApiStatus evt_handle_print_debug_var(Evt *script)
Definition evt.c:1232
ApiStatus evt_handle_set_var(Evt *script)
Definition evt.c:547
ApiStatus evt_handle_get_4_word(Evt *script)
Definition evt.c:729
ApiStatus evt_handle_unbind(Evt *script)
Definition evt.c:1046
ApiStatus evt_handle_bind_lock(Evt *script)
Definition evt.c:1127
ApiStatus evt_handle_if_not_equal(Evt *script)
Definition evt.c:139
ApiStatus evt_handle_get_1_float(Evt *script)
Definition evt.c:758
ApiStatus evt_handle_if_less_equal(Evt *script)
Definition evt.c:175
ApiStatus evt_handle_end_loop(Evt *script)
Definition evt.c:58
ApiStatus evt_handle_debug_log(Evt *script)
Definition evt.c:1225
ApiStatus func_802C73B8(Evt *script)
Definition evt.c:1340
ApiStatus evt_handle_get_Nth_word(Evt *script)
Definition evt.c:748
ApiStatus evt_handle_exec1_get_id(Evt *script)
Definition evt.c:937
ApiStatus evt_handle_case_AND(Evt *script)
Definition evt.c:435
ApiStatus evt_handle_subtractF(Evt *script)
Definition evt.c:640
ApiStatus evt_handle_set_flag_array(Evt *script)
Definition evt.c:831
ApiStatus evt_handle_set_float_buffer_ptr(Evt *script)
Definition evt.c:683
ApiStatus evt_handle_end_child_thread(Evt *script)
Definition evt.c:1220
ApiStatus evt_handle_end_case_group(Evt *script)
Definition evt.c:513
ApiStatus evt_handle_get_Nth_float(Evt *script)
Definition evt.c:816
ApiStatus evt_handle_addF(Evt *script)
Definition evt.c:628
ApiStatus evt_handle_get_1_word(Evt *script)
Definition evt.c:690
ApiStatus evt_handle_set_priority(Evt *script)
Definition evt.c:1056
ApiStatus evt_handle_suspend(Evt *script)
Definition evt.c:1091
ApiStatus evt_handle_get_2_float(Evt *script)
Definition evt.c:768
ApiStatus evt_handle_case_less_equal(Evt *script)
Definition evt.c:325
ApiStatus evt_handle_get_2_word(Evt *script)
Definition evt.c:700
ApiStatus evt_handle_end_switch(Evt *script)
Definition evt.c:536
ApiStatus evt_handle_if_greater_equal(Evt *script)
Definition evt.c:187
ApiStatus evt_handle_resume_all(Evt *script)
Definition evt.c:1076
ApiStatus evt_handle_if_equal(Evt *script)
Definition evt.c:127
ApiStatus evt_handle_child_thread(Evt *script)
Definition evt.c:1195
ApiStatus evt_handle_case_equal(Evt *script)
Definition evt.c:256
ApiStatus evt_handle_get_3_float(Evt *script)
Definition evt.c:781
ApiStatus evt_handle_does_script_exist(Evt *script)
Definition evt.c:1101
ApiStatus evt_handle_else(Evt *script)
Definition evt.c:221
ApiStatus evt_handle_set_group(Evt *script)
Definition evt.c:1066
ApiStatus evt_handle_multiplyF(Evt *script)
Definition evt.c:652
ApiStatus evt_handle_resume(Evt *script)
Definition evt.c:1096
ApiStatus evt_handle_if_not_AND(Evt *script)
Definition evt.c:210
ApiStatus evt_handle_end_if(Evt *script)
Definition evt.c:226
ApiStatus evt_handle_kill(Evt *script)
Definition evt.c:1051
ApiStatus evt_handle_resume_others(Evt *script)
Definition evt.c:1086
ApiStatus evt_handle_if_AND(Evt *script)
Definition evt.c:199
ApiStatus evt_handle_wait_seconds(Evt *script)
Definition evt.c:111
ApiStatus evt_handle_wait(Evt *script)
Definition evt.c:95
ApiStatus evt_handle_case_not_equal(Evt *script)
Definition evt.c:279
ApiStatus evt_handle_get_4_float(Evt *script)
Definition evt.c:797
ApiStatus evt_handle_label(Evt *script)
Definition evt.c:36
ApiStatus evt_handle_case_greater_equal(Evt *script)
Definition evt.c:371
ApiStatus evt_handle_suspend_others(Evt *script)
Definition evt.c:1081
ApiStatus evt_handle_allocate_array(Evt *script)
Definition evt.c:836
ApiStatus evt_handle_divide(Evt *script)
Definition evt.c:604
@ EVT_OP_LOOP
Args: number of repeats (0 = infinite)
Definition evt.h:15
@ EVT_OP_EXEC_GET_TID
Args: EvtScript*, container.
Definition evt.h:79
@ EVT_OP_CASE_DEFAULT
Definition evt.h:38
@ EVT_OP_END_IF
Definition evt.h:29
@ EVT_OP_INTERNAL_FETCH
Definition evt.h:10
@ EVT_OP_MOD
Args: container, expression to divide by.
Definition evt.h:53
@ EVT_OP_FBUF_READ2
Args: container.
Definition evt.h:66
@ EVT_OP_94
Definition evt.h:104
@ EVT_OP_93
Definition evt.h:103
@ EVT_OP_UNBIND
Unbinds any triggers bound to this script.
Definition evt.h:82
@ EVT_OP_ADDF
Args: container, expression to increment by.
Definition evt.h:54
@ EVT_OP_FBUF_READ3
Args: container, container.
Definition evt.h:67
@ EVT_OP_SET_PRIORITY
Args: priority.
Definition evt.h:85
@ EVT_OP_DIVF
Args: container, expression to divide by.
Definition evt.h:57
@ EVT_OP_CASE_FLAG
Args: expression to test for.
Definition evt.h:41
@ EVT_OP_ELSE
Definition evt.h:28
@ EVT_OP_DEBUG_LOG
Definition evt.h:100
@ EVT_OP_MULF
Args: container, expression to multiply by.
Definition evt.h:56
@ EVT_OP_SUSPEND_OTHERS
Args: group.
Definition evt.h:91
@ EVT_OP_SUSPEND_THREAD
Args: ScriptID.
Definition evt.h:93
@ EVT_OP_GOTO
Args: index.
Definition evt.h:14
@ EVT_OP_EXEC
Args: EvtScript*.
Definition evt.h:78
@ EVT_OP_USE_ARRAY
Args: *s32.
Definition evt.h:70
@ EVT_OP_MUL
Args: container, expression to multiply by.
Definition evt.h:51
@ EVT_OP_END_CASE_GROUP
Ends the case block of EVT_OP_CASE_OR_EQ condition(s).
Definition evt.h:42
@ EVT_OP_92
Definition evt.h:102
@ EVT_OP_IF_LE
Args: a, b.
Definition evt.h:24
@ EVT_OP_IF_FLAG
Args: a, b.
Definition evt.h:26
@ EVT_OP_WAIT_SECS
Definition evt.h:19
@ EVT_OP_END
Definition evt.h:11
@ EVT_OP_RETURN
Definition evt.h:12
@ EVT_OP_SET
Args: container, expression.
Definition evt.h:46
@ EVT_OP_IF_NE
Args: a, b.
Definition evt.h:21
@ EVT_OP_CASE_EQ
Args: expression to test for.
Definition evt.h:32
@ EVT_OP_BITWISE_OR_CONST
Args: container, value to bitwise OR with.
Definition evt.h:76
@ EVT_OP_BUF_READ1
Definition evt.h:59
@ EVT_OP_USE_FBUF
Identical to USE_BUFFER. Args: f32*.
Definition evt.h:64
@ EVT_OP_SETF
Args: container, expression.
Definition evt.h:48
@ EVT_OP_CHILD_THREAD
Parallel threads are killed as soon as the parent script returns.
Definition evt.h:98
@ EVT_OP_CASE_GE
Args: expression to test for.
Definition evt.h:37
@ EVT_OP_IF_GT
Args: a, b.
Definition evt.h:23
@ EVT_OP_CASE_OR_EQ
Args: expression to test for.
Definition evt.h:39
@ EVT_OP_END_CHILD_THREAD
Definition evt.h:99
@ EVT_OP_END_SWITCH
Definition evt.h:45
@ EVT_OP_DEBUG_PRINT_VAR
Args: expression.
Definition evt.h:101
@ EVT_OP_BUF_READ3
Args: container, container.
Definition evt.h:61
@ EVT_OP_DIV
Integer division. Args: container, expression to divide by.
Definition evt.h:52
@ EVT_OP_EXEC_WAIT
Spawns a script and waits for it to return before continuing. Args: EvtScript*.
Definition evt.h:80
@ EVT_OP_END_LOOP
Definition evt.h:16
@ EVT_OP_BUF_READ4
Args: container, container, container.
Definition evt.h:62
@ EVT_OP_ADD
Args: container, expression to increment by.
Definition evt.h:49
@ EVT_OP_FBUF_READ4
Args: container, container, container.
Definition evt.h:68
@ EVT_OP_BREAK_SWITCH
Definition evt.h:44
@ EVT_OP_SET_TIMESCALE
Args: timescale.
Definition evt.h:86
@ EVT_OP_USE_BUF
Args: s32*.
Definition evt.h:58
@ EVT_OP_BREAK_LOOP
Definition evt.h:17
@ EVT_OP_USE_FLAGS
Args: *s32.
Definition evt.h:71
@ EVT_OP_CASE_RANGE
Args: from, to.
Definition evt.h:43
@ EVT_OP_BITWISE_AND_CONST
Args: container, value to bitwise AND with.
Definition evt.h:74
@ EVT_OP_FBUF_READ1
Definition evt.h:65
@ EVT_OP_SUBF
Args: container, expression to decrement by.
Definition evt.h:55
@ EVT_OP_WAIT_FRAMES
Definition evt.h:18
@ EVT_OP_JUMP
Args: EvtScript*.
Definition evt.h:84
@ EVT_OP_THREAD
Definition evt.h:96
@ EVT_OP_CASE_AND_EQ
Args: expression to test for.
Definition evt.h:40
@ EVT_OP_SWITCH
Args: expression to test against.
Definition evt.h:30
@ EVT_OP_CASE_LE
Args: expression to test for.
Definition evt.h:36
@ EVT_OP_SUB
Args: container, expression to decrement by.
Definition evt.h:50
@ EVT_OP_IF_GE
Args: a, b.
Definition evt.h:25
@ EVT_OP_CALL
Args: *function, ...
Definition evt.h:77
@ EVT_OP_IF_NOT_FLAG
Args: a, b.
Definition evt.h:27
@ EVT_OP_IS_THREAD_RUNNING
Args: ScriptID, container.
Definition evt.h:95
@ EVT_OP_IF_LT
Args: a, b.
Definition evt.h:22
@ EVT_OP_SWITCH_CONST
Args: value to test against.
Definition evt.h:31
@ EVT_OP_CASE_NE
Args: expression to test for.
Definition evt.h:33
@ EVT_OP_SET_CONST
Args: container, value.
Definition evt.h:47
@ EVT_OP_KILL_THREAD
Args: ScriptID.
Definition evt.h:83
@ EVT_OP_LABEL
Args: index.
Definition evt.h:13
@ EVT_OP_RESUME_OTHERS
Args: group.
Definition evt.h:92
@ EVT_OP_RESUME_THREAD
Args: ScriptID.
Definition evt.h:94
@ EVT_OP_BUF_READ2
Args: container.
Definition evt.h:60
@ EVT_OP_END_THREAD
Definition evt.h:97
@ EVT_OP_RESUME_GROUP
Args: group.
Definition evt.h:90
@ EVT_OP_BIND_TRIGGER
Args: EvtScript*, trigger flags, s32 target, 1, Trigger*.
Definition evt.h:81
@ EVT_OP_BITWISE_AND
Args: container, expression to bitwise AND with.
Definition evt.h:73
@ EVT_OP_CASE_GT
Args: expression to test for.
Definition evt.h:35
@ EVT_OP_BITWISE_OR
Args: container, expression to bitwise OR with.
Definition evt.h:75
@ EVT_OP_SET_GROUP
Args: group.
Definition evt.h:87
@ EVT_OP_BIND_PADLOCK
Args: EvtScript*, trigger flags, s32 target, ItemList*, 0, 1.
Definition evt.h:88
@ EVT_OP_SUSPEND_GROUP
Args: group.
Definition evt.h:89
@ EVT_OP_CASE_LT
Args: expression to test for.
Definition evt.h:34
@ EVT_OP_MALLOC_ARRAY
Allocates a new array. Args: length, s32*.
Definition evt.h:72
@ EVT_OP_BUF_PEEK
Args: container, container, container, container.
Definition evt.h:63
@ EVT_OP_IF_EQ
Args: a, b.
Definition evt.h:20
@ EVT_OP_FBUF_PEEK
Args: container, container, container, container.
Definition evt.h:69
#define ApiStatus_DONE2
Definition evt.h:118
#define ApiStatus_REPEAT
Definition evt.h:119
#define ApiStatus_FINISH
Definition evt.h:120
#define ApiStatus_DONE1
Definition evt.h:117
#define ApiStatus_BLOCK
Definition evt.h:116
@ EVT_CMD_RESULT_YIELD
Definition evt.h:123
@ EVT_CMD_RESULT_CONTINUE
Definition evt.h:124
@ EVT_CMD_RESULT_ERROR
Definition evt.h:125
#define PANIC()
Definition macros.h:55
#define ASSERT_MSG(condition, msg, args...)
Definition macros.h:66
GameStatus * gGameStatusPtr
Definition main_loop.c:32

Referenced by update_scripts().

◆ sort_scripts()

void sort_scripts ( void )

Definition at line 71 of file script_list.c.

71 {
72 s32 temp_a0;
73 s32 temp_a1;
74 s32 tempID;
75 Evt* curScript;
76 ScriptList** currentScriptListPtr;
77 s32 i;
78 s32 j;
79 s32 x;
80 s32 numValidScripts = 0;
81 s32* scriptIndexList = gScriptIndexList;
82 s32* scriptIdList = gScriptIdList;
83
84 for (i = 0; i < MAX_SCRIPTS; i++) {
85 curScript = (*gCurrentScriptListPtr)[i];
86 if (curScript != NULL) {
87 if (curScript->stateFlags != 0) {
88 scriptIndexList[numValidScripts] = i;
89 scriptIdList[numValidScripts] = curScript->id;
90 numValidScripts++;
91 }
92 }
93 }
94
95 gScriptListCount = numValidScripts;
96 for (i = 0; i < (x = numValidScripts - 1); i++) {
97 scriptIndexList = gScriptIndexList;
98 currentScriptListPtr = &gCurrentScriptListPtr;
99 scriptIdList = gScriptIdList;
100 for (j = i + 1; j < numValidScripts; j++) {
101 temp_a1 = scriptIndexList[i];
102 temp_a0 = scriptIndexList[j];
103 x = i;
104 if ((**currentScriptListPtr)[temp_a1]->priority > (**currentScriptListPtr)[temp_a0]->priority) {
105 scriptIndexList[i] = temp_a0;
106 scriptIndexList[j] = temp_a1;
107 tempID = scriptIdList[i];
108 scriptIdList[i] = scriptIdList[j];
109 scriptIdList[j] = tempID;
110 }
111 }
112 }
113}
u8 stateFlags
Evt * ScriptList[128]
#define MAX_SCRIPTS
Definition macros.h:90
BSS s32 gScriptListCount
Definition script_list.c:17
BSS s32 gScriptIdList[MAX_SCRIPTS]
Definition script_list.c:16
BSS s32 gScriptIndexList[MAX_SCRIPTS]
Definition script_list.c:15
BSS ScriptList * gCurrentScriptListPtr
Definition script_list.c:14

Referenced by update_scripts().

◆ find_script_labels()

void find_script_labels ( Evt * script)

Definition at line 115 of file script_list.c.

115 {
116 Bytecode* curLine;
117 s32 type;
118 s32 label;
119 s32 numArgs;
120 s32 i;
121 s32 j;
122
123 for (i = 0; i < ARRAY_COUNT(script->labelIndices); i++) {
124 script->labelIndices[i] = -1;
125 script->labelPositions[i] = 0;
126 }
127
128 j = 0;
129 curLine = script->ptrNextLine;
130 while (j < ARRAY_COUNT(script->labelIndices)) {
131 type = *curLine++;
132 numArgs = *curLine++;
133 label = *curLine;
134 curLine += numArgs;
135
136 if (type == 1) {
137 return;
138 }
139
140 if (type == 3) {
141 script->labelIndices[j] = label;
142 script->labelPositions[j] = curLine;
143 j++;
144 }
145 }
146 PANIC();
147}
s8 labelIndices[16]
void * labelPositions[16]
s32 Bytecode
Definition evt.h:7
#define ARRAY_COUNT(arr)
Definition macros.h:40

Referenced by func_802C39F8(), func_802C3C10(), restart_script(), start_child_script(), start_script(), and start_script_in_group().

◆ clear_script_list()

void clear_script_list ( void )

Definition at line 149 of file script_list.c.

149 {
150 s32 i;
151
156 } else {
160 }
161
162 for (i = 0; i < MAX_SCRIPTS; i++) {
163 (*gCurrentScriptListPtr)[i] = NULL;
164 }
165
166 gNumScripts = 0;
168 IsUpdatingScripts = FALSE;
169
170 for (i = 0; i < MAX_MAPVARS; i++) {
171 gMapVars[i] = 0;
172 }
173
174 for (i = 0; i < MAX_MAPFLAGS; i++) {
175 gMapFlags[i] = 0;
176 }
177
180}
@ CONTEXT_WORLD
Definition enums.h:3529
void clear_virtual_entity_list(void)
void reset_model_animators(void)
Definition model_api.c:258
#define MAX_MAPFLAGS
Definition macros.h:82
#define MAX_MAPVARS
Definition macros.h:81
BSS u32 * gMapFlags
Definition script_list.c:9
BSS u32 gWorldMapFlags[MAX_MAPFLAGS]
Definition script_list.c:58
BSS u32 gBattleMapFlags[MAX_MAPFLAGS]
Definition script_list.c:59
BSS u32 gBattleMapVars[MAX_MAPVARS]
Definition script_list.c:62
BSS u32 gWorldMapVars[MAX_MAPVARS]
Definition script_list.c:61
BSS ScriptList gBattleScriptList
Definition script_list.c:13
BSS ScriptList gWorldScriptList
Definition script_list.c:12
BSS s32 * gMapVars
Definition script_list.c:10
s32 IsUpdatingScripts
Definition script_list.c:5
BSS s32 gNumScripts
Definition script_list.c:11

Referenced by load_demo_battle(), load_engine_data(), load_map_by_IDs(), state_init_demo(), state_init_logos(), state_init_title_screen(), state_step_battle(), state_step_demo(), state_step_intro(), state_step_pause(), and state_step_startup().

◆ init_script_list()

void init_script_list ( void )

Definition at line 182 of file script_list.c.

182 {
187 } else {
191 }
192
193 gNumScripts = 0;
194 IsUpdatingScripts = FALSE;
195
198}
void init_model_animators(void)
Definition model_api.c:278
void init_virtual_entity_list(void)

Referenced by state_step_end_battle(), and state_step_unpause().

◆ suspend_frozen_scripts()

void suspend_frozen_scripts ( Evt * script)

Definition at line 201 of file script_list.c.

201 {
202 switch (gTimeFreezeMode) {
203 default:
204 case TIME_FREEZE_NONE:
205 case TIME_FREEZE_EXIT:
206 return;
209 return;
210 case TIME_FREEZE_FULL:
213 return;
214 }
215}
@ TIME_FREEZE_FULL
Definition enums.h:3466
@ TIME_FREEZE_POPUP_MENU
Definition enums.h:3467
@ TIME_FREEZE_PARTIAL
Definition enums.h:3465
@ TIME_FREEZE_NONE
Definition enums.h:3464
@ TIME_FREEZE_EXIT
Definition enums.h:3468
@ EVT_GROUP_FLAG_MENUS
Definition evt.h:135
@ EVT_GROUP_FLAG_INTERACT
Definition evt.h:134
void suspend_all_group(s32 groupFlags)
s32 gTimeFreezeMode
Definition main_loop.c:12

Referenced by func_802C39F8(), func_802C3C10(), restart_script(), start_child_script(), start_script(), and start_script_in_group().

◆ start_script()

Evt * start_script ( EvtScript * source,
s32 priority,
s32 flags )

Definition at line 217 of file script_list.c.

217 {
218 Evt* newScript;
219 s32 scriptListCount;
220 s32 curScriptIndex;
221 s32 i;
222
223 for (i = 0; i < MAX_SCRIPTS; i++) {
224 if ((*gCurrentScriptListPtr)[i] == NULL) {
225 break;
226 }
227 }
228
229 ASSERT(i < MAX_SCRIPTS);
230 curScriptIndex = i;
231
232 (*gCurrentScriptListPtr)[curScriptIndex] = newScript = heap_malloc(sizeof(*newScript));
233 gNumScripts++;
234 ASSERT(newScript != NULL);
235
236 newScript->stateFlags = flags | EVT_FLAG_ACTIVE;
237 newScript->curOpcode = EVT_OP_INTERNAL_FETCH;
238 newScript->priority = priority;
239 newScript->id = UniqueScriptCounter++;
240 newScript->ptrNextLine = (Bytecode*)source;
241 newScript->ptrFirstLine = (Bytecode*)source;
242 newScript->ptrCurLine = (Bytecode*)source;
243 newScript->userData = NULL;
244 newScript->blockingParent = NULL;
245 newScript->childScript = NULL;
246 newScript->parentScript = NULL;
247 newScript->owner1.actorID = -1;
248 newScript->owner2.npcID = -1;
249 newScript->loopDepth = -1;
250 newScript->switchDepth = -1;
251 newScript->groupFlags = EVT_GROUP_NOT_BATTLE;
252 newScript->ptrSavedPos = NULL;
253 newScript->frameCounter = 0.0f;
254 newScript->unk_158 = 0;
255 newScript->timeScale = GlobalTimeRate;
256
257 scriptListCount = 0;
258
259 for (i = 0; i < ARRAY_COUNT(newScript->varTable); i++) {
260 newScript->varTable[i] = 0;
261 }
262
263 for (i = 0; i < ARRAY_COUNT(newScript->varFlags); i++) {
264 newScript->varFlags[i] = 0;
265 }
266
267 find_script_labels(newScript);
268
270 scriptListCount = gScriptListCount++;
271 gScriptIndexList[scriptListCount] = curScriptIndex;
272 gScriptIdList[scriptListCount] = newScript->id;
273 }
274
275 suspend_frozen_scripts(newScript);
276
277 if (UniqueScriptCounter == 0) {
279 }
280
281 return newScript;
282}
struct Evt * parentScript
struct Evt * childScript
u8 groupFlags
struct Evt * blockingParent
s8 switchDepth
s8 loopDepth
s32 unk_158
union Evt::@8 owner1
Initially -1.
Bytecode * ptrSavedPos
s32 varFlags[3]
union Evt::@9 owner2
Initially -1.
void * userData
f32 frameCounter
f32 timeScale
u8 priority
s8 flags
Definition demo_api.c:15
#define ASSERT(condition)
@ EVT_GROUP_NOT_BATTLE
Definition evt.h:147
@ EVT_FLAG_ACTIVE
Definition evt.h:158
@ EVT_FLAG_RUN_IMMEDIATELY
don't wait for next update_scripts call
Definition evt.h:161
void * heap_malloc(s32 size)
Definition heap.c:34
s32 UniqueScriptCounter
Definition script_list.c:4
void find_script_labels(Evt *script)
f32 GlobalTimeRate
Definition script_list.c:6
void suspend_frozen_scripts(Evt *script)

Referenced by _use_partner_ability(), bind_enemy_ai(), bind_enemy_aux(), bind_enemy_interact(), btl_cam_use_preset_impl(), btl_state_update_9(), btl_state_update_begin_partner_turn(), btl_state_update_begin_player_turn(), btl_state_update_begin_turn(), btl_state_update_celebration(), btl_state_update_change_partner(), btl_state_update_defeat(), btl_state_update_defend(), btl_state_update_end_battle(), btl_state_update_end_demo_battle(), btl_state_update_end_player_turn(), btl_state_update_end_training_battle(), btl_state_update_end_turn(), btl_state_update_enemy_move(), btl_state_update_enemy_striking_first(), btl_state_update_first_strike(), btl_state_update_next_enemy(), btl_state_update_normal_start(), btl_state_update_partner_move(), btl_state_update_partner_striking_first(), btl_state_update_player_move(), btl_state_update_run_away(), btl_state_update_victory(), calc_enemy_damage_target(), calc_item_damage_enemy(), calc_partner_damage_enemy(), calc_player_damage_enemy(), create_actor(), create_encounters(), dispatch_event_actor(), dispatch_event_partner(), dispatch_event_partner_continue_turn(), dispatch_event_player(), dispatch_event_player_continue_turn(), entity_Chest_adjust_camera(), entity_Chest_reset_camera(), evt_trigger_on_activate_exec_script(), evt_trigger_on_activate_lock(), FireBarAI_Callback(), func_80048E34(), load_partner_actor(), partner_handle_after_battle(), shop_owner_begin_speech(), shop_owner_buy_dialog(), shop_owner_continue_speech(), shop_owner_continue_speech_with_quantity(), shop_owner_end_speech(), shop_owner_reset_speech(), start_battle(), start_rumble_type(), update_encounters_neutral(), update_encounters_post_battle(), update_entities(), and use_consumable().

◆ start_script_in_group()

Evt * start_script_in_group ( EvtScript * source,
u8 priority,
u8 flags,
u8 groupFlags )

Definition at line 284 of file script_list.c.

284 {
285 Evt* newScript;
286 s32 scriptListCount;
287 s32 curScriptIndex;
288 s32 i;
289
290 for (i = 0; i < MAX_SCRIPTS; i++) {
291 if ((*gCurrentScriptListPtr)[i] == NULL) {
292 break;
293 }
294 }
295
296 ASSERT(i < MAX_SCRIPTS);
297 curScriptIndex = i;
298
299 (*gCurrentScriptListPtr)[curScriptIndex] = newScript = heap_malloc(sizeof(*newScript));
300 gNumScripts++;
301 ASSERT(newScript != NULL);
302
303 newScript->stateFlags = flags | EVT_FLAG_ACTIVE;
304 newScript->curOpcode = EVT_OP_INTERNAL_FETCH;
305 newScript->priority = priority;
306 newScript->id = UniqueScriptCounter++;
307 newScript->ptrNextLine = (Bytecode*)source;
308 newScript->ptrFirstLine = (Bytecode*)source;
309 newScript->ptrCurLine = (Bytecode*)source;
310 newScript->userData = NULL;
311 newScript->blockingParent = NULL;
312 newScript->childScript = NULL;
313 newScript->parentScript = NULL;
314 newScript->owner1.actorID = -1;
315 newScript->owner2.npcID = -1;
316 newScript->loopDepth = -1;
317 newScript->switchDepth = -1;
318 newScript->groupFlags = groupFlags;
319 newScript->ptrSavedPos = NULL;
320 newScript->frameCounter = 0.0f;
321 newScript->unk_158 = 0;
322 newScript->timeScale = GlobalTimeRate;
323
324 scriptListCount = 0;
325
326 for (i = 0; i < ARRAY_COUNT(newScript->varTable); i++) {
327 newScript->varTable[i] = 0;
328 }
329 for (i = 0; i < ARRAY_COUNT(newScript->varFlags); i++) {
330 newScript->varFlags[i] = 0;
331 }
332
333 find_script_labels(newScript);
334
336 scriptListCount = gScriptListCount++;
337 gScriptIndexList[scriptListCount] = curScriptIndex;
338 gScriptIdList[scriptListCount] = newScript->id;
339 }
340
341 suspend_frozen_scripts(newScript);
342
343 if (UniqueScriptCounter == 0) {
345 }
346
347 return newScript;
348}

Referenced by evt_handle_exec1(), evt_handle_exec1_get_id(), evt_handle_thread(), exec_ShakeCam1(), exec_ShakeCamX(), load_map_by_IDs(), and update_encounters_post_battle().

◆ start_child_script()

Evt * start_child_script ( Evt * parentScript,
EvtScript * source,
s32 flags )

Definition at line 350 of file script_list.c.

350 {
351 s32 curScriptIndex;
352 s32 scriptListCount;
353 Evt* child;
354 s32 i;
355
356 for (i = 0; i < MAX_SCRIPTS; i++) {
357 if ((*gCurrentScriptListPtr)[i] == NULL) {
358 break;
359 }
360 }
361
362 ASSERT(i < MAX_SCRIPTS);
363 curScriptIndex = i;
364
365 (*gCurrentScriptListPtr)[curScriptIndex] = child = heap_malloc(sizeof(*child));
366 gNumScripts++;
367 ASSERT(child != NULL);
368
369 parentScript->childScript = child;
370 parentScript->stateFlags |= EVT_FLAG_BLOCKED_BY_CHILD;
372 child->ptrCurLine = child->ptrFirstLine = child->ptrNextLine = (Bytecode*)source;
373
375 child->userData = NULL;
376 child->blockingParent = parentScript;
377 child->childScript = NULL;
378 child->parentScript = NULL;
379 child->priority = parentScript->priority + 1;
380 child->id = UniqueScriptCounter++;
381 child->owner1 = parentScript->owner1;
382 child->owner2 = parentScript->owner2;
383 child->loopDepth = -1;
384 child->switchDepth = -1;
385 child->groupFlags = parentScript->groupFlags;
386 child->ptrSavedPos = NULL;
387 child->array = parentScript->array;
388 child->flagArray = parentScript->flagArray;
389 child->timeScale = GlobalTimeRate;
390 child->frameCounter = 0.0f;
391 child->unk_158 = 0;
392
393 scriptListCount = 0;
394
395 for (i = 0; i < ARRAY_COUNT(child->varTable); i++) {
396 child->varTable[i] = parentScript->varTable[i];
397 }
398
399 for (i = 0; i < ARRAY_COUNT(child->varFlags); i++) {
400 child->varFlags[i] = parentScript->varFlags[i];
401 }
402
403 find_script_labels(child);
404 if (IsUpdatingScripts) {
405 scriptListCount = gScriptListCount++;
406 gScriptIndexList[scriptListCount] = curScriptIndex;
407 gScriptIdList[scriptListCount] = child->id;
408 }
409
411
412 if (UniqueScriptCounter == 0) {
414 }
415
416 return child;
417}
s32 * flagArray
s32 * array
@ EVT_FLAG_BLOCKED_BY_CHILD
Definition evt.h:160

Referenced by evt_handle_exec_wait().

◆ func_802C39F8()

Evt * func_802C39F8 ( Evt * parentScript,
Bytecode * nextLine,
s32 newState )

Definition at line 419 of file script_list.c.

419 {
420 Evt* child;
421 s32 curScriptIndex;
422 s32 i;
423 s32 scriptListCount;
424
425 for (i = 0; i < MAX_SCRIPTS; i++) {
426 if ((*gCurrentScriptListPtr)[i] == NULL) {
427 break;
428 }
429 }
430
431 ASSERT(i < MAX_SCRIPTS);
432 curScriptIndex = i;
433
434 (*gCurrentScriptListPtr)[curScriptIndex] = child = heap_malloc(sizeof(*child));
435 gNumScripts++;
436 ASSERT(child != NULL);
437
438 child->stateFlags = newState | EVT_FLAG_ACTIVE;
439 child->ptrNextLine = nextLine;
440 child->ptrFirstLine = nextLine;
441 child->ptrCurLine = nextLine;
443 child->userData = NULL;
444 child->blockingParent = NULL;
445 child->parentScript = parentScript;
446 child->childScript = NULL;
447 child->priority = parentScript->priority;
448 child->id = UniqueScriptCounter++;
449 child->owner1.actorID = parentScript->owner1.actorID;
450 child->owner2.npcID = parentScript->owner2.npcID;
451 child->loopDepth = -1;
452 child->switchDepth = -1;
453 child->groupFlags = parentScript->groupFlags;
454 child->ptrSavedPos = NULL;
455 child->array = parentScript->array;
456 child->flagArray = parentScript->flagArray;
457 child->timeScale = GlobalTimeRate;
458 child->frameCounter = 0.0f;
459 child->unk_158 = 0;
460
461 scriptListCount = 0;
462
463 for (i = 0; i < ARRAY_COUNT(child->varTable); i++) {
464 child->varTable[i] = parentScript->varTable[i];
465 }
466
467 for (i = 0; i < ARRAY_COUNT(child->varFlags); i++) {
468 child->varFlags[i] = parentScript->varFlags[i];
469 }
470
471 find_script_labels(child);
472 if (IsUpdatingScripts) {
473 scriptListCount = gScriptListCount++;
474 gScriptIndexList[scriptListCount] = curScriptIndex;
475 gScriptIdList[scriptListCount] = child->id;
476 }
477
478 if (UniqueScriptCounter == 0) {
480 }
481
483 return child;
484}

Referenced by evt_handle_child_thread().

◆ func_802C3C10()

Evt * func_802C3C10 ( Evt * script,
Bytecode * line,
s32 arg2 )

Definition at line 486 of file script_list.c.

486 {
487 Evt* curScript;
488 s32 i;
489
490 script->ptrNextLine = line;
491 script->ptrFirstLine = line;
492 script->ptrCurLine = line;
494 script->frameCounter = 0;
495 script->stateFlags |= arg2;
496 script->timeScale = 1.0f;
497
498 if (script->userData != NULL) {
499 heap_free(script->userData);
500 script->userData = NULL;
501 }
502
503 if (script->childScript != 0) {
504 kill_script(script->childScript);
505 }
506
507 for (i = 0; i < MAX_SCRIPTS; i++) {
508 curScript = (*gCurrentScriptListPtr)[i];
509 if ((curScript != 0) && (curScript->parentScript == script)) {
510 kill_script(curScript);
511 }
512 }
513 script->loopDepth = -1;
514 script->switchDepth = -1;
515 script->blockingParent = NULL;
516 script->parentScript = NULL;
517 script->childScript = NULL;
518 script->frameCounter = 0.0f;
519 script->unk_158 = 0;
520 script->timeScale = GlobalTimeRate;
521 find_script_labels(script);
523
524 return script;
525}
s32 heap_free(void *ptr)
Definition heap.c:42
void kill_script(Evt *instanceToKill)

◆ restart_script()

Evt * restart_script ( Evt * script)

Definition at line 527 of file script_list.c.

527 {
528 Bytecode* ptrFirstLine = script->ptrFirstLine;
529
530 // frameCounter gets set to 0 twice which makes me think a macro is being used here
531 script->loopDepth = -1;
532 script->switchDepth = -1;
533 script->frameCounter = 0;
535
536 script->ptrNextLine = ptrFirstLine;
537 script->ptrCurLine = ptrFirstLine;
538 script->timeScale = 1.0f;
539 script->frameCounter = 0;
540 script->unk_158 = 0;
541
542 script->timeScale = GlobalTimeRate;
543
544 find_script_labels(script);
546
547 return script;
548}

Referenced by btl_cam_move(), and evt_handle_jump().

◆ update_scripts()

void update_scripts ( void )

Definition at line 550 of file script_list.c.

550 {
551 s32 i;
552
554 return;
555 }
556
557 IsUpdatingScripts = TRUE;
558 sort_scripts();
559
560 for (i = 0; i < gScriptListCount; i++) {
561 Evt* script = (*gCurrentScriptListPtr)[gScriptIndexList[i]];
562
563 if (script != NULL &&
564 script->id == gScriptIdList[i] &&
565 script->stateFlags != 0 &&
567 {
568 s32 stop = FALSE;
569 s32 status;
570
571 script->frameCounter += script->timeScale;
572
573 do {
574 if (script->frameCounter < 1.0) {
575 // Continue to next script
576 break;
577 };
578
579 script->frameCounter -= 1.0;
580 status = evt_execute_next_command(script);
581 if (status == EVT_CMD_RESULT_ERROR) {
582 stop = TRUE;
583 break;
584 }
585 } while (status != EVT_CMD_RESULT_YIELD);
586
587 if (stop) {
588 break;
589 }
590 }
591 }
592 IsUpdatingScripts = FALSE;
593}
@ DEBUG_SCRIPTS_NO_UPDATE
Definition enums.h:4276
@ EVT_FLAG_PAUSED
paused through suspend_group_script / resume_group_script
Definition evt.h:159
@ EVT_FLAG_SUSPENDED
doesn't affect child
Definition evt.h:163
void sort_scripts(void)
Definition script_list.c:71
s32 evt_execute_next_command(Evt *script)
Definition evt.c:1351

Referenced by step_game_loop().

◆ func_802C3EE4()

void func_802C3EE4 ( void )

Definition at line 596 of file script_list.c.

596 {
597 s32 temp;
598 s32 i;
599
600 for (i = 0; i < gScriptListCount; i++) {
601 temp = (s32) (*gCurrentScriptListPtr)[gScriptIndexList[i]];
602 temp = *((s32*) temp);
603 if (temp == gScriptIdList[i]) {
604 temp = 1;
605 }
606 }
607}

Referenced by gfx_draw_frame().

◆ kill_script()

void kill_script ( Evt * instanceToKill)

Definition at line 609 of file script_list.c.

609 {
610 Evt* childScript;
611 Evt* blockingParent;
612 s32 j;
613 s32 i;
614
615 for (i = 0; i < MAX_SCRIPTS; i++) {
616 if ((*gCurrentScriptListPtr)[i] == instanceToKill) {
617 break;
618 }
619 }
620
621 if (i >= MAX_SCRIPTS) {
622 return;
623 }
624
625 childScript = instanceToKill->childScript;
626 if (childScript != NULL) {
627 kill_script(childScript);
628 }
629
630 for (j = 0; j < MAX_SCRIPTS; j++) {
631 Evt* tempScriptInstance = (*gCurrentScriptListPtr)[j];
632 if (tempScriptInstance != NULL) {
633 if (tempScriptInstance->parentScript == instanceToKill) {
634 kill_script(tempScriptInstance);
635 }
636 }
637 }
638
639 blockingParent = instanceToKill->blockingParent;
640 if (blockingParent != NULL) {
641 blockingParent->childScript = NULL;
642 blockingParent->stateFlags &= ~EVT_FLAG_BLOCKED_BY_CHILD;
643
644 for (j = 0; j < ARRAY_COUNT(blockingParent->varTable); j++) {
645 blockingParent->varTable[j] = instanceToKill->varTable[j];
646 }
647
648 for (j = 0; j < ARRAY_COUNT(blockingParent->varFlags); j++) {
649 blockingParent->varFlags[j] = instanceToKill->varFlags[j];
650 }
651 }
652
653 if (instanceToKill->userData != NULL) {
654 heap_free(instanceToKill->userData);
655 instanceToKill->userData = NULL;
656 }
657
659 (*gCurrentScriptListPtr)[i] = NULL;
660 gNumScripts--;
661}

Referenced by evt_handle_end_child_thread(), evt_handle_end_thread(), evt_handle_return(), func_802C3C10(), kill_all_scripts(), kill_script(), and kill_script_by_ID().

◆ kill_script_by_ID()

◆ kill_all_scripts()

void kill_all_scripts ( void )

Definition at line 675 of file script_list.c.

675 {
676 s32 i;
677 Evt* scriptContextPtr;
678
679 for (i = 0; i < MAX_SCRIPTS; i++) {
680 scriptContextPtr = (*gCurrentScriptListPtr)[i];
681 if (scriptContextPtr != NULL) {
682 kill_script(scriptContextPtr);
683 }
684 }
685}

Referenced by btl_state_update_end_battle(), and btl_state_update_end_demo_battle().

◆ does_script_exist()

s32 does_script_exist ( s32 id)

Definition at line 687 of file script_list.c.

687 {
688 s32 i;
689 Evt* scriptContextPtr;
690
691 for (i = 0; i < MAX_SCRIPTS; i++) {
692 scriptContextPtr = (*gCurrentScriptListPtr)[i];
693 if (scriptContextPtr != NULL && scriptContextPtr->id == id) {
694 return TRUE;
695 }
696 }
697 return FALSE;
698}

Referenced by _use_partner_ability(), btl_state_update_9(), btl_state_update_begin_partner_turn(), btl_state_update_begin_player_turn(), btl_state_update_begin_turn(), btl_state_update_celebration(), btl_state_update_change_partner(), btl_state_update_defeat(), btl_state_update_defend(), btl_state_update_end_battle(), btl_state_update_end_demo_battle(), btl_state_update_end_player_turn(), btl_state_update_end_training_battle(), btl_state_update_end_turn(), btl_state_update_enemy_move(), btl_state_update_enemy_striking_first(), btl_state_update_first_strike(), btl_state_update_next_enemy(), btl_state_update_normal_start(), btl_state_update_partner_move(), btl_state_update_partner_striking_first(), btl_state_update_player_move(), btl_state_update_run_away(), btl_state_update_victory(), create_encounters(), evt_handle_does_script_exist(), evt_trigger_on_activate_exec_script(), evt_trigger_on_activate_lock(), partner_handle_after_battle(), partner_handle_before_battle(), partner_kill_ability_script(), partner_resume_ability_script(), partner_suspend_ability_script(), state_step_change_map(), state_step_enter_world(), state_step_game_over(), state_step_intro(), update_encounters_conversation(), update_encounters_post_battle(), update_entities(), and update_item_entity_collectable().

◆ does_script_exist_by_ref()

s32 does_script_exist_by_ref ( Evt * script)

Definition at line 700 of file script_list.c.

700 {
701 s32 i;
702
703 for (i = 0; i < MAX_SCRIPTS; i++) {
704 if (script == (*gCurrentScriptListPtr)[i]) {
705 return TRUE;
706 }
707 }
708 return FALSE;
709}

◆ set_script_priority()

void set_script_priority ( Evt * script,
s32 priority )

Definition at line 711 of file script_list.c.

711 {
712 script->priority = priority;
713}

Referenced by evt_handle_set_priority().

◆ set_script_timescale()

void set_script_timescale ( Evt * script,
f32 timescale )

Definition at line 715 of file script_list.c.

715 {
716 script->timeScale = timescale * GlobalTimeRate;
717}

Referenced by evt_handle_set_timescale().

◆ set_global_timespace()

void set_global_timespace ( f32 timeScale)

Definition at line 719 of file script_list.c.

719 {
720 GlobalTimeRate = timeScale;
721}

◆ get_global_timespace()

f32 get_global_timespace ( void )

Definition at line 723 of file script_list.c.

723 {
724 return GlobalTimeRate;
725}

◆ set_script_group()

void set_script_group ( Evt * script,
s32 groupFlags )

Definition at line 727 of file script_list.c.

727 {
728 script->groupFlags = groupFlags;
729}

Referenced by evt_handle_set_group().

◆ bind_trigger()

Trigger * bind_trigger ( EvtScript * script,
s32 flags,
s32 triggerFlagIndex,
s32 triggerVar0,
s32 triggerVar1,
s32 priority,
s32 arg6 )

Definition at line 731 of file script_list.c.

732 {
733 Trigger* trigger;
735
737 bp.colliderID = triggerFlagIndex;
738 bp.tattleMsg = 0;
740 bp.hasPlayerInteractPrompt = arg6;
741
742 trigger = create_trigger(&bp);
743 trigger->onTriggerEvt = script;
744 trigger->runningScript = NULL;
745 trigger->priority = priority;
746 trigger->varTable[0] = triggerVar0;
747 trigger->varTable[1] = triggerVar1;
748 return trigger;
749}
@ TRIGGER_SCRIPT_BOUND
Definition enums.h:2691
s32 evt_trigger_on_activate_exec_script(Trigger *trigger)
Definition evt.c:982
Trigger * create_trigger(TriggerBlueprint *def)
Definition trigger.c:55
s32(* onActivateFunc)(struct Trigger *)
EvtScript * onTriggerEvt
struct Evt * runningScript

Referenced by bind_trigger_1().

◆ bind_trigger_1()

Trigger * bind_trigger_1 ( EvtScript * script,
s32 flags,
s32 triggerFlagIndex,
s32 triggerVar0,
s32 triggerVar1,
s32 priority )

Definition at line 751 of file script_list.c.

752 {
753 return bind_trigger(script, flags, triggerFlagIndex, triggerVar0, triggerVar1, priority, 1);
754}
Trigger * bind_trigger(EvtScript *script, s32 flags, s32 triggerFlagIndex, s32 triggerVar0, s32 triggerVar1, s32 priority, s32 arg6)

◆ suspend_group_script()

void suspend_group_script ( Evt * script,
s32 groupFlags )

Definition at line 756 of file script_list.c.

756 {
757 Evt* childScript = script->childScript;
758 s32 i;
759
760 if (childScript != NULL) {
761 suspend_group_script(childScript, groupFlags);
762 }
763
764 for (i = 0; i < MAX_SCRIPTS; i++) {
765 Evt* scriptContextPtr = (*gCurrentScriptListPtr)[i];
766
767 if (scriptContextPtr != NULL && scriptContextPtr->parentScript == script) {
768 suspend_group_script(scriptContextPtr, groupFlags);
769 }
770 }
771
772 if ((script->groupFlags & groupFlags) != 0) {
773 script->stateFlags |= EVT_FLAG_PAUSED;
774 }
775}
void suspend_group_script(Evt *script, s32 groupFlags)

Referenced by resume_group_script(), suspend_all_group(), suspend_all_script(), suspend_group_others(), suspend_group_script(), and suspend_group_script_index().

◆ resume_group_script()

void resume_group_script ( Evt * script,
s32 groupFlags )

Definition at line 777 of file script_list.c.

777 {
778 Evt* childScript = script->childScript;
779 s32 i;
780
781 if (childScript != NULL) {
782 resume_group_script(childScript, groupFlags);
783 }
784
785 for (i = 0; i < MAX_SCRIPTS; i++) {
786 Evt* scriptContextPtr = (*gCurrentScriptListPtr)[i];
787
788 if (scriptContextPtr != NULL && scriptContextPtr->parentScript == script) {
789 suspend_group_script(scriptContextPtr, groupFlags);
790 }
791 }
792
793 if ((script->groupFlags & groupFlags) != 0) {
794 script->stateFlags &= ~EVT_FLAG_PAUSED;
795 }
796}
void resume_group_script(Evt *script, s32 groupFlags)

Referenced by resume_all_group(), resume_all_script(), resume_group_others(), resume_group_script(), and resume_group_script_index().

◆ suspend_all_script()

s32 suspend_all_script ( s32 id)

Definition at line 798 of file script_list.c.

798 {
799 s32 i;
800
801 for (i = 0; i < MAX_SCRIPTS; i++) {
802 Evt* scriptContextPtr = (*gCurrentScriptListPtr)[i];
803
804 if (scriptContextPtr != NULL && scriptContextPtr->id == id) {
806 }
807 }
808}

Referenced by evt_handle_suspend(), partner_suspend_ability_script(), start_battle(), update_encounters_neutral(), and update_encounters_pre_battle().

◆ resume_all_script()

s32 resume_all_script ( s32 id)

Definition at line 810 of file script_list.c.

810 {
811 s32 i;
812 Evt* scriptContextPtr;
813
814 for (i = 0; i < MAX_SCRIPTS; i++) {
815 scriptContextPtr = (*gCurrentScriptListPtr)[i];
816 if (scriptContextPtr != NULL && scriptContextPtr->id == id) {
817 resume_group_script(scriptContextPtr, EVT_GROUP_NOT_BATTLE);
818 }
819 }
820}

Referenced by evt_handle_resume(), partner_resume_ability_script(), update_encounters_conversation(), and update_encounters_post_battle().

◆ suspend_group_script_index()

void suspend_group_script_index ( s32 id,
s32 groupFlags )

Definition at line 822 of file script_list.c.

822 {
823 s32 i;
824 Evt* scriptContextPtr;
825
826 for (i = 0; i < MAX_SCRIPTS; i++) {
827 scriptContextPtr = (*gCurrentScriptListPtr)[i];
828 if (scriptContextPtr != NULL && scriptContextPtr->id == id) {
829 suspend_group_script(scriptContextPtr, groupFlags);
830 }
831 }
832}

◆ resume_group_script_index()

void resume_group_script_index ( s32 id,
s32 groupFlags )

Definition at line 834 of file script_list.c.

834 {
835 s32 i;
836 Evt* scriptContextPtr;
837
838 for (i = 0; i < MAX_SCRIPTS; i++) {
839 scriptContextPtr = (*gCurrentScriptListPtr)[i];
840 if (scriptContextPtr != NULL && scriptContextPtr->id == id) {
841 resume_group_script(scriptContextPtr, groupFlags);
842 }
843 }
844}

◆ suspend_all_group()

void suspend_all_group ( s32 groupFlags)

Definition at line 846 of file script_list.c.

846 {
847 s32 i;
848 Evt* scriptContextPtr;
849
850 for (i = 0; i < MAX_SCRIPTS; i++) {
851 scriptContextPtr = (*gCurrentScriptListPtr)[i];
852 if (scriptContextPtr != NULL) {
853 suspend_group_script(scriptContextPtr, groupFlags);
854 }
855 }
856}

Referenced by evt_handle_suspend_all(), set_time_freeze_mode(), suspend_frozen_scripts(), update_encounters_neutral(), and update_encounters_pre_battle().

◆ resume_all_group()

s32 resume_all_group ( s32 groupFlags)

Definition at line 858 of file script_list.c.

858 {
859 s32 i;
860 Evt* scriptContextPtr;
861
862 for (i = 0; i < MAX_SCRIPTS; i++) {
863 scriptContextPtr = (*gCurrentScriptListPtr)[i];
864 if (scriptContextPtr != NULL) {
865 resume_group_script(scriptContextPtr, groupFlags);
866 }
867 }
868}

Referenced by create_encounters(), evt_handle_resume_all(), set_time_freeze_mode(), start_battle(), update_encounters_conversation(), update_encounters_post_battle(), and update_item_entity_collectable().

◆ suspend_group_others()

void suspend_group_others ( Evt * script,
s32 groupFlags )

Definition at line 870 of file script_list.c.

870 {
871 s32 i;
872 Evt* scriptContextPtr;
873
874 for (i = 0; i < MAX_SCRIPTS; i++) {
875 scriptContextPtr = (*gCurrentScriptListPtr)[i];
876 if (scriptContextPtr != NULL && scriptContextPtr != script) {
877 suspend_group_script(scriptContextPtr, groupFlags);
878 }
879 }
880}

Referenced by evt_handle_suspend_others().

◆ resume_group_others()

void resume_group_others ( Evt * script,
s32 groupFlags )

Definition at line 882 of file script_list.c.

882 {
883 s32 i;
884 Evt* scriptContextPtr;
885
886 for (i = 0; i < MAX_SCRIPTS; i++) {
887 scriptContextPtr = (*gCurrentScriptListPtr)[i];
888 if (scriptContextPtr != NULL && scriptContextPtr != script) {
889 resume_group_script(scriptContextPtr, groupFlags);
890 }
891 }
892}

Referenced by evt_handle_resume_others().

◆ get_script_by_index()

Evt * get_script_by_index ( s32 index)

Definition at line 894 of file script_list.c.

894 {
895 return (*gCurrentScriptListPtr)[index];
896}

Referenced by dispatch_event_actor(), and func_802C73B8().

◆ get_script_by_id()

Evt * get_script_by_id ( s32 id)

Definition at line 898 of file script_list.c.

898 {
899 s32 i;
900 Evt* scriptContextPtr;
901
902 for (i = 0; i < MAX_SCRIPTS; i++) {
903 if ((*gCurrentScriptListPtr)[i] != NULL) {
904 scriptContextPtr = (*gCurrentScriptListPtr)[i];
905 if (scriptContextPtr->id == id) {
906 return scriptContextPtr;
907 }
908 }
909 }
910 return 0;
911}

Referenced by update_encounters_neutral().

◆ set_script_flags()

void set_script_flags ( Evt * script,
s32 flags )

Definition at line 913 of file script_list.c.

913 {
914 Evt* childScript = script->childScript;
915 s32 i;
916
917 script->stateFlags |= flags;
918 if (childScript != NULL) {
919 set_script_flags(childScript, flags);
920 }
921
922 for (i = 0; i < MAX_SCRIPTS; i++) {
923 Evt* scriptContextPtr = (*gCurrentScriptListPtr)[i];
924
925 if (scriptContextPtr != NULL && scriptContextPtr->parentScript == script) {
927 }
928 }
929}
void set_script_flags(Evt *script, s32 flags)

Referenced by set_script_flags(), and update_encounters_neutral().

◆ clear_script_flags()

void clear_script_flags ( Evt * script,
s32 flags )

Definition at line 931 of file script_list.c.

931 {
932 Evt* childScript = script->childScript;
933 s32 i;
934
935 script->stateFlags &= ~flags;
936 if (childScript != NULL) {
937 clear_script_flags(childScript, flags);
938 }
939
940 for (i = 0; i < MAX_SCRIPTS; i++) {
941 Evt* scriptContextPtr = (*gCurrentScriptListPtr)[i];
942
943 if (scriptContextPtr != NULL && scriptContextPtr->parentScript == script) {
944 clear_script_flags(scriptContextPtr, flags);
945 }
946 }
947}
void clear_script_flags(Evt *script, s32 flags)

Referenced by clear_script_flags(), and update_encounters_neutral().

Variable Documentation

◆ UniqueScriptCounter

s32 UniqueScriptCounter = 1

◆ IsUpdatingScripts

s32 IsUpdatingScripts = FALSE

◆ GlobalTimeRate

◆ gMapFlags

◆ gMapVars

◆ gNumScripts

◆ gWorldScriptList

BSS ScriptList gWorldScriptList

Definition at line 12 of file script_list.c.

Referenced by clear_script_list(), and init_script_list().

◆ gBattleScriptList

BSS ScriptList gBattleScriptList

Definition at line 13 of file script_list.c.

Referenced by clear_script_list(), and init_script_list().

◆ gCurrentScriptListPtr

◆ gScriptIndexList

◆ gScriptIdList

◆ gScriptListCount

◆ evtDebugPrintBuffer

BSS char evtDebugPrintBuffer[0x100]

Definition at line 20 of file script_list.c.

Referenced by evt_handle_print_debug_var().

◆ gLavaResetList

BSS struct LavaReset* gLavaResetList

Definition at line 23 of file script_list.c.

Referenced by get_lava_reset_pos().

◆ LastSafeFloor

BSS s32 LastSafeFloor

Definition at line 24 of file script_list.c.

Referenced by get_lava_reset_pos().

◆ gBattleMeshAnimationList

BSS AnimatedModelList gBattleMeshAnimationList

Definition at line 27 of file script_list.c.

Referenced by init_model_animators(), and reset_model_animators().

◆ gWorldMeshAnimationList

BSS AnimatedModelList gWorldMeshAnimationList

Definition at line 28 of file script_list.c.

Referenced by init_model_animators(), and reset_model_animators().

◆ gCurrentMeshAnimationListPtr

BSS AnimatedModelList* gCurrentMeshAnimationListPtr

Definition at line 29 of file script_list.c.

Referenced by init_model_animators(), and reset_model_animators().

◆ wExtraPartnerID

BSS s32 wExtraPartnerID

Definition at line 32 of file script_list.c.

◆ wExtraPartnerNpcID

BSS s32 wExtraPartnerNpcID

Definition at line 33 of file script_list.c.

◆ ShowMessageScreenOffsetX

BSS s32 ShowMessageScreenOffsetX

Definition at line 36 of file script_list.c.

Referenced by _show_message().

◆ ShowMessageScreenOffsetY

BSS s32 ShowMessageScreenOffsetY

Definition at line 37 of file script_list.c.

Referenced by _show_message().

◆ gCurrentPrintContext

BSS MessagePrintState* gCurrentPrintContext

Definition at line 38 of file script_list.c.

Referenced by _show_message(), and cancel_current_message().

◆ D_802DB268

BSS MessagePrintState* D_802DB268

Definition at line 39 of file script_list.c.

◆ D_802DB264

BSS s32 D_802DB264

Definition at line 40 of file script_list.c.

Referenced by _show_message().

◆ playerNpcData

BSS Npc playerNpcData

Definition at line 43 of file script_list.c.

◆ PlayerImgFXFlags

BSS u16 PlayerImgFXFlags

Definition at line 44 of file script_list.c.

◆ bBattleVirtualEntityList

BSS VirtualEntityList bBattleVirtualEntityList

Definition at line 45 of file script_list.c.

Referenced by clear_virtual_entity_list(), and init_virtual_entity_list().

◆ wWorldVirtualEntityList

BSS VirtualEntityList wWorldVirtualEntityList

Definition at line 46 of file script_list.c.

Referenced by clear_virtual_entity_list(), and init_virtual_entity_list().

◆ gCurrentVirtualEntityListPtr

◆ MusicEventList

BSS MusicEvent* MusicEventList

Definition at line 50 of file script_list.c.

◆ RunningMusicEvents

BSS Evt* RunningMusicEvents[10]

Definition at line 51 of file script_list.c.

◆ RunningMusicEventIDs

BSS s32 RunningMusicEventIDs[10]

Definition at line 52 of file script_list.c.

◆ gItemChoicePopupMenu

BSS PopupMenu gItemChoicePopupMenu

Definition at line 55 of file script_list.c.

◆ gWorldMapFlags

BSS u32 gWorldMapFlags[MAX_MAPFLAGS]

Definition at line 58 of file script_list.c.

Referenced by clear_script_list(), and init_script_list().

◆ gBattleMapFlags

BSS u32 gBattleMapFlags[MAX_MAPFLAGS]

Definition at line 59 of file script_list.c.

Referenced by clear_script_list(), and init_script_list().

◆ gWorldMapVars

BSS u32 gWorldMapVars[MAX_MAPVARS]

Definition at line 61 of file script_list.c.

Referenced by clear_script_list(), and init_script_list().

◆ gBattleMapVars

BSS u32 gBattleMapVars[MAX_MAPVARS]

Definition at line 62 of file script_list.c.

Referenced by clear_script_list(), and init_script_list().

◆ wPushBlockGrids

BSS PushBlockGrid* wPushBlockGrids[8]

Definition at line 64 of file script_list.c.

◆ DoorModelsSwingCW

BSS s32 DoorModelsSwingCW[3]

Definition at line 66 of file script_list.c.

◆ DoorModelsSwingCCW

BSS s32 DoorModelsSwingCCW[3]

Definition at line 67 of file script_list.c.