Advertiser Content

Development ASM Resource Thread Page 3

Started by esperance September 19th, 2014 3:13 PM
  • 274791 views
  • 1484 replies

FBI

Free supporter

Male
Unknown Island
Seen 18 Minutes Ago
Posted 19 Minutes Ago
1,906 posts
6.7 Years
Hey so the silent evo asm doesnt compile for me. I get an error saying 0xfffffffc is too big. I cant fing that offsets so Im kinda confused.

Also how does it work is it via item or what?
I just copy-pasted and compiled it with no problems.

usage:
Set the slot of the Pokemon you want to evolve in var 0x8001 (0x0 to 0x5). Then callasm to this routine and the rest is done automagically.
So if I wanted to evolve the 3rd Pokemon in my party I would put:
setvar 0x8001 0x2
callasm 0xOffset +1

Here's a compiled version:
FF B5 49 48 00 88 64 21 48 43 48 49 40 18 07 1C 0B 21 47 4B 00 F0 84 F8 05 1C 00 F0 29 F8 06 1C 38 1C 38 21 42 4B 00 F0 7B F8 04 1C 38 1C 3D 4A 31 1C 11 80 0B 21 3F 4B 00 F0 72 F8 38 1C 3E 4B 00 F0 6E F8 30 1C 3D 4B 00 F0 6A F8 30 1C 02 21 3B 4B 00 F0 65 F8 30 1C 03 21 39 4B 00 F0 60 F8 38 1C 38 21 32 4B 00 F0 5B F8 A0 42 37 D1 0C E0 04 21 41 43 40 18 C0 00 32 4B C1 18 48 88 8A 88 90 42 00 DC 70 47 10 1C 70 47 38 1C 2E 49 0A 1C 02 21 27 4B 00 F0 44 F8 2C 48 0B 21 69 43 09 18 0D 1C 29 49 0C 1C 00 20 0A 28 0D D0 01 35 29 78 01 34 22 78 8A 42 32 D1 FF 2A 00 D0 02 E0 FF 29 02 D0 2C E0 01 30 EF E7 20 4A 0B 20 46 43 B6 18 38 1C 32 1C 02 21 17 4B 00 F0 22 F8 1F E0 A0 42 D3 D0 02 1C 38 1C 19 21 11 4B 00 F0 19 F8 01 1C 00 09 A2 42 01 D9 09 18 00 E0 09 1A 09 4A 11 60 19 21 38 1C 0B 4B 00 F0 0B F8 38 1C 0A 4B 00 F0 07 F8 38 1C 38 21 06 4B 00 F0 02 F8 DF E7 FF BD 18 47 C0 46 B8 70 03 02 BA 70 03 02 84 42 02 02 E9 FB 03 08 7D 03 04 08 7D E4 03 08 99 32 04 08 75 8E 08 08 54 97 25 08 D0 1C 02 02 E0 5E 24 08
...

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.2 Years
It's a forced inbattle evolution in the screenshots. I've commented the code for evolution if you want to read and see.


*awaits more requests*
OH! MY! GOD!
WITH THIS HACK!
WE CAN FAKE MEGA EVOLUTION!!!!
AWESOME! AWESOME! AWESOME!
By the way, what will I do in inbattle if I want my bulbasaur changes specie in to Ivysaur? What will I press? Sorry I am just so excited..
And theres no compile version for it?
I lost my THUMB compiler >:(

Oh! I hope you can make a routine for it ^_^
Can you port to FireRed the Mach Bike and Acro Bike effect?
and
Can you also port EV-Reducing berries?
and another 1
sorry, there are so many ideas come up in my mind
Can you make a certain Pokemon when It enters the battle it will call a weather effect without having Drizzle, Drought, and Sand Stream?
It is also nice if you can also add new weather effects like thunderstorm and Cold breeze ahahaha

Christos

Male
Seen 2 Weeks Ago
Posted August 4th, 2019
6,368 posts
13.6 Years
*awaits more requests*
Okay, how about the Incense items? The Sea and Lax incenses were used in Gen 3 to breed Azurill and Wynaut, and then 7 more were introduced in Gen 4 for the new pre-evolutions.

http://bulbapedia.bulbagarden.net/wiki/Incense

A Pokemon that is discriminated!
Support squirtle and make it everyone's favourite.

Red John

Progressing Assembly hacker

Male
Where ever there is peace and darkness
Seen May 31st, 2018
Posted September 25th, 2015
137 posts
5.5 Years
Okay, how about the Incense items? The Sea and Lax incenses were used in Gen 3 to breed Azurill and Wynaut, and then 7 more were introduced in Gen 4 for the new pre-evolutions.

http://bulbapedia.bulbagarden.net/wiki/Incense
Afaik Jambo51has already discovered this

FBI

Free supporter

Male
Unknown Island
Seen 18 Minutes Ago
Posted 19 Minutes Ago
1,906 posts
6.7 Years
OH! MY! GOD!
WITH THIS HACK!
WE CAN FAKE MEGA EVOLUTION!!!!
AWESOME! AWESOME! AWESOME!
By the way, what will I do in inbattle if I want my bulbasaur changes specie in to Ivysaur? What will I press? Sorry I am just so excited..
And theres no compile version for it?
I lost my THUMB compiler >:(

Oh! I hope you can make a routine for it ^_^
Can you port to FireRed the Mach Bike and Acro Bike effect?
and
Can you also port EV-Reducing berries?
and another 1
sorry, there are so many ideas come up in my mind
Can you make a certain Pokemon when It enters the battle it will call a weather effect without having Drizzle, Drought, and Sand Stream?
It is also nice if you can also add new weather effects like thunderstorm and Cold breeze ahahaha
- EV reducing berries
- Weather affects when entering battle
- Maybe the bike (I hear that there's only a few movement modes in FR, after I confirm a few things I might try)
- adding new weather effects is something iirc it's been done already.

Okay, how about the Incense items? The Sea and Lax incenses were used in Gen 3 to breed Azurill and Wynaut, and then 7 more were introduced in Gen 4 for the new pre-evolutions.

http://bulbapedia.bulbagarden.net/wiki/Incense
Request received!
EDIT: Christos I took a quick peak right now, and frankly speaking, this is very easy to do, however it's not very keen to customization. What I mean by that is, I'd have to jump directly into the part which checks for the incense branch out and do my own checks for other cases. Which means I'd have to know the following things:
- Pre-evolved Pokemon's species index (so this may change depending on how someone updated their dex)
- If no incense what to turn it into's index (ditto from above)
- Item ID of the item required to achieve effect

Actually I can overcome these by making it read off of a table.


Afaik Jambo51has already discovered this
I'm willing to bet his version is out of date now. Please give links! :P

EDIT: Turns out he did it the way I was going to do it. With a table, well, I guess he's already done it and removed the need for me to do it.
http://www.romhack.me/tutorials/view/adding-new-incense-items-pok-233mon-combinations/
...

FBI

Free supporter

Male
Unknown Island
Seen 18 Minutes Ago
Posted 19 Minutes Ago
1,906 posts
6.7 Years

Inheriting IVs from parents (via Destiny Knot, in the daycare)



How to insert:

Before doing anything, look at the code. There are two comments that say:
@masterball lol. Change to item you want :D
@Parent2 has masterball :D
At those lines, change the line to "cmp r0, #0xDestinyKnotItemID" and
"cmp r3, #0xDestinyKnotItemID" respectively.

Once you're done that, compile and insert into free space.
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	push {r3, r6}
	mov r6, lr
	mov r0, r5
	mov r1, #0xC
	ldr r2, =(0x803FD44 +1)
	bl linker
	mov r3, r0
	mov r0, r5
	add r0, r0, #0x8C
	mov r1, #0xC
	ldr r2, =(0x803FD44 +1)
	bl linker
	cmp r0, #0x1 @masterball lol. Change to item you want :D
	beq inherit
	cmp r3, #0x1 @Parent2 has masterball :D
	beq inherit

end:
	mov lr, r6
	pop {r3, r6}
	mov r0, SP
	mov r1, r5
	ldr r3, = (0x8045AC0 +1)
	bl linkerTwo
	ldr r0, =(0x8046100+1)
	bx r0

inherit:
	mov r3, #0x5
	bl generateRand
	ldrh r3, [r3]
	push {r4, r7}
	mov r4, #0x27
	add r4, r4, r3 @uninherited stat
	mov r7, #0x0

loop:
	cmp r7, #0x6
	beq prepareEnd
	cmp r7, r4
	beq next
	mov r3, #0x1
	bl generateRand @get a random parent's specified IV
	mov r0, r3
	ldrh r0, [r0]
	mov r1, #0x8C
	mul r0, r0, r1
	add r0, r0, r5
	mov r1, #0x27
	add r1, r1, r7
	ldr r2, =(0x803FBE8 +1)
	bl linker
	ldr r2, = (0x20370D0) @set IV to child
	strh r0, [r2]
	mov r1, #0x27
	add r1, r1, r7
	mov r0, SP
	ldr r3, =(0x804037C +1)
	bl linkerTwo	
next:
	add r7, r7, #0x1
	b loop
	 
prepareEnd:
	mov r0, SP
	ldr r3, =(0x803E47C +1) @calc stats
	bl linker
	pop {r4, r7}
	b end

generateRand:
	ldr r2, =(0x8044EC8 +1) @get a random between 0 - r3 (r3 = HW)
	bl linker
	lsl r0, r0, #0x10
	lsr r0, r0, #0x10
	mov r1, r3
	ldr r3, =(0x81E4684 +1)
	bl linkerTwo
	ldr r3, = 0x20370D0 @could just move it to r3 I suppose
	strh r0, [r3]
	bx lr
		

linker:
	bx r2

linkerTwo:
	bx r3


.align 2


Here's a compiled version:
48 B4 76 46 28 1C 0C 21 26 4A 00 F0 49 F8 03 1C 28 1C 8C 30 0C 21 23 4A 00 F0 42 F8 01 28 0A D0 01 2B 08 D0 B6 46 48 BC 68 46 29 1C 1E 4B 00 F0 38 F8 1E 48 00 47 05 23 00 F0 26 F8 1B 88 90 B4 27 24 E4 18 00 27 06 2F 18 D0 A7 42 14 D0 01 23 00 F0 1A F8 18 1C 00 88 8C 21 48 43 40 19 27 21 C9 19 13 4A 00 F0 1C F8 12 4A 10 80 27 21 C9 19 68 46 11 4B 00 F0 15 F8 01 37 E4 E7 68 46 0F 4B 00 F0 0E F8 90 BC CD E7 0D 4A 00 F0 09 F8 00 04 00 0C 19 1C 0B 4B 00 F0 04 F8 06 4B 18 80 70 47 10 47 18 47 45 FD 03 08 C1 5A 04 08 01 61 04 08 E9 FB 03 08 D0 70 03 02 7D 03 04 08 7D E4 03 08 C9 4E 04 08 85 46 1E 08
Now go to 0x460F8 and insert the following:
 00 48 00 47 XX XX XX 08
Where XX XX XX is the pointer in reverse hex +1 of the routine you just compiled.


How it works:
When the egg is generated, we check both parents to see if their holding an item matching the item we're looking for. If they are, the egg inherits 5/6 IVs from their parents. Each parent has a 50% chance to pass down one of their IVs.

There is no usage section, because the rest is done automagically when you have two compatible Pokemon in the daycare and they make an egg :)

Also, sorry for the double post, I wanted a fresh post for the first page :P
...
Age 23
Male
Seen July 6th, 2019
Posted October 26th, 2016
253 posts
6.5 Years
Ok, this one's for Christos, who requested this on IRC.
EDIT: And for MrDollSteak, cuz rombase. (who doesn't like new items?)

Weather Rocks

The following routines hijack the setweather commands and make them check your held item's effect byte.

First, insert this routine, and keep note of where you inserted this. This returns the held item effect byte to r0:
.text
.align 2
.thumb
.thumb_func
.global itemcheck

main:
ldr r0, .items
ldr r1, .struct
ldr r2, .bank
ldrb r2, [r2]
mov r3, #0x58
mul r2, r3
add r1, r2
add r1, #0x2E
ldrh r1, [r1]
mov r2, #0x2C
mul r1, r2
add r0, r1
ldrb r0, [r0, #0x12]
bx lr

.align 2
.items: .word 0x083DB028
.struct: .word 0x02023BE4
.bank: .word 0x02023D6B
Next, insert these routines:

Smooth Rock:
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global smoothrock

main:
mov r0, #0x3
strb r0, [r1, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x48 @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return

itemcheck:
ldr r0, .routine
bx r0

original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]

return:
ldr r0, .return
bx r0

.align 2
.routine: .word 0x08800001
.weatherturns: .word 0x02023F48
.return: .word 0x08028CD7

@ insert 01 48 00 47 C0 46 XX XX XX 08 at 08028CCA

Damp Rock:
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global damprock

main:
ldr r0, .address
strb r1, [r0, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x49 @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return

itemcheck:
ldr r0, .routine
bx r0

original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]

return:
ldr r0, .return
bx r0

.align 2
.address: .word 0x02023E82
.routine: .word 0x08800001
.weatherturns: .word 0x02023F48
.return: .word 0x080274E5

@ insert 00 48 00 47 XX XX XX 08 at 080274D8

Heat Rock:
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global heatrock

main:
ldr r1, .address
mov r0, #0x4
strb r0, [r1, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x4A @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return

itemcheck:
ldr r0, .routine
bx r0

original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]

return:
ldr r0, .return
bx r0

.align 2
.address: .word 0x02023E82
.routine: .word 0x08800001
.weatherturns: .word 0x02023F48
.return: .word 0x0802B313

@ insert 00 49 08 47 XX XX XX 08 at 0802B304

Icy Rock:
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global icyrock

main:
mov r1, #0x5
strb r1, [r0, #0x5]
push {r0-r3}
bl itemcheck
cmp r0, #0x4B @change this number to your desired held item effect number.
bne original
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x8
strb r1, [r0, #0x0]
b return

itemcheck:
ldr r0, .routine
bx r0

original:
pop {r0-r3}
ldr r0, .weatherturns
mov r1, #0x5
strb r1, [r0, #0x0]

return:
ldr r0, .return
bx r0

.align 2
.routine: .word 0x08800001
.weatherturns: .word 0x02023F48
.return: .word 0x0802BCB3

@ insert 00 49 08 47 XX XX XX 08 at 0802BCA8


If you look closely, you'll notice .routine: .word 0x08800001 in every one of the rock routines. Change the address to the address you inserted your first routine (the item check routine) at.

That's all! I've tested the Icy Rock routine, and it works. I haven't tested the others, but there's no reason they shouldn't work, unless I made a stupid mistake somewhere. Happy hacking!

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.2 Years
- EV reducing berries
- Weather affects when entering battle
- Maybe the bike (I hear that there's only a few movement modes in FR, after I confirm a few things I might try)
- adding new weather effects is something iirc it's been done already.
Does it mean, youre working for it?

FBI

Free supporter

Male
Unknown Island
Seen 18 Minutes Ago
Posted 19 Minutes Ago
1,906 posts
6.7 Years
Does it mean, youre working for it?
I'm working on stat reducing berries atm.
Weather effects is being worked on by HidoranBlaze. Weather effects adding is already done. As for the Bike one, I haven't decided yet :P
...

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.2 Years
I'm working on stat reducing berries atm.
Weather effects is being worked on by HidoranBlaze. Weather effects adding is already done. As for the Bike one, I haven't decided yet :P
Oh! Thanks man, about Weather effects, who worked with that? I bet the tut. was here in PC.
Male
California
Seen September 28th, 2015
Posted September 4th, 2015
16 posts
4.9 Years
I'm working on stat reducing berries atm.
Weather effects is being worked on by HidoranBlaze. Weather effects adding is already done. As for the Bike one, I haven't decided yet :P
In addition to the EV berries, it would be awesome if you could make berries that can call new asm or something to create the new berries like custap and roseli :D
Though I'm far from a pro, I try can help you on your ROM with scripting, ASM, mapping WHATEVER.

Just ask

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.2 Years
May I suggest? Will you make a compile version for your hacks, I lost my effective and super cool THUMB compiler and I forgot where todownload that kinda awesome tool...
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.

FBI

Free supporter

Male
Unknown Island
Seen 18 Minutes Ago
Posted 19 Minutes Ago
1,906 posts
6.7 Years

Berry System in FireRed!



First of all, before you implement my system you need to insert:
JPAN's save block hack: http://www.pokecommunity.com/showpost.php?p=6993092&postcount=206
ShinyQuagsire's berry bag hack: http://www.pokecommunity.com/showthread.php?t=295749
My code assumes that you've got all of this already implemented.


How to insert:

There's a lot of work to do before you can get this running. Trust me it was more work to create.
Compile each of the following routines and insert them into free space (KEEP TRACK OF WHERE YOU INSERT):

GetTreeData:
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r2, lr}
	ldr r0, =(0x20370D0)@get tree data
	ldrh r0, [r0]
	ldr r1, .SAVEBLOCK
	mov r2, #0x6
	mul r0, r0, r6
	add r0, r0, r1
	ldr r1, =(0x20370C2) @put values in vars
	ldrb r2, [r0]
	strb r2, [r1] @current stage
	add r0, r0, #0x1
	add r1, r1, #0x2
	ldrh r2, [r0]
	strh r2, [r1] @time planted
	add r0, r0, #0x2
	add r1, r1, #0x2
	ldrb r2, [r0]
	strb r2, [r1] @was watered
	add r0, r0, #0x1
	add r1, r1, #0x2
	ldrb r2, [r0]
	strb r2, [r1]@times watered
	add r0, r0, #0x1
	add r1, r1, #0x2
	ldrb r2, [r0]
	strb r2, [r1]@PlantID

updateStage:
	@check time passed and update
	ldr r1, = (0x300500C)
	ldrh r2, [r1, #0xE] @hours
	mov r3, #0x3C
	mul r2, r2, r3
	ldrb r3, [r1, #0x10]@minutes
	add r2, r2, r3 @current time in minutes
	ldr r3, =(0x20370C4)
	ldrh r3, [r3]
	sub r2, r2, r3
	mov r3, #0x0
	mov r1, #0x14 @CHANGE THIS TO CHANGE TIME BETWEEN PHASES

loop:
	cmp r1, r2
	blo setWater
	lsl r1, r1, #0x1
	add r3, r3, #0x1
	b loop
	
setWater:
	ldr r1, =(0x20370C2)
	ldrh r1, [r1]
	cmp r3, r2
	ble end
	ldr r2, =(0x20370C2)
	strb r3, [r2]
	ldr r2, =(0x20370C6)
	mov r3, #0x0
	strb r3, [r2]
	pop {r0-r2, pc}
	

.align 2
.SAVEBLOCK:
	.word 0x203C000
Compiled version:
07 B5 1A 48 00 88 18 49 06 22 70 43 40 18 18 49 02 78 0A 70 01 30 02 31 02 88 0A 80 02 30 02 31 02 78 0A 70 01 30 02 31 02 78 0A 70 01 30 02 31 02 78 0A 70 0F 49 CA 89 3C 23 5A 43 0B 7C D2 18 0D 4B 1B 88 D2 1A 00 23 14 21 91 42 02 D3 49 00 01 33 FA E7 06 49 09 88 93 42 FE DD 04 4A 13 70 06 4A 00 23 13 70 07 BD 00 C0 03 02 D0 70 03 02 C2 70 03 02 0C 50 00 03 C4 70 03 02 C6 70 03 02


getYeild
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r4, lr}
	ldr r0, =(0x202370B8) @max
	ldr r1, =(0x202370BA) @min
	ldrb r1, [r1]
	mov r2, r0
	sub r2, r2, r1 @max -min
	bl generateRand
	mov r4, r3
	add r4, r4, r1 @rand between min and max
	ldr r3, =(0x202370C8)
	ldrb r3, [r3] @times watered
	sub r3, r3, #0x1
	mul r2, r2, r3 @apply DPPT berry yield formula
	add r2, r2, r4
	lsr r2, r2, #0x2
	add r2, r2, r1
	ldr r1, =(0x202370D0) @store result in 0x800D
	strb r2, [r0]
	pop {r0-r4, pc}

generateRand:
	push {r0-r2}
	ldr r3, =(0x8044EC8 +1)
	bl linker
	lsl r0, r0, #0x10
	lsr r0, r0, #0x10
	pop {r2}
	mov r1, r2
	push {r2}
	ldr r3, =(0x81E4684 +1)
	bl linker
	ldrb r3,  [r0]
	pop {r0-r2}
	bx lr

linker:
	bx r3
	
	
.align 2
Here is a compiled version:
1F B5 11 48 11 49 09 78 02 1C 52 1A 00 F0 0C F8 1C 1C 64 18 0E 4B 1B 78 01 3B 5A 43 12 19 92 08 52 18 0C 49 02 70 1F BD 07 B4 0B 4B 00 F0 0B F8 00 04 00 0C 04 BC 11 1C 04 B4 08 4B 00 F0 03 F8 03 78 07 BC 70 47 18 47 B8 70 23 20 BA 70 23 20 C8 70 23 20 D0 70 23 20 C9 4E 04 08 85 46 1E 08


setTime:
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r3, lr}
	ldr r1, =(0x300500C)
	ldrh r2, [r1, #0xE]
	mov r3, #0x3C
	mul r2, r2, r3
	ldrb r3, [r1, #0x10]
	add r2, r2, r3
	ldr r3, =(0x20370C4)
	strh r2, [r3]
	pop {r0-r3, pc}

.align 2
Here is a compiled version:
0F B5 04 49 CA 89 3C 23 5A 43 0B 7C D2 18 02 4B 1A 80 0F BD 0C 50 00 03 C4 70 03 02


setTreeData:
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r2, lr}
	ldr r0, =(0x20370BC)@get tree data
	ldrh r0, [r0]
	ldr r1, .SAVEBLOCK
	mov r2, #0x6
	mul r0, r0, r6
	add r0, r0, r1
	ldr r1, =(0x20370C2) @put values in vars
	ldrb r2, [r1]
	strb r2, [r0] @current stage
	add r0, r0, #0x1
	add r1, r1, #0x2
	ldrh r2, [r1]
	strh r2, [r0] @time planted
	add r0, r0, #0x2
	add r1, r1, #0x2
	ldrb r2, [r1]
	strb r2, [r0] @was watered
	add r0, r0, #0x1
	add r1, r1, #0x2
	ldrb r2, [r1]
	strb r2, [r0]@times watered
	add r0, r0, #0x1
	add r1, r1, #0x2
	ldrb r2, [r1]
	strb r2, [r0]@PlantID
	pop {r0-r2, pc}
	

.align 2
.SAVEBLOCK:
	.word 0x203C000
Here is a compiled version:
07 B5 0E 48 00 88 0C 49 06 22 70 43 40 18 0C 49 0A 78 02 70 01 30 02 31 0A 88 02 80 02 30 02 31 0A 78 02 70 01 30 02 31 0A 78 02 70 01 30 02 31 0A 78 02 70 07 BD C0 46 00 C0 03 02 BC 70 03 02 C2 70 03 02


Now, once you've compiled those routines into free space you will need to insert their pointers (not in reverse hex) into this script. Remember to add 1 to the pointer.
You'll notice that I've added comments, which in PKSV, are signified by the apostrophe. I.e
 'This is a comment
I've made sure to add comments everywhere there is a callasm command to one of my routines. You'll also notice that the names I call these routines are identical to the names I gave the spoilers. You need to match the call to the pointer to the name of the routine!

The PKSV script (sorry no XSE version, convert it yourself :P):

Spoiler:

#dyn 0x740000
#org @start
lock
copyvar 0x8002 0x800D
callasm 0xOffset +1'set tree data
callasm 0xOffset + 1 'get tree data
compare 0x8005 0x0
if == jump @nonePlanted
compare 0x8005 0x1
if == jump @fresh
compare 0x8005 0x2
if == jump @sprouted
compare 0x8005 0x3
if == jump @growing
compare 0x8005 0x4
if == jump @blooming
callasm 0xOffset +1 'get yeild
storevar 0x0 0x800D
storevar 0x1 0x8009
additem 0x8009 0x800D
msgbox @recieved
callstd MSG_NORMAL
setvar 0x8005 0x0
setvar 0x8006 0x0
setvar 0x8007 0x0
setvar 0x8008 0x0
setvar 0x8009 0x0
callasm 0xOffset +1 'set tree data
msgbox @returned
callstd MSG_NORMAL
release
end

#org @nonePlanted
msgbox @none
callstd MSG_YESNO
compare LASTRESULT 0x0
if == jump @end
fadescreen 0x1
setvar 0x8000 0x7E
setvar 0x800E 0x0
callasm 0x0A1881
pauseevent 0x0
setvar 0x8000 0x0
compare 0x800E 0x0
if == jump @end
copyvar 0x8009 0x800E
storeitem 0x0 0x8009
msgbox @addedBerry
callstd MSG_NORMAL
setvar 0x8005 0x1
setvar 0x8007 0x0
setvar 0x8008 0x0
callasm 0xOffset +1' set time
callasm 0xOffset +1' set tree data
removeitem 0x8009 0x1
release
end

#org @fresh
storeitem 0x0 0x8009
msgbox @newplant
callstd MSG_NORMAL
compare 0x8007 0x0
if <= jump @water
msgbox @wateredAlready
callstd MSG_NORMAL
release
end

#org @sprouted
storeitem 0x0 0x8009
msgbox @sprouting
callstd MSG_normal
compare 0x8007 0x0
if <= jump @water
msgbox @wateredAlready
callstd MSG_NORMAL
release
end

#org @growing
storeitem 0x0 0x8009
msgbox @tall
callstd MSG_NORMAL
compare 0x8007 0x0
if <= jump @water
msgbox @wateredAlready
callstd MSG_NORMAL
release
end


#org @blooming
storeitem 0x0 0x8009
msgbox @bloom
callstd MSG_NORMAL
compare 0x8007 0x0
if <= jump @water
msgbox @wateredAlready
callstd MSG_NORMAL
release
end

#org @water
checkitem 0x1 0x1 'checks you have one masterball. Change 0x1 to your watering item
if != jump @end
msgbox @wantWater
callstd MSG_YESNO
compare LASTRESULT 0x0
if == jump @end
msgbox @finishedWatering
callstd MSG_NORMAL
addvar 0x8007 0x1
addvar 0x8008 0x1
copyvar 0x800D 0x8005
callasm 0x800001 'set tree data
release
end


#org @end
release
end

#org @addedBerry
= You planted a \v\h02 here.

#org @returned
= The soil returned to it's soft and\nloamy state.

#org @newplant
= A \v\h02 was planted here.

#org @none
= The soil is soft here[.]\nPlant a berry?

#org @bloom
= The \v\h02 plant is in bloom!

#org @tall
= The \v\h02 plant\nis growing bigger.

#org @sprouting
= The \v\h02 has sprouted.

#org @wantWater
= The plant can use some water[.]\nWould you like to water it?

#org @wateredAlready
= It's been watered already.

#org @recieved
= \v\h01 found \v\h02 \v\h03!


Usage:
After you've compiled the script, write down the offset of it as well. You will need to remember it.
Here is how you'll be using the script:
#dyn 0x740000
#org @start
setvar 0x8000 0x[max berry yield]
setvar 0x8001 0x[min berry yield]
setvar LASTRESULT 0x[Tree ID]
jump 0x8[Offset where you compiled the above script]
Every tree should have a unique Tree ID. So if you want two trees, one can be 0x0, and the other can be 0x1. Set the tree ID to lastresult and then jump the script that handles the complicated stuff.


System Mechanics:
The beauty of the system is that it uses only temporary variables and derives their values from the RAM. Meaning you can go ahead and use those variables for anything, without having to save them for just the tree. Incase you are interested here's how the data is stored and the variable's significance:

General variables:
var 0x8000: Max berry yield for tree
var 0x8001: Minimum berry yield for tree
var 0x8005: Current stage
var 0x8006: Time planted
var 0x8007: Was watered
var 0x8008: Times watered
var 0x8009: ID of berry

RAM Data storage:
[Current Stage: 1 byte]
[Time planted: 2 bytes]
[Watered: 1 byte]
[times watered: 1 byte]
[ID of plant: 1 bytes]

System Algorithm:
The system works identical to that of DPPT. The only complication is that FR does not have an RTC. So I used play time to obtain as clock. The current system has 5 phases, each phase lasts 20 minutes playtime. You can Increase or decrease this time by going to the "getTreeData" routine, finding my comment in all caps and changing the constant 0x14 (20) to some other hex number you'd want.
Link to DPPT berry system: http://bulbapedia.bulbagarden.net/wiki/Berry#Formula
...

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.2 Years
Another suggestion about your Silent evolution hack, you can improve it by letting a certain pokemon holing specific item evolve in your method than a pokemon in an specific slot.

JPAN save block is 404 page not found
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.

FBI

Free supporter

Male
Unknown Island
Seen 18 Minutes Ago
Posted 19 Minutes Ago
1,906 posts
6.7 Years
Another suggestion about your Silent evolution hack, you can improve it by letting a certain pokemon holing specific item evolve in your method than a pokemon in an specific slot.
I made an item checker already. So you can do
callasm itemchecker
copyvar 0x8000 0x800D
compare 0x8000 0x[Item you want]
if != jump @end
setvar 0x8000 0x800D
callasm silentEvolve

May I suggest? Will you make a compile version for your hacks, I lost my effective and super cool THUMB compiler and I forgot where todownload that kinda awesome tool...
I'll do that from future. I'm too lazy to do it for these :P

In addition to the EV berries, it would be awesome if you could make berries that can call new asm or something to create the new berries like custap and roseli :D
That's possible already with Davidjcobb's tutorial on item adding!
...

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.2 Years
How about an specific pokemn rather than Pokemon party slot..

by the way what is the name of your THUMB compiler?
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.

FBI

Free supporter

Male
Unknown Island
Seen 18 Minutes Ago
Posted 19 Minutes Ago
1,906 posts
6.7 Years
How about an specific pokemn rather than Pokemon party slot..

by the way what is the name of your THUMB compiler?
Use special 0x9F to select the Pokemon then callasm.


EV Reducing berries



Speaking of special 0x9F, I finished EV reducing berries which was rather easy.
First of all, follow this tutorial: http://www.pokecommunity.com/showthread.php?t=258426
until you get to the part where you have to give the item an effect via script.

Compile and insert into free space the following routine:
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r4, lr}
	ldr r0, = (0x20370C0)
	ldrb r1, [r0]
	ldr r0, =(0x2024284)
	mov r2, #0x64
	mul r1, r1, r2
	add r0, r0, r1
	mov r4, r0
	ldr r2, =(0x20370D0)
	ldrb r1, [r2]
	push {r4}
	ldr r3, =(0x803FBE8 +1)
	bl linker
	pop {r4}
	ldr r2, =(0x20370B8)
	ldrb r3, [r2]
	cmp r3, r0
	bhi NoEffect
	sub r0, r0, r3
	mov r3, r0

end:
	mov r0, r4
	ldr r2, =(0x20370D0)
	ldrb r1, [r2]
	strh r3, [r2]
	ldr r3, =(0x804037C +1)
	bl linker
	pop {r0-r3, pc}

noEffect:
	ldr r2,  =(0x20370d0)
	mov r1, #0xFF
	strb r1, [r2]
	pop {r0-r4, pc}
	

linker:
	bx r3

.align 2
Here's a compiled version:
1F B5 10 48 01 78 10 48 64 22 51 43 40 18 04 1C 0E 4A 11 78 10 B4 0E 4B 00 F0 13 F8 10 BC 0D 4A 13 78 83 42 FE D8 C0 1A 03 1C 20 1C 07 4A 11 78 13 80 09 4B 00 F0 05 F8 0F BD 04 4A FF 21 11 70 1F BD 18 47 C0 70 03 02 84 42 02 02 D0 70 03 02 E9 FB 03 08 D2 70 03 02 7D 03 04 08


For the part of inserting a script to give your item functionality, you need to insert this script.
#dyn 0x740000
#org @start
special 0x9f
waitspecial
storepartypokemon 0x0 0x8004 'bufferpokemon2 in xse
setvar LASTRESULT 0x[EV to modify]
setvar 0x8000 0x[amount to decrease EV by]
callasm 0x[routine +1]
compare LASTRESULT 0xFF
if == jump @failed
storevar 0x1 0x800F 'buffervar in xse
msgbox @gain
callstd MSG_NORMAL
removeitem 0x[ID] 0x1
release
end

#org @failed
msgbox @noEffect
callstd MSG_NORMAL
release
end

#org @noEffect
= It would have no effect!

#org @gain
= \v\h02 gained \v\h03\nInsert the EV your berry gives
In variable 0x8000 put the amount the EV is to decrease by.
In variable 0x800D put which EV you want to modify, in this format:
0x1A - HP EV
0x1B - Attack EV
0x1C - Defence EV
0x1D - Speed EV
0x1E - Sp. Attack EV
0x1F - Sp. Defence EV
...

Joexv

joexv.github.io

Age 22
Male
Oregon
Seen September 9th, 2019
Posted August 7th, 2018
Ok I have a request. Could you make an asm routine that searches your party for a specific pokemon and then stores its party slot in a variable?
And could you possibly do it for emerald cause I know thats a thing for fire red all ready.
I died and am dead
Age 23
Male
Seen July 6th, 2019
Posted October 26th, 2016
253 posts
6.5 Years
Ok I have a request. Could you make an asm routine that searches your party for a specific pokemon and then stores its party slot in a variable?
And could you possibly do it for emerald cause I know thats a thing for fire red all ready.
There's a routine made by itari that returns the number of specified Pokemon you have. It'd be easy to modify that to return the party slot of a specific pokemon.

And, here you go! Credits to itari for the original ASM routine, which I modified a tad. The original routine can be found here: http://www.pokecommunity.com/showpost.php?p=8388671&postcount=547

If you want this to work for EM, just use the same offsets she posted.

.text
.align 2
.thumb
.thumb_func
.global CountPartyPokemonSpecies

main:
	push {r0-r7, lr}
	ldr r6, var
	ldr r7, party_amount
	ldrb r4, [r7] @ Get Pokemon count from r7
	cmp r4, #0x0
	beq exit
	ldrh r3, [r6] @ Get the species to check
	cmp r3, #0x0
	beq exit @ Don't allow Missingno. This doesn't limit the species from going up, though.
	mov r7, #0x0
loop:
	ldr r0, first_pokemon @ Offset of first Pokemon
	mov r1, #0x64 @ Length of Pokemon RAM data
	mul r1, r1, r7 @ r7 holds current index
	add r0, r0, r1
	bl decrypt_poke_species @ Get this specific species.
	mov r9, r0
	pop {r0-r7}
	cmp r9, r3
	beq exit
next:
	add r7, r7, #0x1 @ Increase party index
	cmp r7, r4 @ And compare against the number in the party
	blo loop @ I could use a bls here?
        mov r7, #0xFF
exit:
	str r7, [r6, #0x10] @ Store the index (r7) in r6 (the var -- 0x800D)
	pop {r0-r7, pc} @ Return

decrypt_poke_species:
	push {r0-r7}
	mov r1, #0xB @ This is the index for the Pokemon species.
	ldr r2, decrypt_poke @ Call the Pokemon decryption code
	bx r2
	
.align 2
party_amount:
	.word 0x02024029
first_pokemon:
	.word 0x02024284
var: @ Got this beauty from HackMew.
	.word 0x020270B8 + (0x8004 * 2)
decrypt_poke:
	.word 0x0803FBE9
This should store the party slot (which would be from 0-5) in 0x800D. Haven't tested it, but I'm fairly confident it should work.

EDIT: Ok, realized there was an oversight, so I modified it a bit. This should return 0xFF if the specified Pokemon doesn't exist in your party. I shouldn't be modifying routines at 2 am lol.

Make sure you set the var 0x8004 to the species you want. The routine should return a value between 0-5 if the Pokemon exists, or 0xFF if it doesn't exist, in var 0x800D. Check for those in a script.

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.2 Years
Use special 0x9F to select the Pokemon then callasm.
Can you give a full script on how it works?

EV Reducing berries



Speaking of special 0x9F, I finished EV reducing berries which was rather easy.
First of all, follow this tutorial: http://www.pokecommunity.com/showthread.php?t=258426
until you get to the part where you have to give the item an effect via script.

Compile and insert into free space the following routine:
Spoiler:

.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r3, lr}
	ldr r0, = (0x20370C0)
	ldrb r1, [r0]
	ldr r0, =(0x2024284)
	mov r2, #0x64
	mul r1, r1, r2
	add r0, r0, r1
	mov r4, r0
	ldr r2, =(0x20370D0)
	ldrb r1, [r2]
	ldr r3, =(0x803FBE8 +1)
	bl linker
	ldr r2, =(0x20370D2)
	ldrb r3, [r2]
	sub r3, r3, r0
	cmp r3, #0x0
	bls setZero
	b end

setZero:
	mov r3, #0x0

end:
	mov r0, r4
	strh r3, [r2]
	ldr r2, =(0x20370D0)
	ldrb r1, [r2]
	ldr r3, =(0x804037C +1)
	bl linker
	pop {r0-r3, pc}

linker:
	bx r3

.align 2


For the part of inserting a script to give your item functionality, you need to insert this script.
#dyn 0x740000
#org @start
special 0x9f
storepokemonvar 0x0 0x8004 'bufferpartypokemon2 in xse
setvar LASTRESULT 0x[EV to modify]
setvar 0x800F 0x[amount to decrease EV by]
callasm 0x[routine +1]
storevar 0x1 0x800F 'buffervar in xse
msgbox @gain
callstd MSG_NORMAL
release
end

#org @gain
= \v\h02 gained \v\h03\nInsert the EV your berry gives
In variable 0x800F put the amount the EV is to decrease by.
In variable 0x800D put which EV you want to modify, in this format:
0x1A - HP EV
0x1B - Attack EV
0x1C - Defence EV
0x1D - Speed EV
0x1E - Sp. Attack EV
0x1F - Sp. Defence EV
This is great! man! Just a request or anyone here who can give me a THUMB compiler.

BLAx501!

Pokemon Flux

Male
Madrid, Spain
Seen 3 Days Ago
Posted February 5th, 2019
80 posts
6 Years
I've came up with another idea, I hope it is not very complicated xD.

The main thing is being able to have two separated teams. I know havingo two different Storage Sistems would be really difficult, but I thougth it might be easier this way. For example you are playing with a character, and then you want to change the perspective and take control of another one; you don't want to have the same team for both, so you need to store the first team and give the second character it's own team that is stored in other place...

Is this possible??

Percy

Male
Asia
Seen 47 Minutes Ago
Posted 2 Days Ago
2,969 posts
5.1 Years
If this is hard, ignore this post:

You can have more than 4 moves.

If this is hard, ignore this post:

You can have more than 4 moves.

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.2 Years
I will give you some ideas and suggestions:

A routine for Mega Evolution, we dont need a Mega Ring because it is very hard, I think:

1.Routine of Item effect(Held item) that checks an specific specie of pokemon then go to Evolution routine(You can use silent evolution so it is not time consuming)

TIP: You can compare how Berries affect in battle so that, instead of eating it, it will go to silent evolution routine. Also, you can use your method in Ev reducing berries to call a script so that you are now able to search certain species

2.Routine of "Return Specie" after the battle it will goto Silent evolution method

With these routines, Advance rom will now be Mega Advance rom XD

FBI

Free supporter

Male
Unknown Island
Seen 18 Minutes Ago
Posted 19 Minutes Ago
1,906 posts
6.7 Years
Ok I have a request. Could you make an asm routine that searches your party for a specific pokemon and then stores its party slot in a variable?
And could you possibly do it for emerald cause I know thats a thing for fire red all ready.
Sorry, Fire Red is my love :(
Plus Hidoran already did it, so there's that.

There's a routine made by itari that returns the number of specified Pokemon you have. It'd be easy to modify that to return the party slot of a specific pokemon.

And, here you go! Credits to itari for the original ASM routine, which I modified a tad. The original routine can be found here: http://www.pokecommunity.com/showpost.php?p=8388671&postcount=547

If you want this to work for EM, just use the same offsets she posted.

.text
.align 2
.thumb
.thumb_func
.global CountPartyPokemonSpecies

main:
	push {r0-r7, lr}
	ldr r6, var
	ldr r7, party_amount
	ldrb r4, [r7] @ Get Pokemon count from r7
	cmp r4, #0x0
	beq exit
	ldrh r3, [r6] @ Get the species to check
	cmp r3, #0x0
	beq exit @ Don't allow Missingno. This doesn't limit the species from going up, though.
	mov r7, #0x0
loop:
	ldr r0, first_pokemon @ Offset of first Pokemon
	mov r1, #0x64 @ Length of Pokemon RAM data
	mul r1, r1, r7 @ r7 holds current index
	add r0, r0, r1
	bl decrypt_poke_species @ Get this specific species.
	mov r9, r0
	pop {r0-r7}
	cmp r9, r3
	beq exit
next:
	add r7, r7, #0x1 @ Increase party index
	cmp r7, r4 @ And compare against the number in the party
	blo loop @ I could use a bls here?
        mov r7, #0xFF
exit:
	str r7, [r6, #0x10] @ Store the index (r7) in r6 (the var -- 0x800D)
	pop {r0-r7, pc} @ Return

decrypt_poke_species:
	push {r0-r7}
	mov r1, #0xB @ This is the index for the Pokemon species.
	ldr r2, decrypt_poke @ Call the Pokemon decryption code
	bx r2
	
.align 2
party_amount:
	.word 0x02024029
first_pokemon:
	.word 0x02024284
var: @ Got this beauty from HackMew.
	.word 0x020270B8 + (0x8004 * 2)
decrypt_poke:
	.word 0x0803FBE9
This should store the party slot (which would be from 0-5) in 0x800D. Haven't tested it, but I'm fairly confident it should work.

EDIT: Ok, realized there was an oversight, so I modified it a bit. This should return 0xFF if the specified Pokemon doesn't exist in your party. I shouldn't be modifying routines at 2 am lol.

Make sure you set the var 0x8004 to the species you want. The routine should return a value between 0-5 if the Pokemon exists, or 0xFF if it doesn't exist, in var 0x800D. Check for those in a script.
Thanks :P

Can you give a full script on how it works?

This is great! man! Just a request or anyone here who can give me a THUMB compiler.
ehh, this isn't really a script thread, but the main parts of it will be like this:
special 0x9f
copyvar 0x8000 0x8004
callasm 0xevolution

For your thumb compiler use HackMew's one. http://www.pokecommunity.com/showpost.php?p=8515334&postcount=3

I've came up with another idea, I hope it is not very complicated xD.

The main thing is being able to have two separated teams. I know havingo two different Storage Sistems would be really difficult, but I thougth it might be easier this way. For example you are playing with a character, and then you want to change the perspective and take control of another one; you don't want to have the same team for both, so you need to store the first team and give the second character it's own team that is stored in other place...

Is this possible??
While it is possible, you would have to put these Pokemon into a save block. Each Pokemon take 100 bytes of space (but if it's just for storage this value is a little less). Needless to say, even with JPAN's save block hack you would only be able to have about 37 Pokemon in this storage. It would be fine for a small team of 5 I suppose. This is an idea I thought up of some time ago as well, however, back then I didn't have the expertise to implement it. Hopefully now I can try for a smaller team size (no promises :P).

edit: I also kinda need this for 2vs2 battles.

If this is hard, ignore this post:

You can have more than 4 moves.
It's not just hard, it requires a complete rework of the current system. The system assumes you have only four moves when:
- you're trying to learn a move
- you're trying to delete moves
- displaying moves
- in battle for AI and yourself
- biggest of all is the Pkmn data structure is written to be exactly 100 bytes, having even one extra move (2 bytes) would overflow onto the next Pokemon.
I probably missed some, but I know after evolution this is checked as well. The biggest hurdle is storage, and then displaying. Sadly, it's a hurdle I'm not going to try to conquer because I think it ruins the current PKMN main game's gameplay and it's too hard :D
...
Advertiser Content