Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Reload this Page Development: Making Dive Work in FireRed

Notices
For all updates, view the main page.

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!
Research & Development programs in this forum are subject to moderator approval before they are displayed.



Reply
 
Thread Tools
  #1    
Old July 19th, 2011 (08: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: 20
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
  #2    
Old July 19th, 2011 (12:53 PM). Edited July 19th, 2011 by knizz.
knizz's Avatar
knizz knizz is offline
 
Join Date: Aug 2007
Posts: 192
From Underwater: call script 081BE3D4
From Overworld: call script 081BE38B

To connect change the hometown-connection to a dive-connection set 08352754 to 05

To disable the check whether you actually have a dive pokemon with you set the 6 bytes 081BE394-081BE399 to 0. This function also decides which pokemon is shown in the black bar. So if you disable it and see a bad egg. That's because of this.

Disable the badge-check for HMs set 0812462E to 0.

There are two ways to warp. The special one is just used when the behaviour of the tile the player is standing on is 0x19 and when the light byte is set to 0x5. Through different ways the execution can reach 0806DFB0. To avoid that you can destroy the bne/beqs. Write 0000 to 0806DF82 and 0806DF9C. This is not a good solution though. I'm sure there is a reason why these if's are there.

I don't know if the warp destination is correct. But the bank and mapnumber are in the variables 7004 and 7005.
__________________
Firered IDA 6.5 DB: https://www.dropbox.com/s/hvvmxxoo1dkmdzc/firered.idb
VBA-M with lua scripting support
Reply With Quote
  #3    
Old July 28th, 2011 (12:01 PM). Edited July 29th, 2011 by Teh Blazer.
Teh Blazer's Avatar
Teh Blazer Teh Blazer is offline
Divider of Zero
 
Join Date: Feb 2009
Location: 'MERICA
Age: 19
Gender: Male
Nature: Relaxed
Posts: 693
I may not be the brightest Ampharos in the lighthouse, but how would I make sense of this? Do we have to write a script and put this in, and how do we give stuff tile behaviors?
__________________
Coming soon...
Reply With Quote
  #4    
Old July 29th, 2011 (03:45 PM).
Putin's Avatar
Putin Putin is offline
Anspruchsvolle Narr
 
Join Date: Dec 2010
Location: Florida
Gender: Male
Nature: Brave
Posts: 52
Perhaps this is flawed somehow, but could this not effectively be done using signpost scripts? You'd have to use it sparingly unless you had the space to spare, but then, using too many dive points is kind of obnoxious anyway.
Reply With Quote
  #5    
Old July 29th, 2011 (04:13 PM).
Lyzo's Avatar
Lyzo Lyzo is offline
On vacation
 
Join Date: Mar 2007
Location: The Netherlands
Age: 20
Gender: Male
Nature: Bold
Posts: 251
Send a message via Windows Live Messenger to Lyzo
Quote originally posted by Putin:
Perhaps this is flawed somehow, but could this not effectively be done using signpost scripts? You'd have to use it sparingly unless you had the space to spare, but then, using too many dive points is kind of obnoxious anyway.
You could do that, but if you wanted to make big dive areas like in Ruby and Saphire, this would make the game lag. So putting an ASM routine in the tile behaviour, either using JPAN's engine, or... something else Is much more efficient.

If you would like to make Dive work in only one part of your game, then your solution would work
__________________


Thank you The Blueprint !!!
Reply With Quote
  #6    
Old July 30th, 2011 (05:11 AM).
sonic1's Avatar
sonic1 sonic1 is offline
ASM is my life now...
 
Join Date: May 2008
Location: Portugal
Age: 20
Gender: Male
Nature: Timid
Posts: 79
Why don't you locate one of those useless tile behaviour scripts like the ones that are the TV's talking or something and make a 'goto' (like in asm bx r0 xD ) to the diving scripts?

This way it isn't needed JPAN's engine for it to work. And its more easier IMO.
__________________
This signature has been disabled.
over 350px high
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.
Reply With Quote
  #7    
Old October 19th, 2011 (11:46 AM).
avolonsaber avolonsaber is offline
 
Join Date: Oct 2010
Posts: 182
Wow, I was just about to start a thread about this :3

When it comes to ASM hacking Pokemon games I know nothing, in fact, my ASM knowledge is limited at best, and only limited to the Sonic The Hedgehog titles for the Genesis, lol. If you can port various things from one Sonic title to another though, I'm sure someone could port Dive and it's functionality to Fire Red. Sooo, yeah, if anyone is working on this, keep at it!
Reply With Quote
  #8    
Old October 19th, 2011 (07:38 PM).
DavidJCobb DavidJCobb is offline
RESIDENT RAAAAAAAAAAAAGEMASTER
 
Join Date: Jul 2010
Gender: Male
Nature: Lonely
Posts: 275
Quote originally posted by sonic1:
Why don't you locate one of those useless tile behaviour scripts like the ones that are the TV's talking or something and make a 'goto' (like in asm bx r0 xD ) to the diving scripts?
Those are actually scripts, not ASM.

As for the DIVE functionality, I can tell you guys that the scripts (as in XSE) for it still exist in FireRed. They don't have any identifiable warp calls, so either the warping results from the field move animation commands, or ASM detects when the script ends and warps then.

If the former, then that would explain why the DIVE field move animation crashes when triggered from script: it needs to read values from some location to know where to warp to, and it's not getting valid ones. Figure out how the field move animation works, and it may then be possible to make DIVE fully-functional.
__________________
Reply With Quote
  #9    
Old October 20th, 2011 (07:34 AM).
sonic1's Avatar
sonic1 sonic1 is offline
ASM is my life now...
 
Join Date: May 2008
Location: Portugal
Age: 20
Gender: Male
Nature: Timid
Posts: 79
I know that they were scripts. I was refering to the 'goto' script command.

About DIVE, i already have a fully functional version, and if you watch carefully, the coordinates are the ones of the player when warping.

(Cheap Test): http://www.youtube.com/watch?v=pZiSs0r9yHI
__________________
This signature has been disabled.
over 350px high
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.
Reply With Quote
  #10    
Old November 18th, 2011 (07:29 AM). Edited March 18th, 2012 by Hackrex.
Hackrex Hackrex is offline
 
Join Date: Aug 2007
Gender:
Posts: 35
Wow, it´s realy working?
for dive you can insert a new tileset (underwater tileset maybe tiles from kyledove). Ok, I try to make it work on a german rom. I hope I´m succesful.
What do I need in the Script? Should I use any special commands?

//Edit1: Ok, it works on a german rom, too.

//Edit2: Ok, I have written a tutorial. I hope you can understand it. If not please tell me and I would explain it. http://www.pokecommunity.com/showthread.php?t=276031
__________________
Temporarily not available
Reply With Quote
  #11    
Old May 13th, 2012 (12:25 AM).
buggy131313 buggy131313 is offline
 
Join Date: May 2012
Posts: 2
Well, another trick is to have Dive at certain spots make you 'wash up' on some other location. Say, a beach that you warp to.
Reply With Quote
  #12    
Old October 14th, 2014 (06:21 PM). Edited October 14th, 2014 by Lance32497.
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 526
Quote originally posted by knizz:
From Underwater: call script 081BE3D4
From Overworld: call script 081BE38B
Good Day knizz, about the quoted one, How to call that offsets? So do I need to call it as a script or something? What is the step by step procedure?

Quote originally posted by knizz:
To connect change the hometown-connection to a dive-connection set 08352754 to 05
What is 08352754? Is that 0x352754 offset? And 08 refers to a POINTER? Am I right?



And.... Do I need to insert the ASM code given by giga universe?
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC -8. The time now is 10:04 AM.