Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Functions:
- 001b5460 - ???? Some sort of input state management, changes behavior when paused, entering menus, loading new areas, etc - more importantly, copies controller state to 413DA8
- 001b5590 - Convert analog inputs to digital, handle exclusion and priority - many places in the game make decisions based on the digital status of movement, so it's important analog inputs be converted to their digital equivalents here
- 001b5a48 - rats nest of a function that processes all digital controls (after analog to digital conversion in the above) - this is where digital movement logic should be replaced with analog logic
- There seem to be 3 locations that store button state:
- 01E0DB00 - These two seem to contain inverted button masks but identical axis info?
- 01E0DB80
- 01E0DC00 - This seems to contain active state?
- + 0x20 - Mask for new buttons pressed
- 01E0DC7E - Some sort of processing disabled? Could also possibly mean the controller is digital only (not DS2)
- $02 $03
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- Sq. X Cir. Tri. R1 L1 R2 L2 Left Down Right Up Start R3 L3 Select
- (20)413DB8 - Effective button state after analog processing
- +2 - Effective new buttons pressed after analog processing
- +4 - Boolean indicating if input was processed this frame
- +6 - ^- ya that's stored as a word ...
- +8 - Working space for calculating effective state from right joypad
- +a - Working space for calculating effective new buttons pressed from right joypad
- +c - Working space for calculating effective state from left joypad
- +e - Working space for calculating effective new buttons pressed from left joypad
- There appears to be a button map at 00446924(ish), half words are stored and used as masks around 1b5cd4
- Initialized from 0036A161
- 0044692C = move forward
- 0044692E = move backward
- 00446930 = turn right
- 00446932 = turn left
- 00446934 = strafe right
- 00446936 = strafe left
- 00446938 = look up
- 0044693A = look down
- 0044693C = square, swing sword
- 0044693E = triangle, magic slot
- 00446940 = X, run, action
- 00446942 = circle, open menu
- 00446944 = select, use accessory item
- 00446946 = start, pause game
- There is a bug in the game code where looking down immediately cancels right turn deceleration. To fix change the following:
- Byte 1b856c to "nop" (00000000) from "lwc1 $f0, $01b8(v0)" (c44001b8)
- Byte 1b8574 to "c.lt.s $f1, $f2" (46020834) from "c.lt.s $f0, $f2" (46020034)
- patch=1,EE,001b8574,word,46020834
- Magic numbers:
- 0x1c0 - Possibly the size of a game state struct, often multiplied by integer values to construct a pointer offset
- These are used in two functions.
- 002179F8: I believe this is returning a flag to indicate if the game should be processing input at this time
- byte func(int shift, int offset)
- {
- // When both inputs are 0 goes to 0x01e0dc7e
- return *(0x01e0db00 + (((shift << 2) + offset) * 0x1c0) + 0x17e);
- }
- 00217760:
- void *func(int shift, int offset)
- {
- return 0x01e0dc00 + (((shift << 2) + offset) * 0x1c0);
- }
- { 0x20413DE0 , "Movement Settings" , 'movement'},
- movement ={
- { 0x00 , "Move Speed Max: %s" , vtSingle, array = 6, name = 'movement' },
- { 0x18 , "movement Accel: %s" , vtSingle, array = 6, name = 'movement' }, // 413df8
- { 0x30 , "movement Deccel: %s" , vtSingle, array = 6, name = 'movement' }, // 413e10
- { 0x48 , "left right turn cap: %s" , vtSingle, array = 6, name = 'movement' }, // 413e28
- { 0x60 , "Turn Accel: %s" , vtSingle, array = 6, name = 'movement' }, // 413e40
- { 0x78 , "Unknown 0x78?: %s" , vtSingle, array = 6, name = 'movement' }, // 413e58
- { 0x90 , "up down look cap: %s" , vtSingle, array = 6, name = 'movement' }, // 413e70
- { 0xA8 , "up down accel: %s" , vtSingle, array = 6, name = 'movement' }, // 413e88
- { 0xC0 , "Turn Deccel: %s" , vtSingle, array = 6, name = 'movement' }, // 413ea0
- { 0xD8 , "Recenter Speed: %s" , vtSingle, array = 6, name = 'movement' }, // 413eb8
- { 0xF0 , "Gravity: %s" , vtSingle, array = 6, name = 'movement' }, // 413ed0
- },
- movement={
- 'Normal',
- 'Ice',
- 'Water Surface',
- 'Underwater',
- 'Lava',
- 'unknown(5)',
- },
- { 0x20413F80 , "Player Stats" , 'playerStats'},
- playerStats ={
- { 0x000, "Position%s" , vtSingle, array = 4, name = 'coords' },
- { 0x010, "Look Direction Vertical" , vtSingle},
- { 0x014, "Look Direction Horizontal" , vtSingle},
- { 0x020, "Max HP (Base)" , vtDword },
- { 0x024, "Max MP (Base)" , vtDword },
- { 0x028, "Max Physical" , vtDword },
- { 0x02C, "Max Magical" , vtDword },
- { 0x030, "Status Time" , 'statuses' },
- { 0x03C, "Equip Weapon" , vtByte, dropdown = 'weapon' },
- { 0x03D, "Equip Magic" , vtByte, dropdown = 'spell' },
- { 0x03E, "Equip %s" , vtByte, dropdown = 'armor', array=8, name='equipArmorSlot' },
- { 0x046, "Equip Shortcut" , vtWord },
- { 0x048, "Equip Shortcut Category", vtByte },
- { 0x04C, "Gold", vtDword },
- { 0x050, "Exp", vtDword },
- { 0x054, "Level", vtDword },
- { 0x058, "Max HP (Scaled)", vtDword },
- { 0x05C, "Max MP (Scaled)", vtDword },
- { 0x060, "Weapon Damage" , 'elements' },
- { 0x072, "Weapon Status Chance%" , 'statuses' },
- { 0x07E, "Defense (Base)" , 'elements' },
- { 0x090, "Defense (Scaled)" , 'elements' },
- { 0x0A4, "Weight Current" , vtDword },
- { 0x0A8, "Weight Maximum" , vtDword },
- { 0x0AC, "Current Physical" , vtDword },
- { 0x0B0, "Current Magical" , vtDword },
- { 0x0B4, "Current HP" , vtDword },
- { 0x0B8, "Current MP" , vtDword },
- { 0x0BC, "Physical Meter" , vtDword },
- { 0x0C0, "Magic Meter" , vtDword },
- { 0x0C4, "Physical Meter Charge Delay" , vtDword },
- { 0x0C8, "Magical Meter Charge Delay" , vtDword },
- { 0x0CC, "Breath Time" , vtDword },
- { 0x0D0, "Breath Time Max" , vtDword },
- { 0x0D4, "Physical XP (100/lvl)" , vtDword },
- { 0x0D8, "Magical XP (100/lvl)", vtDword },
- { 0x0DC, "Resist Status%", 'statuses' },
- { 0x1A8, "Player Death Frame" , vtDword },
- { 0x1AC, "Velocity Falling Down" , vtSingle },
- { 0x1B0, "Velocity Strafe" , vtSingle },
- { 0x1B4, "Velocity" , vtSingle },
- { 0x1B8, "Velocity Rotate Y" , vtSingle },
- { 0x1BC, "Velocity Rotate X" , vtSingle },
- { 0x1C8, "Condition Flags" , vtQword, hex=true },
- { 0x200, "Status Time Fall Damage Stumble" , vtDword },
- { 0x230, "Knockback Magnitude?" , vtSingle },
- { 0x234, "Status Time Hit Disorientation" , vtDword },
- { 0x238, "Disorientation Look Down" , vtSingle },
- { 0x23C, "Disorientation?" , vtSingle },
- { 0x240, "Push Velocity? %s" , vtSingle, array = 3, name = 'coords' },
- { 0x25E, "Sword Magic Related?" , vtByte },
- size = 0x300},
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement