Skeli-

Lord of the Rings

Age 20
Male
Canada
Seen 6 Hours Ago
Posted 1 Week Ago
213 posts
5.3 Years
Has anyone been able to get this working for Fire Red? I know it says its been extensively tested, but I just can't seem to get it to work. Even though I've inserted all of the routines properly (I know this because the game doesn't crash), the game still only loads the daytime data.
I rewrote the Pokemon loading routine so it would work for day and night switching, as well as swarms.
Spoiler:
.text
.text
.align 2
.thumb
.thumb_func
.global daynightwildswitch

@r7 is wild pokemon data for that map

Main:
	add r0, r7, #0x4
	push {r0}
	ldr r0, var_4fff
	bl var_decrypt
	ldrh r0, [r0]
	cmp r0, #0x1
	bge Swarm
	pop {r0}
	push {r2}
Daynight: 
	ldr r2, hour
	ldrb r2, [r2]
	cmp r2, #0x14 /*8PM - Change it if you want*/
	bge night
	cmp r2, #0x11 /*5PM - Change it if you want*/
	bge evening
	cmp r2, #0xA /*10AM - Change it if you want*/
	bge day
	cmp r2, #0x4 /*4AM - Change it if you want*/
	bge morning
night: 
	add r2, r0, #0x4
	b check
evening: 
	mov r2, r0
        @add r2, #0x8 @remove comment if you want evening based Pokemon
	b check
morning: 
	mov r2, r0
        @add r2, #0xC @remove comment if you want morning based Pokemon
	b check
day: 
	mov r2, r0
check:
	ldrb r1, [r2, #0x3]
	cmp r1, #0x8
	bne nodata
	ldr r0, [r2]
nextnormal: 
	add r0, r4
	ldrh r0, [r0, #0x2]
back: 
	ldr r1, lastpokemon
	strh r0, [r1]
	mov r1, r5
	pop {r2}
	ldr r3, .Return
	bx r3

Swarm: 
	ldr r1, currentmap
	ldrb r1, [r1] @r1=current map name
	cmp r1, r0
	pop {r0}
	bne daynightone
	ldr r0, var_4ffe
	bl var_decrypt
	ldrh r0, [r0]
	b back

var_decrypt: 
	ldr r1, vardecrypt
	bx r1

daynightone: 
	ldr r0, [r7, #0x4]
	push {r0}
	b Daynight

nodata: 
	sub r2, r0
	cmp r2, #0xC
	beq night
	b day

.align 2
.Return: .word 0x08082b51
lastpokemon: .word 0x0300555C
hour: .word 0x03005542
vardecrypt: .word 0x0806E455
var_4fff: .word 0x00004FFF @Replace this with whatever variable you would like to use
var_4ffe: .word 0x00004FFE  @Replace this with whatever variable you would like to use
currentmap: .word 0x03005558


To set a swarm, set var_4fff to your map name id, and var_4ffe to your Pokemon species.
Pokemon Unbound