Button Presses During Events

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search

Addresses & Input Values

Controller Inputs

Title Screen: 0x800851BC
Event/Battle: 0x80045944
World Map/Formation: 0x8019A204

  0x8000  Left
  0x4000  Down
  0x2000  Right
  0x1000  Up
  0x0800  Start
  0x0400  R3
  0x0200  L3
  0x0100  Select
  0x0080  Square
  0x0040  Cross (X)
  0x0020  Circle
  0x0010  Triangle
  0x0008  R1
  0x0004  L1
  0x0002  R2
  0x0001  L2

Example: Playing a sound if the player held Start

//Button presses during Events can be found at the address 0x80045944. Since we can only adjust two bytes of a variable at a time with standard event commands, we'll need two lines to set this address.

LUI(x0070,x8004)
ADD(x0070,x5944)

//Load the current value at the address to Var x00

LoadAddress(x00,x0000,x70,002)

//AND the value of x0800, which is equal to the value of Start. This will clear out any other buttons that might be pressed, since we're only looking for Start.

AND(x0000,x0800)

//At this point, the only two values that Var x00 can have are x0800 or x0000. Run an If check - if it has a value, the player was pressing Start.

If()
  SoundEffect(x0001)
EndIf()