News:

11 March 2016 - Forum Rules

Main Menu

Problems with menu/battle function in Bahamut Lagoon

Started by RedScorpion, April 27, 2014, 02:06:32 PM

Previous topic - Next topic

RedScorpion

Iam currently try to fix the last issues with BL, I could fix the tile screen and the font issue which occurs on emulation.

Further i have to set to complet menu/battle and dialog font to a extended area of the game, because there was no more space available.

Now, all Battledislogs and Item descrption will not display correctly.

The original BL Font centered the description after a big amount of functions. After this, the game transfer the description from RAM to VRAM and displayed during battles and in menu list.

See the image to understand the issue.

$E6/3DD2 8F 03 42 00 STA $004203 -> I think this could be the problem. I think the original calculate the lengh of the available chars and set the aligment for the description.



I hope anyone could help me to fix the problem

BL Original function:

$E6/3DC8 E2 21       SEP #$21                A:0052 X:0000 Y:0001 P:envMxdizC
$E6/3DCA E9 20       SBC #$20                A:0052 X:0000 Y:0001 P:envMxdizC
$E6/3DCC 8F 02 42 00 STA $004202[$00:4202]   A:0032 X:0000 Y:0001 P:envMxdizC
$E6/3DD0 A9 0E       LDA #$0E                A:0032 X:0000 Y:0001 P:envMxdizC
$E6/3DD2 8F 03 42 00 STA $004203[$00:4203]   A:000E X:0000 Y:0001 P:envMxdizC
$E6/3DD6 C2 39       REP #$39                A:000E X:0000 Y:0001 P:envMxdizC
$E6/3DD8 EA          NOP                     A:000E X:0000 Y:0001 P:envmxdizc
$E6/3DD9 AF 16 42 00 LDA $004216[$00:4216]   A:000E X:0000 Y:0001 P:envmxdizc
$E6/3DDD AA          TAX                     A:02BC X:0000 Y:0001 P:envmxdizc
$E6/3DDE E0 33 05    CPX #$0533              A:02BC X:02BC Y:0001 P:envmxdizc
$E6/3DE1 90 03       BCC $03    [$3DE6]      A:02BC X:02BC Y:0001 P:eNvmxdizc
$E6/3DE6 60          RTS                     A:02BC X:02BC Y:0001 P:eNvmxdizc


$E6/3DC8 E2 21       SEP #$21                A:0672 X:001F Y:0020 P:envMxdizC
$E6/3DCA 5C 00 00 F8 JMP $F80000[$F8:0000]   A:0672 X:001F Y:0020 P:envMxdizC
$F8/0000 8F DE FF 7F STA $7FFFDE[$7F:FFDE]   A:0672 X:001F Y:0020 P:envMxdizC
$F8/0004 8F 02 42 00 STA $004202[$00:4202]   A:0672 X:001F Y:0020 P:envMxdizC
$F8/0008 A9 10       LDA #$10                A:0672 X:001F Y:0020 P:envMxdizC
$F8/000A 8F 03 42 00 STA $004203[$00:4203]   A:0610 X:001F Y:0020 P:envMxdizC
$F8/000E 5C D6 3D E6 JMP $E63DD6[$E6:3DD6]   A:0610 X:001F Y:0020 P:envMxdizC
$E6/3DD6 C2 39       REP #$39                A:0610 X:001F Y:0020 P:envMxdizC
$E6/3DD8 EA          NOP                     A:0610 X:001F Y:0020 P:envmxdizc
$E6/3DD9 AF 16 42 00 LDA $004216[$00:4216]   A:0610 X:001F Y:0020 P:envmxdizc
$E6/3DDD AA          TAX                     A:0720 X:001F Y:0020 P:envmxdizc
$E6/3DDE E0 00 20    CPX #$2000              A:0720 X:0720 Y:0020 P:envmxdizc
$E6/3DE1 90 03       BCC $03    [$3DE6]      A:0720 X:0720 Y:0020 P:eNvmxdizc
$E6/3DE6 60          RTS                     A:0720 X:0720 Y:0020 P:eNvmxdizc


Please sent me an PM if you want help. I could sent you the ROM

Thanks in advance

red

P.S. This is not a pointer issue!

KingMike

I don't think there's enough context of what the memory does. What's the purpose of the input and the output values?

So, in the original, we have IF (SOMETHING - #$20) * 14 < 0x533 THEN...
and in the hack we have IF SOMETHING * 16 < 0x2000 THEN...
"My watch says 30 chickens" Google, 2018

mopoz

In the English version uses the font 8х14 ($8 х $E)
Here multiplication goes to font was 8x16
Skate-punk rulezzzz

RedScorpion

hi,

okay maybe i have not enough knowledge about the operations which are used in this asm function.

This is what i know...

1. Read pointer position of dialog description -> Jump to point -  Read a lot of VRAM transfers -> create MAP in 7F4000 (not completly sure, have to check the debug log)
2. Read and store each char of font with function and save at 7FFFDE . The game perform this 2 times. Display the description.

Hope anyone could help.

Thanks

red