[FE8] CG transitioning

I actually have two issues here, but the first is, well, not solved, but worked around.

Issue #1: Background 0x35 (Black) doesn’t work properly.

If you look at it in GBAGE, it’s just 1 8x8 black tile. People who know more about this than I say the TSA that tiles it isn’t working; presumably, IntSys saw no reason to fix it since it’s never used. I tried to copy the TSA from FE7, but that actually has a 240x160 black background, so no dice.

My workaround: I took an image I’m reasonably sure I’ll never use in this hack, 0x16 (Castle_Outside_Past, plays during certain flashbacks), and zeroed out the palette block. Unless someone has an idea how to actually fix the TSA, I’m just going to leave it like this. I can just copy the block from a vanilla ROM if I need to.

Issue #2: CG transitioning is weird.

FE8 doesn’t have a nice FADICG, as far as I could tell. The command to transition between backgrounds, as used in Ch 14 Eirika route, is:

SETVAL 0x2 0x2A //id of first bg
CALL label30 //loads the bg, basically
...(Show a conversation depending on whether Joshua is alive or not)
_0x2141 0x2B 0x1 0x4 //does the transitioning. Parameters are backgroundID, unknown, speed of transition
_0x1A21 //no idea what this is, but is necessary

So I tried it out in my own events. Using the same backgrounds as in vanilla works fine. However, when I try to transition to a cg of my own, I get this as the end result:

Here’s what it’s supposed to look like:

Here’s the event file, if it helps:

[spoiler]
//Made by Camtech075 of SerenesForest
//Modified by Nintenlord

#include EAstdlib.event

EventPointerTable(0x07,ThisChapter)

ORG 0xB2BE10

ThisChapter:
POIN TurnBasedEvents
POIN CharacterBasedEvents
POIN LocationBasedEvents
POIN MiscBasedEvents
POIN Dunno Dunno Dunno
POIN Tutorial
POIN TrapData TrapData
POIN Units Units
POIN $0 $0 $0 $0 $0 $0
POIN BeginningScene EndingScene

TurnBasedEvents:
TURN 0x00 BeginningScene [00,01] 0x00 
END_MAIN

CharacterBasedEvents:
END_MAIN

LocationBasedEvents:
END_MAIN

MiscBasedEvents:
CauseGameOverIfLordDies
END_MAIN

Dunno:
//DO NOT TOUCH
WORD $00

Tutorial:
//DO NOT TOUCH
WORD $00

TrapData:
ENDTRAP

ALIGN 4

Units:
UNIT

//SET BACKGROUND
label21:
EVBIT_CHECK 0x8 
IFEQUAL 0x80D2 0xC 0x0
FADI 16
ENIF 0x80D2
_0x1A21
_0x2140 0xFFFF 0x0 0x0
ENDA

BeginningScene:
SETVAL 0x2 0x37 //starting background
CALL label21
FADU 16
STAL 60

//NOTE FROM THE AUTHOR
//_0X1A23
//SETVAL 0xB 0xFFFFFFFF
//TEXTSHOW 0xD4C
//TEXTEND
//REMA

//DEATH'S SOLILOQUOY
//SOLOTEXTBOXSTART
//SETVAL 0xB 0x68FFFF //center bottom
//TEXTSHOW 0xD4D
//TEXTEND
//REMA

//LOAD DEATH CG
SETVAL 0x2 0x36
//CALL label21

EVBIT_CHECK 0x8 
IFEQUAL 0x80D2 0xC 0x0
//FADI 16
ENIF 0x80D2
//_0x1A21
//_0x2140 0xFFFF 0x0 0x0

_0x1A21
_0x2141 0xFFFF 0x1 0x3

STAL 120
//SOLOTEXTBOXSTART
//SETVAL 0xB 0x68FFFF //center bottom
//TEXTSHOW 0xD4E
//TEXTEND
//REMA

FADI 10
EVBIT_T 0x7
MNC2 0x1
ENDA

EndingScene:
ENDA

MESSAGE Events end at offset currentOffset

[/spoiler]

On a completely unrelated note, I had an idea regarding the first issue. I made a 240x160 black background and uploaded it as a CG using the method detailed here (this is also how I got the skull background that’s glitchy): [FE8] Using CGs
So there’s normally 0x35 backgrounds in vanilla. Skull is 0x36, black background is 0x37. As you can see in my events file, I loaded 0x37 as the first one, so you’d expect to see a pitch black background, right?

Wrong.

I know it’s one of the vanilla backgrounds, but I’m not sure which one. What it most definitely isn’t is a black background. I’ve double-checked the pointers, and I dunno what to do at this point.

I’d upload a video of the transition because there’s some garbage data that appears during the transition and vanishes afterward, but I don’t know how. EIther way, anyone got any ideas?

EDIT: Took a look in GBAGE to make sure I’m not going crazy about the black background:

Okay, issue #1: background 0x35 is not meant to be a black background, the backgrounds in vanilla go from 0x0 to 0x34. The workaround is to repoint and expand the table at 0x95dd1c then insert a black image yourself, as you figured out. I don’t know why your 0x37 image is not working, but I’m pretty sure you need to triple check your pointers because it works fine for me.

Now for the bad news. _0x2141 only works with backgrounds that use 6 or less palettes, because IS are idiots or something
seriously there is no reason NOT to have up to 8 palettes FE7 handles it fine

For your situation, why not just call label21? The background’s already black, nobody is going to notice the FADI.

When you insert the cg, it only comes with one palette as far as I know. Where are the other 5/7 coming from?

Or maybe the real question is, how big is a palette?

16 colours is one palette. TSA lets you use multiple palettes in an image.

So…could I point to the TSA of a background that only uses 6 palettes, or will that make the picture look funky?

Nope that’d look screwed up. I would probably either make an ASM hack to copy 8 palettes instead of 6 (no luck so far), or edit the CG maker to have a 6 palette limit (less than ideal).

Welp once again I have to fix IS’ mistakes

Change $EBCA from 06 to 08 and $EDE0 from C0 22 to 0A 1C