Users browsing this thread: 1 Guest(s)
Portraits position in main menu

#1
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
I've been spending many hours recently trying to find the portraits position in the main menu. My idea would be to shift them one tile to the left. I had also the idea to display the sprite instead of the portrait so I could save a lot of space (2x3 for the sprite vs 5x5 for the portrait). I would tweak the row command so the portrait/sprite wouldn't move again to the left and I would instead display "Back Row" under the portrait/sprite or next to the name.

However to achieve any of these idea, I need to know how to move the portrait/sprite and how to reduce the format of the portrait from a 5x5 to a 2x3 if I want to display a sprite instead. I know how to display a sprite, but there is unnecessary tiles and they are not in the good order.

I tried to do some tracing but the routines before and after the portrait loading doesn't seem to indicate any position or format. This is called when the main menu is loading:

Code:
C3/6AE9:    20136B      JSR $6B13    (Function loads Fixed-Width Font Graphics Data)
C3/6AEC:    20376B      JSR $6B37    (Function loads graphics for Menu)
C3/6AEF:    20E86B      JSR $6BE8    (Function loads Menu Cursor Palette)
C3/6AF2:    20676E      JSR $6E67    (Function loads Hand Cursor Graphics)
C3/6AF5:    20826E      JSR $6E82    (load the portrait)
C3/6AF8:    20096C      JSR $6C09    (Function loads Menu Portrait Palettes)
C3/6AFB:    20E96C      JSR $6CE9    (sprite related ?)    
C3/6AFE:    20846C      JSR $6C84
C3/6B01:    4C606C      JMP $6C60

now the function at C3/6E82 load the good offset of the portrait and the portrait data function is called in this one:

Code:
C3/6E82:    A600        LDX $00            
C3/6E84:    C220        REP #$20          (16 bit memory/accum.)
C3/6E86:    BF516FC3    LDA $C36F51,X
C3/6E8A:    8D1621      STA $2116
C3/6E8D:    B46D        LDY $6D,X        (Load character starting RAM offset)
C3/6E8F:    DA          PHX
C3/6E90:    7B          TDC
C3/6E91:    E220        SEP #$20          (8 bit memory/accum.)
C3/6E93:    B91400      LDA $0014,Y        (Load character statuses)
C3/6E96:    2920        AND #$20        (check for Imp)
C3/6E98:    F004        BEQ $6E9E        (Branch if not Imp)
C3/6E9A:    A90F        LDA #$0F        (Load imp sprite ?)
C3/6E9C:    800A        BRA $6EA8
C3/6E9E:    B90000      LDA $0000,Y        (Load actor number)
C3/6EA1:    C901        CMP #$01        (compare to Locke)
C3/6EA3:    F003        BEQ $6EA8        (branch if Locke)
C3/6EA5:    B90100      LDA $0001,Y        (Load sprite number)
C3/6EA8:    C220        REP #$20          (16 bit memory/accum.)
C3/6EAA:    0A          ASL A
C3/6EAB:    AA          TAX
C3/6EAC:    BF1B6FC3    LDA $C36F1B,X    (load offset to jump to depending on the character)
C3/6EB0:    AA          TAX
C3/6EB1:    200070      JSR $7000        (Load portrait data)
C3/6EB4:    FA          PLX
C3/6EB5:    E8          INX
C3/6EB6:    E8          INX
C3/6EB7:    E00800      CPX #$0008
C3/6EBA:    D0C8        BNE $6E84        (branch if we haven't done 4 characters ?)
C3/6EBC:    E220        SEP #$20          (8 bit memory/accum.)
C3/6EBE:    60          RTS

Code:
C3/7000:    A09001      LDY #$0190        (size of a portrait ?)
C3/7003:    BF001DED    LDA $ED1D00,X   (get character portrait data)
C3/7007:    8D1821      STA $2118        (store in video data)
C3/700A:    E8          INX
C3/700B:    E8          INX
C3/700C:    88          DEY
C3/700D:    D0F4        BNE $7003
C3/700F:    60          RTS

The above function ($6E82) pull data from these two table. One is for the offset to add to ED1D00 to get to the good portrait depending one the character and with some test I did, the other table seems to affect that offset but there is only 8 entries instead of 16. The second table doesn't modify the portrait position or format either...

Code:
C3/6F1B:    0000
C3/6F1D:    2003
C3/6F1F:    4006
C3/6F21:    6009
C3/6F23:    800C
C3/6F25:    A00F
C3/6F27:    C012
C3/6F29:    E015
C3/6F2B:    0019
C3/6F2D:    201C
C3/6F2F:    401F
C3/6F31:    6022
C3/6F33:    8025
C3/6F35:    A028
C3/6F37:    C02B
C3/6F39:    E02E
Code:
C3/6F51:    0026
C3/6F53:    0028  
C3/6F55:    002A  
C3/6F57:    002C  
C3/6F59:    002E  
C3/6F5B:    0030    
C3/6F5D:    0032  
C3/6F5F:    0034

The function after ($6C09) loads the good palette depending on the character and then there is a function ($6CE9) that loads the OAM data for the party selection screen I think. I might be wrong but I think this one is more sprite related than related to the portraits:

Code:
C3/6CE9:    7B          TDC           (from C3/6A7E, C3/6ACB, C3/6AFB)
C3/6CEA:    AA          TAX
C3/6CEB:    DA          PHX
C3/6CEC:    C220        REP #$20          (16 bit memory/accum.)
C3/6CEE:    BFE5F8CF    LDA $CFF8E5,X
C3/6CF2:    85F3        STA $F3
C3/6CF4:    8A          TXA
C3/6CF5:    0A          ASL A
C3/6CF6:    AA          TAX
C3/6CF7:    BF13F9CF    LDA $CFF913,X
C3/6CFB:    85E7        STA $E7
C3/6CFD:    BF11F9CF    LDA $CFF911,X
C3/6D01:    85E9        STA $E9
C3/6D03:    A600        LDX $00
C3/6D05:    BFDFF8CF    LDA $CFF8DF,X
C3/6D09:    85EF        STA $EF
C3/6D0B:    20446D      JSR $6D44
C3/6D0E:    A5F3        LDA $F3
C3/6D10:    18          CLC
C3/6D11:    690001      ADC #$0100
C3/6D14:    85F3        STA $F3
C3/6D16:    E8          INX
C3/6D17:    E8          INX
C3/6D18:    E00400      CPX #$0004
C3/6D1B:    D0E8        BNE $6D05
C3/6D1D:    A5F3        LDA $F3
C3/6D1F:    38          SEC
C3/6D20:    E9E001      SBC #$01E0
C3/6D23:    85F3        STA $F3
C3/6D25:    BFDFF8CF    LDA $CFF8DF,X
C3/6D29:    85EF        STA $EF
C3/6D2B:    20446D      JSR $6D44
C3/6D2E:    A5F3        LDA $F3
C3/6D30:    18          CLC
C3/6D31:    690001      ADC #$0100
C3/6D34:    85F3        STA $F3
C3/6D36:    20676D      JSR $6D67
C3/6D39:    FA          PLX
C3/6D3A:    E8          INX
C3/6D3B:    E8          INX
C3/6D3C:    E02C00      CPX #$002C
C3/6D3F:    D0AA        BNE $6CEB
C3/6D41:    E220        SEP #$20          (8 bit memory/accum.)
C3/6D43:    60          RTS

The above function pull data from here. I haven'T played with those value but I don't think they change the portraits position in any menu:

Code:
CF/F8DF: C0 03
CF/F8E1: 00 05 40 05
CF/F8E5: 00 30 80 30
CF/F8E9: 00 32 80 32
CF/F8ED: 00 34 80 34
CF/F8F1: 00 36 80 36
CF/F8F5: 00 38 80 38
CF/F8F9: 00 3A 80 3A
CF/F8FD: 00 3C 80 3C
CF/F901: 00 3E 80 3E
CF/F905: 40 30 C0 30
CF/F909: 40 32 C0 32
CF/F90D: 40 34 C0 34
CF/F911: D6 00 40 00
CF/F915: D5 00 C0 25
CF/F919: D5 00 40 2D
CF/F91D: D5 00 E0 43
CF/F921: D5 00 60 7A
CF/F925: D5 00 20 71
CF/F929: D5 00 C0 87
CF/F92D: D5 00 60 9E
CF/F931: D5 00 00 B5
CF/F935: D5 00 A0 CB
CF/F939: D5 00 40 E2
CF/F93D: D5 00 E0 F8
CF/F941: D6 00 80 0F
CF/F945: D6 00 45 65
CF/F949: D6 00 66 66
CF/F94D: D6 00 60 53
CF/F951: D6 00 00 6A
CF/F955: D6 00 60 7F
CF/F959: D6 00 C0 94
CF/F95D: D6 00 20 AA
CF/F961: D6 00 80 BF
CF/F965: D6 00 E0 D4

So I believe that the portrait position should be somewhere in the code I posted, which is after the hand cursor loading and before the last sprite related function. Unless what is in $2118 (the portrait video data) is processed elsewhere that I'm not aware of, I have no clue where the portrait position and format would be determined. If anyone has any info on what I'm trying to find you are very welcome to post in this thread...
  Find
Quote  

#2
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
After many, many hours spent in bank C3, I finally found the X and Y position of the portraits. Now the fun can begin!

X position (same for all characters)

Code:
C3/0B01:    A91A00      LDA #$001A      (X position)
C3/0B04:    8005        BRA $0B0B
C3/0B06:    C220        REP #$20          (16 bit memory/accum.)
C3/0B08:    A90E00      LDA #$000E    
C3/0B0B:    FA          PLX
C3/0B0C:    9DCA33      STA $33CA,X     (store as horizontal position)

Y positions

Code:
character slot 1
C3/0A3E:    A91500      LDA #$0015      
C3/0A41:    9D4A34      STA $344A,X    (set as vertical position)

character slot 2
C3/0A69:    A94500      LDA #$0045
C3/0A6C:    9D4A34      STA $344A,X

character slot 3
C3/0A94:    A97500      LDA #$0075
C3/0A97:    9D4A34      STA $344A,X

character slot 4
C3/0ABF:    A9A500      LDA #$00A5
C3/0AC2:    9D4A34      STA $344A,X

WIP

[Image: test_00000-1.png]
  Find
Quote  

#3
Posts: 2,549
Threads: 98
Thanks Received: 147
Thanks Given: 159
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
Haha, right on, glad you got it! Atta boy. I also love to spend hours and hours on stuff, as you know. Wink


We are born, live, die and then do the same thing over again.
Quote  

#4
Posts: 2,769
Threads: 88
Thanks Received: 24
Thanks Given: 87
Joined: Jun 2009
Reputation: 25
Status
None
awesome job madsiur


"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC
Quote  

#5
Posts: 1,261
Threads: 250
Thanks Received: 11
Thanks Given: 7
Joined: Jun 2009
Status
Traitor
You guys could try this layout. Smile
[Image: newmenu.png]
  Find
Quote  

#6
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(05-04-2012, 01:42 PM)Zeemis Wrote: You guys could try this layout. Smile

I'm aiming for somethimg similar but I'm not sure yet if I'll keep the portrait or display the character sprite in a certain pose. That would save a lot of space since a sprite is smaller than a portrait. I also found how to disable the left shift of the portrait when you perform row, but you still hear the sound and row works. I'm thinking displaying the back row state as an extra icon next to the status aliments. My goal is also to display the class names AND status at the same time.

I will also have the place for an extra entry (maybe two!!) in the menu, which is already made, for special option(s). What comes to my mind is a music/SFX player and/or a bestiary. I'm also planning to restore the custom controls window and renaming window for Cyan's SwTech but the valuable SRAM used for this could be used for a 7th character name letter also. These last two feature were in FF6j but not ported to FF3us. I'll have to decide...

I'm also thinking trying to transform the fixed width font into a variable width font, like in the dialogue. This would be a lot nicer and a lot of string could have more letters. This a really ambitious feature though.I will aslo apply most of the changes Angelo did in his Longer name patch and will expand the item names to 16 letter.
  Find
Quote  

#7
Posts: 127
Threads: 8
Thanks Received: 21
Thanks Given: 12
Joined: Jan 2012
Reputation: 13
Status
None
Some cool stuff you got there Madsiur!
  Find
Quote  

#8
Posts: 1,261
Threads: 250
Thanks Received: 11
Thanks Given: 7
Joined: Jun 2009
Status
Traitor
(05-04-2012, 02:43 PM)Madsiur Wrote:
(05-04-2012, 01:42 PM)Zeemis Wrote: You guys could try this layout. Smile

I'm aiming for somethimg similar but I'm not sure yet if I'll keep the portrait or display the character sprite in a certain pose. That would save a lot of space since a sprite is smaller than a portrait. I also found how to disable the left shift of the portrait when you perform row, but you still hear the sound and row works. I'm thinking displaying the back row state as an extra icon next to the status aliments. My goal is also to display the class names AND status at the same time.

I will also have the place for an extra entry (maybe two!!) in the menu, which is already made, for special option(s). What comes to my mind is a music/SFX player and/or a bestiary. I'm also planning to restore the custom controls window and renaming window for Cyan's SwTech but the valuable SRAM used for this could be used for a 7th character name letter also. These last two feature were in FF6j but not ported to FF3us. I'll have to decide...

I'm also thinking trying to transform the fixed width font into a variable width font, like in the dialogue. This would be a lot nicer and a lot of string could have more letters. This a really ambitious feature though.I will aslo apply most of the changes Angelo did in his Longer name patch and will expand the item names to 16 letter.

You know, you could just make a portrait of an enhanced character sprite. I mean, the portrait is the character itself and it's higher quality than a 12 color sprite. If that's done, you'll still have ample room because portraits do have transparency, so a 40x40 portrait can technically overlap each other because it'd be a character sprite.
Just a thought. Smile
  Find
Quote  

#9
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(05-04-2012, 11:09 PM)Zeemis Wrote: You know, you could just make a portrait of an enhanced character sprite. I mean, the portrait is the character itself and it's higher quality than a 12 color sprite. If that's done, you'll still have ample room because portraits do have transparency, so a 40x40 portrait can technically overlap each other because it'd be a character sprite.

That is a good idea. I can already display a sprite instead of the portrait but it still display the portrait as 5x5 so there is unwanted sprite tiles and I haven't found where the format is set, so I can't change it to 2x3. But a sprite with a custom pose would be original and I could display the class at the bottom of the portrait. I could use a 1x5 stripe at the bottom for the class name. I could fit maybe 8-9 letters, assuming a 4 to 5 pixels width for each letter.

If I ever find the portrait format setting spot I could also go to a 7x5 format and leave a 7x2 stripe for the class name, allowing more letters or a bigger font. In this case, I would use the 7x3 top stripe transparency to my advantage and make some text overlap the portrait. I could also do a bigger sprite (3x3 or 3x4) and make a separate graphic for the class name (1x5 to 2x6) I just need to find a spriter or make myself a new pose for each character...

[Image: menu.png]

A similar implementation from RuneLancer
  Find
Quote  

#10
Posts: 2,769
Threads: 88
Thanks Received: 24
Thanks Given: 87
Joined: Jun 2009
Reputation: 25
Status
None
niiice


"Sometimes ninjas do wrong to each other, and in dat way the force of tha earf' comes around da moon - and at that presence, da dirt, it overshadows the grass, so you're like, I can't cut dis grass, there's no sun comin' through. So in order to enable each other the two fruits have to look each other in da eye and understand we can only be right, as da ripe is wrong, you know what I mean?"

-HNIC
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite