The PokéCommunity Forums Fan Games ROM Hacking Research & Development
Quick Research & Development Thread

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
  #151    
Old September 10th, 2011 (7:33 AM).
NarutoActor's Avatar
NarutoActor NarutoActor is offline
The rocks cry out to me
 
Join Date: Jan 2009
Location: Brooklyn/Marlboro
Age: 24
Gender: Female
Nature: Bashful
Posts: 1,979
'Offset of the facing direction byte for Person event N: 0x02036E38 + (0x24 * N) + 0x20'
This is extremely useful I have been trying to find this out recently too. Good job :D

Actually, I have a question. If you talk to the npc does the value change, or is it strictly the facing the player has in advance map.
__________________
~There are those people who understand hex, F the rest
Reply With Quote

Relevant Advertising!

  #152    
Old September 10th, 2011 (1:54 PM). Edited September 11th, 2011 by Missingyep.
Missingyep Missingyep is offline
     
    Join Date: Jul 2010
    Posts: 275
    Quote:
    Originally Posted by NarutoActor View Post
    'Offset of the facing direction byte for Person event N: 0x02036E38 + (0x24 * N) + 0x20'
    This is extremely useful I have been trying to find this out recently too. Good job :D

    Actually, I have a question. If you talk to the npc does the value change, or is it strictly the facing the player has in advance map.
    It varies depending on the movement behavior that you have set. What I found was that the byte was not updated after talking if the behavior was "No Movement". When using either the rotate-clockwise or walk-around-randomly behaviors, however, the OW's facing byte updated when they moved, when they turned, and when the "faceplayer" command was used.

    EDIT: I also just updated my list of every known flag and variable in FireRed. A list of all Hidden IDs (hidden-item Signposts) has been added as well.
    Reply With Quote
      #153    
    Old September 16th, 2011 (12:28 AM).
    Missingyep Missingyep is offline
       
      Join Date: Jul 2010
      Posts: 275
      I just found a few interesting quirks about some FireRed scripting commands. When I get around to it, I'll be uploading an updated version of a command reference I've been working on.

      - - -

      Setworldmapflag will set a flag if it is one of the sixteen entries in a list of world map flag numbers whose maps can be flown to. (That is, it will work for Viridian City's world map flag, but not for, say, Rock Tunnel's.)

      - - -

      Braille2 sets variable 0x8004 to a value based on the width of the braille string at the pointer you give it.

      Because braille strings do not support the \p or \l control codes, Game Freak had to create a "fake" message cursor every time they wanted to show multi-part or multi-line braille strings. To facilitate this, they created special 0x1B2, which draws a cursor on the screen at a position specified by variables 0x8004 (X) and 0x8005 (Y).

      braille2 will calculate the length of a specified braille string, and then set 0x8004 to a value based on that length. If you then show that string in a message box and call special 0x1B2, a cursor will appear exactly at the end of the braille string. For an example of its usage, view the scripts for the Signpost events in the Ruby or Sapphire rooms in Mt. Ember.

      - - -

      Setwildbattle will actually generate a 100-byte Pokemon data structure. If you know how, you can then manipulate this data structure before calling dowildbattle if you want to change its moveset or something.

      - - -

      If hidepokepic is called too soon after showpokepic, the script will freeze and hang with the pokepic box visible. I suspect the problems arise if you try to hide a pokepic while the game is still trying to display one.

      - - -

      Givepokemon will send the new Pokemon to the player's PC if their party is full. The number of the box to which the Pokemon is sent is stored in 0x4037 (yes, the game itself writes that var as part of the command). LASTRESULT is set to 0 if the Pokemon is stored in the party, 1 if it's sent to the PC, and 2 if there's no room in the party or the PC.
      Reply With Quote
        #154    
      Old September 23rd, 2011 (11:09 AM).
      Mr. Magius's Avatar
      Mr. Magius Mr. Magius is offline
        
       
      Join Date: Jul 2007
      Location: ... ;)
      Gender: Male
      Posts: 243
      How about adding a new type? Sorry if it's been mentioned, I haven't checked out much of this thread.
      __________________
      :|
      Reply With Quote
        #155    
      Old September 23rd, 2011 (11:30 AM).
      Crimson5M's Avatar
      Crimson5M Crimson5M is offline
      what
       
      Join Date: Feb 2011
      Location: Scotland
      Age: 22
      Gender: Male
      Nature: Quiet
      Posts: 1,109
      Quote:
      Originally Posted by Mr. Magius View Post
      How about adding a new type? Sorry if it's been mentioned, I haven't checked out much of this thread.
      Why not just edit the ??? type and change Curse to ghost like it is in gen V?
      __________________
      Youtube
      Reply With Quote
        #156    
      Old September 23rd, 2011 (7:53 PM).
      Mr. Magius's Avatar
      Mr. Magius Mr. Magius is offline
        
       
      Join Date: Jul 2007
      Location: ... ;)
      Gender: Male
      Posts: 243
      Quote:
      Originally Posted by Fireworks View Post
      Why not just edit the ??? type and change Curse to ghost like it is in gen V?
      Hmm.. yes, but what about strengths and weaknesses and whatnot? And say one wanted to add more than one type?
      __________________
      :|
      Reply With Quote
        #157    
      Old September 24th, 2011 (2:36 PM).
      Missingyep Missingyep is offline
         
        Join Date: Jul 2010
        Posts: 275
        During my analysis of cmda6, I discovered that Game Freak implemented their own script-controlled walking ASM into the Advance-generation games. There can be up to eight subroutines to run on every frame of animation, only one of which may be active at any given time. You can select a subroutine to activate using cmda6.

        At 0x03005090, there is a list of ASM functions to be executed on every frame of animation. Each entry in the list is a pointer to the routine, some metadata about the list item itself, and thirty-or-so bytes for the routine to work with (so that it may maintain its state).

        When on the overworld, one of the items on this list is 0x0806E811, a walking routine manager. This routine manager will check one of the bytes in its execution-list-item (set by cmda6) and based on that byte, it will call one of eight walking subroutines.

        Those subroutines in turn check the player's coordinates against stored values to see if the player has moved. If so, the subroutine processes player movement accordingly (check the tile they're standing on, change it if necessary, what have you).

        There are eight slots for walking subroutines, and the defined subroutines (pointed to by pointers at 0x083A7310) are:
        #0 at 0x0806E955: Nop
        #1 at 0x0806EB55: Broken (R/S/E leftover: Route 113 ash-covered grass)
        #2 at 0x0806E955: Nop
        #3 at 0x0806E955: Nop
        #4 at 0x0806E9E1: Icefall Cave ice tiles
        #5 at 0x0806E955: Nop
        #6 at 0x0806E955: Nop
        #7 at 0x0806EC41: Broken (R/S/E leftover: Granite Cave/Sky Pillar broken floor tiles)

        (The three defined subroutines basically change certain tiles out from under the player's feet. Theoretically, though, a subroutine can do anything it wants on every frame of animation that the overworld is being processed.)

        What this means is that we now have an official way -- something that was designed for this use -- to set up our own custom-made ASM functions to run the very instant the player takes a step. If we keep the broken functions in the table, we can define up to four custom ASM subroutines; if we ditch those, we can define six.

        (We could also repoint and extend the subroutine pointer table, and modify the related ASM code, thereby allowing up to 255 custom subroutines to be predefined and activated with cmda6.)

        One possible use case for all of this would be an alternate (and more script-friendly) implementation of JPAN-style walking scripts, which would work without breaking other game functions (i.e. wild encounters in tall grass).

        For more information, see the description for cmda6 in my FireRed script command reference.

        Oh, something else: the R/S/E leftovers prove that this discovery applies to all Advance-generation games. The offsets will differ, and the walking subroutines will have some differences in R/S/E, but the system itself exists in all Pokemon GBA games.
        Reply With Quote
          #158    
        Old September 26th, 2011 (6:42 PM). Edited September 26th, 2011 by Missingyep.
        Missingyep Missingyep is offline
           
          Join Date: Jul 2010
          Posts: 275
          Here's some information that may make my previous discovery more useful.

          First, a demonstration.

          Next, the walking subroutine that I used in that demonstration, with comments added. Modifying this should allow for easily-controlled tile-changing-when-stepped on effects.

          Spoiler:
          Code:
          .align 2
          .thumb
          
          SUBR_MAIN:
          push {r4-r7,lr}
          add sp, #-0x4
          lsl r0, r0, #0x18
          lsr r0, r0, #0x18
          ldr r2, EXECUTION_QUEUE
          add r2, r2, #0x8
          lsl r1, r0, #0x2
          add r1, r1, r0
          lsl r1, r1, #0x3
          add r5, r1, r2                     // r5 is the start of roughly 30 bytes of RAM alotted for this functionality
          mov r1, #0x2
          ldsh r0, [r5, r1]                  // we use this as part of a queueing system
          cmp r0, #0x0                       // only happens after switching subroutines with cmda6 (the 30 bytes are cleared)
          beq SUBR_INIT
          cmp r0, #0x1                       // 1 means that we're listening for footsteps
          beq SUBR_STEP
          bgt SUBR_TILE                      // higher values mean we have a tile change queued
          mov r0, #0x1
          strh r0, [r5, #0x2]
          
          SUBR_RTRN:
          add sp, #0x4
          pop {r4-r7}
          pop {pc}
          
          SUBR_INIT:                         // initialize our state data
          mov r4, sp
          add r4, r4, #0x2
          mov r1, r4
          ldr r3, F_GET_COORDS
          bl CALL_R3
          ldrh r2, [sp]
          strh r2, [r5, #0x4] // we
          ldrh r0, [r4]
          strh r0, [r5, #0x6]
          ldr r2, DEFAULT_COLOR
          strh r2, [r5, #0x8]
          mov r2, #0x0
          strh r2, [r5, #0xC]
          mov r2, #0x1
          strh r2, [r5, #0x2]
          b SUBR_RTRN
          
          SUBR_STEP:                         // check if the player's taken a step
          mov r4, sp
          add r4, r4, #0x2
          mov r1, r4
          mov r0, sp
          ldr r3, F_GET_COORDS
          bl CALL_R3
          mov r0, sp                         // compare current coords to logged coords
          ldrh r2, [r0]
          mov r3, #0x0
          ldsh r1, [r0, r3]
          mov r3, #0x4
          ldsh r0, [r5, r3]
          cmp r0, r1
          bne SUBR_STEP_CHECK_SWITCH
          mov r3, #0x0
          ldsh r1, [r4, r3]
          mov r3, #0x6
          ldsh r0, [r5, r3]
          cmp r0, r1
          beq SUBR_RTRN
          b SUBR_STEP_CHECK_SWITCH
          
          SUBR_STEP_CHECK_SWITCH:
          strh r2, [r5, #0x4]                // log the new coords
          ldrh r0, [r4]
          strh r0, [r5, #0x6]
          mov r0, sp
          mov r3, #0x0
          ldsh r0, [r0, r3]
          ldsh r1, [r4, r3]
          ldr r3, F_GET_TILE                 // check if the player's standing on one of the "palette" tiles
          bl CALL_R3
          mov r2, #0x0
          ldr r1, BLUE_SWITCH_TILE
          cmp r0, r1
          beq SUBR_STEP_SET_BLUE
          ldr r1, RED_SWITCH_TILE
          cmp r0, r1
          beq SUBR_STEP_SET_RED
          ldr r1, GREEN_SWITCH_TILE
          cmp r0, r1
          beq SUBR_STEP_SET_GREEN
          ldr r1, WHITE_SWITCH_TILE
          cmp r0, r1
          beq SUBR_STEP_SET_WHITE
          b SUBR_STEP_CHECK_CANVAS
          
          SUBR_STEP_SET_BLUE:
          ldr r2, BLUE_CANVAS_TILE
          b SUBR_STEP_SET
          
          SUBR_STEP_SET_RED:
          ldr r2, RED_CANVAS_TILE
          b SUBR_STEP_SET
          
          SUBR_STEP_SET_GREEN:
          ldr r2, GREEN_CANVAS_TILE
          b SUBR_STEP_SET
          
          SUBR_STEP_SET_WHITE:
          ldr r2, WHITE_CANVAS_TILE
          b SUBR_STEP_SET
          
          SUBR_STEP_SET:
          strh r2, [r5, #0x8]                // if so, store their selection (tile ID of color to change to)
          b SUBR_RTRN
          
          SUBR_STEP_CHECK_CANVAS:            // check if standing on a "canvas" tile
          ldr r2, BLUE_CANVAS_TILE
          cmp r0, r2
          beq SUBR_STEP_QUEUE_CANVAS
          ldr r2, RED_CANVAS_TILE
          cmp r0, r2
          beq SUBR_STEP_QUEUE_CANVAS
          ldr r2, GREEN_CANVAS_TILE
          cmp r0, r2
          beq SUBR_STEP_QUEUE_CANVAS
          ldr r2, WHITE_CANVAS_TILE
          cmp r0, r2
          beq SUBR_STEP_QUEUE_CANVAS
          b SUBR_RTRN
          
          SUBR_STEP_QUEUE_CANVAS:
          mov r2, #0x4                       // if so, queue a change
          strh r2, [r5, #0xC]
          mov r0, #0x2
          strh r0, [r5, #0x2]
          ldrh r0, [sp]
          strh r0, [r5, #0xE]
          ldrh r0, [r4]
          strh r0, [r5, #0x10]
          b SUBR_RTRN
          
          SUBR_TILE:
          ldrh r0, [r5, #0xC]
          cmp r0, #0x1                       // we can delay a change by a specific number of frames
          bgt SUBR_TILE_DELAY
          mov r1, sp
          ldrh r0, [r5, #0xE]
          strh r0, [r1]
          mov r4, sp
          add r4, r4, #0x2
          ldrh r0, [r5, #0x10]
          strh r0, [r4]
          mov r0, #0x24                      // the "ice tile just cracked" sound
          ldr r3, F_PLAY_SOUND
          bl CALL_R3
          mov r0, sp
          mov r3, #0x0
          ldsh r0, [r0, r3]
          ldsh r1, [r4, r3]
          ldrh r2, [r5, #0x8]
          ldr r3, F_CHANGE_TILE
          bl CALL_R3
          mov r0, sp
          mov r3, #0x0
          ldsh r0, [r0, r3]
          ldsh r1, [r4, r3]
          ldr r3, F_REPAINT_TILE             // not entirely sure how it works, but it does update the specified tile's entries in graphical memory
          bl CALL_R3
          mov r0, #0x1
          strh r0, [r5, #0x2]
          b SUBR_RTRN
          
          SUBR_TILE_DELAY:
          sub r0, #0x1
          strh r0, [r5, #0xC]
          b SUBR_RTRN
          
          CALL_R3:
          bx r3
          bx lr
          
          .align 2
          F_GET_COORDS:
          .word 0x0805C539
          
          F_GET_TILE:
          .word 0x08058E49
          
          F_PLAY_SOUND:
          .word 0x080722CD
          
          F_CHANGE_TILE:
          .word 0x08058FA5
          
          F_REPAINT_TILE:
          .word 0x0805A8E9
          
          EXECUTION_QUEUE:
          .word 0x03005090
          
          // Everything below here is a tile number in the major and minor tilesets
          // You'd basically use the hex values that AMap shows you when you mouseover a given tile
          DEFAULT_COLOR:
          .word 0x000003F4
          
          BLUE_CANVAS_TILE:
          .word 0x000003EC
          
          RED_CANVAS_TILE:
          .word 0x000003ED
          
          GREEN_CANVAS_TILE:
          .word 0x000003F5
          
          WHITE_CANVAS_TILE:
          .word 0x000003F4
          
          BLUE_SWITCH_TILE:
          .word 0x000003E9
          
          RED_SWITCH_TILE:
          .word 0x000003EA
          
          GREEN_SWITCH_TILE:
          .word 0x000003EB
          
          WHITE_SWITCH_TILE:
          .word 0x000003F1


          The upshot of all of this is that it is now very easy to make polished effects like a floor cracking underneath the player's feet, for example -- complete with sound effects and perhaps even other behaviors.

          That alone could be used for things like unique Gym puzzles. Theoretically, that is just scratching the surface of this functionality's potential, however. Remember that it runs on every frame of animation in which the overworld is being shown and/or processed. In theory, you could do things like timing how long the player stands on a block, or tampering with the movement patterns of an NPC (this runs when you take a step, not when you finish moving, so problems waiting for movement should be few and far between).

          And so this concludes my research on CmdA6.
          Reply With Quote
            #159    
          Old October 6th, 2011 (7:38 AM).
          knizz's Avatar
          knizz knizz is offline
             
            Join Date: Aug 2007
            Gender: Female
            Posts: 192
            Quote:
            Originally Posted by DavidJCobb View Post
            At 0x03005090, there is a list of ASM functions to be executed on every frame of animation. Each entry in the list is a pointer to the routine, some metadata about the list item itself, and thirty-or-so bytes for the routine to work with (so that it may maintain its state).
            FINALLY! Finally someone understands the relevance of this list.
            I called it callback3-list and all functions that can be in one of it's slots are prefixed with c3_ in my database. The walking routine manager (0x0806E811) is called c3_ash in it. The table with the eight slots (0x083A7310) is named 'ashtable'.

            The ash handler calls 'music_play' and 'setmaptile' internally. Once at 0806EB22 (Tile 0x35B) and another time at 0806EAD8 (Tile 0x35A). A subfunction (0806E958) that is called from 0806EA82 and sets some flags.

            I didn't know that this is controllable via the 0xA6 command. So thanks for telling.
            __________________
            Firered IDA 6.6 DB: https://www.dropbox.com/s/d856o3pyndyr5sr/firered.idb
            VBA-M with lua scripting support
            incomplete firered decompilation
            Reply With Quote
              #160    
            Old October 13th, 2011 (7:21 AM).
            slawter666's Avatar
            slawter666 slawter666 is offline
               
              Join Date: Sep 2008
              Posts: 84
              Is the screen size for the GBA Pokémon games (240 x 160) set within the ROM or the GBA hardware? And if it was theoretically possible to expand it to the DS screen size (or greater)(256 x 192) would it be that size on an emulator or if it was played on a DS or would it still be limited to the original GBA screen size?
              Reply With Quote
                #161    
              Old October 13th, 2011 (8:27 AM). Edited October 13th, 2011 by The 100 Mega Shock.
              The 100 Mega Shock The 100 Mega Shock is offline
               
              Join Date: Aug 2010
              Gender: Male
              Posts: 1,235
              Even if you tried expanding the viewable area on an emulator I'm almost certain that the system would not draw anything outside of the original screen size, due to the nature of how 2D consoles, and emulation of them, work

              You can do this with emulators for 3D consoles like N64, DC and Gamecube, but they're a completely different beast when it comes to emulation and passing the graphics to your computer to be drawn - and it totally depends on the game whether or not you'll get a useful result from displaying more screen area than was originally intended.

              As for your other point, for all intents and purposes the DS is treated as a Game Boy Advance when it goes into backwards compatibility mode - the main processor of the GBA is identical to the second processor of the DS, so the game's code can be run natively on the system. It behaves exactly the same as a GBA would.
              __________________
              Reply With Quote
                #162    
              Old October 13th, 2011 (11:03 AM).
              romancandle romancandle is offline
                 
                Join Date: Oct 2009
                Gender: Male
                Nature: Adamant
                Posts: 72
                How hard would it be to make a tool for editing Pokemon Abilities--names, effects, descriptions--or adding new ones in Gen III?
                Reply With Quote
                  #163    
                Old October 13th, 2011 (11:26 AM).
                Gamer2020's Avatar
                Gamer2020 Gamer2020 is offline
                Accept no Imitations!
                   
                  Join Date: Jun 2008
                  Location: Distant Land
                  Gender: Male
                  Nature: Bold
                  Posts: 934
                  Quote:
                  Originally Posted by romancandle View Post
                  How hard would it be to make a tool for editing Pokemon Abilities--names, effects, descriptions--or adding new ones in Gen III?
                  I'm not sure but I think someone made one already.
                  __________________

                  The new home for ROM Hacking!
                  Reply With Quote
                    #164    
                  Old October 13th, 2011 (11:35 AM).
                  romancandle romancandle is offline
                     
                    Join Date: Oct 2009
                    Gender: Male
                    Nature: Adamant
                    Posts: 72
                    Quote:
                    Originally Posted by Gamer2020 View Post

                    I'm not sure but I think someone made one already.
                    I sure haven't found any, but then again, I'm not a great searcher. I've tried Google and searching these forums specifically. If you find it, please PM a link to me.
                    Reply With Quote
                      #165    
                    Old October 14th, 2011 (5:06 AM).
                    ruup20's Avatar
                    ruup20 ruup20 is offline
                    Gonna splash everybody!
                       
                      Join Date: Jan 2011
                      Location: Undella Town
                      Gender: Male
                      Nature: Jolly
                      Posts: 118
                      Do you mean like YAPE? That's a good one.
                      __________________

                      I really need a advanced scripter for my hack and a good storyline-guy,
                      Thank you. ;)
                      Reply With Quote
                        #166    
                      Old October 14th, 2011 (9:05 AM).
                      romancandle romancandle is offline
                         
                        Join Date: Oct 2009
                        Gender: Male
                        Nature: Adamant
                        Posts: 72
                        Quote:
                        Originally Posted by ruup20 View Post
                        Do you mean like YAPE? That's a good one.
                        YAPE lets me give pokemon any ability in the game, yes, but I'd like to edit the Abilities themselves. For example, I wouldn't mind making Lightning Rod act like it does Gen V or put in Motor Drive.
                        Reply With Quote
                          #167    
                        Old October 14th, 2011 (9:31 AM).
                        TheDarkShark TheDarkShark is offline
                        Metal Headed Hacker
                           
                          Join Date: May 2010
                          Location: Germany
                          Gender: Male
                          Nature: Calm
                          Posts: 56
                          If there was a tool for something like that, I'd probably leave GBA-Hacking - it'd be too easy (which it already is, IMO). If you want something alike, you'll have to do some serious hacking involving ASM.
                          If you don't want to do it that way, you don't want that feature bad enough to deserve it. That's my philosophy.

                          Anyway, try putting a break on read at a pokemon's Ability. That should lead you to most routines which use them. Then you can easily extend the header to enable new abilities. That won't do the job, though. AFAIK, each ability has it's own ASM-routines, so you'd need to wright new code.
                          I'm sure there's a thread around dealing with it. I think it's name was "modernizing the Firered-field engine" or something.
                          I hope I could help you - at least a bit.
                          __________________
                          There are two things every Rom-Hacker should learn:
                          1. Don't give away everything you know!

                          Reply With Quote
                            #168    
                          Old October 14th, 2011 (1:13 PM).
                          Jambo51's Avatar
                          Jambo51 Jambo51 is offline
                          Glory To Arstotzka
                             
                            Join Date: Jun 2009
                            Gender: Male
                            Nature: Quiet
                            Posts: 732
                            Quote:
                            Originally Posted by romancandle View Post
                            YAPE lets me give pokemon any ability in the game, yes, but I'd like to edit the Abilities themselves. For example, I wouldn't mind making Lightning Rod act like it does Gen V or put in Motor Drive.
                            I don't wanna s**t all over your hopes, but there is no such editor. And I highly doubt there ever will be.

                            Gamer2020's tool lets you change/add ability names and descriptions, but there is no way to create custom ability effects without using ASM.

                            I'm currently working on adding pretty much everything I can from gen 4/5 into gen 3, abilities included. Give me some time, and I'll see what I can do.
                            __________________
                            Hey guys, please check out my recreations of the gen 1 and 2 music on my custom engine at my SoundCloud! - Here!
                            Reply With Quote
                              #169    
                            Old October 14th, 2011 (1:20 PM).
                            Missingyep Missingyep is offline
                               
                              Join Date: Jul 2010
                              Posts: 275
                              Hey, guys, just a heads-up. I haven't confirmed anything yet, but...

                              The RAM used by JPAN's Hacked Engine (1856 bytes starting at 0x0203F3C0) appears to overlap a small RAM space used by the Teachy TV's ASM (10 bytes starting at 0x0203F444). This sound minor, but it's a clear indicator that the RAM isn't unused, and it also means that there may be more overlaps with other seldom-used functionality.

                              I haven't heard of any particularly-bizarre or unexplained problems arising from JPAN's Hacked Engine, and it's worked excellently for me; this is just a minor thing to keep in mind. Nothing major should be affected by RAM conflicts with JPAN's code.
                              Reply With Quote
                                #170    
                              Old October 14th, 2011 (3:57 PM).
                              dudedude1 dudedude1 is offline
                              .
                                 
                                Join Date: Feb 2011
                                Gender: Male
                                Posts: 141
                                I'm not sure if this has yet to have been accomplished but I've read Darthatron says its possible. I'm trying to find and way to increase the number of unique world map tiles to at least 2048 but I had read Darthatron said the max that was possible was 4096. Any information would be greatly appreciated!
                                Reply With Quote
                                  #171    
                                Old October 24th, 2011 (8:50 AM).
                                SupahNinja's Avatar
                                SupahNinja SupahNinja is offline
                                Scripting Ninja
                                   
                                  Join Date: Mar 2011
                                  Gender: Male
                                  Posts: 34
                                  Quote:
                                  Originally Posted by DavidJCobb View Post
                                  Code:
                                  LIST OF IDENTIFIED IN-GAME VARS (FIRERED)
                                  
                                  4000        Temporary/disposable variable.
                                              Written to by special E7.
                                  4001        Temporary/disposable variable.
                                  4003        Temporary/disposable variable? Used in TRAINER TOWER.
                                  4006        Temporary/disposable variable? Used in TANOBY KEY.
                                  4008        Temporary/disposable variable? Used in TANOBY KEY.
                                  400E        Temporary/disposable variable? Used in TRAINER TOWER.
                                  400F        Temporary/disposable variable? Used in TRAINER TOWER.
                                  4010        Temporary/disposable variable.
                                              Written to by (incomplete?) special 142.
                                  4020        Pedometer. It counts down, and upon reaching 0x0000, REPEL expires.
                                  4021        Pedometer. Max value 0x007F; it loops back to 0x0000 after.
                                  4022        Pedometer. Max value 0x0004; it loops back to 0x0000 after.
                                  4023        Pedometer. Max value 0x05DC; it just stays at that value after?
                                  4025        Pedometer? Used for DAISY's script? Haven't seen it in action myself yet.
                                              Set to 0x01F4 (500) by GAME START SCRIPT.
                                  4031        The starter that the player chose (0, 1, 2).
                                              Accessed directly by special 129.
                                  4036        Multi-use, for SELPHY's Pokemon-fetching-and-showing game.
                                              Apparently set to 0x0000 when it's time for a new "round" to start.
                                              Apparently set to 0xFFFF if you're out of time.
                                  4037        Box that a newly-received (givepokemon) Pokemon was sent to. Is directly manipulated by the game engine 
                                          itself.
                                              Read by special 165.
                                  4038        Unknown.
                                              Read by specials A6 and A9.
                                              Written to by special A8.
                                              Used by special AA.
                                  4039        Unknown.
                                              Written to by specials A6, A7, and A9.
                                  403A        Used in elevator scripts (current floor?). Written to by special 0xD8.
                                  403C        0xXXYY -- the current bank and map, respectively.
                                  403E        Unknown.
                                              Accessed directly by special 1AC.
                                  4042        Unknown.
                                              Read by special 167.
                                  4043        Unknown.
                                              Written to by special 167.
                                  4049        Unknown. Something to do with the sticker kid on FOUR ISLAND.
                                  404A        Unknown. Something to do with the sticker kid on FOUR ISLAND.
                                  404B        Unknown. Something to do with the sticker kid on FOUR ISLAND.
                                  404E        Unknown.
                                              Written to by special 197.
                                  4050        Unknown or multi-use.
                                              Set to 0x1 after the "Don't go out yet!" OAK Script event.
                                              Set to 0x2 during the Hall of Fame room level script, if the National Dex is NOT already unlocked.
                                              Set to 0x3 after OAK's chat with the player in PALLET TOWN after beating the E4.
                                  4051        Set to 0x2 to disable the "Old Man Needs Coffee" Script event in VIRIDIAN CITY.
                                  4052        Set to 0x1 to disable Script events for Gary in CERULEAN CITY.
                                  4053        Unknown. Set to 0x0 after the player watches the S.S. ANNE depart.
                                  4054        Unknown or multi-use.
                                              Set to 0x2 to disable Script events for a Rival encounter on ROUTE 22.
                                              Set to 0x3 after VIRIDIAN CITY Gym Leader GIOVANNI is defeated. Enables next Rival.
                                              Set to 0x4 to disable Script events for a second Rival encounter on ROUTE 22.
                                  4055        Unknown.
                                              Is set to 0x0 when the player hasn't encounted PROF. OAK yet.
                                              Is set to 0x1 when OAK is escorting the player to his lab.
                                              Is set to 0x2 when the player needs to choose a starter.
                                              Is set to 0x3 when the player and their Rival have both chosen starters.
                                              Is set to 0x4 after the player's first battle with their Rival.
                                              Is set to 0x5 when the player needs to deliver OAK's PARCEL.
                                              Is set to 0x9 when the player enters PROF. OAK while it is set to 0x8.
                                              If >= 0x1 and no other events pending, then DAISY comments on a recent Rival battle.
                                              Set to 0x7 after OAK's chat with the player in PALLET TOWN after beating the E4.
                                  4056        Unknown. If equal to 0x0, "sethealingplace" runs whenever the player enters their bedroom in 
                                          PALLET TOWN. Another level script then sets the variable to 0x1.
                                  4057        Multi-use.
                                              Set to 0x1 to disable the OAK's PARCEL level script in VIRIDIAN CITY's PokeMart.
                                              Set to some other value to enable VIRIDIAN CITY's normal PokeMart script.
                                  4058        Unknown. Checked by DAISY's script in PALLET TOWN. Apparently part of the sequence of events 
                                          that makes her give away the TOWN MAP.
                                              Set to 0x2 when DAISY gives away the TOWN MAP.
                                  4059        If != 0x0, then the player beat the Ghost MAROWAK at POKeMON TOWER.
                                  405A        Set to some value to disable the Old Man that blocks the VIRIDIAN CITY Gym.
                                  405B        Multi-use.
                                              Set to 0x1 to disable Script events for a Rival encounter on the S.S. ANNE.
                                              Is set to 0x1 when entering LAVENDER TOWN.
                                  405C        If != 0x0, then the player beat Gary at SILPH CO.
                                  405D        If != 0x0, then the player beat Gary at POKeMON TOWER.
                                  405E        Set to 0x0 to disable Script events on the tiles bordering the exits to the CYCLING ROAD 
                                          gatehouse. Set to 0x1 to disable Script events on the tiles bordering the entrances.
                                  405F        Controls various badge-checking Script events on Route 23.
                                  4060        If >= 0x1, then TEAM ROCKET has left SILPH CO.
                                  4061        Set to 0x1 to disable the Pay-To-Enter Script events in PEWTER CITY's Museum.
                                  4062        Set to 0x1 to disable the thirsty-guard roadblock Script events in the SAFFRON gatehouses.
                                  4064        Unknown or multi-use.
                                              Reset to 0x0000 when entering Route 23.
                                              Used as part of the Boulder puzzle scripts in VICTORY ROAD.
                                  4065        Unknown or multi-use.
                                              Reset to 0x0000 when entering Route 23.
                                              Used as part of the Boulder puzzle scripts in VICTORY ROAD.
                                  4066        Unknown or multi-use.
                                              Reset to 0x0000 when entering Route 23.
                                              Used as part of the Boulder puzzle scripts in VICTORY ROAD.
                                  4067        Unknown. Reset to 0x0000 when entering Route 23.
                                  4068        Set to 0x2 after an Elite Four chamber level script forces the player to walk up. Rechecked 
                                          later after the E4 battle in that chamber has ended. Reset to 0x0000 in the Hall of Fame room.
                                  4069        Set to 0x1, 0x2, or 0x3 depending on which fossil is being revived at the CINNABAR ISLAND 
                                          lab.
                                  406A        Fossil revival process. 0x1 means that a revival is in progress. 0x2 means that it is 
                                          complete.
                                  406B        Set to 0x1 to disable Script events for the Nugget Bridge challenge.
                                  406C        Unknown or multi-use.
                                              Set to 0x1 to disable the man that traps you in PEWTER until you beat Brock.
                                              Set to 0x2 to disable Script events for the man that gives Running Shoes at PEWTER.
                                  406E        Safari Zone status.
                                              Set to 0x0 when not in the SAFARI ZONE.
                                              Set to 0x1 ...?
                                              Set to 0x2 after paying to enter the SAFARI ZONE.
                                  406F        I haven't the faintest idea. Used in Pokemon Center 2F level scripts.
                                  4070        Set to 0x1 when talking to some chick in PALLET TOWN that mimics a sign or whatever.
                                  4071        See 408A.
                                  4073        Affects dialogue in the SAFFRON CITY TRAINER FAN CLUB building.
                                              Is set to 0x1 when the occupants -- your new fans -- swarm you.
                                  4074        Unknown. Checked if != 0x0 in a level script for the woman-who-likes-battles's house (map 
                                          31.0).
                                  4075        Used in a ONE ISLAND level script. If it equals 0x2, BILL will welcome you to ONE ISLAND, 
                                          bring you into the PokeCenter to see CELIO, and then the variable will be set to 0x3.
                                  4076        Multi-use, for the RUBY/SAPPHIRE subplot.
                                              Set to 0x4 if hasn't beaten the ROCKET GRUNTs they eavesdrop on at MT. EMBER?
                                              Set to 0x5 when the RUBY has been delivered to CELIO on ONE ISLAND.
                                              Set to 0x6 when the subplot is complete.
                                              If >= 0x5, VERMILION dockworker acknowledges your RAINBOW PASS. (Travel to SEVII)
                                              If >= 0x1, VERMILION dockworker acknowledges your TRI-PASS. (Travel to SEVII 1-3)
                                  4078        Affects the commentary and items offered by the shopkeeper on One Island. The variable's 
                                          value is managed by a TWO ISLAND level script that checks various flags.
                                              0x4078 == 0x2 means that Lostelle has been rescued.
                                              0x4078 == 0x3 means that you've beaten all Gyms, but not the Elite Four. (?)
                                              0x4078 == 0x4 means that the shopkeeper offers items "from distant lands". (Beat E4)
                                  4079        Multi-use, for the LOSTELLE event.
                                              Set to 0x1 after dealing with a Biker at the TWO ISLAND GAME CORNER.
                                              Set to 0x2 after rescuing LOSTELLE in BERRY FOREST, before warping to her home.
                                              Is set to 0x3 when LOSTELLE is reunited with her father.
                                              Is set to 0x4 when the subplot is complete.
                                  407B        Unknown or multi-use.
                                              Set to 0x2 to enable the first Script events for the Bikers in THREE ISLAND?
                                              Set to 0x3 to disable the first Script events for the Bikers in THREE ISLAND.
                                              Set to 0x4 to disable the second Script events for the Bikers. (They leave.)
                                  407C        Unknown or multi-use.
                                              Set to 0x1 to ...?
                                              Set to 0x2 to disable the Pokemon Center 2F level script (TEALA's tutorial).
                                  407D        Set to 0x1 to disable the ROCKET GRUNT Script events behind the broken home in CERULEAN.
                                  407E        Unknown or multi-use.
                                              Is set to 0x1 after the player helps the S.S. ANNE's captain.
                                              Is set to 0x2 when the player is stepping out of a boat and into VERMILION CITY or the S.S. ANNE harbor.
                                              Is set to 0x3 when the S.S. ANNE has departed VERMILION CITY.
                                  407F        Set to 0x2 after a Script event on MT. EMBER, in which the player hears ROCKET GRUNTs talk.
                                  4080        Set to 0x1 after a Script event in ICEFALL CAVE, in which the player assists LORELEI.
                                  4081        Set to 0x1 to disable a Script event blocking access to the Pokemon in the FIGHTING DOJO.
                                  4082        Multi-use.
                                              Set to 0x0 to enable a Script event at the TRAINER TOWER counter. (A level script 
                                              on the tower's exterior (Map 3.62) does this.)
                                              Set to 0x1 to disable a Script event at the TRAINER TOWER counter.
                                  4083        Set to 0x1 upon entering the LOST CAVE room with the lost woman.
                                  4084        Multi-use, for the SELPHY event.
                                              Set to 0x1 upon rescuing SELPHY from LOST CAVE, before warping to RESORT GORGEOUS.
                                              Set to 0x2 upon being promptly dismissed from her front door (level script).
                                  4085        Unknown. Used in two level scripts for INDIGO PLATEAU (3.9). Does something if it equals 1.
                                  4086        Set to 0x1 to disable a FOUR ISLAND level script (Gary encounter without battle).
                                  4088        Set to 0x1 to disable Script events in ROCKET WAREHOUSE.
                                  4089        Set to 0x1 to disable a SIX ISLAND (37.0) level script (Gary encounter without battle).
                                  408A        Multi-use, for an event where you meet BILL at CINNABAR ISLAND's PokeCenter, and he leaves on 
                                          a boat.
                                              Set to 0x1 upon meeting BILL in the PokeCenter. The same script makes you both leave.
                                              Is set to 0x1 when used in level scripts that show BILL's departure from the island.
                                  408B        Set to 0x1 to disable the Script events for the fossil guy in MT. MOON.
                                  ...
                                  5EF4 - 7FFF    CONFIRMED UNSAFE! In PC box space!
                                  Does this mean that vars under 4000 (and vars in betwen 408B and 5EF4) are safe to use?
                                  __________________
                                  SupahNinja

                                  My feelings on
                                  ROM hacking:

                                  -I like scripting a lot.
                                  -Mapping is almost as fun.
                                  -Hex editing isn't bad at all.
                                  -I do NOT enjoy spriting.
                                  -I've been meaning to start learning ASM for a while, but I don't ever seem to have enough time.

                                  Favorites:

                                  -My favorite color is green.
                                  -My favorite type is fire.
                                  -My favorite Pokémon are:
                                  Growlithe, Charizard, Mew,
                                  Giratina, Haxorus, and Aggron.
                                  SupahNinja
                                  Reply With Quote
                                    #172    
                                  Old October 24th, 2011 (12:40 PM).
                                  Missingyep Missingyep is offline
                                     
                                    Join Date: Jul 2010
                                    Posts: 275
                                    Quote:
                                    Originally Posted by SupahNinja View Post
                                    Does this mean that vars under 4000 are safe to use?
                                    Variables under 4000 can't be used because:
                                    • They overlap RAM used for flags
                                    • Most script commands don't recognize them as variables
                                      • Most commands basically do this: "If argument > 0x3FFF, then find the value of variable number argument and use that value. Else, use argument itself as a value."
                                    Quote:
                                    Originally Posted by SupahNinja View Post
                                    Does this mean that vars in betwen 408B and 5EF4 are safe to use?
                                    Some of them have been confirmed unsafe since I last updated that document. The rest are a mystery and could be safe or unsafe.
                                    • Variables 0x4100 to 0x417F (inclusive) overlap the RAM used for a special data type called "hidden variables" -- a set of 64 dwords used by certain script commands whose purpose is unknown.
                                    • Variables 0x5084 to 0x55CC overlap RAM used for seemingly-arbitrary data. I haven't noticed any ill effects from overwriting this data, but it changes frequently, so the variables themselves are unreliable.
                                    • Variables 0x56F4 - 0x5EF3 appear to also overlap RAM used for the PC. This doesn't match with JPAN's findings (the 0x5EF4 figure is from him) so either one of us is wrong, or this variable range overlaps non-essential parts of the PC data.
                                    My suspicion -- an unconfirmed one -- is that the only safe variables are those from 0x4000 to 0x40FF (inclusive), excluding variables in that range that are set or read by the core game engine (as opposed to those used by scripts that can be safely removed).

                                    Basically, you're better off keeping your variables to a minimum. If you find yourself running short on variables, see if flags (or perhaps key items) could be used instead of variables to track the player's progression through different scripts.
                                    Reply With Quote
                                      #173    
                                    Old October 24th, 2011 (3:24 PM).
                                    SupahNinja's Avatar
                                    SupahNinja SupahNinja is offline
                                    Scripting Ninja
                                       
                                      Join Date: Mar 2011
                                      Gender: Male
                                      Posts: 34
                                      Quote:
                                      Originally Posted by DavidJCobb View Post
                                      Variables under 4000 can't be used because:
                                      • They overlap RAM used for flags
                                      • Most script commands don't recognize them as variables
                                        • Most commands basically do this: "If argument > 0x3FFF, then find the value of variable number argument and use that value. Else, use argument itself as a value."
                                      Some of them have been confirmed unsafe since I last updated that document. The rest are a mystery and could be safe or unsafe.
                                      • Variables 0x4100 to 0x417F (inclusive) overlap the RAM used for a special data type called "hidden variables" -- a set of 64 dwords used by certain script commands whose purpose is unknown.
                                      • Variables 0x5084 to 0x55CC overlap RAM used for seemingly-arbitrary data. I haven't noticed any ill effects from overwriting this data, but it changes frequently, so the variables themselves are unreliable.
                                      • Variables 0x56F4 - 0x5EF3 appear to also overlap RAM used for the PC. This doesn't match with JPAN's findings (the 0x5EF4 figure is from him) so either one of us is wrong, or this variable range overlaps non-essential parts of the PC data.
                                      My suspicion -- an unconfirmed one -- is that the only safe variables are those from 0x4000 to 0x40FF (inclusive), excluding variables in that range that are set or read by the core game engine (as opposed to those used by scripts that can be safely removed).

                                      Basically, you're better off keeping your variables to a minimum. If you find yourself running short on variables, see if flags (or perhaps key items) could be used instead of variables to track the player's progression through different scripts.
                                      Okay, thank you.
                                      So I'll use flags when possible, and when I need variables (let's say, for the scripts that activate when stepped on by the player, and require a certain variable to be set) then I'll use 0x4000 to 0x40FF.
                                      If any of the variables cause an error, I'll report back here so you can update the list.
                                      __________________
                                      SupahNinja

                                      My feelings on
                                      ROM hacking:

                                      -I like scripting a lot.
                                      -Mapping is almost as fun.
                                      -Hex editing isn't bad at all.
                                      -I do NOT enjoy spriting.
                                      -I've been meaning to start learning ASM for a while, but I don't ever seem to have enough time.

                                      Favorites:

                                      -My favorite color is green.
                                      -My favorite type is fire.
                                      -My favorite Pokémon are:
                                      Growlithe, Charizard, Mew,
                                      Giratina, Haxorus, and Aggron.
                                      SupahNinja
                                      Reply With Quote
                                        #174    
                                      Old November 7th, 2011 (6:17 AM).
                                      EdensElite's Avatar
                                      EdensElite EdensElite is offline
                                      No0b, but getting there.
                                         
                                        Join Date: Jun 2011
                                        Location: UK
                                        Gender: Male
                                        Nature: Bold
                                        Posts: 190
                                        Hey Guys. I've been trying to find out how to edit the PC Boxes for a while. So far all I've find out is that it is stored in the VRAM and what I've include in the screenshot below. If anyone experienced with Hex etc. can help me out, I would really appreciate it :)

                                        Findings


                                        I managed to find the header. I havn't tried editing it yet. As I'm more interested interested in the actual box. I noticed that most boxes only use one or two different tiles repeated over and over, so maybe there isn't actually a whole image to edit unlike Gen IV games. In which case it's possible that those tiles are in that picture and I missed them.
                                        __________________

                                        ROM Hacking was getting frustrating for me. I've now stopped productions and writing the game from scratch in HTML 5.

                                        That means it will be playable in the browser, and across multiple devices such as the iPod touch.
                                        Reply With Quote
                                          #175    
                                        Old November 8th, 2011 (4:04 PM).
                                        Awkward Squirtle Awkward Squirtle is offline
                                        ,@,e .ºoO
                                           
                                          Join Date: Jul 2011
                                          Gender: Male
                                          Posts: 110
                                          Uh... they're stored in the ROM, and copied to the VRAM when the game needs to draw them to the screen. I suspect they're uncompressed in the ROM, so you could just use a tile editor to change them (if you can find them).
                                          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 6:01 AM.