Change Trainer Sprite of Trainer Card

  • Hello guys, in this guide I will explain the change of the sprite in the trainer card in the rom of RUBY USA.
    As we all know we can have 2 sprites:
    Male & Female Player. Using the offset WBTO 02024EAC (overwriting 0 or 1) you can change the sex of the pg and the resulting sprite, unfortunately, are only two sprites mentioned before.
    First, go to offset 080937E6 this byte to hijack the routine:
    C0 46 00 48 00 47 XX+1 XX XX 08
    XX XX XX 08 mean pointer of your routine +1 (THUMB MODE).
    This is ASM ROUTINE i use:


    binary routine:

    Quote

    00 F0 17 F8 07 B4 0C 4A 12 88 D2 00 31 21 C9 01 03 20 40 06 09 18 09 48 80 18 00 68 12 DF 08 48 80 18 00 68 07 49 12 DF 07 49 12 DF 07 BC 01 BC 00 47 06 48 00 47 00 00 C4 E8 02 02 3C C5 1E 08 D4 C7 1E 08 68 EF 02 02 68 EB 02 02 AD 3D 09 08


    Let me explain how work:
    the routine save var 8000 value and mul it *8 because the table of trainer sprite and pal sprite are made with:
    XX XX XX 08 YY YY YY YY
    where the first four byte mean the pointer of image/pal and other 4 byte.
    after i add offset of table to the previous result and i use SWI to decompress image. The total sprite in the rom are 52 (HEX). if you set var 8000 with value (greater than 52) and call routine you might have an error when you open the menu of trainer card ;)
    when you load palette it's necessary to load pal in the direct pal in the ram and the pal of fadescreen.
    this is the script for change your sprite:

    Quote

    #dynamic 0x800000
    #org @inizio
    setvar 0x8000 0xNumber_Sprite
    callasm 0xOffset routine +1
    end


    This is the finale result :D
    [Blocked Image: http://i61.tinypic.com/2z6fdpk.png]
    if you have problem write in the comment, hope you like it :D