Aslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=278;area=showposts;start=15e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index2aae.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=278e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index2aae.html.zxg^0P.OKtext/htmlISO-8859-1gzip0|Tue, 10 Mar 2020 19:25:05 GMT0 0Pg^* Show Posts - chillyfeez

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - chillyfeez

16
There are a lot of reasons that Cecil will not be removable from the party, but the main reason is that, for the purpose of this mod, it would just be too complicated. I'm working with very limited space in certain situations, and in order to make everything work right, I'm going to have to slash character records in such a way that I can fit everyone except Cecil. You, specifically, may be sad to hear that this also leaves no place for Golbez. Sorry, man.

17
It's 4, and I did consider it for that reason, but in the end I think those images are too small relative to the screen.
I'm pretty sure the plan I've got will work, and it should look pretty cool once I've got it all working.
Is Squall's tutorial responsible for the better understanding you spoke about on RHDN?

18
Cool, Squall, good to have the whole thing in one place.

I haven't had a whole lot of time to work on the project lately. I got a couple of hours in today, but it was all background stuff - literally and figuratively.

A couple of days ago I took out the routines that draw the battle character graphics into the Namingway screen as sprites, because in this mod they'll actually be part of a BG screen. Then I wrote the first part of the routine that will load the battle character tiles into VRAM. But today I realized that the same routine I removed also draws the battle character images in the Load Saved Game screen, so today was spent reworking those changes so that the sprites still load there, but not in my PHS screen.

Anyway, blah-blah-blah, right? I'll keep you guys updated as I make progress when there is progress worth mentioning.

19
Hello, dear readers.
Quick status update. There isn't much to show, since there is a lot of coding to do for what will end up being just one (dynamic) screen.
Here is the visible portion I have so far:


The window on the left will display the portraits of the characters currently in the party (except Cecil, as he will not be swappable). The small window to the right of that will display the name of the character the finger cursor is pointing at. The large window on the right will display the portraits of the available characters not currently in the party. Due to palette limitations, those portraits will be displayed in black and white until pointed to by the finger. The small space in between the windows towards the top will show the battle sprites of the current party (including Cecil).

There's a lot to do, and the going is slow, but this is really happening!

20
Oh, I know, and I do appreciate that, but I am necessarily restricted by the particular scope of this project.
That doesn't mean that I won't eventually have a creative application for what you're teaching me here, but I don't need all of it for this project.
Still, I'm using the tools you're providing here to formulate a workable plan for the project as originally conceived.

21
I think you might be misunderstanding my intentions for this project...
I'm not creating any new images or palettes for the PHS. The portraits I'll be using are the same portraits from the menu ("push X") screen. The portraits are already locked into a dedicated palette for each.
One of the primary goals of this hack is that it can easily be used as a base for other hackers' projects, so I want to avoid creating original content.

22
3. Palette memory
PPU contain dedicated memory of 512 bytes for Palettes, abbreviated as CGRAM. That memory can hold 256 colors. Depending of the Layer's BPP that memory is used differently:
- in 8bpp - we have 1 Palette containing 256 colors, entries: $00..$FF
- in 4bpp - we have 8 Palettes, occupying entries: $00..$7F
- in 2bpp (Mode 0) we have 8 Palettes for each layer: $00..$1F (BG1), $20..$3F (BG2), $40..$5F (BG3) and $60..7F (BG4)
* Sprites use 8 Palettes, occupying entries: $80..$FF

Uh-oh... This is going to be a problem for this project.
In FFIV, every character portrait and every PC battle sprite has a dedicated palette. So to use every palette I was planning to use, that would be a minimum of 16 palettes (11 portraits + 5 battle sprites). That means that hardware limitations will definitely prevent me from using the method I had originally intended for this project.

So now I have to rethink how this is all going to work.

The easy option would be to eliminate the battle sprites from the picture entirely, then use a gray palette for "inactive" characters, only using the proper palettes for characters currently in the party. This is not my favorite option. I think it would look cheap.

So looking through the documentation. It looks like Mode 1 uses one 4-color BG and two 16-color BGs... how are the palettes allocated in Mode 1?
I assume sprites get 8 palettes regardless of mode? Would that mean, then, that in Mode 1 there are eight 4-color palettes for BG3 and six 16-color palettes shared by BG1 and BG2?
That still wouldn't be ideal - I'd still have to gray-out the portraits of inactive characters, but I could bring back the battle sprites (they could be a BG). Then, what I could do is have the active party's portraits in color, as well as the highlighted inactive character's portrait (all other portraits would share a grayscale palette)...

23

Aha, I see...

Code: [Select]
Bit-Plane 0:        Bit-Plane 1:      Bit-Plane 2:       Bit-Plane 3:
0 1 0 1 0 1 0 1   0 0 1 1 0 0 1 1   0 0 0 0 1 1 1 1   0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1   0 0 1 1 0 0 1 1   0 0 0 0 1 1 1 1   1 1 1 1 1 1 1 1
0 1 0 1 0 1 0 1   0 0 1 1 0 0 1 1   0 0 0 0 1 1 1 1   0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1   0 0 1 1 0 0 1 1   0 0 0 0 1 1 1 1   1 1 1 1 1 1 1 1
0 1 0 1 0 1 0 1   0 0 1 1 0 0 1 1   0 0 0 0 1 1 1 1   0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1   0 0 1 1 0 0 1 1   0 0 0 0 1 1 1 1   1 1 1 1 1 1 1 1
0 1 0 1 0 1 0 1   0 0 1 1 0 0 1 1   0 0 0 0 1 1 1 1   0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1   0 0 1 1 0 0 1 1   0 0 0 0 1 1 1 1   1 1 1 1 1 1 1 1
Code: [Select]
55-33-55-33-55-33-55-33-55-33-55-33-55-33-55
0F-00-0F-FF-0F-00-0F-FF-00-0F-FF-0F-00-0F-FF

And I've actually watched the 3BPP->4BPP conversion happen for a tile, byte by byte, in Geiger's. At the time I wondered why it made sense to insert 00s in between each of the last 8 bytes, but now I get it.
3BPP uses 3 bit planes. All of the information for the fourth bit plane used by a 4BPP tile would be stored in bytes 11, 13, 15, 17, 19, 1B, 1D and 1F.

Well, that means I can pretty much abandon all hope of editing tiles on the fly in hex (not really that important, anyway) because the unpacking and re-packing of bits is way too complicated for my very human brain to do with any efficiency.

I guess this somehow makes the data easier or faster for the SNES to interpret? You don't have to explain why or how that is - it's probably deeper than I need to go.

24
OK, I have some questions about this section...

1) is it important for me to know specifically what "MxN" means? You used that a couple of times and I don't know what M and N stand for in this instance.

2) So SNES can only do 2/4/8 BPP? What about the 3BPP format that is very prominent in FFIV? Is that just a somewhat-compressed version of 4BPP? I did notice that when copying (0x18 byte) 3BPP tiles to VRAM, the last 8 bytes get spread out over 0x10 bytes. Is that essentially taking the tile data and converting it to 4BPP?

3) I don't know if it's really important for me to know, since there are graphics viewing and editing programs, but I am curious - how exactly is image data encoded? If four bits are used to define a pixel, what do each of those bits represent?
This may also be an appropriate time to mention that I don't really know what a bit plane is...

25
Not related to this particular project, but related to this section of your tutorial...
A while ago I was helping Rodimus Primal out by recreating the Japanese FFIV title screen for his "Namingway Edition" hack. The major roadblock that I ran into was transparency. In the Japanese version, the title screen is composed of (at least) two layers of the "FINAL FANTASY IV" lettering and the large crystal image. I was unable to recreate the "flashing" effect of the crystal and the lettering because the top layer seems to be semitransparent.
So if a layer is either transparent or not... How did they do that?!

26
OK, I had some time to do some studying this evening and I had a bit of a breakthrough...

So it seems that FFIV always stores object data in RAM at $0300-$0520 and then regularly does what I think is a DMA transfer. I don't really know what DMA is, but I'm pretty sure that's what's happening.

So that's all well and good. By playing with the data there, I can effectively move the Namingway image to the location where I would want a portrait to be, giving me proof of concept that I could put portraits on the screen in all the right spots.
Here's the problem I'm facing now, though: Maybe it's because the game is treating every tile like a sprite, instead of just using 32x32 sprites, but that Namingway image uses 0x40 bytes of data. So if I wanted to display 11 character portraits on screen at a time, I'd need to transfer 0x02C0 bytes instead of 0x0220. Add in the finger cursor, and I'd need 0x02D0. Then if I also wanted the current party's battle sprites displayed, I'd need 0x0370. I think I could condense all the space used down to 0x0330 bytes, but that doesn't matter, because it seems like the game is already using the RAM beginning at $0600 for something else, so unfortunately it looks like I'm going to have to do without the battle sprites.

The question, then, is this: is there any reason (hardware limitations, or anything like that) why I can't change the 220-byte DMA transfer to a 2D0-byte DMA transfer? I've found the line of assembly that sets the transfer at 220 bytes, so the change would be simple,as long as it wouldn't cause a crash.
The other thing I could learn how to do, I guess, would be to change it so that the game is using 32x32 sprites... Or at least 16x16 sprites. Based on what I'm reading, it seems like that might be the better option, because the Battle sprites are 16x24, so I'd need to keep them as collections of 8x8 sprites, but then each portrait could be four 16x16 sprites instead of 16 8x8 sprites.

 :edit:
OK, forget most of the above post. I just figured out that when they say OAM is 512 + 32 bytes, that's a decimal value, so those 0x0220 bytes being transferred are the entirety of the OAM. That means I have to figure out how to make those sprites 16x16 in order for this to work. By manipulating those last 0x20 bytes I can make the Namingway sprites load as 16x16, but they're not composed of the right tiles (they're half Namingway and half NPC merchant), so I have to figure out the proper arrangement of data in VRAM in order to make the sprites look right. I'm sure there's a pattern and it'll be pretty obvious once I delve into it...

27
Final Fantasy IV Research & Development / Re: Minor possibly known bug
« on: November 24, 2017, 06:24:26 PM »
I gotta ask, since the screenshot you linked has Edge in the same party as Palom & Porom - are you applying a patch to the 1.0 and 1.1 ROMs?

I've never noticed that before, but it's rare I give Edge a claw... And it's not uncommon for me to miss things anyway.

28
It's been a good amount of info at a time. I like having it up on the forum, too, because then I know it will be there if I need to go back and reference it again sometime.

29
- Its seems to me that whoever has made this, instead of defining a char as a Sprite he/she have defined each tile as Sprite ... I don't see the point of doing it that way ... logically you should have only 4 sprites (1 for the pointer, 2 for the chars and 1 for portrait)
Yeah, FFIV was the first game Square developed for SNES, and it was released only about eight months after the console. A lot of times when you dig into the code, you get the impression that they really didn't understand the capabilities or how best to use the hardware yet.
Quote
- by knowing ID of tiles, you may try to check the code for LDA/x/y ID and pinpoint 'the drawing' on the screen
Looking forward to that for the practical application (I mean, this project), but I also still want to understand better how this all really works. So, thank you for taking this time.

I have to digest everything here. It's a busy work weekend for me (do they do "Black Friday" where you are?), but I have Monday and Tuesday off, so we can pick up then at the latest.

30
Please don't alter the $2101, just read the value written there, particularly bits 5-7 (sets Sprite size).
Post the code here, so we can delve in details. Keep in mind that reading/writing to video could be auto-incremented. So even if you have initial value in the address ($2116), if you have some read/writes ($2118/$2139) after initialization and the code you are looking, the address has been already changed! Besides as I said the transfer could be done trough DMA/HDMA ... it all depends.

You know what? Lets do something else:
 - Download vSNES (the tool I've talk about)
 - Make sure you use zSNES as emulator. Load the ROM and when the namingway screen pops up - make a savestate
 - Send me or attach here that savestate
* You can check for yourself many things in vSNES - like what mode you use, layers, tiles, sprites,...
Ok, I made a save state in zSNES and downloaded vSNES and opened it but I don't really know what I'm looking at here...
It's too large to attach so here's a link:
https://drive.google.com/file/d/1_HmFLAMLgSGUHpSmtYkM8ses9BuAsiqD/view?usp=drivesdk