Thread: Development: Making Dive Work in FireRed
View Single Post
  #1    
Old July 19th, 2011 (8:53 AM).
Giga Universe's Avatar
Giga Universe Giga Universe is offline

Working on a tool.

Crystal Tier
 
Join Date: Aug 2007
Location: South Africa
Age: 21
Gender: Male
Nature: Calm
Posts: 121
Send a message via ICQ to Giga Universe Send a message via AIM to Giga Universe Send a message via Yahoo to Giga Universe Send a message via Skype™ to Giga Universe

Dive doesn't work in FireRed, I'm not sure if the code is there for it to work, but I suppose we could just write some more, as we could then create things like the underground.
I'm not sure if it helps, but I wrote a routine that finds a connection and stores the map and bank of that connection in a variable. You have to tell it what kind of connection to search for though...
0x5 is a 'Dive' connection, and 0x6 is a 'Emerge' connection.

Code:
.text
.align 2
.thumb
.thumb_func

main: push {r0-r5,lr} ldr r0, mapheader ldr r0, [r0,#0xC] ldr r1, [r0] ldr r0, [r0,#0x4] ldr r4, variable ldrh r5, [r4] mov r2, #0x0 b search

search: cmp r1, #0x0 beq notfound ldrb r3, [r0,r2] cmp r3, r5 beq found add r2,#0xC sub r1, #0x1 b search

notfound: pop {r0-r5,pc}

found: add r2, #0x8 ldrb r1, [r0,r2] add r2, #0x1 ldrb r2, [r0,r2] lsl r3, r1, #0x8 orr r3, r2 strh r3, [r4] pop {r0-r5,pc}

.align 2

mapheader: .word 0x02036DFC

variable: .word 0x020370D0 @Last result

All we need from here is to make it warp, and then we can make a tile behavior for it or something. I have absolutely no idea how to make it warp, so if someone could help there, then I could make this thing work...

__________________
Reply With Quote