bx not working -trainer-

Discussion in 'GBA - Game Development, ROM Hacks and Translations' started by DimondEdge, Dec 2, 2006.

Dec 2, 2006

bx not working -trainer- by DimondEdge at 3:51 PM (819 Views / 0 Likes) 3 replies

  1. DimondEdge
    OP

    Newcomer DimondEdge Newbie

    Joined:
    Nov 28, 2006
    Messages:
    6
    Country:
    I am coding a trainer for a GBA game, and no matter what I try, it freezes. It appears to be jumping to my trainer, but not back. I now have reduced my trainer to do nothing except jump back to the gamecode.
    Code:
    ldr  r4, =#0x08000C92
    bx  r4
    All I get is a white screen. By the way, I'm using Pokemon Pinball - Ruby and Sapphire (E) and
    following the GBA trainermaker guide.

    Thanks!

    De
     
  2. bunsy

    Newcomer bunsy Advanced Member

    Joined:
    Nov 23, 2005
    Messages:
    88
    Country:
    Sweden
    The code you're jumping from is in thumb mode, yet you're telling the cpu to switch to arm mode when jumping back.

    ldr r4, =#0x08000C93
    bx r4

    Will do what you want.
     
  3. DimondEdge
    OP

    Newcomer DimondEdge Newbie

    Joined:
    Nov 28, 2006
    Messages:
    6
    Country:
    I forgot... I tried that too, the same thing happened.
     
  4. bunsy

    Newcomer bunsy Advanced Member

    Joined:
    Nov 23, 2005
    Messages:
    88
    Country:
    Sweden
    Then without knowing how the code you're jumping from looks it's hard to tell. Maybe R4 is used as a source location for an LDR so you should be using another register to jump back via. Or maybe your jump from around 0x08000C90 jumps into your inserted instructions as arm mode when they are thumb instructions or vice versa.
     

Share This Page