Difference between revisions of "SCUS 942.21 Routines"
Line 9: | Line 9: | ||
[[00011bc0 - 00011bf0]]: | [[00011bc0 - 00011bf0]]: | ||
− | [[00011bf4 - 00011dd4]]: | + | [[00011bf4 - 00011dd4]]: [[0x11bf4]] |
[[00011dd8 - 00011e14]]: | [[00011dd8 - 00011e14]]: | ||
Line 43: | Line 43: | ||
[[000124cc - 00012514]]: | [[000124cc - 00012514]]: | ||
− | 00012518 - 0001255c: [[Cursor Sound Effects?]] | + | 00012518 - 0001255c: [[Play Sound Effect (Inner Routine)]] | [[Cursor Sound Effects?]] |
[[00012560 - 000125a4]]: | [[00012560 - 000125a4]]: | ||
Line 119: | Line 119: | ||
[[000138ac - 00013b1c]]: | [[000138ac - 00013b1c]]: | ||
− | 00013b20 - 00013f70: [[Cursor Sound Effects?]] | + | 00013b20 - 00013f70: [[Play Sound Effect (Worker Routine)]] | [[Cursor Sound Effects?]] |
[[00013f74 - 00013fbc]]: | [[00013f74 - 00013fbc]]: | ||
Line 563: | Line 563: | ||
− | + | 0001bf38 - 0001bfb8: [[Frame Timing Related? (0x1bf38)]] | |
− | |||
− | |||
− | |||
[[0001bfb4 - 0001c048]]: | [[0001bfb4 - 0001c048]]: | ||
− | 0001c04c - 0001c050: [[ | + | 0001c04c - 0001c050: [[Return -1]] |
Line 601: | Line 598: | ||
[[0001c9e0 - 0001cb00]]: | [[0001c9e0 - 0001cb00]]: | ||
− | [[0001cb04 - 0001cb3c]]: | + | [[0001cb04 - 0001cb3c]]: [[? 0x1cb04]] |
− | [[0001cb40 - 0001cba0]]: | + | [[0001cb40 - 0001cba0]]: [[? 0x1cba4]] |
[[0001cba4 - 0001cbd8]]: | [[0001cba4 - 0001cbd8]]: | ||
Line 679: | Line 676: | ||
[[0001d56c - 0001d59c]]: | [[0001d56c - 0001d59c]]: | ||
+ | |||
+ | 0001d578 - 0001d59c: [[0x1d578]] | ||
[[0001d5a0 - 0001d5c8]]: | [[0001d5a0 - 0001d5c8]]: | ||
Line 692: | Line 691: | ||
[[0001dad0 - 0001db54]]: | [[0001dad0 - 0001db54]]: | ||
− | [[0001db58 - 0001db84]]:[[Get Buttons pressed Layer?]] | + | [[0001db58 - 0001db84]]: [[Get Inverted Button Input]] | [[Get Buttons pressed Layer?]] |
[[0001db88 - 0001dba4]]: | [[0001db88 - 0001dba4]]: | ||
Line 698: | Line 697: | ||
[[0001dba8 - 0001dcec]]: | [[0001dba8 - 0001dcec]]: | ||
− | [[0001dcf0 - 0001dd88]]: | + | [[0001dcf0 - 0001dd88]]: [[Wait for Vertical Sync]] |
[[0001dd8c - 0001ddb8]]: | [[0001dd8c - 0001ddb8]]: | ||
Line 878: | Line 877: | ||
[[00021f14 - 00022040]]: | [[00021f14 - 00022040]]: | ||
+ | |||
+ | 00021ff4 - 00021ffc: [[PAD_dr]] (Gets controller button state) | ||
[[00022044 - 00022050]]: | [[00022044 - 00022050]]: | ||
[[00022054 - 000221b0]]: | [[00022054 - 000221b0]]: | ||
+ | |||
+ | 000220f4 - 000220fc: [[Change Clear Pad]] | ||
+ | |||
+ | |||
+ | 00022104 - 0002210c: [[Change Clear RCnt]] | ||
[[000221b4 - 000221e8]]: | [[000221b4 - 000221e8]]: | ||
Line 891: | Line 897: | ||
[[00022254 - 00022288]]: | [[00022254 - 00022288]]: | ||
− | [[ | + | 0002228c - 00022294: [[Write String to Terminal]] |
− | 0002230c - 00022314: [[Random Number Generator]] | + | |
+ | 0002230c - 00022314: [[rand]] | [[Random Number Generator]] | ||
+ | |||
+ | [[0002228c - 00022b94]] | ||
00040934 - start of meaningful code | 00040934 - start of meaningful code | ||
Line 919: | Line 928: | ||
[[000235ac - 00023988]]: | [[000235ac - 00023988]]: | ||
− | [[0002398c - 00023a50]]: | + | [[0002398c - 00023a50]]: [[? Calculation (0x2398c)]] |
[[00023a54 - 00023a68]]: | [[00023a54 - 00023a68]]: | ||
Line 939: | Line 948: | ||
[[00023c50 - 00023c64]]: | [[00023c50 - 00023c64]]: | ||
− | [[00023c68 - 00023c8c]]: | + | [[00023c68 - 00023c8c]]: [[? 0x23c68]] |
[[00023c90 - 00023cb4]]: | [[00023c90 - 00023cb4]]: | ||
Line 1,007: | Line 1,016: | ||
[[00024510 - 000245b8]]: | [[00024510 - 000245b8]]: | ||
− | [[000245bc - 000245c8]]: | + | [[000245bc - 000245c8]]: [[? Accessor (0x245bc)]] |
[[000245cc - 000245d8]]: | [[000245cc - 000245d8]]: | ||
Line 1,017: | Line 1,026: | ||
[[000246d4 - 0002473c]]: | [[000246d4 - 0002473c]]: | ||
− | [[00024740 - 00024864]]: | + | [[00024740 - 00024864]]: [[? 0x24740]] |
[[00024868 - 000248f8]]: | [[00024868 - 000248f8]]: | ||
− | [[000248fc - 0002495c]]: | + | [[000248fc - 0002495c]]: [[? 0x248fc]] |
[[00024960 - 000249c0]]: | [[00024960 - 000249c0]]: | ||
− | [[000249c4 - 00024a84]]: | + | [[000249c4 - 00024a84]]: [[? 0x249c4]] |
[[00024a88 - 00024b3c]]: | [[00024a88 - 00024b3c]]: | ||
Line 1,055: | Line 1,064: | ||
[[000254a4 - 000254c8]]: | [[000254a4 - 000254c8]]: | ||
− | [[000254cc - 00025520]]: | + | [[000254cc - 00025520]]: [[? 0x254cc]] |
[[00025524 - 000257c4]]: | [[00025524 - 000257c4]]: | ||
Line 1,193: | Line 1,202: | ||
00042a10 - 00042aac: [[Starting Inventory]] | 00042a10 - 00042aac: [[Starting Inventory]] | ||
− | [[00042ab0 - 00042b18]]: | + | [[00042ab0 - 00042b18]]: [[? 0x42ab0]] (Starting new game related) |
− | [[00042b1c - 00042b28]]: | + | [[00042b1c - 00042b28]]: [[Store Three Consecutive Halfwords]] |
[[00042b2c - 00042b38]]: | [[00042b2c - 00042b38]]: | ||
Line 1,257: | Line 1,266: | ||
[[00043f88 - 00043ff4]]: | [[00043f88 - 00043ff4]]: | ||
− | 00043ff8 - 00044014: [[Play Sound Effect?]] (value in r4 decides sound effect) | + | 00043ff8 - 00044014: [[Play Sound Effect]] | [[Play Sound Effect?]] (value in r4 decides sound effect) |
− | |||
− | |||
[[00044018 - 00044034]]: | [[00044018 - 00044034]]: | ||
Line 1,285: | Line 1,292: | ||
[[00044414 - 000444d8]]: | [[00044414 - 000444d8]]: | ||
− | [[000444dc - 000445fc]]: | + | [[000444dc - 000445fc]]: [[? 0x444dc]] |
[[00044600 - 0004466c]]: | [[00044600 - 0004466c]]: | ||
Line 1,313: | Line 1,320: | ||
[[00044a08 - 00044a30]]: | [[00044a08 - 00044a30]]: | ||
− | [[00044a34 - 00044a5c]]: | + | [[00044a34 - 00044a5c]]: [[? 0x44a34]] |
− | [[00044a60 - 00044a78]]: | + | [[00044a60 - 00044a78]]: [[? 0x44a60]] |
[[00044a7c - 00044ac8]]: | [[00044a7c - 00044ac8]]: | ||
Line 1,346: | Line 1,353: | ||
[[00045900 - 00045938]]: | [[00045900 - 00045938]]: | ||
+ | |||
+ | 00045938 - end of meaningful code | ||
0004593c - 00059abc: | 0004593c - 00059abc: | ||
Line 1,353: | Line 1,362: | ||
[[00059ac0 - 00059aec]]: | [[00059ac0 - 00059aec]]: | ||
− | 00059ac8 - 00059aec: [[Initialize Party ID to FF]] | + | 00059ac8 - 00059aec: [[Clear Party]] | [[Initialize Party ID to FF]] |
00059af0 - 00059b14: [[Get Party Data Pointer]] | 00059af0 - 00059b14: [[Get Party Data Pointer]] | ||
Line 1,359: | Line 1,368: | ||
00059b18 - 00059bac: [[Unit Initialization ]] | 00059b18 - 00059bac: [[Unit Initialization ]] | ||
− | 00059bb0 - 00059d58: [[Add Unit to Party/Store Unit's Party Data]] | + | 00059bb0 - 00059d58: [[Save Unit to Party]] | [[Add Unit to Party/Store Unit's Party Data]] |
− | 00059d5c - 00059e14: [[Find Free Party Slot]] | + | 00059d5c - 00059e14: [[Find Free Party Index]] | [[Find Free Party Slot]] |
00059e18 - 00059ed0: [[Create Monster Egg]] | 00059e18 - 00059ed0: [[Create Monster Egg]] | ||
− | 00059ed4 - 00059f90: [[Find Empty Party Slot and Generate Unit]] | + | 00059ed4 - 00059f90: [[Generate Party Unit In Empty Slot]] | [[Find Empty Party Slot and Generate Unit]] |
00059f94 - 00059fdc: [[Find Unit's Party Data Location]] | 00059f94 - 00059fdc: [[Find Unit's Party Data Location]] | ||
Line 1,487: | Line 1,496: | ||
0005e088 - 0005e0c8: [[Calculate Unit's Palette/Portrait (return Portrait)]] | 0005e088 - 0005e0c8: [[Calculate Unit's Palette/Portrait (return Portrait)]] | ||
− | 0005e0cc - 0005e11c: [[Check if Random is greater/equal to Chance]] | + | 0005e0cc - 0005e11c: [[Pass/Fail Roll]] | [[Check if Random is greater/equal to Chance]] |
0005e120 - 0005e1ac: [[Get Unit's Portrait/Palette]] **changes sprite that's loaded in battle | 0005e120 - 0005e1ac: [[Get Unit's Portrait/Palette]] **changes sprite that's loaded in battle | ||
Line 1,495: | Line 1,504: | ||
0005e200 - 0005e228: [[Get Known Abilities]] | 0005e200 - 0005e228: [[Get Known Abilities]] | ||
− | 0005e22c - 0005e250: [[Transfer Target ID? Through Mount Data]] | + | 0005e22c - 0005e250: [[Copy Byte Data (20 Bytes)]] (Used Action data) | [[Transfer Target ID? Through Mount Data]] |
0005e254 - 0005e284: [[Store X Byte into Y]] | 0005e254 - 0005e284: [[Store X Byte into Y]] | ||
Line 1,503: | Line 1,512: | ||
0005e478 - 0005e4e4: [[Initialize Unit's X/Y+Facing/Battle Rewards]] | 0005e478 - 0005e4e4: [[Initialize Unit's X/Y+Facing/Battle Rewards]] | ||
− | 0005e4e8 - 0005e5d4: [[Get Lowest Order Status' 0x08 Check Data? (Status Checks 2)]] | + | 0005e4e8 - 0005e5d4: [[Find Action Highest Order Status Effect]] | [[Get Lowest Order Status' 0x08 Check Data? (Status Checks 2)]] |
0005e5d8 - 0005e640: [[Calculate Zodiac Symbol]] | 0005e5d8 - 0005e640: [[Calculate Zodiac Symbol]] |
Revision as of 16:43, 5 August 2020
SCUS_942.21 RAM
00012518 - 0001255c: Play Sound Effect (Inner Routine) | Cursor Sound Effects?
00013b20 - 00013f70: Play Sound Effect (Worker Routine) | Cursor Sound Effects?
00017e7c - 00017eb4: Get Sound Effect Data For ability effects?
0001bec8 - 0001d64c: Initialize some screen data
0001bf38 - 0001bfb8: Frame Timing Related? (0x1bf38)
0001c04c - 0001c050: Return -1
0001cb04 - 0001cb3c: ? 0x1cb04
0001cb40 - 0001cba0: ? 0x1cba4
0001d09c - 0001d0d4: Store Rotation matrix elements to GTE
0001d0d8 - 0001d104: Store Light Source Matrix Elements to GTE
0001d108 - 0001d134: Store Light Color matrix source RGB's to GTE
0001d138 - 0001d154: Store Translation Vectors to GTE
0001d158 - 0001d160: Get Projection Plane distance from GTE
0001d164 - 0001d184: Store Background RGB to GTE
0001d188 - 0001d1a4: Store far color RGB to GTE
0001d1a8 - 0001d1bc: Store Screen offsets to GTE
0001d1c0 - 0001d1d0: Store Projection plane distance in GTE
0001d1d4 - 0001d1fc: Multiply vector and store results
0001d200 - 0001d224: Depth Cue Color Light
0001d228 - 0001d260: Depth Cue Triple
0001d264 - 0001d284: interpolate
0001d288 - 0001d2ac: square vector
0001d2b0 - 0001d2d4: square matrix/vector (duplicate routine?
0001d2d8 - 0001d2f4: Find Average of 3 Z values
0001d2f8 - 0001d318: Find Average of 4 Z values
0001d31c - 0001d370: calculate outer product of 2 vectors
0001d374 - 0001d3c8: calculate outer product of 2 vectors 2
0001d3cc - 0001d3e0: Get leading 0 or 1 count
0001d578 - 0001d59c: 0x1d578
0001db58 - 0001db84: Get Inverted Button Input | Get Buttons pressed Layer?
0001dcf0 - 0001dd88: Wait for Vertical Sync
0001ef54 - 0001ef74: Load file into RAM 1 Calls 20650 routine, where the magic happens
00020650 - 0002074c: Load file into RAM
00020840 - 00020a5c: Call load file into RAM routine
00021ff4 - 00021ffc: PAD_dr (Gets controller button state)
000220f4 - 000220fc: Change Clear Pad
00022104 - 0002210c: Change Clear RCnt
0002228c - 00022294: Write String to Terminal
0002230c - 00022314: rand | Random Number Generator
00040934 - start of meaningful code
0002398c - 00023a50: ? Calculation (0x2398c)
00023c68 - 00023c8c: ? 0x23c68
000245bc - 000245c8: ? Accessor (0x245bc)
00024740 - 00024864: ? 0x24740
000248fc - 0002495c: ? 0x248fc
000249c4 - 00024a84: ? 0x249c4
000254cc - 00025520: ? 0x254cc
00028acc - 00040970:
00040bd8 - 00041380: Build Image Data for Now Loading message
00042a10 - 00042aac: Starting Inventory
00042ab0 - 00042b18: ? 0x42ab0 (Starting new game related)
00042b1c - 00042b28: Store Three Consecutive Halfwords
00043ff8 - 00044014: Play Sound Effect | Play Sound Effect? (value in r4 decides sound effect)
000444dc - 000445fc: ? 0x444dc
00044a34 - 00044a5c: ? 0x44a34
00044a60 - 00044a78: ? 0x44a60
000454cc - 0004571c:
00045938 - end of meaningful code
0004593c - 00059abc:
00059854 - 00059abc: Initialize Status Check Data
00059ac8 - 00059aec: Clear Party | Initialize Party ID to FF
00059af0 - 00059b14: Get Party Data Pointer
00059b18 - 00059bac: Unit Initialization
00059bb0 - 00059d58: Save Unit to Party | Add Unit to Party/Store Unit's Party Data
00059d5c - 00059e14: Find Free Party Index | Find Free Party Slot
00059e18 - 00059ed0: Create Monster Egg
00059ed4 - 00059f90: Generate Party Unit In Empty Slot | Find Empty Party Slot and Generate Unit
00059f94 - 00059fdc: Find Unit's Party Data Location
00059fe0 - 00059ff8: Remove Unit from Party
00059ffc - 0005a3dc: Out of Battle Unit Generation
0005a3e0 - 0005a3fc: Generate Unit's Base Raw Stats Prep
0005a400 - 0005a444: Prep for Generating Base Raw Stats
0005a448 - 0005a51c: Generate Unit's Base Raw Stats
0005a520 - 0005a564: Transfer Job's Growths/Mults to Unit
0005a568 - 0005a634: Load Ability From Skillset
0005a638 - 0005a728: Store Skillset's Abilities
0005a72c - 0005a880: Calculate Ability Pointers and Type
0005a884 - 0005a8a0: Get Item Data Pointer
0005a8a4 - 0005a8d0: Get Job Data Pointer
0005a8d4 - 0005a9b0: Initialize Unit's Job Data
0005a9b4 - 0005aafc: Unit Battle Initialization
0005ab00 - 0005ab44: Equipment/Move/Jump +X/Name Storing/Generation
0005ab48 - 0005ac18: Store Ramza's Name/Birthday/Zodiac
0005ac1c - 0005b034: ENTD Data Calculation
0005b038 - 0005b0cc: Prep for Initializing Unit's Job Data
0005b0d0 - 0005b2b0: Initialize Unit's Battle Data
0005b2b4 - 0005b4fc: Calculate ENTD Unit Jobs
0005b500 - 0005b5d8: Sprite Set and Random Secondary Job Calculation
0005b5dc - 0005b79c: Transfer Job's Data to Unit's Data
0005b7a0 - 0005b828: Enable Unit's R/S/M Flags
0005b82c - 0005b87c: R/S/M Flag Setting
0005b880 - 0005ba6c: Calculate Actual Stats (Used for Stat Capping as well)
0005ba70 - 0005bdac: Calculate Unit's Abilities
0005bdb0 - 0005bdec: Monster Equipment Storing
0005bdf0 - 0005c278: Calculate/Store ENTD Unit Equipment
0005c27c - 0005c394: Equippable Item Setting (Support/Female-only)
0005c398 - 0005c5c4: Equipment Stat Setting
0005c5c8 - 0005c8e8: Equipment Attribute Setting
0005c8ec - 0005c980: Move/Jump +X Calculation (can be used to load data at start of battle)
0005c984 - 0005cbcc: Store/Generate Character Names
0005cbd0 - 0005cc60: Calculate Highest Party Level
0005cc64 - 0005cc94: Store X into Y (r4 = Loading Pointer, r5 = Storing Pointer)
0005cc98 - 0005ce70: Calculate Random Equipment
0005ce74 - 0005d0b8: Calculate Learned Abilities
0005d0bc - 0005d3c0: Calculate Unit's R/S/M
0005d3c4 - 0005d410: Find Skillset's Job ID (Not used?)
0005d414 - 0005d46c: Status Initialization
0005d470 - 0005d4cc: Nullify CT/Initialize Death Counter
0005d4d0 - 0005d5b8: Float/Current Statuses/Status Immunities/Status CT
0005d5bc - 0005d5dc: Status Setting/Checking + Equip/R/S/M Stats Prep
0005d5e0 - 0005d600: Status Setting/Checking + Equip/R/S/M Stats Prep 2 (Level Up)
0005d604 - 0005d624: Status Setting/Checking + Equip/R/S/M Stats Prep 3
0005d628 - 0005d87c: Status Setting/Checking + Equip/R/S/M Stats
0005d880 - 0005d8f8: Check if Unit Leveled UP
0005d8fc - 0005da0c: Level Unit to Specific Level
0005da10 - 0005db6c: Level Up Section
0005db70 - 0005dc10: Status CT Setting
0005dc14 - 0005dd44: Calculate Unlocked Jobs
0005dd48 - 0005ded4: Proposition JP Gain
0005ded8 - 0005def0: Store 3-Byte Data
0005def4 - 0005df34: Calculate Job Level
0005df38 - 0005dfa8: Initialize Unit's Job Levels
0005dfac - 0005dfd0: Initialize Some Unit Data
0005dfd4 - 0005e014: Minimum SP Capping/War Trophy Nulling/Status Initialization
0005e018 - 0005e04c: Get Ability's Range
0005e050 - 0005e084: Get Ability's AoE
0005e088 - 0005e0c8: Calculate Unit's Palette/Portrait (return Portrait)
0005e0cc - 0005e11c: Pass/Fail Roll | Check if Random is greater/equal to Chance
0005e120 - 0005e1ac: Get Unit's Portrait/Palette **changes sprite that's loaded in battle
0005e1b0 - 0005e1fc: Status Checks (r5 = set to check)
0005e200 - 0005e228: Get Known Abilities
0005e22c - 0005e250: Copy Byte Data (20 Bytes) (Used Action data) | Transfer Target ID? Through Mount Data
0005e254 - 0005e284: Store X Byte into Y
0005e288 - 0005e474: Get Total Equipment Quantity (Equip Change/Formation Screen?)
0005e478 - 0005e4e4: Initialize Unit's X/Y+Facing/Battle Rewards
0005e4e8 - 0005e5d4: Find Action Highest Order Status Effect | Get Lowest Order Status' 0x08 Check Data? (Status Checks 2)
0005e5d8 - 0005e640: Calculate Zodiac Symbol
0005e644 - 0005e66c: Data Nullifying (requires r5 = Limit, and r4 = Starting location)
0005e670 - 0005e6c8: Increase Casualties/Injured Counters
0005e6cc - 0005e740: Inflicted Status Changes
0005e744 - 0005e774: Store Current Statuses
0005e778 - 0005e7a4: Transfer Last Ability Used CT
0005e7a8 - 0005e8e4: Status infliction/removal?
0005e8e8 - 0005e908: ? removed code?
END
Other SCUS_942.21 Notes:
- 0x4F1D0: 64 bytes
- "Elemental" skillset lookup table: determines which abilities are enabled by which terrain type.
- 0x4F210: 64 bytes
- Terrain status inflict: determines which terrains cause Poison ("80" instead of "00")
- 0x4F250: 64 bytes
- Default movement table: determines the movement cost for crossing various terrain.
- 0x4F290: 320 bytes
- Ability movement tables: like the above, but enabled by Fly/Teleport, Float, Walk on Water/Move in Water, Move Undrwater, Move on Lava, respectivelyENDENDENDENDENDENDENDENDENDENDENDENDENDEND