HackMew's Knowledge Page 4

Started by HackMew December 1st, 2007 2:21 AM
  • 107709 views
  • 122 replies
Seen June 6th, 2014
Posted May 18th, 2014
84 posts
13.7 Years
i have question about compiling
i understand how it was done and all but how was it compiled into the rom? i dont see where that happened :(

and also concerning palettes if i was making a titlescreen would it be possible to repoint the palettes to a different offset wouldnt that make it easier for using images that used 32 palettes or more?
ATL
Seen June 9th, 2015
Posted October 3rd, 2010
397 posts
14.2 Years
I have a problem...I've been doing the ASM tutorial but whenever I start the debugger and the Rom, it always gives me an error and shuts out of the rom with an error report. It says "VBA-over.ini not found" on the command prompt.





Please warm my eggs...I'll be sure to return the favor

From now one, if you haven't contacted me yet....I will not accept hacks unless they are at least in progressing hacks. So if you want my help, get some screenshots first.
Seen October 2nd, 2014
Posted August 29th, 2010
713 posts
15.3 Years
I have a problem...I've been doing the ASM tutorial but whenever I start the debugger and the Rom, it always gives me an error and shuts out of the rom with an error report. It says "VBA-over.ini not found" on the command prompt.
if you have the ordinary VBA, copy it's .ini file and paste the same directory as the debugger.
ATL
Seen June 9th, 2015
Posted October 3rd, 2010
397 posts
14.2 Years
if you have the ordinary VBA, copy it's .ini file and paste the same directory as the debugger.
Hmm...how would I do that excatly? And what's the ordinary VBA?





Please warm my eggs...I'll be sure to return the favor

From now one, if you haven't contacted me yet....I will not accept hacks unless they are at least in progressing hacks. So if you want my help, get some screenshots first.
Age 29
Male
Location: United States
Seen June 11th, 2013
Posted June 24th, 2012
64 posts
14.8 Years
I was wondering, is the
.VAR:
     .word 0x020270B6 + (0x800D * 2)
in the ASM code in lesson 1 for the buffer part of the script? I don't know since I'm still new to assembly and scripting. The main reason I'm asking is because I'd like to know how I can modify the .word portion. Additionally, what is the
+ (0x800D * 2)
for?

Edit: One thing I forgot to mention: I'm hacking Fire Red.

I found out that 0x800D is the buffer (yay, scripting tutorials), but what's the times 2 thing for?

Also, what does address 0x020270B6 do (in Fire Red)?
Occasionally I do things related to ROM hacking, especially assembly stuffs.

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
I was wondering, is the
.VAR:
     .word 0x020270B6 + (0x800D * 2)
in the ASM code in lesson 1 for the buffer part of the script? I don't know since I'm still new to assembly and scripting. The main reason I'm asking is because I'd like to know how I can modify the .word portion. Additionally, what is the
+ (0x800D * 2)
for?

Edit: One thing I forgot to mention: I'm hacking Fire Red.

I found out that 0x800D is the buffer (yay, scripting tutorials), but what's the times 2 thing for?

Also, what does address 0x020270B6 do (in Fire Red)?
That is the address of the variable '0x800D' (more commonly known as 'LASTRESULT') in the WRAM. The reason that "+ (0x800D * 2)" is appended to the main '0x020270B6' part is that if you multiply 0x800D by 2 and then add it to the main part, you get '0x020370D0' which is the actual address of '0x800D'. HackMew formatted it that way for convenience. If you wanted to use variable '0x8004' instead, all you have to do is change '0x800D' to '0x8004'. Otherwise, you'd have to calculate what address '0x8004' is at and that's just no fun.

Brother of Vrai
Seen July 8th, 2014
Posted July 31st, 2010
2 posts
12.9 Years
Hi, how exactly the extended script looks like regarding to the Trainer ID + Secret ID in the 1st ASM Lesson? I just manage to get the Trainer ID to show up but not the Secret ID.

I'll just recopy the script part from the 1st Lesson so anyone of you don't have to look back:
Spoiler:
#dynamic 0x800000

#org @start
callasm YourOffset
buffernumber 0x0 LASTRESULT
msgbox @secret 0x2
end

#org @secret
= Sshh! I'll tell you a secret[.]\nYour Secret ID is [buffer1]!


and the ASM that I'm based on (Emerald):
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global lesson1

main:
	push {r0-r1, lr}
	ldr r0, .PLAYER_DATA
	ldr r0, [r0]
	ldr r1, .VAR
	ldrh r0, [r0, #0xA]
	strh r0, [r1]
	ldr r0, .PLAYER_DATA
	ldr r0, [r0]
	ldrh r0, [r0, #0xC]
	strh r0, [r1, #0x2]
	pop {r0-r1, pc}


.align 2
.PLAYER_DATA:
	.word 0x03005D90
.VAR:
	.word 0x020275D6 + (0x800D * 2)


And, do you set the [buffer1] twice in the strings area or split it to something like [buffer1] and [buffer2]?

I really like to know how it's done because the extended script isn't covered in any of the tutorials (only the crucial asm part was covered in the end of 2nd ASM Lesson).

colcolstyles

Yours truly

Male
The Bay Area
Seen May 18th, 2019
Posted August 13th, 2012
1,588 posts
15 Years
Hi, how exactly the extended script looks like regarding to the Trainer ID + Secret ID in the 1st ASM Lesson? I just manage to get the Trainer ID to show up but not the Secret ID.

I'll just recopy the script part from the 1st Lesson so anyone of you don't have to look back:
Spoiler:
#dynamic 0x800000

#org @start
callasm YourOffset
buffernumber 0x0 LASTRESULT
msgbox @secret 0x2
end

#org @secret
= Sshh! I'll tell you a secret[.]\nYour Secret ID is [buffer1]!


and the ASM that I'm based on (Emerald):
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global lesson1

main:
	push {r0-r1, lr}
	ldr r0, .PLAYER_DATA
	ldr r0, [r0]
	ldr r1, .VAR
	ldrh r0, [r0, #0xA]
	strh r0, [r1]
	ldr r0, .PLAYER_DATA
	ldr r0, [r0]
	ldrh r0, [r0, #0xC]
	strh r0, [r1, #0x2]
	pop {r0-r1, pc}


.align 2
.PLAYER_DATA:
	.word 0x03005D90
.VAR:
	.word 0x020275D6 + (0x800D * 2)


And, do you set the [buffer1] twice in the strings area or split it to something like [buffer1] and [buffer2]?

I really like to know how it's done because the extended script isn't covered in any of the tutorials (only the crucial asm part was covered in the end of 2nd ASM Lesson).
The ASM looks fine as far as I can tell. Here's how I would do the script:
#dynamic 0x800000

#org @start
callasm YourOffset
buffernumber 0x0 0x800D
buffernumber 0x1 0x800E
msgbox @secret 0x2
end

#org @secret
= Sshh! I'll tell you a secret[.]\nYour Secret ID is [buffer1]! Also, your Trainer ID is [buffer2].
So, yes, you would use 'buffer2'. Just remember that you have to buffer the second number and use '0x01' as the first parameter. It's a little counterintuitive because the number stored in 'buffer 0x0' is accessed via 'buffer1' and the number stored in 'buffer 0x1' is accessed via 'buffer2' but you'll get the hang of it. Also note that since you stored the second number at 'r0 + #0x02', the number would be contained in the variable after LASTRESULT (0x800D), i.e., 0x800E.

Brother of Vrai
Seen July 8th, 2014
Posted July 31st, 2010
2 posts
12.9 Years
Thank you!

Once, I thought I had to make some comparative function. The closest thing I did was:

#dynamic 0x800000

#org @start
callasm YourOffset
buffernumber 0x0 LASTRESULT
buffernumber 0x1 LASTRESULT
msgbox @secret 0x2
end

#org @secret
= [buffer1] and [buffer2].
All this while, I thought that the LASTRESULT (0x800D) was the only carrier for an output/result, lol. I should be more careful in reading any scripts/tutorials after this.

So, yes, you would use 'buffer2'. Just remember that you have to buffer the second number and use '0x01' as the first parameter. It's a little counterintuitive because the number stored in 'buffer 0x0' is accessed via 'buffer1' and the number stored in 'buffer 0x1' is accessed via 'buffer2' but you'll get the hang of it. Also note that since you stored the second number at 'r0 + #0x02', the number would be contained in the variable after LASTRESULT (0x800D), i.e., 0x800E.
Thank you again for the reminder, the actual 2nd call is at 0x800F.
Male
In your brain!
Seen December 9th, 2011
Posted May 26th, 2011
49 posts
12.9 Years
Wow, you know alot about hacking pokemon games!
Any one seen an HGSS Starter editor? Dose it exist, probably not. Any one know how to make an editing program? I dont. If you do and want to teach me, pm or vm me about it!
Ongoing challenges:
Ultimate Monotype Challenge: Dragon Type Johto:0/8 Kanto 0/8 Hoenn 0/8 Sinnoh 0/8
Unova 0/8


73% of teenagers would cry if they saw Justin Bieber standing on top of a skyscraper about to jump. If you are the 27% sitting there with popcorn and 3D glasses, screaming b"DO A BACKFLIP!" copy this as your signature!!!
What pokemon games have I finished you ask? Well. Let me start at the beging, and make it aws simple as possible: All of them. Not one of the regular seires has escape the new and everything in between, even all of the Mystery Dungeon games.
Rainbow

All the simple things in life:
Smiling suns, Evil Duxs, and line.

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 25
Male
Hoenn Safari Zone
Seen August 7th, 2020
Posted April 17th, 2017
697 posts
14 Years
This has cleared a few things up for me thanks ^.^, But just a question, do you actually need ASM to script, or can I just never go near ASM and just use XSE to compile scripts without it?
ASM and scripting are two different things. ASM is actual coding that the game uses to manage data. Scripting is string of commands used for events. While scripting can call ASM, ASM isn't needed to script.
Age 28
Female
USA
Seen August 8th, 2013
Posted August 30th, 2012
11 posts
11.9 Years
Thanks, I only have one more question. I can get my scripts to work, but only if I start a completely new file! How do I fix this? I want to be able to load my old file and see the changes I made. Oh and when I load my save-states, I can't go through any doors.
I hope this isn't Chris' sandwich...
~Forestpelt~
Male
Seen August 16th, 2012
Posted October 31st, 2011
2 posts
11.7 Years
I have a question about your debbuger,because the command prompt dysplays this message:

..............
Unknown file type pokemon.

Also,when trying to open a fire red rom,only a white image is displayed in the emulator.

But apart from all this all your tools are exellent,specially xse because I really like scripting in an easy way(not like pokescript or scripted).

Sorry for any mistake I commit but English is not my native language.
Male
Seen November 2nd, 2016
Posted January 9th, 2013
94 posts
12.8 Years
This is way more complicated than it needs to be... 080440F4 is the shiny decision routine. Go to 0804411E and replace it with 00 20. This is the spot that it checks whether the value is greater or less than 7. Replacing that will make the value always 00 right before the check, and that means all pokemon will be shiny. Much easier to replace 2 bytes.

just throwin that out there