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 March 8th, 2010 (8:35 AM). Edited March 8th, 2010 by >Dante<.
>Dante<'s Avatar
>Dante< >Dante< is offline
Call me Steven
     
    Join Date: Jun 2008
    Location: Torino (ITA)
    Nature: Adamant
    Posts: 204
    Istant change of camera with WBTO

    As the title says, this is a command that allows to change in instant way the camera.
    Before beginning to speak you about this command, I want to specify that, the creator of this "makeup" or "magic" (as you prefer) is R!cci (Skoria).
    To understand well what I try to say, I show you a wonderful video with this special command.



    for the one who had not understood yet, for WBTO I intend the command WriteByteToOffset that, as the same word says, it entrusts himself to write a byte in the RAM of the game (an only byte for WBTO).

    Fortunately, for our command, only are necessary 2 WBTOs that point out the 2 positions of X and Y


    Then, our command will be this way:
    Code:
    writebytetooffset 0xposiciónX 0x2025734
    writebytetooffset 0xpocisiónY 0x2025736
    special 0x8E
    IMPORTANT: This command is only for pokèmon Ruby

    Now...
    will you ask you, why I had opened this topic in the section "research and development"??
    because I need your help to know how to do the same thing on Fire red..

    Does someone have some idea??
    __________________

    Reply With Quote

    Relevant Advertising!

      #2    
    Old March 8th, 2010 (11:20 AM). Edited March 17th, 2010 by Derlo.
    Derlo's Avatar
    Derlo Derlo is offline
    Working on Essence of light...
       
      Join Date: Aug 2007
      Posts: 129
      I looked at it and saw that the place (in FR) where the informations of the screen are saved in the range of 0202550C - 020255BC (approximately).

      Must be something with DMA or not.
      Maybe if check the routine that is part of the Special 0x113 and 0x114, maybe find something.
      or check the routine of Special 0x8e in R/S/E.

      EDIT:

      Try this script...
      PS.: just work when the data of screen are in this offset.

      Quote:
      special 0x113
      writebytetooffset 0xXX 0x202555C
      writebytetooffset 0xYY 0x202555E
      special 0x8e
      But the map gets an error:
      Events and Permissions Movement, are in position where you changed the screen.
      __________________



      Pokémon
      Essence of Light

      Comming Soon...
      Reply With Quote
        #3    
      Old March 8th, 2010 (2:45 PM).
      giradialkia's Avatar
      giradialkia giradialkia is offline
      • Crystal Tier
       
      Join Date: Apr 2009
      Location: Ireland
      Age: 23
      Gender: Male
      Nature: Timid
      Posts: 1,563
      Quote:
      Originally Posted by >Dante< View Post
      Istant change of camera with WBTO

      As the title says, this is a command that allows to change in instant way the camera.
      Before beginning to speak you about this command, I want to specify that, the creator of this "makeup" or "magic" (as you prefer) is R!cci (Skoria).
      To understand well what I try to say, I show you a wonderful video with this special command.



      for the one who had not understood yet, for WBTO I intend the command WriteByteToOffset that, as the same word says, it entrusts himself to write a byte in the RAM of the game (an only byte for WBTO).

      Fortunately, for our command, only are necessary 2 WBTOs that point out the 2 positions of X and Y


      Then, our command will be this way:
      Code:
      writebytetooffset 0xposiciónX 0x2025734
      writebytetooffset 0xpocisiónY 0x2025736
      special 0x8E
      IMPORTANT: This command is only for pokèmon Ruby

      Now...
      will you ask you, why I had opened this topic in the section "research and development"??
      because I need your help to know how to do the same thing on Fire red AND EMERALD..

      Does someone have some idea??
      Fixed...
      ...
      ...
      ...
      ...okay, not "fixed", but... It's not as if Emerald is bad or anything, am I right? This is pretty awesome, though, and I was thinking about it a few days ago. Thanks for posting, Dante
      __________________

      I'm working on an album of Pokémon-inspired music. Check out the Soundcloud link if you're interested!


      This is my Soundcloud | | This is my bandcamp
      Reply With Quote
        #4    
      Old March 8th, 2010 (5:09 PM).
      Diegoisawesome's Avatar
      Diegoisawesome Diegoisawesome is offline
      Oh god the bees
      • Silver Tier
       
      Join Date: Dec 2007
      Location: :noitacoL
      Age: 20
      Gender: Male
      Nature: Naive
      Posts: 1,032
      Just what I need for some cutscenes!
      Too bad FireRed has DMA protection... Maybe some ASM hacking could fix the problem.
      __________________


      My other resources:
      My Website
      diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
      diegoisawesome's Miscellaneous Finds
      The Ruins of Alph Puzzles
      Diego's Miscellaneous Patches
      GBA Intro Manager
      The Secret Sauce: Triple-Layer Tiles
      Reply With Quote
        #5    
      Old March 10th, 2010 (7:25 AM).
      Giga Universe's Avatar
      Giga Universe Giga Universe is offline
      Working on a tool.
      • Crystal Tier
       
      Join Date: Aug 2007
      Location: South Africa
      Age: 22
      Gender: Male
      Nature: Calm
      Posts: 121
      Here is something useful. I have found two addresses that are not DMA protected, that hold pointers to the location in the RAM where the X and Y positions of the camera are stored.

      03005008 - Pointer to X position of the camera
      0300500E - Pointer to Y position of the camera
      __________________
      Reply With Quote
        #6    
      Old March 10th, 2010 (8:13 AM).
      Derlo's Avatar
      Derlo Derlo is offline
      Working on Essence of light...
         
        Join Date: Aug 2007
        Posts: 129
        Quote:
        Here is something useful. I have found two addresses that are not DMA protected, that hold pointers to the location in the RAM where the X and Y positions of the camera are stored.

        03005008 - Pointer to X position of the camera
        0300500E - Pointer to Y position of the camera
        I had already checked these offsets.
        They are a jump to the place where the coordinates of the player on the map are saved.

        I think these offsets is changing the place where the player's position on the map is saved.
        Because it changes to the exact location where the bytes are saved.
        Perhaps, is only possible by making a routine that leave these values in one place (like R / S)
        Reply With Quote
          #7    
        Old March 10th, 2010 (11:08 AM).
        Giga Universe's Avatar
        Giga Universe Giga Universe is offline
        Working on a tool.
        • Crystal Tier
         
        Join Date: Aug 2007
        Location: South Africa
        Age: 22
        Gender: Male
        Nature: Calm
        Posts: 121
        They don't. They are just telling the game where the data is stored. A much simpler solution than removing DMA protection is to follow those pointers in an ASM routine and changing the values stored there. I'm trying to write to code to do so now.
        __________________
        Reply With Quote
          #8    
        Old March 10th, 2010 (3:23 PM).
        Diegoisawesome's Avatar
        Diegoisawesome Diegoisawesome is offline
        Oh god the bees
        • Silver Tier
         
        Join Date: Dec 2007
        Location: :noitacoL
        Age: 20
        Gender: Male
        Nature: Naive
        Posts: 1,032
        A good idea (if you're not already doing so) is to make an ASM routine to copy the bytes there into four variables, not just to edit the bytes into something specific, and another one to repack the bytes and place them back in.
        __________________


        My other resources:
        My Website
        diegoisawesome's MEGA-HUGE XSE Scripting Tutorial
        diegoisawesome's Miscellaneous Finds
        The Ruins of Alph Puzzles
        Diego's Miscellaneous Patches
        GBA Intro Manager
        The Secret Sauce: Triple-Layer Tiles
        Reply With Quote
          #9    
        Old March 13th, 2010 (12:03 AM). Edited March 13th, 2010 by Giga Universe.
        Giga Universe's Avatar
        Giga Universe Giga Universe is offline
        Working on a tool.
        • Crystal Tier
         
        Join Date: Aug 2007
        Location: South Africa
        Age: 22
        Gender: Male
        Nature: Calm
        Posts: 121
        Well, I've done a half-job. I'm just posting the progress I have made so far. I'm in a bit of a rush, so they aren't very good or optimised.

        Code:
        .text
        .align 2
        .thumb
        .thumb_func
        
        main:
        	push {r0-r3, lr}
        	ldr r0, .CAM
        	ldr r0, [r0]
        	ldrh r1, [r0, #0x2]
        	ldr r0, .CAM
        	ldr r0, [r0]
        	ldrh r0, [r0, #0x0]
        	ldr r2, .VAR
        	ldr r3, .VARS
        	strh r0, [r2]
        	strh r1, [r3]
        	pop {r0-r3, pc}
        
        .align 2
        .CAM:
        	.word 0x03005008
        .VAR:
        	.word 0x020370B8
        .VARS:
        	.word 0x020370BA


        Compile it, Insert it at a propper offset, then in a script call a 'callasm YOUR-OFFSET-1' command. This above code exports the X position of the camera to the variable 0x8000 and the Y position to 0x8001.


        Below is the setting routine. It doesn't work properly, because if you use special 0x8E after it, the game freezes. But, if you open a menu (Pokedex, Pokemon menu, etc), the camera updates without freezing the game. I'll try find a way to make it not freeze after use of special 0x8E. Insert the routine and insert this script:
        setvar 0x8000 XPOS
        setvar 0x8001 YPOS
        callasm YOUROFFSET-1
        end

        Run the script, and then open a menu, and you'll notice the camera adjusts to those positions. If you want to jump the camera up 2 places, and don't know the coordinates of the camera, use it in conjunction with the first routine.

        Code:
        .text
        .align 2
        .thumb
        .thumb_func
        
        main:
        	push {r0-r1, lr}
        	ldr r0, .CAM
        	ldr r0, [r0]
        	ldr r1, .VAR
        	str r1, [r0]
        	pop {r0-r1, pc}
        
        .align 2
        .CAM:
        	.word 0x03005008
        .VAR:
        	.word 0x020370B8
        .VARS:
        	.word 0x020370BA
        I'll try and fix them up later.
        __________________
        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 12:16 AM.