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
  #1326    
Old February 24th, 2018 (5:25 PM). Edited February 25th, 2018 by Miko-chan.
Miko-chan's Avatar
Miko-chan Miko-chan is offline
Haruka Fanboy
     
    Join Date: Feb 2018
    Location: Hoenn <3
    Age: 22
    Gender: Male
    Nature: Timid
    Posts: 3
    Old post :/
    Spoiler:
    Is there a port of the Disable Bag in Emerald?

    I've been trying it myself by trying to port JPAN's Prevent Items routine from Fire Red.
    It checks for a certain value in memory and calls the "Items can't be used now." used in link battles if it meets the condition.

    The original routine from FR:
    Code:
    .thumb
    .align 2
    @At 080143D6 place 00 47, and at 08014410 place the pointer to this function + 1
    No_items: 		ldr r0, num_to_check
    				ldrb r0, [r0]
    				cmp r0, #0x1
    				bne return_to_normal
    				ldr r0, denyItemsAddr
    				bx r0
    				
    return_to_normal:	ldr r1, battleFlags
    				ldr r0, [r1]
    				ldr r1, itemForbiddenTestAddr
    				bx r1
    
    num_to_check:		 .word 0x020370c0
    battleFlags:			 .word 0x02022B4C
    denyItemsAddr:		 .word 0x080143E1
    itemForbiddenTestAddr:	 .word 0x080143D9
    My attempt at porting it to Emerald:
    Code:
    @Routine is somewhere at 0x0806F116
    .thumb
    .align 2
    
    No_items:    ldr r0, num_to_check
                        ldrb r0, [r0]
                        cmp r0, #0x1
                        bne return_to_normal
                        ldr r0, denyItemsAddr
                        bx r0
    				
    return_to_normal:	ldr r1, battleFlags
    				ldr r0, [r1]
    				ldr r1, itemForbiddenTestAddr
    				bx r1
    
    num_to_check:           	 .word 0x02022FFC		@Some random location for testing
    battleFlags:	        	 .word 0x02022FEC
    denyItemsAddr:         	 .word 0x08			@Unusure where this is one located
    itemForbiddenTestAddr:	 .word 0x0806F11B		@Also not sure here but seems like it

    Okay, having checked the Disable Bag routine for FR here in this thread (which I actually checked before using JPAN's, but apparently I was so in a rush that I didn't check properly).

    Here is the routine for Emerald:
    Code:
    @Insert this compiled routine at 0x0803C230
    .thumb
    .equ qq_bag,        0x0803C230
    .equ flag_check,    0x0809D790
    .equ loc_803C23E,   0x0803C23E
    .equ off_803C254,   0x0803C254
     
    .equ loc,       qq_bag
    .equ checkflag, flag_check
    .equ blockitem, loc_803C23E
    .equ flag,      off_803C254
     
    main:
        ldr r0, [pc, #flag-(loc+4)]
        bl +checkflag-loc
        bne +blockitem-loc
        NOP
        NOP
    All those hours wasted yesterday :catflip:
    Reply With Quote
      #1327    
    Old March 2nd, 2018 (1:14 AM).
    DarkPsychic's Avatar
    DarkPsychic DarkPsychic is offline
       
      Join Date: Jul 2012
      Location: CO
      Gender: Male
      Nature: Timid
      Posts: 144
      Quote:
      Originally Posted by Hotice03 View Post
      I want to make an ghost eeveelution and to evolve it you must level it up with a rare candy in the party while it is fainted then once it is leveled up it evolves
      Here ya go ^_^
      Faint/Low Hp Evolution:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global faintEvolution
      
      main:
      push {r0-r7}
      add r0, r6, r7   @line to change if expanded evos
      lsl r0, r0, #0x3
      add r0, r2, r0
      add r3, r0, r3
      ldrb r2, [r3, #0x2]
      mov r0, r8
      bl decrypt
      mov r11, r0
      pop {r0-r7}
      mov r1, r11
      cmp r1, #0x2    @Compare Amount of Current Hp
      blo low_hp
      b exit
      
      low_hp:
      mov r10, r3
      pop {r0-r7}
      mov r1, r10
      ldr r0, evolution_loc
      bx r0
      
      exit:
      pop {r0-r7}
      ldr r0, no_evo
      bx r0
      
      decrypt: 
      push {r0-r7}
      mov r1, #0x39
      ldr r2, decryptpoke
      bx r2
      
      .align 2
      no_evo: .word 0x08043111
      evolution_loc: .word 0x0804310D
      decryptpoke: .word 0x0803FBE9

      Note for the first highlighted in green:
      If you have expaned your evolutions for your pokemon you must change this line:
      "add r0, r6, r7"
      to:
      8 evos or less = lsl r0, r6, #0x1
      16 evos or less = lsl r0, r6, #0x2
      32 evos or less = lsl r0, r6, #0x3

      or
      just change the bytes in the compiled file from F0 19 to:
      8 evos or less = 70 00
      16 evos or less = B0 00
      32 evos or less = F0 00


      Note for second highlighted in green:
      As it is the Pokemon must be leveled up with a Rare Candy to get it to revive and have 1-Hp.
      You can change the value of 0x2 to something higher but anything lower than 0x2 will not work with this routine.
      After the compare it the vaule must be lower than the "0x2" or what ever value you decide to change it to.


      Hope this helps!
      Reply With Quote
        #1328    
      Old March 2nd, 2018 (8:04 PM).
      Petuuuhhh's Avatar
      Petuuuhhh Petuuuhhh is online now
       
      Join Date: Apr 2017
      Location: Georgia
      Age: 25
      Gender: Male
      Posts: 575
      Quote:
      Originally Posted by FBI View Post

      Pokemon Storage (outside the PC)



      Basically, in it's current state, this is effectively a storage system. It stores Pokemon and can be interacted with by the player to withdraw or deposit Pokemon. It's standalone from the PC storage system and is also much smaller (I've limited it to 6, but it can go upto 47). Some things that you will be able to do with this routine (and conjunction with some smaller ones) include:
      - Extra Pokemon storage, you can possibly get a little over 1 box worth
      - Flash back battles (complete swap between stored Pokemon and party Pokemon with capabilities to swap back)
      - Carry a party of greater than 6 Pokemon (you can use the 2nd party for HM slaves, or whatever)
      - Trade evolver guy! He will take your Pokemon and then when you come back it can be evolved! (silent evolution ftw!)
      - Separate Daycare holding larger amount of Pokemon at once

      I've tested it thoroughly and there doesn't seem to be any problems. I will be adding more and more features into this because I believe that it has the potential to become a very useful feature.
      Currently planning to add:
      - Party swap completely all in one go (this will actually be in the very near future..maybe today even :P)
      - Partial swapping (believe it or not, this is hard because there's no graphical support)
      - Suggest me more :D

      How to insert:

      Compile into free space the following routine:
      Spoiler:

      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      
      main:
      	push {r0, r4, lr}
      	ldr r0, .FROM
      	ldr r1, [r0]
      	cmp r1, #0x0 @party
      	beq addParty
      
      addStorage:
      	ldr r0, .STORAGE
      	sub r0, r0, #0x1
      	ldrb r1, [r0]
      	cmp r1, #0x6 @limit of storage. Change depending on your space situation
      	beq end
      	add r0, r0, #0x1
      	mov r2, #0x50
      	cmp r1, #0x0
      	beq skipline
      	sub r1, r1, #0x1
      	mul r1, r1, r2
      	add r0, r0, r1 @destination
      	ldr r1, =(0x20370C0)
      	ldrb r1, [r1]
      	ldr r2, .PARTY
      	mov r3, #0x64
      	mul r1, r1, r3
      	add r1, r1, r2 @source
      	mov r2, #0x50 @size
      	ldr r3, =(0x8040B08 +1) @func
      	bl linker
      	@need to fix up Player's party slots
      	ldr r1, =(0x20370C0)
      	ldrb r1, [r1]
      	cmp r1, #0x5
      	beq writeLastZero
      	mov r2, #0x5
      	sub r2, r2, r1
      	mov r3, #0x64
      	mul r2, r2, r3 @size
      	ldr r0, .PARTY
      	mul r1, r1, r3
      	add r0, r0, r1 @dest
      	add r3, r3, r0
      	mov r1, r3      @src
      	ldr r3, =(0x8040B08 +1) @func
      	bl linker
      	
      
      writeLastZero:
      	ldr r0, =(0x2024478)
      	mov r1, #0x0
      	mov r2, #0x64
      	ldr r3, =(0x81E5ED8 +1)
      	bl linker
      
      correctCounters:
      	ldr r0, .STORAGE
      	sub r0, r0, #0x1
      	ldrb r2, [r0]  @pks in storage counter
      	ldr r1, =(0x2024029)
      	ldrb r3, [r1] @pks in party
      	add r2, r2, #0x1
      	strb r2, [r0]
      	sub r3, r3, #0x1
      	strb r3, [r1]
      	b end
      	
      
      
      addParty:
      	ldr r0, =(0x2024029)
      	ldrb r0, [r0]
      	cmp r0, #0x6
      	beq end
      	ldr r1, .PARTY
      	mov r2, #0x64
      	mul r0, r0, r2
      	add r0, r0, r1 @destination
      	mov r4, r0
      	ldr r3, .STORAGE
      	ldr r1, =(0x20370C0) @var 0x8004 determines which slot of storage to take from
      	ldrb r1, [r1]
      	mov r2, #0x50 @size
      	mul r1, r1, r2
      	add r1, r1, r3 @source
      	ldr r3, =(0x8040B08 +1) @func
      	bl linker
      	@update stats 
      	mov r0, r4
      	ldr r3, =(0x803E47C +1)
      	bl linker
      	@adjust the storage
      	ldr r0, =(0x20370C0)
      	ldrb r0, [r0]
      	cmp r0, #0x5 @storage limit minus 1
      	beq writeZero
      	mov r2, #0x5
      	sub r2, r2, r0
      	mov r3, #0x50
      	mul r2, r2, r3 @size
      	ldr r1, .STORAGE
      	mul r0, r0, r3
      	add r0, r0, r1 @dest
      	add r3, r3, r0
      	mov r1, r3      @src
      	ldr r3, =(0x8040B08 +1) @func
      	bl linker
      
      writeZero:
      	ldr r0, .STORAGE
      	mov r1, #0xC8
      	lsl r1, r1, #0x1
      	add r0, r0, r1
      	mov r1, #0x0
      	mov r2, #0x50
      	ldr r3, =(0x81E5ED8 +1)
      	bl linker
      
      updateCounters:
      	ldr r0, .STORAGE
      	sub r0, r0, #0x1
      	ldrb r2, [r0]
      	ldr r1, =(0x2024029)
      	ldrb r3, [r1]
      	sub r2, r2, #0x1
      	strb r2, [r0]
      	add r3, r3, #0x1
      	strb r3, [r1]
      
      end:
      	pop {r0-r4, pc}	
      
      linker:
      	bx r3	
      	
      .align 2
      
      .FROM:
      	.word 0x20270B8 + (0x8000 *2)
      
      .STORAGE:
      	.word 0x203C001 @storage location
      
      .PARTY:
      	.word 0x2024284 @player's party


      Here's a compiled version:
      Code:
      11 B5 38 48 01 68 00 29 32 D0 37 48 01 38 01 78 06 29 65 D0 01 30 50 22 51 43 40 18 34 49 09 78 32 4A 64 23 59 43 89 18 50 22 32 4B 00 F0 59 F8 2F 49 09 78 05 29 0B D0 05 22 52 1A 64 23 5A 43 2A 48 59 43 40 18 1B 18 19 1C 2A 4B 00 F0 49 F8 29 48 00 21 64 22 29 4B 00 F0 43 F8 22 48 01 38 02 78 27 49 0B 78 01 32 02 70 01 3B 0B 70 37 E0 23 48 00 78 06 28 33 D0 1C 49 64 22 50 43 40 18 04 1C 19 4B 1A 49 09 78 50 22 51 43 C9 18 19 4B 00 F0 27 F8 20 1C 1B 4B 00 F0 23 F8 14 48 00 78 05 28 0B D0 05 22 12 1A 50 23 5A 43 0E 49 58 43 40 18 1B 18 19 1C 0F 4B 00 F0 13 F8 0A 48 C8 21 49 00 40 18 00 21 50 22 0C 4B 00 F0 0A F8 06 48 01 38 02 78 0A 49 0B 78 01 3A 02 70 01 33 0B 70 1F BD 18 47 B8 70 03 02 01 C0 03 02 84 42 02 02 C0 70 03 02 09 0B 04 08 78 44 02 02 D9 5E 1E 08 29 40 02 02 7D E4 03 08
      Usage:

      The routine itself manages party storage and storage extraction. What you need to do is determine which one it performs.
      If you want to remove a Pokemon from the party and into storage, setvar 0x8000 anything but zero
      if you want to remove a Pokemon from storage, setvar 0x8000 0x0
      Which variable you used can be changed, as always, by editing the pointer at the bottom of the routine.
      The next thing is variable 0x8004. I use this variable to determine the slot of extraction for both the Party and the Storage system.
      If I wanted to take the 3rd Pokemon in the party and put it in storage:
      setvar 0x8004 0x2
      setvar 0x8000 0x1
      callasm 0x[routine] +1

      The reason for this is to support easy use of special 0x9F. Though you can use copyvar, I suppose.

      Finally, the routine writes to RAM a counter, which keeps track of how many Pokemon are in the storage.
      This is written at 0x203C000, and can be retrieved by using the "copybyte" scripting command. For example:
      copybyte 0x20370D0 0x203C000 'puts the storage counter into variable 0x800D (lastresult).

      I tried to keep it simple, and do the work inside the routine, hopefully that paid off.
      Here's a very poor sample script. Poor because it handles all the cases, but it doesn't display the system's full potential :P

      Spoiler:

      PKSV script.
      Code:
      #dyn 0x740000
      #org @start
      lock
      faceplayer
      copybyte 0x20370D0 0x203C000 ' storage count into last result
      compare LASTRESULT 0x0
      if == jump @putOnly
      msgbox @add
      callstd MSG_YESNO 'want to take?
      compare LASTRESULT 0x1
      if == jump @addParty
      jump @putOnly
      
      #org @putOnly
      countpokemon
      copyvar 0x8000 0x800D
      compare 0x8000 0x1
      if <= jump @greetings
      msgbox @put
      callstd MSG_YESNO 'want to put?
      compare LASTRESULT 0x1
      if == jump @addStorage
      msgbox @exit
      callstd MSG_NORMAL
      release
      end
      
      #org @addStorage
      setvar 0x8000 0x1
      special 0x9F
      waitspecial
      countpokemon
      compare LASTRESULT 0x8004
      if < jump @noSelection
      callasm 0x[routine +1]
      msgbox @gave
      callstd MSG_NORMAL
      release
      end
      
      
      #org @addParty
      setvar 0x8000 0x0
      countpokemon
      compare LASTRESULT 0x6
      if == jump @fullP
      msgbox @store
      callstd MSG_NORMAL
      setvar 0x8004 0x0 'gotta rework this to work a better way
      callasm 0x[routine +1]
      fanfare 0x101
      msgbox @complete
      callstd MSG_NORMAL
      release
      end
      
      #org @greetings
      msgbox @hello
      callstd MSG_NORMAL
      release
      end
      
      #org @fullP
      msgbox @full
      callstd MSG_NORMAL
      release
      end
      
      #org @noSelection
      msgbox @exit
      callstd MSG_NORMAL
      release
      end
      
      #org @full
      = You're party is full!
      
      #org @hello
      = Hi, I can't do anything\nyour slots are full or empty\lor mine are full while yours are\lfull[.]
      
      #org @complete
      = I gave it back.
      
      #org @store
      = Alright, I'll give it to you.
      
      #org @gave
      = Thanks for giving me this.
      
      #org @exit
      = Alright, next time then.
      
      #org @add
      = Want your Pokemon back?
      
      #org @put
      = Want to give me a pokemon?


      That's it for now. Keep an eye out for "addons" for this routine in the future :)
      Sorry for the double post. I like seperate posts for my routines to keep the first post's links neat :x
      Hi,

      I want to know what a script would be that would allow the player to retrieve items and Pokemon only if they have a certain item or a certain amount of money. For example, let's say there's a Larvitar at level 10 in a new PC called "Boss' PC". The player can retrieve that Larvitar, but only after obtaining the item "Boss' Password". Another case would be that this Larvitar costs 1000 Pokecurrency. If the player has less than 1000 Pokecurrency, the PC will not let the player withdraw the Larvitar. If the player has 1000 Pokecurrency or more, the PC will deduct that money from the player's total Pokecurrency, and will allow the player to withdraw the Larvitar.

      Thank you,
      Reply With Quote
        #1329    
      Old March 4th, 2018 (6:24 AM).
      Hotice03 Hotice03 is offline
         
        Join Date: Apr 2017
        Posts: 10
        omg thank you so much dude! youve just made me so happy now since im still new to asm i gotta figure out the little bits but im sure i can get it :) again thank you so much would you like credit since youve created the asm for it
        Reply With Quote
          #1330    
        Old March 4th, 2018 (3:50 PM).
        Hotice03 Hotice03 is offline
           
          Join Date: Apr 2017
          Posts: 10
          so me and my friend got it into the rom and everything and turns out it didnt work, did you test it? cause we cant get it to work
          Reply With Quote
            #1331    
          Old March 13th, 2018 (1:11 PM). Edited March 13th, 2018 by Dionen.
          Dionen's Avatar
          Dionen Dionen is offline
          living on the edge of a tomato soup bowl
             
            Join Date: Jun 2011
            Location: Brazil
            Gender: Male
            Nature: Quirky
            Posts: 290
            Quote:
            Originally Posted by FBI View Post

            OAM routines


            Generating OAMs



            This routine is only to generate OAMs which are trainer or Pokemon sprites. I've modified it to be usable with a script, but honestly, setting the values yourself via ASM would've been faster (not that this is noticeably slow, just comparatively). I will have to do more research on making it portray an arbitrary image, but with the expansion work on the Pokedex and such, I don't see it as very necessary anymore.

            How to insert:
            Compile and insert the following routine into a free word aligned offset.

            Spoiler:

            Code:
            .text
            .align 2
            .thumb
            .thumb_func
             
            main:
                    push {r0-r4, lr}
                    sub SP, SP, #0x14
                   
                    @load PID
                    ldr r2, =(0x20370B8) @PokeSlot
                    ldrb r2, [r2]
                    cmp r2, #0x6
                    beq shiny
                    ldr r0, =(0x2024284)
                    mov r4, #0x64
                    mul r2, r2, r4
                    add r2, r2, r0
                    ldrh r2, [r2] @PID
                   
                    @load TID
                    ldr r1, =(0x300500C)
                    ldr r1, [r1]
                    ldrh r1, [r1, #0xA] @TID
                    b cont
                           
            shiny:
                    mov r0, #0x0
                    mov r1, r0
                    mov r2, r0
             
            cont:
                    @X-pos
                    ldr r0, =(0x20370BA)
                    ldrh r0, [r0]
                    str r0, [SP] @X-Pos
                   
                    @Y-pos
                    ldr r0, =(0x20370BC)
                    ldrh r0, [r0]
                    str r0, [SP, #0x4] @Y-Pos
                   
                    @pal #
                    ldr r0, =(0x20370BE)
                    ldrh r0, [r0]
                    str r0, [SP, #0x8] @pal #
                   
                    ldr r3, =(0x20370C0)
                    ldrb r3, [r3]
                    cmp r3, #0x1
                    bne nonsil
                    mov r3, #0x0
                    str r3, [SP, #0xC] @occupacity
                    b unkn
                   
            nonsil:
                    ldr r3, =(0x0000FFFF)
                    str r3, [SP, #0xC] @occupacity
                   
            unkn:  
                    @??? - No idea, but leave as 0s
                    @possibly priority?
            	ldr r0, =(0x20370C6)
            	ldrb r0, [r0]
                    str r0, [SP, #0x10]
            	mov r0, #0x0
                    str r0, [SP, #0x14]
                   
                    @species/sprite ID
                    ldr r0, =(0x20370C2)
                    ldrh r0, [r0]
             
                    @front VS back
                    ldr r3, =(0x20370C4)
                    ldrb r3, [r3]
             
                    @display func
                    ldr r4, =(0x810BDAC +1)
                    bl linker
                    add SP, SP, #0x14
                    pop {r0-r4, pc}
                   
             
             
            linker:
                    bx r4
             
            .align 2
            Compiled version:
            Code:
            1F B5 85 B0 18 4A 12 78 06 2A 08 D0 17 48 64 24 62 43 12 18 12 88 16 49 09 68 49 89 02 E0 00 20 01 1C 02 1C 13 48 00 88 00 90 13 48 00 88 01 90 12 48 00 88 02 90 12 4B 1B 78 01 2B 02 D1 00 23 03 93 01 E0 0F 4B 03 93 0F 48 00 78 04 90 00 20 05 90 0E 48 00 88 0E 4B 1B 78 0E 4C 00 F0 02 F8 05 B0 1F BD 20 47 C0 46 B8 70 03 02 84 42 02 02 0C 50 00 03 BA 70 03 02 BC 70 03 02 BE 70 03 02 C0 70 03 02 FF FF 00 00 C6 70 03 02 C2 70 03 02 C4 70 03 02 AD BD 10 08
            so, little question, cause I'm still learning.
            Is it possible to modify this routine in order to display Item images? Is this display function able to handle them?
            If not, what is the best way to show them?
            __________________
            Reply With Quote
              #1332    
            Old March 14th, 2018 (9:08 PM).
            Petuuuhhh's Avatar
            Petuuuhhh Petuuuhhh is online now
             
            Join Date: Apr 2017
            Location: Georgia
            Age: 25
            Gender: Male
            Posts: 575
            Quote:
            Originally Posted by NewDenverCity View Post
            SPEEDING UP FIRERED
            All this does is make the turbo button on VBA work faster.
            Emerald solution is found here. That's also the source of my implementation of this.
            Code:
            .thumb
            
            .org 0x890
            main:
            	push {lr}
            	ldr r2, super_bits
            	ldrh r3, [r2]
            	mov r0, #1
            	bic r3, r0
            	strh r3, [r2]
            loop_label:
            	swi #2
            	ldrh r3, [r2]
            	tst r3, r0
            	beq loop_label
            	pop {pc}
            
            .align 2
            super_bits: .word 0x0300310C
            Is there a way to make the turbo slower?
            Reply With Quote
              #1333    
            Old March 14th, 2018 (9:33 PM).
            Delta231's Avatar
            Delta231 Delta231 is offline
            A noob
               
              Join Date: May 2016
              Location: India
              Gender: Male
              Nature: Bold
              Posts: 605
              Quote:
              Originally Posted by Petuuuhhh View Post
              Is there a way to make the turbo slower?
              Just don't use the routine simple.
              __________________
              HGSS OWs in FR Style
              Fire Red NSE Bookmarks


              A supporter of


              Reply With Quote
                #1334    
              Old March 15th, 2018 (5:25 AM).
              Skeli-'s Avatar
              Skeli- Skeli- is offline
              Lord of the Rings
                 
                Join Date: Apr 2014
                Location: Canada
                Age: 20
                Gender: Male
                Nature: Adamant
                Posts: 192
                Quote:
                Originally Posted by Petuuuhhh View Post
                Is there a way to make the turbo slower?
                You could add a bunch of useless long loops to that routine, but I'm pretty sure that'd make the game lag as well.
                __________________
                Pokemon Unbound

                Reply With Quote
                  #1335    
                Old March 15th, 2018 (10:40 AM).
                Petuuuhhh's Avatar
                Petuuuhhh Petuuuhhh is online now
                 
                Join Date: Apr 2017
                Location: Georgia
                Age: 25
                Gender: Male
                Posts: 575
                Quote:
                Originally Posted by Skeli Unbound View Post
                You could add a bunch of useless long loops to that routine, but I'm pretty sure that'd make the game lag as well.
                That would effectively keep the player from using the turbo function, which is what I would like in my hack. I'm assuming you mean it would lag when using turbo.
                Reply With Quote
                  #1336    
                Old March 15th, 2018 (1:44 PM).
                Skeli-'s Avatar
                Skeli- Skeli- is offline
                Lord of the Rings
                   
                  Join Date: Apr 2014
                  Location: Canada
                  Age: 20
                  Gender: Male
                  Nature: Adamant
                  Posts: 192
                  Why do you want to prevent the player from using the turbo button? One of the main benefits to playing a rom is that you get a turbo button.

                  It would lag without turbo. Turbo would probably still speed the game up somewhat, but just not as much.
                  __________________
                  Pokemon Unbound

                  Reply With Quote
                    #1337    
                  Old March 16th, 2018 (10:44 AM).
                  Petuuuhhh's Avatar
                  Petuuuhhh Petuuuhhh is online now
                   
                  Join Date: Apr 2017
                  Location: Georgia
                  Age: 25
                  Gender: Male
                  Posts: 575
                  Quote:
                  Originally Posted by Skeli Unbound View Post
                  Why do you want to prevent the player from using the turbo button? One of the main benefits to playing a rom is that you get a turbo button.

                  It would lag without turbo. Turbo would probably still speed the game up somewhat, but just not as much.
                  I want the player to get as authentic of an experience as possible when playing my hack, which means that if I can disable the Turbo button, I will. Is there an emulator that doesn't have a turbo button?

                  Thank you,
                  Reply With Quote
                    #1338    
                  Old March 16th, 2018 (2:25 PM).
                  DarkPsychic's Avatar
                  DarkPsychic DarkPsychic is offline
                     
                    Join Date: Jul 2012
                    Location: CO
                    Gender: Male
                    Nature: Timid
                    Posts: 144
                    Quote:
                    Originally Posted by Petuuuhhh View Post
                    I want the player to get as authentic of an experience as possible when playing my hack, which means that if I can disable the Turbo button, I will. Is there an emulator that doesn't have a turbo button?

                    Thank you,
                    This should be asked in the Quick Questions thread.
                    I have told you before that even with asm this would be hard.
                    Because its on a emulator level.
                    Reply With Quote
                      #1339    
                    Old March 16th, 2018 (3:34 PM).
                    AkameTheBulbasaur's Avatar
                    AkameTheBulbasaur AkameTheBulbasaur is offline
                    Akame Marukawa of Iyotono
                       
                      Join Date: May 2013
                      Location: A place :D
                      Age: 21
                      Gender: Male
                      Nature: Gentle
                      Posts: 354
                      Quote:
                      Originally Posted by Petuuuhhh View Post
                      I want the player to get as authentic of an experience as possible when playing my hack, which means that if I can disable the Turbo button, I will. Is there an emulator that doesn't have a turbo button?

                      Thank you,
                      I'm pretty sure No$GBA doesn't. You can speed up the emulation through the options menu, but as far as I know there isn't a button that you press to do that automatically.

                      I could be wrong about this so nobody sue me if there in fact is one xD

                      Sweet Scent Script
                      This is what I did with FBI's Field Moves ASM in this post.

                      I basically just made it so you could attract certain Pokemon in certain special areas with an increased shiny chance.

                      You will need FBI's Shiny Generator. Either use this one here or use the modified version if you want to have Synchronize's overworld effect here.

                      Then follow the steps for inserting a new field move, except you don't need to expand the table if you're replacing Sweet Scent's effect. Just replace the pointer C9 E0 0D 08 with the pointer to the first routine.

                      Anyway the script I made is here:
                      Spoiler:
                      #dyn 0x6B0000
                      #org @start
                      lockall
                      compare 0x4050 0x0
                      if true jump @Normal
                      compare 0x4050 0x1
                      if true jump @Celebi
                      compare 0x4050 0x2
                      if true jump @Hooh
                      compare 0x4050 0x3
                      if true jump @Lugia
                      compare 0x4050 0x4
                      if true jump @Moltres
                      compare 0x4050 0x5
                      if true jump @Articuno
                      compare 0x4050 0x6
                      if true jump @Zapdos
                      compare 0x4050 0x7
                      if true jump @Entei
                      compare 0x4050 0x8
                      if true jump @Raikou
                      compare 0x4050 0x9
                      if true jump @Suicune
                      compare 0x4050 0xA
                      if true jump @Mewtwo
                      release
                      end

                      #org @Normal
                      checkitem 0xEF 1
                      if true jump @SCharm
                      jump @NoCharm

                      #org @SCharm
                      random 0x10A
                      jump @SweetScent

                      #org @NoCharm
                      random 0x320
                      jump @SweetScent

                      #org @SweetScent
                      compare LASTRESULT 0x1
                      if true call @ShinySet
                      doanimation 0x33
                      release
                      end

                      #org @Celebi 'Forest
                      setvar 0x4054 CELEBI
                      setvar 0x4055 ROSELIA
                      setvar 0x4056 RALTS
                      setvar 0x4057 PARAS
                      jump @SetChance

                      #org @Hooh 'Volcano
                      setvar 0x4054 HO-OH
                      setvar 0x4055 SOLROCK
                      setvar 0x4056 NUMEL
                      setvar 0x4057 VULPIX
                      jump @SetChance

                      #org @Lugia 'Island
                      setvar 0x4054 LUGIA
                      setvar 0x4055 EEVEE
                      setvar 0x4056 MARILL
                      setvar 0x4057 CATERPIE
                      jump @SetChance

                      #org @Moltres 'Mountain
                      setvar 0x4054 MOLTRES
                      setvar 0x4055 RHYHORN
                      setvar 0x4056 MACHOP
                      setvar 0x4057 GEODUDE
                      jump @SetChance

                      #org @Articuno 'Tundra
                      setvar 0x4054 ARTICUNO
                      setvar 0x4055 DELIBIRD
                      setvar 0x4056 SPHEAL
                      setvar 0x4057 SWINUB
                      jump @SetChance

                      #org @Zapdos 'Savannah
                      setvar 0x4054 ZAPDOS
                      setvar 0x4055 TAUROS
                      setvar 0x4056 ELECTRIKE
                      setvar 0x4057 RATTATA
                      jump @SetChance

                      #org @Entei 'Ruins
                      setvar 0x4054 ENTEI
                      setvar 0x4055 EKANS
                      setvar 0x4056 ZUBAT
                      setvar 0x4057 BALTOY
                      jump @SetChance

                      #org @Suicune 'Ruins
                      setvar 0x4054 SUICUNE
                      setvar 0x4055 EKANS
                      setvar 0x4056 ZUBAT
                      setvar 0x4057 BALTOY
                      jump @SetChance

                      #org @Raikou 'Ruins
                      setvar 0x4054 RAIKOU
                      setvar 0x4055 EKANS
                      setvar 0x4056 ZUBAT
                      setvar 0x4057 BALTOY
                      jump @SetChance

                      #org @Mewtwo 'Settlement
                      setvar 0x4054 MEWTWO
                      setvar 0x4055 MAGNEMITE
                      setvar 0x4056 VOLTORB
                      setvar 0x4057 PICHU
                      jump @SetChance

                      #org @SetChance
                      random 0xFF
                      compare LASTRESULT 0x7F
                      if >= jump @Common
                      compare LASTRESULT 0x3F
                      if >= jump @Uncommon
                      compare LASTRESULT 0x1F
                      if >= jump @Rare
                      jump @SecretRare

                      #org @Common
                      copyvar 0x8000 0x4057
                      setvar 0x4041 0x1
                      checkitem 0xEF 1
                      if true jump @SCharmC
                      jump @NoCharmC

                      #org @SCharmC 'max: 40/400 = 10%
                      random 0x10A
                      comparevars LASTRESULT 0x4044
                      if <= call @ShinySet
                      jump @Battle

                      #org @NoCharmC 'max: 40/800 = 5%
                      random 0x320
                      comparevars LASTRESULT 0x4044
                      if <= call @ShinySet
                      jump @Battle

                      #org @Uncommon
                      copyvar 0x8000 0x4056
                      setvar 0x4041 0x2
                      checkitem 0xEF 1
                      if true jump @SCharmUC
                      jump @NoCharmUC

                      #org @SCharmUC 'max: 40/266 = 15%
                      random 0x10A
                      comparevars LASTRESULT 0x4045
                      if <= call @ShinySet
                      jump @Battle

                      #org @NoCharmUC 'max: 40/400 = 10%
                      random 0x190
                      comparevars LASTRESULT 0x4045
                      if <= call @ShinySet
                      jump @Battle

                      #org @Rare
                      copyvar 0x8000 0x4055
                      setvar 0x4041 0x3
                      checkitem 0xEF 1
                      if true jump @SCharmR
                      jump @NoCharmR

                      #org @SCharmR 'max: 40/200 = 20%
                      random 0xC8
                      comparevars LASTRESULT 0x4046
                      if <= call @ShinySet
                      jump @Battle

                      #org @NoCharmR 'max: 40/266 = 15%
                      random 0x10A
                      comparevars LASTRESULT 0x4046
                      if <= call @ShinySet
                      jump @Battle

                      #org @SecretRare
                      copyvar 0x8000 0x4054
                      setvar 0x4041 0x4
                      checkitem 0xEF 1
                      if true jump @SCharmR
                      jump @NoCharmR

                      #org @SCharmR 'max: 40/160 = 25%
                      random 0xA0
                      comparevars LASTRESULT 0x4047
                      if <= call @ShinySet
                      jump @Battle

                      #org @NoCharmR 'max: 40/200 = 20%
                      random 0xC8
                      comparevars LASTRESULT 0x4047
                      if <= call @ShinySet
                      jump @Battle

                      #org @Battle
                      doanimation 0x1
                      copyvar LASTRESULT 0x8000
                      showpokepic LASTRESULT 0xA 0x3
                      hidepokepic
                      battle LASTRESULT 0xA SITRUSBERRY
                      special BATTLE_INTERLACE
                      waitspecial
                      special2 LASTRESULT 0xB4
                      compare LASTRESULT 0x4
                      if true jump @Reset
                      compare 0x4041 0x1
                      if true jump @CommonPlus
                      compare 0x4041 0x2
                      if true jump @UncommonPlus
                      compare 0x4041 0x3
                      if true jump @RarePlus
                      compare 0x4041 0x4
                      if true jump @SRarePlus
                      release
                      end

                      #org @CommonPlus
                      compare 0x4044 0x28
                      if true jump @Return
                      addvar 0x4044 0x1
                      release
                      end

                      #org @UncommonPlus
                      compare 0x4045 0x28
                      if true jump @Return
                      addvar 0x4045 0x1
                      release
                      end

                      #org @RarePlus
                      compare 0x4046 0x28
                      if true jump @Return
                      addvar 0x4046 0x1
                      release
                      end

                      #org @SRarePlus
                      compare 0x4047 0x28
                      if true jump @Return
                      addvar 0x4047 0x1
                      release
                      end

                      #org @ShinySet
                      setvar 0x8003 0x1
                      return

                      #org @Reset
                      setvar 0x4044 0x0
                      setvar 0x4045 0x0
                      setvar 0x4046 0x0
                      setvar 0x4047 0x0
                      release
                      end

                      #org @Return
                      release
                      end


                      The CheckItem part was for the Shiny Charm, so if you have that then change the number to the index number for the Shiny Charm.

                      I also modified the Set Wild Battle command with this:
                      Spoiler:
                      /*Replace the pointer 69 C3 06 08 with the pointer to this +1*/
                      .text
                      .align 2
                      .thumb
                      .thumb_func

                      Main:
                      push {r4-r6, lr}
                      mov r4, r0
                      bl GetSpecies
                      ldr r5, =0x800D
                      cmp r0, r5
                      beq LastResult
                      b Return

                      GetSpecies:
                      ldr r2, .GetSpecies
                      bx r2

                      LastResult:
                      ldr r5, .Var800D
                      ldrh r0, [r5]

                      Return:
                      ldr r5, .Return
                      bx r5

                      .align 2
                      .GetSpecies: .word 0x080698F9
                      .Var800D: .word 0x020370D0
                      .Return: .word 0x0806C371


                      Basically all that does is let you use LASTRESULT for the Pokemon.
                      __________________
                      "The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
                      Reply With Quote
                        #1340    
                      Old March 27th, 2018 (2:45 AM).
                      Diego98 Diego98 is offline
                         
                        Join Date: Jan 2015
                        Gender: Male
                        Posts: 18
                        Anyone can make a routine that counts the amount of a certain item in the bag and stores it in a variable? I know this can be made with loops but I think a routine is a better way to do this. Thanks anyway.
                        Reply With Quote
                          #1341    
                        Old March 27th, 2018 (3:58 AM).
                        DrFuji's Avatar
                        DrFuji DrFuji is online now
                        Heiki Hecchara‌‌
                         
                        Join Date: Sep 2009
                        Location: Aussie
                        Age: 25
                        Gender: Male
                        Nature: Jolly
                        Posts: 1,489
                        Quote:
                        Originally Posted by Diego98 View Post
                        Anyone can make a routine that counts the amount of a certain item in the bag and stores it in a variable? I know this can be made with loops but I think a routine is a better way to do this. Thanks anyway.
                        Spherical Ice made a routine for that.
                        __________________
                        Reply With Quote
                          #1342    
                        Old March 27th, 2018 (11:44 AM).
                        Diego98 Diego98 is offline
                           
                          Join Date: Jan 2015
                          Gender: Male
                          Posts: 18
                          Quote:
                          Originally Posted by DrFuji View Post
                          Thanks! Just what I was searching for.
                          Reply With Quote
                            #1343    
                          Old April 4th, 2018 (4:53 AM).
                          pikachux2's Avatar
                          pikachux2 pikachux2 is offline
                          Never Evolve
                             
                            Join Date: Mar 2010
                            Location: USA
                            Gender: Male
                            Nature: Jolly
                            Posts: 115
                            Hey helpful people, you all might have seen my post about this in a thread under Rom Hacking. But anyway, I've never used ASM coding in my PKMN hacking career thus far. I'm making a game in which I only want double battles and have encountered a glitch in which if you start a double battle with 1 (not-fainted) Pokémon is your party, the game just clones that pokemon for your partner in battle... (not desired) I've come to the realization that the only way to keep this game double battles only Is to either fix this glitch by changing the battle engine (sounds too hard) or to find another solution.

                            Well, the solution I came up with was to possibly have an ASM call before each trainer that would change the bitfield's double battle bit of the trainer in question to 1 or 0 based on how many Pokémon the player has. Now again, I've never used ASM so I don't know if you have access to that certain part of the rom, but if you did this would be a great way of fixing my problem.

                            So any help would be awesome, thanks!
                            Reply With Quote
                              #1344    
                            Old April 4th, 2018 (5:35 AM).
                            Delta231's Avatar
                            Delta231 Delta231 is offline
                            A noob
                               
                              Join Date: May 2016
                              Location: India
                              Gender: Male
                              Nature: Bold
                              Posts: 605
                              Quote:
                              Originally Posted by pikachux2 View Post
                              Hey helpful people, you all might have seen my post about this in a thread under Rom Hacking. But anyway, I've never used ASM coding in my PKMN hacking career thus far. I'm making a game in which I only want double battles and have encountered a glitch in which if you start a double battle with 1 (not-fainted) Pokémon is your party, the game just clones that pokemon for your partner in battle... (not desired) I've come to the realization that the only way to keep this game double battles only Is to either fix this glitch by changing the battle engine (sounds too hard) or to find another solution.

                              Well, the solution I came up with was to possibly have an ASM call before each trainer that would change the bitfield's double battle bit of the trainer in question to 1 or 0 based on how many Pokémon the player has. Now again, I've never used ASM so I don't know if you have access to that certain part of the rom, but if you did this would be a great way of fixing my problem.

                              So any help would be awesome, thanks!
                              https://github.com/jiangzhengwenjz/Double_wild_battle
                              __________________
                              HGSS OWs in FR Style
                              Fire Red NSE Bookmarks


                              A supporter of


                              Reply With Quote
                                #1345    
                              Old April 11th, 2018 (8:02 AM).
                              Delta231's Avatar
                              Delta231 Delta231 is offline
                              A noob
                                 
                                Join Date: May 2016
                                Location: India
                                Gender: Male
                                Nature: Bold
                                Posts: 605
                                Quote:
                                Originally Posted by eaglesfan View Post
                                I have a request. I followed this tutorial to make two frame animations in fire red. the only issue is with trainers the animation starts right out of the ball and with wild pokemon it starts at the beggining of the encounter and doesnt show the animation because the pokemon is not in sight when it starts. Would it be possible to create two animation tables and insert an asm routine that sets the pointer at 0x2349BC to point to animation table 1 by default or table 2 if a var or flag is set? If no one has time to make a routine like this could someone at least tell me if it is possible?
                                I will say not to implement it because it takes a lot of storage in you rom.
                                __________________
                                HGSS OWs in FR Style
                                Fire Red NSE Bookmarks


                                A supporter of


                                Reply With Quote
                                  #1346    
                                Old April 12th, 2018 (2:06 AM).
                                Delta231's Avatar
                                Delta231 Delta231 is offline
                                A noob
                                   
                                  Join Date: May 2016
                                  Location: India
                                  Gender: Male
                                  Nature: Bold
                                  Posts: 605
                                  Quote:
                                  Originally Posted by eaglesfan View Post
                                  why would an asm routine take alot of storage?
                                  If you are having 500 pokemon then multiply by x4 or even x8. That would actually take a lot of space. Even Emerald hackers also remove Animations.
                                  __________________
                                  HGSS OWs in FR Style
                                  Fire Red NSE Bookmarks


                                  A supporter of


                                  Reply With Quote
                                    #1347    
                                  Old April 13th, 2018 (7:13 AM). Edited April 13th, 2018 by xizqu.
                                  xizqu's Avatar
                                  xizqu xizqu is offline
                                     
                                    Join Date: Feb 2018
                                    Location: California
                                    Gender: Male
                                    Nature: Adamant
                                    Posts: 82
                                    Hello! Would it be possible to request a routine?

                                    If possible, I would like a battle routine that only allows you to use a maximum of 6 itmes throughout a battle(ignoring the pokeball bag). This would get rid of potion spamming! :)
                                    Reply With Quote
                                      #1348    
                                    Old April 21st, 2018 (8:52 AM).
                                    paccy's Avatar
                                    paccy paccy is offline
                                    Pokeholic
                                       
                                      Join Date: May 2009
                                      Location: 'Straya
                                      Gender: Male
                                      Nature: Quiet
                                      Posts: 3
                                      Inherit Pokeball from Mother (Emerald)
                                      So I'm learning asm and decided to see if I could implement passing down pokeballs like in 6th gen, and after a while I managed to make something that seems to work. Since this is basically my first go at writing asm feel free to point out better ways to do things and improve it.

                                      There's is two parts to this, you have to give the egg its mother's pokeball and you have to keep the ball when it hatches. This is for Emerald only (Though I'm guessing it wouldn't be too hard to port to FR).

                                      Give Egg Pokeball
                                      How to insert:
                                      Compile and put this into free space
                                      Spoiler:

                                      Code:
                                      .text
                                      .align 2
                                      .thumb
                                      .thumb_func
                                      
                                      main:
                                          push {r5}
                                          ldr r0, =(0x3005D8C)    @Getting location of parents in daycare
                                          ldr r0, [r0]
                                          ldr r1, =0x3030
                                          add r0, r0, r1
                                          mov r5, r0
                                          ldr r3, pokemon_get_gender @Get gender of 1st parent
                                          bl linker
                                          cmp r0, #0xFE
                                          beq mother                @Branch if female
                                          mov r0, r5
                                          mov r5, #0x8C
                                          add r0, r0, r5
                                          mov r5, r0
                                          ldr r3, pokemon_get_gender @Get gender of 2nd parent
                                          bl linker
                                          cmp r0, #0xFE
                                          beq mother                @Branch if female
                                      
                                      use_pokeball:
                                          mov r1, #4
                                          pop {r5}
                                          add r0, sp, #0x10
                                          strh r1, [r0]
                                          mov r4, sp
                                          
                                      return:
                                          ldr r3, =(0x8070A50 +1)
                                          bl linker
                                      
                                      mother:    
                                          mov r0, r5
                                          mov r1, #0x26
                                          ldr r3, pokemon_getattr @get mother's pokeball
                                          bl linker
                                          mov r1, r0
                                          cmp r1, #1            @It's a masterball
                                          beq use_pokeball        @Use pokeball instead of master
                                          pop {r5}
                                          add r0, sp, #0x10
                                          strh r1, [r0]            @Store mother's pokeball
                                          mov r4, sp
                                          b return
                                          
                                      linker:
                                          bx r3    
                                      
                                      .align 2
                                      
                                      @Functions:
                                      pokemon_get_gender:
                                          .word 0x8069FC4 +1
                                          
                                      pokemon_getattr:
                                          .word 0x806A518 +1
                                      
                                      @At 0x70A48 write 00 48 00 47 XX+1 XX XX 08

                                      and at 0x8070A48 write 00 48 00 47 XX XX XX 08
                                      (where XX XX XX is the reverse hex pointer of where you put in the code +1)

                                      How it works:
                                      When given an egg it will check if either of the parents are female. If yes it will pass on the egg, unless it's a masterball.

                                      Keep Ball when Hatching
                                      How to insert:
                                      Compile and put both of these into free space
                                      Spoiler:

                                      Code:
                                      .text
                                      .align 2
                                      .thumb
                                      .thumb_func
                                      
                                      main:
                                      	mov r0, r5				@Doing things that we overwrote
                                      	mov r1, #0x25
                                      	ldr r3, pokemon_getattr @Get game of origin
                                      	bl linker
                                      	mov r1, r10
                                      	strb r0, [r1]
                                      	mov r0, r5
                                      	mov r1, #0x26
                                      	ldr r3, pokemon_getattr @Get the egg's pokeball
                                      	bl linker
                                      	ldr r1, =(0x20375D8)	@var 0x8000
                                      	strh r0, [r1] 			@Store pokeball in 0x8000
                                      	ldr r3, =(0x80713DC +1)
                                      	bl linker
                                      
                                      linker:
                                      	bx r3	
                                      
                                      .align 2
                                      
                                      @Functions:
                                      pokemon_getattr:
                                      	.word 0x806A518 +1
                                      	
                                      @At 0x713D4 write 00 48 00 47 XX+1 XX XX 08

                                      Spoiler:

                                      Code:
                                      .text
                                      .align 2
                                      .thumb
                                      .thumb_func
                                      
                                      main:
                                      	mov r2, sp
                                      	add r2, #0xE
                                      	ldr r0, =(0x20375D8) @Get ball from 0x8000
                                      	ldrh r0, [r0]
                                      	strh r0, [r2]
                                      	mov r0, r5
                                      	mov r1, #0x26
                                      	ldr r3, pokemon_setattr @Set pokeball
                                      	bl linker
                                      	ldr r3, =(0x8071536 +1)
                                      	bl linker
                                      
                                      linker:
                                      	bx r3	
                                      
                                      .align 2
                                      
                                      @Functions:
                                      pokemon_setattr:
                                      	.word 0x806ACAC +1
                                      	
                                      @At 0x71528 write 00 4A 10 47 XX+1 XX XX 08

                                      and at 0x80713D4 write 00 48 00 47 XX XX XX 08
                                      (where XX XX XX is the reverse hex pointer of where you put in the first piece of code +1)
                                      and at 0x8071528 write 00 4A 10 47 XX XX XX 08
                                      (where XX XX XX is the reverse hex pointer of where you put in the second piece of code +1)

                                      How it works:
                                      When hatching some data doesn't seem to be transferred to the pokemon, the type of ball being one. The first routine simply stores the ball type to 0x8000 while the second retrieves and gives it to the pokemon where before a normal pokeball was given.
                                      Reply With Quote
                                        #1349    
                                      Old April 21st, 2018 (11:45 AM).
                                      deoadiuvante deoadiuvante is offline
                                         
                                        Join Date: Apr 2018
                                        Posts: 1
                                        Quote:
                                        Originally Posted by jiangzhengwenjzw View Post
                                        Misc:

                                        A EV-IV Display Screen


                                        RENEWAL:
                                        Spoiler:
                                        The new version is here (no difference, but codes will be automatically inserted into the ROM):
                                        FIRERED:

                                        EMERALD:

                                        Read Readme.md to know how to compile.

                                        Quick Preview:
                                        The EV-IV display here looks fantastic! Unfortunately, I am unsure how to insert it into a ROM (Emerald).

                                        The readme file says I need to have "Devkitarm" and "make" installed and that "armips v0.8/0.9" is required.

                                        Mainly, I just have no clue what those programs are and how I would get them installed correctly in order to compile and insert this code into my ROM. I believe I MAY have Devkitarm installed (from using DizzyEgg's Emerald Battle Engine Upgrade), but I'm not sure about "make" nor "armips".

                                        Any help on this would be absolutely appreciated, otherwise it seems I may have a lot of basic research on my hands before I'm able to include this in my ROM (which I'm also unsure of where to start).
                                        Reply With Quote
                                          #1350    
                                        Old April 23rd, 2018 (12:45 PM).
                                        mattyman mattyman is offline
                                           
                                          Join Date: Apr 2018
                                          Gender: Male
                                          Posts: 2
                                          Hi everyone. I was hoping someone could take a look at an asm routine and a script and tell me what i'm doing wrong. Here's the routine, originally made by FBI,

                                          Spoiler:

                                          .text
                                          .align 2
                                          .thumb
                                          .thumb_func

                                          main:
                                          push {r0-r4, lr}
                                          ldr r0, =(0x80568E0 +1)
                                          str r0, [SP, #0x4]
                                          ldr r1, =(0x300500C)
                                          ldr r1, [r1]
                                          mov r0, #0x0
                                          mov r2, #0x0
                                          mov r3, #0x0
                                          ldr r4, =(0x20370D0)
                                          strb r0, [r4]
                                          ldr r4, =(0x809D954 +1)
                                          bl linker

                                          checkValidName:
                                          ldr r0, =(0x300500C)
                                          ldr r0, [r0]
                                          ldrb r0, [r0]
                                          cmp r0, #0xFF
                                          beq invalid
                                          cmp r0, #0x0
                                          beq invalid

                                          done:
                                          pop {r0-r4, pc}

                                          invalid:
                                          ldr r0, =(0x20370D0)
                                          mov r1, #0x1
                                          strb r1, [r1]
                                          pop {r0-r4, pc}

                                          linker:
                                          bx r4

                                          .align 2


                                          It is meant to rename the player from the overworld, but if the name is invalid (contains spaces), is sets 0x800D to 0x1. Everything works, except that last part. If I put a space in the name, it acts as if the name is valid and continues without changing the name.

                                          Here is the script I wrote for it,

                                          Spoiler:

                                          #dynamic 0x800000

                                          #org @main
                                          lockall
                                          callasm 0x825AB25
                                          waitstate
                                          compare 0x800D 0x1
                                          if 0x1 call @invalid
                                          msgbox @msg MSG_KEEPOPEN
                                          closeonkeypress
                                          releaseall
                                          end

                                          #org @invalid
                                          msgbox @msginvalid MSG_KEEPOPEN
                                          closeonkeypress
                                          callasm 0x825AB25
                                          waitstate
                                          compare 0x800D 0x1
                                          if 0x1 call @invalid
                                          return

                                          #org @msg
                                          = Name set.

                                          #org @msginvalid
                                          = The chosen name was invalid.\pPlease choose a valid name.


                                          Is it something wrong with the routine or my script?
                                          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
                                          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 3:06 PM.