News: 11 March 2016 - Forum Rules

Author Topic: Need help on expanding Phantasy Star 4's battle windows  (Read 1511 times)

WAYE222

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Need help on expanding Phantasy Star 4's battle windows
« on: September 22, 2021, 03:06:05 am »
Hi!
I've worked on a Phantasy Star 4 hack for several days using lory1990's PSIV disassembly. The aim is to give items and skills their full names and so far I've managed to expand the camp menus. The image below is an example.

When it comes to battle windows, I had some problems, one of them is, when vehicle battle command opened for the first time, it worked well,

but after opening and closing the Option window, it becomes like this:

This is not the only window with such problem. It seems that the number of the window's tiles is limited to some value and I can't find where to change it cuz I have no knowledge about codes and programming. Could anyone help me please? Thank you!

September 23, 2021, 02:45:04 am - (Auto Merged - Double Posts are not allowed before 7 days.)
This problem is solved by myself (although I don't why)
« Last Edit: September 23, 2021, 01:55:11 pm by WAYE222 »

FAST6191

  • Hero Member
  • *****
  • Posts: 3290
    • View Profile
Re: Need help on expanding Phantasy Star 4\'s battle windows
« Reply #1 on: September 23, 2021, 07:53:41 am »
Are they separate tiles or are they rotated/flipped?

If they are rotated/flipped then I would be looking at whatever handles the megadrive's equivalent of OAM (been too long since I looked at megadrive hardware listings to see if it supports flips/rotations -- mainstay 16 bit era thing I would expect it but I am also surprised by limitations all the time) that handles tile/sprite layout.
A secondary opening might have used a separate call or setting for that area.

Granted if it was separate tiles (can be done even on systems with it if the devs think ROM and VRAM space is less valuable than CPU time to create the relevant patterns, or are just bad at their job/lazy) you would still be looking at the OAM and figuring out what changed in the layout.

Felipefpl

  • Jr. Member
  • **
  • Posts: 28
  • Banned
    • View Profile
Re: Need help on expanding Phantasy Star 4\'s battle windows
« Reply #2 on: September 23, 2021, 09:19:37 am »
A good project you got there.  :thumbsup:

I hope someday will make a "tooltip" or a "description's bar" showing what every skill does, it sucks having to keep in memory what each of them do...  :-\
Core i7 Celeron Sandy Bridge G460 1.8 Ghz - 4 GB RAM - Win7 Home Premium x64 - Intel HD Graphics 2000 Onboard


KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7206
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Need help on expanding Phantasy Star 4\'s battle windows
« Reply #3 on: September 23, 2021, 10:25:22 am »
It's possible the game could be keeping track of a copy of the window underneath (when it draws a new window) and only updating the amount of bytes it thinks the window should be (the size of the old window).

One thing I would check is if the game keeps a copy of the tilemap in RAM, and tracing to see how it edits that tilemap when opening and closing the other window.
"My watch says 30 chickens" Google, 2018

WAYE222

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Need help on expanding Phantasy Star 4's battle windows
« Reply #4 on: September 24, 2021, 01:58:40 am »
Are they separate tiles or are they rotated/flipped?

If they are rotated/flipped then I would be looking at whatever handles the megadrive's equivalent of OAM (been too long since I looked at megadrive hardware listings to see if it supports flips/rotations -- mainstay 16 bit era thing I would expect it but I am also surprised by limitations all the time) that handles tile/sprite layout.
A secondary opening might have used a separate call or setting for that area.

Granted if it was separate tiles (can be done even on systems with it if the devs think ROM and VRAM space is less valuable than CPU time to create the relevant patterns, or are just bad at their job/lazy) you would still be looking at the OAM and figuring out what changed in the layout.
They are rotated/flipped tiles, but I think I cannot understand what OAM is (I am a noob and the only thing I can do is changing some numbers in the code), I'm sorry. Maybe I should learn something about 68K assembly.
« Last Edit: September 24, 2021, 04:55:11 am by WAYE222 »

WAYE222

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Need help on expanding Phantasy Star 4's battle windows
« Reply #5 on: September 24, 2021, 02:04:27 am »
A good project you got there.  :thumbsup:

I hope someday will make a "tooltip" or a "description's bar" showing what every skill does, it sucks having to keep in memory what each of them do...  :-\
Yeah I have the same problem remembering what each skill is for, even if after so many times of playthrough. But I think add some descriptions may need some coding and programming skills, which is beyond my ability, sorry :-[

WAYE222

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Need help on expanding Phantasy Star 4's battle windows
« Reply #6 on: September 24, 2021, 02:18:25 am »
It's possible the game could be keeping track of a copy of the window underneath (when it draws a new window) and only updating the amount of bytes it thinks the window should be (the size of the old window).

One thing I would check is if the game keeps a copy of the tilemap in RAM, and tracing to see how it edits that tilemap when opening and closing the other window.
Yes I think it's something about RAM. It may be when the first window is expanded, the additional tiles will use some addresses which are used by the second window. I have added some value (precisely $C) to an address (which seems to be the starting address of the second window) and the problem is solved now.

FAST6191

  • Hero Member
  • *****
  • Posts: 3290
    • View Profile
Re: Need help on expanding Phantasy Star 4's battle windows
« Reply #7 on: September 24, 2021, 10:42:20 am »
They are rotated/flipped tiles, but I think I cannot understand what OAM is (I am a noob and the only thing I can do is changing some numbers in the code), I'm sorry. Maybe I should learn something about 68K assembly.

In most Nintendo consoles then OAM = Object Area Memory. AKA the area of memory that handles the sprites (sometimes called objects/objs in various programming guides and discussions). The background/BG, which also is what usually is supposed to be handling text, also having something similar.

In its simplest form then it will simply be the X-Y locations of the sprite/tile, however more powerful systems will also give it rotate, flip, scale perhaps, transparency/visibility (though many will just say go off the screen to become invisible), priority, what palette to use, formats and all the other fun possibilities that devs could add to a given piece of sprite bothering hardware. Such details usually then being important for whatever hardware documentation you have or an emulator provides.
http://techdocs.exodusemulator.com/Console/SegaMegaDrive/Documentation.html looks a bit more rough and ready than some of the documents we are otherwise used to for other systems but the main document there looks like it has some good stuff in on layers, sprites, backgrounds, windows and whatnot. Sprite attribute table appears to be the name in those docs but some emulators, hackers or coders might use other things.
Page 55 in the internal numbering, or 65 if you are using the PDF viewer numbering, though before it and after it is good stuff.

You might be able to fix it without knowing much code if you are only getting numbers entered and it is copying those numbers from somewhere else, or is just an instruction saying put this number here (same idea to you probably not knowing how a calculator works underneath it all but still able to enter numbers).

Felipefpl

  • Jr. Member
  • **
  • Posts: 28
  • Banned
    • View Profile
Re: Need help on expanding Phantasy Star 4's battle windows
« Reply #8 on: September 24, 2021, 03:06:15 pm »
Yeah I have the same problem remembering what each skill is for, even if after so many times of playthrough. But I think add some descriptions may need some coding and programming skills, which is beyond my ability, sorry :-[

No need to be sorry, keep up with your good work.  ;)  :thumbsup:
Core i7 Celeron Sandy Bridge G460 1.8 Ghz - 4 GB RAM - Win7 Home Premium x64 - Intel HD Graphics 2000 Onboard


WAYE222

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Need help on expanding Phantasy Star 4's battle windows
« Reply #9 on: September 25, 2021, 08:41:18 am »
In most Nintendo consoles then OAM = Object Area Memory. AKA the area of memory that handles the sprites (sometimes called objects/objs in various programming guides and discussions). The background/BG, which also is what usually is supposed to be handling text, also having something similar.

In its simplest form then it will simply be the X-Y locations of the sprite/tile, however more powerful systems will also give it rotate, flip, scale perhaps, transparency/visibility (though many will just say go off the screen to become invisible), priority, what palette to use, formats and all the other fun possibilities that devs could add to a given piece of sprite bothering hardware. Such details usually then being important for whatever hardware documentation you have or an emulator provides.
http://techdocs.exodusemulator.com/Console/SegaMegaDrive/Documentation.html looks a bit more rough and ready than some of the documents we are otherwise used to for other systems but the main document there looks like it has some good stuff in on layers, sprites, backgrounds, windows and whatnot. Sprite attribute table appears to be the name in those docs but some emulators, hackers or coders might use other things.
Page 55 in the internal numbering, or 65 if you are using the PDF viewer numbering, though before it and after it is good stuff.

You might be able to fix it without knowing much code if you are only getting numbers entered and it is copying those numbers from somewhere else, or is just an instruction saying put this number here (same idea to you probably not knowing how a calculator works underneath it all but still able to enter numbers).
Thank you for the explanation and the document, I'll read it carefully once this project is over