• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Research: Let's research the OAM-System

knizz

192
Posts
16
Years
    • Seen Oct 28, 2020
    Structures
    Code:
    00000000 [B]coords[/B]              struc @ (sizeof=0x4)
    00000000 [COLOR="Red"]x[/COLOR]:                  .short
    00000002 [COLOR="Blue"]y[/COLOR]:                  .short
    00000004 coords              ends
    
    [COLOR="Orange"]00000000[/COLOR] [B]oam[/B]                 struc @ (sizeof=0x8)
    [COLOR="orange"]00000000[/COLOR] y:                  .byte
    [COLOR="orange"]00000001[/COLOR] flags1:             .byte
    [COLOR="orange"]00000002[/COLOR] x:                  .byte
    [COLOR="orange"]00000003[/COLOR] msb_of_x_and_flags2:.byte
    [COLOR="orange"]00000004[/COLOR] tile_prio_pal:      .short
    [COLOR="orange"]00000006[/COLOR] irrelevant:         .short
    [COLOR="orange"]00000008[/COLOR] oam                 ends
    
    00000000 [B]animation[/B]           struc @ (sizeof=0x4)
    00000000 frame:              .half @ Internally: 0xFFFD=>animcmd1 0xFFFE=>animcmd2
    00000000                           @ 0xFFFF=>animcmd3 any other number (=framenr) =>animcmd4
    00000002 duration:           .half
    00000004 animation           ends
    (read [url]http://www.pokecommunity.com/showthread.php?t=236456[/url] for details)
    
    [COLOR="Lime"]00000000[/COLOR] [B]object_template[/B]     struc @ (sizeof=0x18)
    [COLOR="lime"]00000000[/COLOR] tiles_tag:          .short
    [COLOR="lime"]00000002[/COLOR] pal_tag:            .short
    [COLOR="lime"]00000004[/COLOR] oam:                .long
    [COLOR="lime"]00000008[/COLOR] [U]image_table[/U]:        .long
    [COLOR="lime"]0000000C[/COLOR] gfx_table:          .long
    [COLOR="lime"]00000010[/COLOR] rotscale_table:     .long
    [COLOR="lime"]00000014[/COLOR] [U]callback[/U]:           .long
    [COLOR="lime"]00000018[/COLOR] object_template     ends
    
    [COLOR="Sienna"]00000000[/COLOR] [B]object[/B]         struc @ (sizeof=0x44)
    [COLOR="sienna"]00000000[/COLOR] [COLOR="Orange"]final_oam[/COLOR]:          oam
    [COLOR="sienna"]00000008[/COLOR] [U]animation_table[/U]:    .long
    [COLOR="sienna"]0000000C[/COLOR] gfx_table:          .long
    [COLOR="sienna"]00000010[/COLOR] rotscale_table:     .long
    [COLOR="sienna"]00000014[/COLOR] [COLOR="Lime"][U]template[/U][/COLOR]: .long
    [COLOR="sienna"]00000018[/COLOR] field_18:           .long
    [COLOR="sienna"]0000001C[/COLOR] [U]callback[/U]:           .long
    [COLOR="sienna"]00000020[/COLOR] pos_1:              [COLOR="red"]coo[/COLOR][COLOR="Blue"]rds[/COLOR]
    [COLOR="sienna"]00000024[/COLOR] pos_2:              [COLOR="red"]coo[/COLOR][COLOR="blue"]rds[/COLOR]
    [COLOR="sienna"]00000028[/COLOR] [COLOR="Red"]pos_3_x[/COLOR]:            .byte  @ These coordinates are [u]subtracted[/u] from actual position!
    [COLOR="sienna"]00000029[/COLOR] [COLOR="blue"]pos_3_y[/COLOR]:            .byte  @ It is used to center the sprites. So most of the times pos_3_x=width/2 and pos_3_y=height/2
    [COLOR="sienna"]0000002A[/COLOR] anim_nr:            .byte
    [COLOR="sienna"]0000002B[/COLOR] anim_frame:         .byte
    [COLOR="sienna"]0000002C[/COLOR] anim_delay_countdown:      .byte @ six bits acting as countdown. two upper bits can pause image and rotscale-animations
    [COLOR="sienna"]0000002D[/COLOR] field_2D:           .byte
    [COLOR="sienna"]0000002E[/COLOR] ipos:               [COLOR="red"]coo[/COLOR][COLOR="Blue"]rds[/COLOR] ?
    [COLOR="sienna"]00000032[/COLOR] ivel:               [COLOR="red"]coo[/COLOR][COLOR="Blue"]rds[/COLOR] ?            @ It seems like this is the private area
    [COLOR="sienna"]00000032[/COLOR]                                         @ for functions managing a single oam.
    [COLOR="sienna"]00000032[/COLOR]                                         @ Moving objects use ipos and ivel to save
    [COLOR="sienna"]00000032[/COLOR]                                         @ the position and velocity. But they have
    [COLOR="sienna"]00000032[/COLOR]                                         @ to be transferred to pos_1 manually. And
    [COLOR="sienna"]00000032[/COLOR]                                         @ NPCs use the first byte of ivel to store
    [COLOR="sienna"]00000032[/COLOR]                                         @ their current state.
    ...
    [COLOR="sienna"]00000042[/COLOR] field_42:           .byte
    [COLOR="sienna"]00000043[/COLOR] field_43:           .byte
    [COLOR="sienna"]00000044[/COLOR] object         ends
     
    Last edited:

    knizz

    192
    Posts
    16
    Years
    • Seen Oct 28, 2020
    Code:
    00000000 [B]npc_state[/B]       struc @ (sizeof=0x24)
    00000000 bitfield_DX:    .byte ?
    00000001 field_1:        .byte ?
    00000002 field_2:        .byte ?
    00000003 field_3:        .byte ?
    00000004 oamid:          .byte ?
    00000005 typeid:         .byte ?          @ Used as index for gender-color-lookup
    00000006 running_behaviour:.byte ?
    00000007 is_trainer:     .byte ?
    00000008 field_8:        .byte ?
    00000009 field_9:        .byte ?
    0000000A field_A:        .byte ?
    0000000B height:         .byte ?          @ Only bits 0x0F define height. I don't know about 0xF0.
    0000000C stay_around:    coords ?
    00000010 from:           coords ?
    00000014 to:             coords ?
    00000018 unknown2:       .byte ?
    00000019 movement_area:  .byte ?
    0000001A field_1A:       .short ?
    0000001C the_state:      .byte ?
    0000001D sight_distance: .byte ?
    0000001E tile_from:      .byte ?
    0000001F tile_to:        .byte ?
    00000020 unknown1:       .byte ?
    00000021 unknown3:       .byte ?
    00000022 field_22:       .byte ?
    00000023 field_23:       .byte ?
    00000024 npc_state       ends
     
    Last edited:

    Shiny Quagsire

    I'm Still Alive, Elsewhere
    697
    Posts
    14
    Years
  • Lol, I tried this out, and it's pretty cool. I messed with the flags, and made my person a reflection. :)

    The only flags I really found were: normal, no flip, vanish, and reflection
     

    knizz

    192
    Posts
    16
    Years
    • Seen Oct 28, 2020
    I found the oam-structures for the game-freak-star in the intro.

    Code:
    0840BC2C oam_star:       oam <0, 0, 0, 0x40, 0x800, 0>
    0840BC34 oam_sparks:     oam <0, 0, 0, 0, 0x800, 0>
    0840BC3C anim_spark_1:   animation <0, 0,  4, 0> @ 0
    0840BC3C                 animation < 1, 0,  4, 0>@ 1
    0840BC3C                 animation < 2, 0,  4, 0>@ 2
    0840BC3C                 animation < 3, 0,  4, 0>@ 3
    0840BC3C                 animation <0xFE, 0xFF, 0, 0>@ 4
    0840BC50 anim_spark_2:   animation <0, 0,  4, 0> @ 0
    0840BC50                 animation < 1, 0,  4, 0>@ 1
    0840BC50                 animation < 2, 0,  4, 0>@ 2
    0840BC50                 animation < 3, 0,  4, 0>@ 3
    0840BC50                 animation <0xFF, 0xFF, 0, 0>@ 4
    0840BC64 animtable_sparks:.long anim_spark_1,anim_spark_2@ 0
    0840BC6C tpl_star:       object_template <0, 0, oam_star, animtable_empty, 0, off_08231CFC, oac_star+1>
    0840BC84 tpl_sparks:     object_template <1, 1, oam_sparks, animtable_sparks, 0, off_08231CFC, oac_sparks+1>

    Write 0840bc6c/0840bcbc/0840bcdc to 080EDDD8 and LOL.
     
    Last edited:
    Back
    Top