The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.33 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




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

#1
Posts: 3,971
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  



Messages In This Thread
Portraits position in main menu - by madsiur - 04-30-2012, 03:21 PM
RE: Portraits position in main menu - by madsiur - 05-04-2012, 06:06 AM
RE: Portraits position in main menu - by SSJ Rick - 05-04-2012, 12:55 PM
RE: Portraits position in main menu - by Zeemis - 05-04-2012, 01:42 PM
RE: Portraits position in main menu - by madsiur - 05-04-2012, 02:43 PM
RE: Portraits position in main menu - by Zeemis - 05-04-2012, 11:09 PM
RE: Portraits position in main menu - by madsiur - 05-05-2012, 12:01 AM
RE: Portraits position in main menu - by m06 - 05-04-2012, 04:14 PM
RE: Portraits position in main menu - by SSJ Rick - 05-05-2012, 02:33 PM
RE: Portraits position in main menu - by madsiur - 05-16-2012, 08:15 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite