The PokéCommunity Forums Fan Games ROM Hacking
ASM & Hex Refresh player palette

ROM Hacking Need a helping hand? You can get help on any ROM Hacking-related problems or questions you have here.


Reply
 
Thread Tools
  #1    
Old March 14th, 2018 (11:48 AM).
Koople Koople is offline
     
    Join Date: Nov 2016
    Nature: Sassy
    Posts: 26
    Hello!

    I've been trying to refresh the player palette without reloading the map (after callasm 0x805BE61). I found this page, and formulated my own assembly routine (below) to load a new palette into the appropriate RAM.

    The problem is, if I open a start menu function such as Options, the old palette reappears briefly before opening the menu. And using fadescreen after updating OWs causes the old palette to be permanently attributed to the player again.

    So my question is, where else is the player palette stored besides 0x020377F8? Im not too familiar with the OAMT or object data structures so my hunch is that opening a menu loads a palette from there somehow?

    I tried using karatekid's assembly routine in the linked post but it didn't seem to work (although chances are I messed up the insertion instructions)

    Thanks for any help you can give!

    Test Assembly:
    Code:
    .align 2
    .thumb
    
    Main:
      push {r0-r2, lr}
      ldr r0, =(0x08900000)  @new pal loc
      ldr r1, =(0x05000000)  @pal 0
      mov r2, #0x10
      swi 0xb
      ldr r1, =(0x020377F8)  @player pal
      swi 0xb
      pop {r0-r2, pc}
    Reply With Quote

    Relevant Advertising!

      #2    
    Old March 14th, 2018 (12:18 PM).
    eMMe97 eMMe97 is offline
       
      Join Date: Jan 2015
      Posts: 28
      This is the right code

      Code:
      .thumb
      .align 2
      
      push {lr}
      ldr r0, = 0x8xxxxxx @your palette location
      ldr r1, = 0x020377F8 @player pal
      mov r2, #16
      swi 0xb
      pop {pc}
      Reply With Quote
        #3    
      Old March 14th, 2018 (1:28 PM).
      Koople Koople is offline
         
        Join Date: Nov 2016
        Nature: Sassy
        Posts: 26
        Quote:
        Originally Posted by eMMe97 View Post
        This is the right code

        Code:
        .thumb
        .align 2
        
        push {lr}
        ldr r0, = 0x8xxxxxx @your palette location
        ldr r1, = 0x020377F8 @player pal
        mov r2, #16
        swi 0xb
        pop {pc}
        How is this different from also applying the palette to the VRAM?
        Reply With Quote
          #4    
        Old March 15th, 2018 (12:36 AM).
        eMMe97 eMMe97 is offline
           
          Join Date: Jan 2015
          Posts: 28
          - ldr r1, =(0x05000000) @pal 0 -> 05 loads the colors from 02. if you change the colors on 05, after 1 second, the game will search again the colors on 02 (the old ones) and load them on 05, getting the wrong colors.

          - mov r2, #0x10 -> loads 20 colors only...you must write #16, in this case the routine loads 32 colors
          Reply With Quote
            #5    
          Old March 15th, 2018 (2:27 PM).
          Koople Koople is offline
             
            Join Date: Nov 2016
            Nature: Sassy
            Posts: 26
            Quote:
            Originally Posted by eMMe97 View Post
            - ldr r1, =(0x05000000) @pal 0 -> 05 loads the colors from 02. if you change the colors on 05, after 1 second, the game will search again the colors on 02 (the old ones) and load them on 05, getting the wrong colors.

            - mov r2, #0x10 -> loads 20 colors only...you must write #16, in this case the routine loads 32 colors
            Hm interesting. It solves the player showing up in the middle of fadescreen. Turns out I also needed to write the pal to 0x020373F8 to fix the menu problem. Also 0x10 and 16 are the same number :laugh-squinted:

            Thanks!
            Reply With Quote
            Reply

            Quick Reply

            Join the conversation!

            Create an account to post a reply in this thread, participate in other discussions, and more!

            Create a PokéCommunity Account

            Sponsored Links
            Thread Tools

            Posting Rules
            You may not post new threads
            You may not post replies
            You may not post attachments
            You may not edit your posts

            BB code is On
            Smilies are On
            [IMG] code is On
            HTML code is Off

            Forum Jump


            All times are GMT -8. The time now is 10:02 AM.