The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

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.


Advertise here

Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old January 6th, 2010, 01:45 PM
mindfreak's Avatar
mindfreak
Belgium Rom hacker
 
Join Date: Dec 2007

Advertise here
Sorry for my horrible English.I'll try to explain everything as good as I can.

You probably know that in the pokémon games with a D/N system the pokemon at night are different from the one at day.
And now that ZodiacDaGreat and Interdpth have created a clock and a D/N system for firered I wondered if something like that would be possible to make.

So I tied to make something like that.

This is what I got so far:
(I used a Fire red rom with the D/N system from Zodiac and Interdpth)

I started to try to make a ASM script that stored the hours to 0x800D
(Unfortunally I can't give you the script because Interdepth asked in his treat to not post it)
(but I don't understand asm either so i can give you a hint ''Hackmew's knowledge secret ID tut'')
After that i searched for the pointer to ''the data of the pokemon in route 1 ''(search for 608E3C08).
and changed it to 4C550003 since I figured that you cant write to ROM ingame.
And at 0x00750000 I made new 'Night pokemon data'
Each pokemon has 4 bytes like this 03 03 13 00
Code:
03      Min Lv
03      Max LV
1300    Pokemon hex number
(Keep in mind that you need at least 48 bytes free space 4bytes*12 pokemon)

After that I made (edited the pallete change script from foofatron) two asm scripts.
One to store the 'original day pokemon' from ROM to the RAM at 0300554C
And an other to store 'The night pokemon' from ROM to RAM at 0300554C

Day pokemons
Code:
.thumb
push {r0-r2, lr}
ldr r0, .Daypokes
ldr r1, .pokés
mov r2, #0x18
swi 11
pop {r0-r2, pc}
.align 2
.Daypokes:
.word 0x083C8E60
.pokés:
.word 0x0300554C
Night pokemons ''same script other offset'' (750000 is the place where I stored the night pokemon data)
Code:
.thumb
push {r0-r2, lr}
ldr r0, .Nightpokes
ldr r1, .pokés
mov r2, #0x18
swi 11
pop {r0-r2, pc}
.align 2
.Nightpokes:
.word 0x08750000
.pokés:
.word 0x0300554C
Once these were inserted I used this XSE script as a levelscript....

Code:
#Dynamic 0x810000

#define B_< 0x0
#define B_<< 0x0
#define B_= 0x1
#define B_== 0x1
#define B_> 0x2
#define B_>> 0x2
#define B_<= 0x3
#define B_>= 0x4
#define B_!= 0x5
#define B_<> 0x5


'------------------------------------------------------
'Script
'------------------------------------------------------

#org @START
setvar 0x4033 0x1
callasm 0x800001
compare 0x800D 0x4
if B_>= goto @CHECK
goto @night
end

#org @CHECK
compare 0x800D 0x13
if B_>= goto @night
goto @day

#org @night
callasm 0x750031
end

#org @day
callasm 0x750045
end
Problems I have found:
Advance map gives an error when you open route 1 cause 4C550003 isn't a pointer
you got to leave the map before the effect takes place.
I think there must be another way of making something like this

I hope you understanded everything .
__________________
Reply With Quote
  #2    
Old January 7th, 2010, 09:50 AM
Sora's Nobody's Avatar
Sora's Nobody
The Official Roxas
 
Join Date: Jun 2009
Location: Destiny Island
Gender: Male
Nature: Brave
Send a message via Windows Live Messenger to Sora's Nobody
Sad nobody answerd to this thread so ill just do even tought i have no scripting or asm experience, this is a good idea and would open alot of possiblitiys
__________________

Sora's Nobody ★ Nothing Yet!
♠The Official Roxas♠ My Stuff:


Reply With Quote
  #3    
Old January 7th, 2010, 09:56 AM
interdpth
I've seen things, man.
 
Join Date: Jul 2004
Quote:
Originally Posted by Sora's Nobody View Post
Sad nobody answerd to this thread so ill just do even tought i have no scripting or asm experience, this is a good idea and would open alot of possiblitiys
Hush you.

Anyway, Mindfreak, I was talking about this with a friend a few days ago.

My idea was to make a wild list for night time.

Store it somewhere.

Then make a level script to check the time and replace the pointer list in memory, seems like a two hour job at most, and should be easy.

Good luck.
__________________
yes, this is doge.

potato is not here.

bye
Reply With Quote
  #4    
Old January 7th, 2010, 10:29 AM
hashtag's Avatar
hashtag
the man in black
Community Supporter
 
Join Date: Nov 2008
Location: Salisbury, England
Age: 19
Gender: Male
Andrea (HackMew) told me that with his D/N the even and odd pokémon in A-Map were based on which session they would appear in. But they might've been just in his D/N system, I'll have to ask him about it again.
__________________
"i am the hero pokécommunity deserves, but not the one it needs right now"

paired with christos
Reply With Quote
  #5    
Old January 7th, 2010, 12:21 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Uh, there's no need for the use of scripts to perform this. If you would only be patient and let us work XD But then again it is your way. My idea is to edit the loader, so it'll load different sets of Pokémon depending on the period. This also means you need to have more then 1 set of Pokemon.
__________________
Reply With Quote
  #6    
Old January 7th, 2010, 04:52 PM
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Honestly, this would be solved if the knowledge of how to check for the time in a script were released to the general public, if we're all talking interdepth's system. I'm about as useful as a tree stump when it comes to ASM, and though I've tried, I can't seem to make heads or tails of the code.

With that information, those using JPAN's engine could simply set a level script that checks the time and have it load a new set of wildpokemon data depending on the time. Not to mention the other flavor things we could do with the knowledge of how to check for the time.

"Good Evening, welcome to our Pokemon Center!"
"I'm waiting here for Pokemon that only come out in the morning."
"Sorry, we're closed on Mondays."
Reply With Quote
  #7    
Old January 7th, 2010, 04:56 PM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
I once thought about how this might be possible and the idea I eventually came up with is to alter both the way Wild Pokémon data is stored along with the routine that access the data. I don't know much about how Wild Pokémon data is accessed but my understanding is that each map has a pointer to its Wild Pokémon data. My proposal would be to use that pointer to point to, instead of the data itself, a table consisting of two pointers, one pointing to the daytime pokémon data and the other to the nighttime pokémon data (more pointers could be used in the table if you wanted morning, day, and night). The routine(s) that access the Wild Pokémon data would then be altered so that instead of simply loading the data pointed to by the map, it would follow one of the pointers where the old Wild Pokémon data was and, depending on the time, then access the correct time's data. The data would still be stored in the same format, but there would just be twice as much data. As I see it, the routine would remain practically the same except for a conditional branch depending on the time but the way that the data is accessed and used should remain the same. All that would be changed would be the act of locating the data.

Eh, it's just a thought. I haven't strongly considering trying it because I wouldn't know where to start.
__________________

Brother of Vrai
Reply With Quote
  #8    
Old January 7th, 2010, 05:06 PM
interdpth
I've seen things, man.
 
Join Date: Jul 2004
bleh


okay because it's this forum.

I'll do it. XD

with my RTC
copybyte 0x20370BA 0x3005542

Should put the hour byte into LASTResult

Then

cmp lastresult yournighthour
insertcraphere


or use the d&n value


We've presented people with two ways to do it.

You can either make a level script or some script that gets called in the loadmap thing etc, my mind is rambling, sorry XD
__________________
yes, this is doge.

potato is not here.

bye
Reply With Quote
  #9    
Old January 7th, 2010, 05:07 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 21
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
@ colcolstyles - That's exactly what I meant
__________________
Reply With Quote
  #10    
Old January 7th, 2010, 05:17 PM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Quote:
Originally Posted by Deokishisu View Post
Honestly, this would be solved if the knowledge of how to check for the time in a script were released to the general public, if we're all talking interdepth's system. I'm about as useful as a tree stump when it comes to ASM, and though I've tried, I can't seem to make heads or tails of the code.
I tried using ZodiacDaGreat's code and it conveniently places it somewhere in the WRAM. I forget where but I think he mentioned it somewhere.

Quote:
Originally Posted by Deokishisu View Post
With that information, those using JPAN's engine could simply set a level script that checks the time and have it load a new set of wildpokemon data depending on the time. Not to mention the other flavor things we could do with the knowledge of how to check for the time.
I think having a level script for every single map seems a little cumbersome.

Quote:
Originally Posted by Deokishisu View Post
"Good Evening, welcome to our Pokemon Center!"
"I'm waiting here for Pokemon that only come out in the morning."
"Sorry, we're closed on Mondays."
We could have a whole thread on ideas for how to use the RTC ^^

Quote:
Originally Posted by ZodiacDaGreat View Post
@ colcolstyles - That's exactly what I meant ^^
Nice to see I'm not alone. :)
__________________

Brother of Vrai
Reply With Quote
  #11    
Old January 7th, 2010, 05:34 PM
Deokishisu's Avatar
Deokishisu
Mr. Magius
 
Join Date: Feb 2006
Location: If I'm online, it's a safe bet I'm at a computer.
Gender: Male
Nature: Relaxed
Quote:
Originally Posted by colcolstyles View Post
I tried using ZodiacDaGreat's code and it conveniently places it somewhere in the WRAM. I forget where but I think he mentioned it somewhere.
Honestly, I've read tutorials, tried doing ASM, and failed miserably everytime. I just can't seem to grasp it. I wouldn't even know how to check the WRAM. :P

Quote:
Originally Posted by colcolstyles View Post
I think having a level script for every single map seems a little cumbersome.
Really? Just to be difficult here, but you'd only have to do it with maps that have wildpokemon on it. And how many maps could that feasibly be on? 45-50? Including routes and caves? I guess I may just be a sucker for levelscripts. I just love how much can be done and how many ideas could be realized with them. It just seems easier to go with levelscripts than ASMing everything, from my perspective of course.

Actually, now that I think about it, someone might want to ask JPAN or take a look at his engine to determine how his ASM worked out. It may give everyone a jumping off point.
Reply With Quote
  #12    
Old January 7th, 2010, 05:40 PM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Quote:
Originally Posted by Deokishisu View Post
Honestly, I've read tutorials, tried doing ASM, and failed miserably everytime. I just can't seem to grasp it. I wouldn't even know how to check the WRAM. :P
Well I just checked and it's located at 0x03004038. You can access using the 'copybyte' command in XSE.

Quote:
Originally Posted by Deokishisu View Post
Really? Just to be difficult here, but you'd only have to do it with maps that have wildpokemon on it. And how many maps could that feasibly be on? 45-50? Including routes and caves? I guess I may just be a sucker for levelscripts. I just love how much can be done and how many ideas could be realized with them. It just seems easier to go with levelscripts than ASMing everything, from my perspective of course.

Actually, now that I think about it, someone might want to ask JPAN or take a look at his engine to determine how his ASM worked out. It may give everyone a jumping off point.
Well, you could if you really wanted. It just seems, to me at least, more efficient to edit one routine that will then apply to every map.
__________________

Brother of Vrai
Reply With Quote
  #13    
Old January 8th, 2010, 07:34 AM
Juan
Brazilian with a bad English
 
Join Date: Jun 2007
Location: Pindamonhangaba - SP
Age: 23
Nature: Adamant
In a few months ago I did a routine to Emerald, but it was not complete.

Now I updated it to work with the interdpth rtc.

It works perfectly, the only problem is that it is incompatible with the A-MAP, so to edit wild Pokemon have to do manually, or create a program that does that.

Soon I edit with the routine that I did, it is simple, but it works. :D


==========================================================

Edit:

Open A-MAP and go to a map that has wild Pokemon.
Click to expand the number of Pokémon.
You will see the header offset.
Spoiler:



the header is:

Code:
u32	Ratio
u32	Pointer to Pokemon Data
the Pokemon Data is:

Code:
u8	LV MIN [1]
u8	LV MAX [1]
u16	Pokemon[1]
u8	LV MIN [2]
u8	LV MAX [2]
u16	Pokemon[2]
u8	LV MIN [3]
u8	LV MAX [3]
u16	Pokemon[3]
u8	LV MIN [4]
u8	LV MAX [4]
u16	Pokemon[4]
u8	LV MIN [5]
u8	LV MAX [5]
u16	Pokemon[5]
u8	LV MIN [6]
u8	LV MAX [6]
u16	Pokemon[6]
u8	LV MIN [7]
u8	LV MAX [7]
u16	Pokemon[7]
u8	LV MIN [8]
u8	LV MAX [8]
u16	Pokemon[8]
u8	LV MIN [9]
u8	LV MAX [9]
u16	Pokemon[9]
u8	LV MIN [10]
u8	LV MAX [10]
u16	Pokemon[10]
u8	LV MIN [11]
u8	LV MAX [11]
u16	Pokemon[11]
u8	LV MIN [12]
u8	LV MAX [12]
u16	Pokemon[12]

The modified routine uses the following header:

Code:
u32	Ration
u32	Table Pointer
The table then is this:
Code:
u32 Morning Pokemon Pointer
u32 Night Pokémon Pointer
And the data of the Pokémon are kept the same as the original.

Routine:

Code:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@Different wild Pokemon based on time.              @
@Version 0.1                                        @
@Uses the interdpth RTC.                            @
@For Pokémon Fire Red BPEE                          @
@                                                   @
@                                                   @
@OBS:New wild Pokémon incompatible with the A-MAP.  @
@                                                   @
@Made by Juan                                       @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.thumb

@
@Insert the following routine in 0x8083060.
@
loc_8083060:
		LDR	R1, sub1a
		BX	R1
.align
sub1a:		.long 	0x00000000




@
@Insert the following routine in 0x8082B48.
@
loc_8082B48:
		LDR 	r0, sub2a
		BX 	r0
.align
sub2a:		.long 0x00000000




@
@Insert the following routine in 0x08082B26.
@
loc_08082B26:
		LSL	R0, R0, #0
		LDR	R0, sub3a
		BX 	R0
.align
sub3a:		.long 0x00000000



					@called by 0x8083060
sub1:
		BL 	sub_808274C	
		LSL     R0, R0, #0x18
		LDR     R1, [R5,#4]
		PUSH 	{r0}
		mov 	r0, r1
		BL 	TimeWildPoke
		mov 	r1, r0
		POP 	{r0}
		LDR r6, return1
		BX r6
.align
return1:	.long 0x08083069



					@called by 0x8082B48
sub2:
		LDR     R0, [R7,#4]
		BL 	TimeWildPoke
		ADD     R0, R4, R0
		LDRH    R0, [R0,#2]
		ADD     R1, R5, #0
		ADD     R2, R6, #0
		LDR	R6, return2
		BX	R6
.align
return2:	.long 0x08082B53


	
					@called by 0x08082B26
sub3:		LDR     R0, [R7,#4]
		BL 	TimeWildPoke
		ADD     R0, R0, R4
		PUSH 	{R4}
		BL      sub_80828F8
		POP	{R4}
		LSL     R0, R0, #0x18
		LDR	R5, return3
		BX	R5
.align
return3:	.long	0x08082B31



					@Routine that checks the time and reads the pointer indicated.
TimeWildPoke:
		PUSH	{LR}
		PUSH	{R4}
		LDR	R4, Hour
		LDRB	R4, [R4]
		CMP	R4, #0x6	@6AM
		BGE	Morning
		B	Night
.align
Hour:		.long 0x03005542


Morning:
		CMP	R4, #0x12	@6PM
		BGE	Night
		LDR	R0, [R0]
		B	End
	
Night:
		LDR	R0, [R0, #4]
		

End:
		POP	{R4}
		POP	{R1}
		BX	R1



@
@Part of the original routine.
@
sub_808274C:
	LDR r1,= 0x808274D
	BX r1

sub_80828F8:
	LDR r4,= 0x80828F9
	BX r4


.end
__________________

Last edited by Juan; January 8th, 2010 at 08:01 AM. Reason: Routine posted ^^
Reply With Quote
  #14    
Old January 15th, 2010, 12:24 PM
Omega Zero's Avatar
Omega Zero
Is back...
Community Supporter Tier 4
 
Join Date: Dec 2009
Location: I'm always living aren't I?
Age: 16
Gender: Male
Nature: Relaxed
Send a message via Skype™ to Omega Zero
i was thinking.. would there be a way with jpans hacked enging and the Rtc patch to check the palettes and then in a level script checks if it is day time and then goes to a pointer and has special 0x97 to generate a wild battle or something and if the palettes are dark it goes to a pointer that jumps to a headbutt tree pokemon but that wouldn't be very useful :\
__________________
Reply With Quote
  #15    
Old January 24th, 2010, 02:39 AM
HackMew's Avatar
HackMew
Mewtwo Strikes Back
 
Join Date: Jun 2006
I did it differently, ages ago. Here's a short video. Basically, in my RTC + D/N system, there are 4 times of day.
  • 0 = Morning
  • 1 = Afternoon
  • 2 = Evening
  • 3 = Night
Determing wheteher it's day or night it's pretty easy. I just look at the MSB, which is always 0 during day time, and 1 during night time. Then, right after the random wild Pokémon index has been choosen, I check if that number is odd or even. If the wild Pokémon index is even while day time, nothing happens. If the the index is odd while day time, instead, the value is XORed with 0x1, making it odd. Analog thing for night time. This means on AM, the first Pokémon in the list is for day time, the second one is night time, and so on.
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links


Advertise here
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 07:14 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.