Advertiser Content

Development Pokémon Fire Red Hacked Engine Page 23

Started by JPAN September 10th, 2009 4:14 AM
  • 269346 views
  • 574 replies
Seen 1 Hour Ago
Posted 1 Day Ago
299 posts
11.4 Years
Why the HELL would you make such a great resource and then ruin it by making it come with the con of deleting every damn script in the game? Seriously...please explain to me how this makes even the slightest bit of fricken sense. It's like you didn't put a single thought into this.
Use the Tool instead of the patch?

DrFuji

Heiki Hecchara‌‌

Age 26
Male
Aussie
Seen 5 Hours Ago
Posted 2 Days Ago
1,616 posts
10.1 Years
Why the HELL would you make such a great resource and then ruin it by making it come with the con of deleting every damn script in the game? Seriously...please explain to me how this makes even the slightest bit of fricken sense. It's like you didn't put a single thought into this.
From my point of view, that makes it better as it frees up space by clearing scripts that I was never going to use. People are suppossed to use this to build things from scratch, not retread Kanto.

That being said, if you really want to use JPAN's engine and keep all of the in-game scripts, download the hack tool applier in the first post. It will also allow you to choose as many or as little of the features you want.

Lunos

Random Uruguayan User

Male
Montevideo (Uruguay)
Online now
Posted 1 Day Ago
2,055 posts
11 Years
After applying the backsprite switch fix from here, I got a bug that caused the player's backsprite to inherit the default hero palette on every frame after the first.

EDIT:
I'm not sure if anyone else has had that issue, but I found a way to fix it by modifying the assembly routine JPAN had written:

I've tested with a few different backsprites and it appears to work as desired.

.text
.align 2
.thumb
.thumb_func

new_rot_start:	
	lsl r1, r4, #0x1
	add r1, r1, r4
	lsl r1, r1, #0x2
	add r2, r1, r6
	ldr r0, [r2]
	push {r2-r5}
	mov r2, #0x80
	ldr r1, .first_male_back
	lsl r2, r2, #0x4
	mov r4, #0x0

compare_loop:
	cmp r0, r1
	beq other_tag
	add r1, r1, r2
	add r4, #0x1
	cmp r4, #0x1A
	blt compare_loop
	
print_picture:	
	pop {r2-r5}
	lsl r1, r4, #0x1
	add r1, r1, r4
	lsl r1, r1, #0x2
	add r1, r1, r7
	ldr r1, [r1]
	ldrh r2, [r2, #8]
	lsr r2, r2, #0x1
	swi #0xb
	ldr r1, .return_addr
	bx r1
	
.hword 0x0000
.first_male_back: .word 0x08E69EBC
.return_addr:	.word 0x08007641


other_tag:	
	cmp r4, #0xA
	blt FR_hero
	sub r4, #0xA
		
change_picture:	
	cmp r4, #0x4		
	blt all_maned
	sub r4, #0x4
	b change_picture
		
FR_hero:
	cmp r4, #0x5		
	blt all_maned
	sub r4, #0x5
	b FR_hero
		
all_maned:	
	mov r5, r0
	ldr r0, .var_4062
	bl call_var_load
	cmp r0, #0x0
	beq print_old_picture
	ldr r1, .table_addr
	lsl r3 ,r0, #0x5
	lsl r0, r0, #0x3
	add r0, r0, r3
	lsl r5, r4, #0x3	@r5 = frame number
	add r4, r1, r5	
	add r4, r0, r4
	ldr r3, [r4]
	cmp r3, #0x0
	beq print_old_picture
	ldr r0, [r4, #0x4]
	ldr r1, .first_pallette_slot
	mov r2, #0x10
	swi 0xb
	mov r4, #0xc0
	add r1, r1, r4
	swi 0xb
	ldr r1, .pallete_dump
	cmp r5, #0x0			@first frame
	bne Other
	swi 0xB					@player first frame as normal
	add r1, r1, r4
	mov r8, r8				@trainer pal fix
	b Continue

Other:
	mov r8, r8				@player pal fix
	add r1, r1, r4
	swi 0xB
	
Continue:
	mov r0, r3
	b print_picture
	
print_old_picture:	
	add r0, r5, #0x0
	b print_picture

call_var_load:	
		ldr r1, .var_load
		bx r1
		
.var_load:	.word 0x0806E569
.var_4062: 	.word 0x00004062		
.table_addr:	.word 0x081ab1d8
.first_pallette_slot:	.word 0x05000200
.pallete_dump: .word 0x020377f8
How would one go about using this?
Is it just a matter of compiling, inserting it in the ROM and the Var 0x4062 will do the rest or...?
Seen 4 Weeks Ago
Posted March 19th, 2019
202 posts
2.1 Years
For anyone wondering, you should NOT apply this to a Clean Fire Red Rom, but instead, use JPAN's Clearing Patch, that clears out all of the scripts, signposts, and sprites in every map. Otherwise, some bugs may occur. You can find it in the OLD rom hacking thread, for those who can't find it anymore, here is a link.

http://www.pokecommunity.com/showpost.php?p=5005730&postcount=252
(That is his post.)
dead link? can't download it.

Edit: NVM, You don't even need it for the ips.

I can't download the v1.0 it is saying that it is no longer available
v1.0 doesn't mean for FireRed 1.0, it's just v1.0 of his tool/ips. You're better off downloading v1.1 because of bug fixes, but it is still applied to FireRed 1.0.
Male
Seen 18 Hours Ago
Posted 18 Hours Ago
122 posts
3.6 Years
Here's a small 'createsprite' fix for anyone using this engine. The script command createsprite's sprite number argument only allows for a byte, so this fix loads a table number from free ram and removes register size limits to allow you to create a sprite from any table.

I used free ram instead of a temp variable to remove any erroneous table loading that might occur in old scripts or other areas where the create_npc function is used. This method retains functionality and doesn't require changing old scripts to accomodate it.

To insert, just compile the following code, and copy the hex values at each .org offset from the .bin file to your .gba file. (after defining your own free offset and free ram byte. hint, 0x0203e000 - 0x0203f000 is free).

Spoiler:

.text
.thumb
.align 2
/*
usage:
	writebytetooffset 0x[table_num] RAM_SETTER
        createsprite 0x[sprite_num] etc etc...
*/

@ customize this
.equ RAM_SETTER, 0x02xxxxxx

.equ offset, 0xYYYYYY   @ where the function will go
.equ rom, 0x08000000


@ remove byte limit
@	prevent lnpc_new from removing upper byte from sprite num
.org 0x5ea0a, 0xff
	.word 0x0

@ script cmd location
.org 0x15fc5c, 0xff
	.word offset+rom+1

@ function
.org offset, 0xff
main:
	push {r4-r6,lr}
	mov r6, r8
	push {r6}
	sub sp, #0x8
	mov r5, r0
	ldr r0, [r5, #0x8]
	ldrb r1, [r0]	@sprite number
	ldr r6, =RAM_SETTER
	ldrb r6, [r6]
	cmp r6, #0x0
	beq createSprite
getTable:
	lsl r6, r6, #0x18
	lsr r6, r6, #0x10
	orr r1, r6	
createSprite:
	mov r8, r1
	ldr r6, =(0x0806b660 +1)
	bx r6
Seen March 19th, 2019
Posted March 19th, 2019
5 posts
213 Days
Why is that breaking every one rom im applying it to. Base fire red - complete white screen forever. Omega red hack - reset after oaks monologue. Some other hack that I downloaded only for tests - not crashing but there were looped trees and water everywhere. (cannot post images yet so you must believe me)

That's how I did it:
Used .isp file to patch rom.
Opened rom to check if it still works.

Avara

Female
Izantine
Seen 4 Hours Ago
Posted 4 Hours Ago
1,083 posts
7.9 Years
Why is that breaking every one rom im applying it to. Base fire red - complete white screen forever. Omega red hack - reset after oaks monologue. Some other hack that I downloaded only for tests - not crashing but there were looped trees and water everywhere. (cannot post images yet so you must believe me)

That's how I did it:
Used .isp file to patch rom.
Opened rom to check if it still works.
The patch was designed to be applied to a FR ROM for hackers to use as a base at the beginning of development, so it's not going to work if you apply it over the top of an existing ROM hack. RE: It not working on FR, are you sure it's the 1.0 version you have?
Seen March 19th, 2019
Posted March 19th, 2019
5 posts
213 Days
I've used basic fire red that I had on disc, after it didn't work I downloaded it from and also tried to use it. First of them is 1.1 version of fire red, second was not precised. (,,rev 1"?)
If you are asking about hacked engine version, it was ,,Pokemon_Fire_Red_Hacked_v1.1.zip" file.

Edit. Oh, nice. It didn't work with clean fire red but worked with ,,Pokemon Fire Sun Hard + 900" rom. (just deleted some scripts, that's why I couldn't see first city after leaving house)
But I would like to know how to make it working with clean fire red.

Avara

Female
Izantine
Seen 4 Hours Ago
Posted 4 Hours Ago
1,083 posts
7.9 Years
I've used basic fire red that I had on disc, after it didn't work I downloaded it from and also tried to use it. First of them is 1.1 version of fire red, second was not precised. (,,rev 1"?)
If you are asking about hacked engine version, it was ,,Pokemon_Fire_Red_Hacked_v1.1.zip" file.

Edit. Oh, nice. It didn't work with clean fire red but worked with ,,Pokemon Fire Sun Hard + 900" rom. (just deleted some scripts, that's why I couldn't see first city after leaving house)
But I would like to know how to make it working with clean fire red.
It needs to be the 1.0 version of FireRed you have in order to get the hacked engine patch to work =)

Avara

Female
Izantine
Seen 4 Hours Ago
Posted 4 Hours Ago
1,083 posts
7.9 Years
Thanks, not it works. And now it's bugless. (for now)

Is there any way to keep all default scripts with this engine hack?
That's great, glad you got it sorted! It's been actual years since I used this engine so not 100% but I think JPAN cleared out all the scripts from the patch version deliberately so that people could use it as a "clean slate". If you'd prefer, there's a tool you can use to apply features from the engine without using the patch - maybe that'd be better for you if you want to keep the original scripts?
Seen March 19th, 2019
Posted March 19th, 2019
5 posts
213 Days
That's great, glad you got it sorted! It's been actual years since I used this engine so not 100% but I think JPAN cleared out all the scripts from the patch version deliberately so that people could use it as a "clean slate". If you'd prefer, there's a tool you can use to apply features from the engine without using the patch - maybe that'd be better for you if you want to keep the original scripts?
Where can I find that tool? It sounds very interesting.
Advertiser Content