News: 11 March 2016 - Forum Rules

Author Topic: Battles background animations in Earthbound  (Read 2661 times)

darthvaderx

  • Full Member
  • ***
  • Posts: 243
    • View Profile
Battles background animations in Earthbound
« on: July 01, 2019, 03:22:50 am »
In Earthbound the battle background animations are presented differently from simple enemies and bosses, the former have only a third of the screen:



The latter have animations in full screen:



So I ask you, would it be possible for a hack that would make all the battles have animations in full screen?
See my hacks channel including some of my works:

https://www.youtube.com/user/MyWashington2/videos

Alchemic

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Re: Battles background animations in Earthbound
« Reply #1 on: July 02, 2019, 06:07:43 pm »
It is indeed possible.

The size of the battle "letterbox" is controlled by the "enemy battle groups pointer table" at 0x10C60D to 0x10D52C*. Each entry in that table has eight bytes, and the last byte of each entry controls the letterbox size for that battle group (00-03, with 00 being "full screen visible").

* A lot of EarthBound's hacking documentation uses addresses with the 0x200-byte copier header included, and would give the range as 0x10C80D to 0x10D72C instead. Use whichever is appropriate to your ROM (hopefully the former).

So the slow, laborious approach would be to update each entry with a last byte of 00 - but we can do better, by updating the code that reads the letterbox size instead:

Code: [Select]
...
C2/48CC: AD 8C 4A     LDA $4A8C                 A = [1F 23] battle entry number
C2/48CF: 0A           ASL
C2/48D0: 0A           ASL
C2/48D1: 0A           ASL
C2/48D2: 18           CLC
C2/48D3: 69 07 00     ADC #$0007
C2/48D6: AA           TAX
C2/48D7: BF 0D C6 D0  LDA $D0C60D,X
C2/48DB: 29 FF 00     AND #$00FF
C2/48DE: 85 29        STA $29
...

Change the 29 FF 00 (AND #$00FF) at 0x248DB* to A9 00 00 (LDA #$0000), and it will use the constant 0 instead of the byte from the table. (On review, 29 00 00 (AND #$0000) would also work, if you wanted to change as few bytes as possible.)

* Or 0x24ADB, for a headered ROM.

darthvaderx

  • Full Member
  • ***
  • Posts: 243
    • View Profile
Re: Battles background animations in Earthbound
« Reply #2 on: July 03, 2019, 04:34:11 am »
It works perfectly!!!



Thank you, it's people like you who dignifies the romhacking scene ... ;)
See my hacks channel including some of my works:

https://www.youtube.com/user/MyWashington2/videos