The PokéCommunity Forums Fan Games ROM Hacking Research & Development
Research Let's research the OAM-System

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Reply
 
Thread Tools
  #1    
Old December 17th, 2010 (11:27 AM). Edited August 5th, 2014 by knizz.
knizz's Avatar
knizz knizz is offline
     
    Join Date: Aug 2007
    Posts: 192
    Structures
    Code:
    00000000 coords              struc @ (sizeof=0x4)
    00000000 x:                  .short
    00000002 y:                  .short
    00000004 coords              ends
    
    00000000 oam                 struc @ (sizeof=0x8)
    00000000 y:                  .byte
    00000001 flags1:             .byte
    00000002 x:                  .byte
    00000003 msb_of_x_and_flags2:.byte
    00000004 tile_prio_pal:      .short
    00000006 irrelevant:         .short
    00000008 oam                 ends
    
    00000000 animation           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 http://www.pokecommunity.com/showthread.php?t=236456 for details)
    
    00000000 object_template     struc @ (sizeof=0x18)
    00000000 tiles_tag:          .short
    00000002 pal_tag:            .short
    00000004 oam:                .long
    00000008 image_table:        .long
    0000000C gfx_table:          .long
    00000010 rotscale_table:     .long
    00000014 callback:           .long
    00000018 object_template     ends
    
    00000000 object         struc @ (sizeof=0x44)
    00000000 final_oam:          oam
    00000008 animation_table:    .long
    0000000C gfx_table:          .long
    00000010 rotscale_table:     .long
    00000014 template: .long
    00000018 field_18:           .long
    0000001C callback:           .long
    00000020 pos_1:              coords
    00000024 pos_2:              coords
    00000028 pos_3_x:            .byte  @ These coordinates are subtracted from actual position!
    00000029 pos_3_y:            .byte  @ It is used to center the sprites. So most of the times pos_3_x=width/2 and pos_3_y=height/2
    0000002A anim_nr:            .byte
    0000002B anim_frame:         .byte
    0000002C anim_delay_countdown:      .byte @ six bits acting as countdown. two upper bits can pause image and rotscale-animations
    0000002D field_2D:           .byte
    0000002E ipos:               coords ?
    00000032 ivel:               coords ?            @ It seems like this is the private area
    00000032                                         @ for functions managing a single oam.
    00000032                                         @ Moving objects use ipos and ivel to save
    00000032                                         @ the position and velocity. But they have
    00000032                                         @ to be transferred to pos_1 manually. And
    00000032                                         @ NPCs use the first byte of ivel to store
    00000032                                         @ their current state.
    ...
    00000042 field_42:           .byte
    00000043 field_43:           .byte
    00000044 object         ends
    __________________
    Firered IDA 6.6 DB: https://www.dropbox.com/s/d856o3pyndyr5sr/firered.idb
    VBA-M with lua scripting support
    Reply With Quote

    Relevant Advertising!

      #2    
    Old December 21st, 2010 (7:25 AM). Edited June 11th, 2011 by knizz.
    knizz's Avatar
    knizz knizz is offline
       
      Join Date: Aug 2007
      Posts: 192
      Code:
      00000000 npc_state       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
      __________________
      Firered IDA 6.6 DB: https://www.dropbox.com/s/d856o3pyndyr5sr/firered.idb
      VBA-M with lua scripting support
      Reply With Quote
        #3    
      Old December 24th, 2010 (11:08 AM).
      Shiny Quagsire's Avatar
      Shiny Quagsire Shiny Quagsire is offline
      I'm Still Alive, Elsewhere
         
        Join Date: May 2009
        Location: Hoenn Safari Zone
        Age: 19
        Gender: Male
        Nature: Jolly
        Posts: 700
        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
        __________________



        Reply With Quote
          #4    
        Old January 3rd, 2011 (9:58 AM). Edited February 9th, 2013 by knizz.
        knizz's Avatar
        knizz knizz is offline
           
          Join Date: Aug 2007
          Posts: 192
          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.
          __________________
          Firered IDA 6.6 DB: https://www.dropbox.com/s/d856o3pyndyr5sr/firered.idb
          VBA-M with lua scripting support
          Reply With Quote
          Reply
          Quick Reply

          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 8:28 PM.