• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Development: The 4th gen class split in 3rd gen

17
Posts
12
Years
  • Seen Mar 27, 2014
What exactly is the tool that I should use to find the table with the move data? I was directed to PKSV-UI, but that doesn't seem to be the right tool.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Did you want me to port my Emerald version to FireRed, or are you set?

You know what? Feel free to do it!

I'm beginning to get really frustrated by the coding, as it feels like I fix one thing and another breaks.
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
HAPPY NEW YEAR!

Here's the Emerald hack ported to the other games. I find it amusing that with this hack we got it working for Emerald first, then Ruby, and then FireRed, when usually it's the complete opposite. xD

FireRed (US)
Code:
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0

Ruby (US) 1
Code:
0803BA94: 80 7A
0803BFBE: 00 29
0803BFC0: 00 D0
0803C124: 02 2E
0803C126: 00 DB
0803C12C: 01 28
0803C12E: 00 D0

Emerald (US) 2
Code:
080695E8: 80 7A
08069A5A: 00 29
08069A5C: 00 D0
08069BC4: 02 2F
08069BC6: 00 DB
08069BCC: 01 28
08069BCE: 00 D0

1 Credit to Chaos Rush for the Ruby port; I don't even have a Ruby ROM. xD
2 Credit to colcolstyles for the Emerald hack; I based everything off of his post.

EDIT: Literally no testing was done for the FireRed port. So someone should test it and let me know if it breaks everything. But I really don't see that happening...
 
Last edited:

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
FireRed (US)
Code:
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0
EDIT: Literally no testing was done for the FireRed port. So someone should test it and let me know if it breaks everything. But I really don't see that happening...

I did a very quick test. And it has the opposite bug that my original code did. The physical attacks work fine, the special attacks do no damage at all.

EDIT: Never Mind. It was a leftover from the old code causing it. My bad. :)
 
Last edited:

Darthatron

巨大なトロール。
1,152
Posts
18
Years
The code doesn't work. I set a break on read of the battle data, and the game only ever reads the physical stats - regardless of whether the attack in question is physical or special. In theory, this wouldn't be too hard to fix, but I can't see a way of doing it without a hijack at the moment.

The offending code in BPRE is at 0x3ED6E. It always loads from 0x02023BE6 - the physical attack stat of the Pokémon in question. (Obviously, it can load from other slots as well - point is - it always loads the physical attack stat.)

It is immediately followed by another few load commands which then get the physical defense of the opposing Pokémon.

Obviously - we could hijack this routine in a rather unattractive manner, and force it to recalculate the physical/special byte (as it CAN potentially be overwritten by this point) and then get the correct respective bytes from there.

I'm a bit tired right now, so I hope this makes sense. And I hope it helps explain some of the problems we've been having. Obviously, I haven't checked - but this could be the same on other ROMs like RSE as well - so I'd check carefully if I were you!

Jambo51 out!
It loads both stats, doesn't it? Physical to r7 and Special to r8..?
Code:
0803ED6E loc_0803ED6E:                           @ CODE XREF: sub_0803ECEC+6Cj
[S-HIGHLIGHT]0803ED6E                 LDRH    R7, [R6,#2]               //Attacker's Attack stat
[/S-HIGHLIGHT]0803ED70                 LDR     R2, [SP,#0x4C+var_48]
0803ED72                 LDRH    R2, [R2,#4]
0803ED74                 STR     R2, [SP,#0x4C+var_38]
[S-HIGHLIGHT]0803ED76                 LDRH    R3, [R6,#8]               //Attacker's Special-Attack stat
0803ED78                 MOV     R8, R3
[/S-HIGHLIGHT]0803ED7A                 LDR     R0, [SP,#0x4C+var_48]
0803ED7C                 LDRH    R0, [R0,#0xA]
0803ED7E                 STR     R0, [SP,#0x4C+var_34]
It later loads the correct value in to r5.

Physical:
Code:
0803F26E loc_0803F26E:                           @ CODE XREF: sub_0803ECEC+554j
0803F26E                 LSLS    R0, R0, #1
0803F270                 ADDS    R1, R0, R2
0803F272                 LDRB    R1, [R1]
[S-HIGHLIGHT]0803F274                 MOVS    R5, R7
[/S-HIGHLIGHT]0803F276                 MULS    R5, R1
0803F278                 ADDS    R2, #1
0803F27A                 ADDS    R0, R0, R2
0803F27C                 LDRB    R1, [R0]
0803F27E                 MOVS    R0, R5
0803F280                 BL      div_mod
0803F284                 ADDS    R5, R0, #0
Special:
Code:
0803F3CA loc_0803F3CA:                           @ CODE XREF: sub_0803ECEC+6C2j
0803F3CA                 LSLS    R0, R0, #1
0803F3CC                 ADDS    R1, R0, R2
0803F3CE                 LDRB    R1, [R1]
[S-HIGHLIGHT]0803F3D0                 MOV     R5, R8
[/S-HIGHLIGHT]0803F3D2                 MULS    R5, R1
0803F3D4                 ADDS    R2, #1
0803F3D6                 ADDS    R0, R0, R2
0803F3D8                 LDRB    R1, [R0]
0803F3DA                 MOVS    R0, R5
0803F3DC                 BL      div_mod
0803F3E0                 ADDS    R5, R0, #0
Please correct me if you aren't getting this too. :\
Note: All code relevant to FireRed.

EDIT: Never mind this stuff. We worked out that it's fine.
 
Last edited:

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I think I've found the code which causes the Mirror Coat/Counter bug in Fire Red.
Change it to this, and it should hopefully fix it.
Code:
0801F6C2: 86 [B]7A[/B]
0801F908: [B]00[/B] 2E
0801F90A: 41 [B]D1[/B]

Also, Darthatron's routine for showing the images is slightly buggy. It turns out the move index is actually DMA protected, but in a really odd way. It only gets DMA shifted after certain actions are taken within the game's overworld. Anyway - to solve this, change the parts in BOLD in Darthatron's original routine (or just copy this routine, I suppose), and then follow Darthatron's original post to insert it.

Code:
.align 2
.thumb
Start:
 push {r0-r4}
 ldr r0, .CurMoveIndex
 ldrb r1, [r0]
 lsl r1, r1, #1
 [B]ldr r0, .Move_List_Loc
 ldr r0, [r0]
 ldr r3, .number
 add r0, r0, r3
[/B] add r0, r0, r1
 ldrh r3, [r0]
 [B]cmp r3, #0x0
 beq Finish
[/B] lsl r0, r3, #1
 add r0, r0, r3
 lsl r0, r0, #2
 ldr r1, .MoveBase
 add r0, r0, r1
 ldrb r4, [r0, #10]
 lsl r0, r4, #1
 add r4, r4, r0
 lsl r4, r4, #6
 ldr r0, .SplitImages
 add r0, r4
 ldr r1, .VRAM
 mov r2, #0x30
 swi #0xB 
 ldr r0, .SplitImages
 add r0, r4
 add r0, #0x60
 ldr r1, .VRAM
 mov r2, #0x1E
 lsl r2, #0x04
 add r1, r1, r2
 mov r2, #0x30
 swi #0xB 
Finish:
 pop {r0-r4}
 ldr r4, .Some_Offset
 ldr r0, [r4]
 ldr r1, .Return_Addr
 bx r1
.align 2
.MoveBase:  .word 0x08250C04
[B].number: .word 0x00003258
[/B].CurMoveIndex: .word 0x0203B16D
[B].Move_List_Loc:  .word 0x0203B140
[/B].VRAM:   .word 0x06001800
.SplitImages: .word 0x08YYYYYY
.Some_Offset: .word 0x0203B148
.Return_Addr: .word 0x0813A17D
 
Last edited:

Darthatron

巨大なトロール。
1,152
Posts
18
Years
Thanks for that, Jambo. We still need to go about finding a better location to put it as well. I can't believe I didn't notice it was DMA protected.
 
22
Posts
12
Years
  • Seen Aug 4, 2019
WOw
The Emerald patch should be really helpful
Thanks for all the amazing effort, everybody!
Kicking myself at the timing, just a month later and my Touhoumon hack would have had a Phys/Spec split.
As every move is customised and stat spreads and movepools of 67 are already done though, it'd be more effort than it's worth in a game already full of many unique features, I suppose.
But my third hack will really love this a whole lot, and it's all thanks to the persistence of the people involved in this thread!
 
60
Posts
17
Years
  • Seen Mar 14, 2024
I want to find a better place to put it. Right now, the image showing if it's physical/special/status appears a frame before the rest of the screen is loaded. :\ I mean, it's not that bad. I just don't love it.

Change these bytes:
Code:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]

Here's the source:
Code:
.align 2
.thumb
Start:
	push {r0-r4}
	ldr r0, .CurMoveIndex
	ldrb r1, [r0]
	lsl r1, r1, #1
	ldr r0, .Move_List
	add r0, r0, r1
	ldrh r3, [r0]
	lsl r0, r3, #1
	add r0, r0, r3
	lsl r0, r0, #2
	ldr r1, .MoveBase
	add r0, r0, r1
	ldrb r4, [r0, #10]
	lsl r0, r4, #1
	add r4, r4, r0
	lsl r4, r4, #6
	
	ldr r0, .SplitImages
	add r0, r4
	ldr r1, .VRAM
	mov r2, #0x30
	swi #0xB
	
	ldr r0, .SplitImages
	add r0, r4
	add r0, #0x60
	ldr r1, .VRAM
	mov r2, #0x1E
	lsl r2, #0x04
	add r1, r1, r2
	mov r2, #0x30
	swi #0xB
	
Finish:
	pop {r0-r4}
	ldr r4, .Some_Offset
	ldr r0, [r4]
	ldr r1, .Return_Addr
	bx r1

.align 2
.MoveBase:		.word 0x08250C04
.CurMoveIndex:	.word 0x0203B16D
.Move_List:		.word 0x02003268

.VRAM:			.word 0x06001800
.SplitImages:	.word 0xYYYYYYYY

.Some_Offset:	.word 0x0203B148
.Return_Addr:	.word 0x0813A17C+1

Change the .SplitImages (0xYYYYYYYY) pointer to where ever you have the images.
The images are uncompressed. And should look like this:
nrzzL.png

They need to be in this order. Use TileMolester or something to insert them.
They use the same palette as the Types, which is located at 0x08E95DBC in a clean FireRed ROM. :)

I have a problem with this...

The images appear fine while outside battle...

but, if we check summary screen while in battle, all attacks have physical icon...

could you fix this problem?

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

EDIT: It works fine even it's in battle after I use Jambo's fix code...

splittest.jpg


thank you~
 
Last edited:
5
Posts
12
Years
  • Seen Feb 26, 2012
HAPPY NEW YEAR!

FireRed (US)
Code:
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0

I'm sorry for asking a question you probably think is stupid, but how/where do we insert this code?
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
I'm sorry for asking a question you probably think is stupid, but how/where do we insert this code?

You need to open the ROM in a hex editor and then change the bytes at the locations specified. Search the tutorials section for hex editing tutorials.

And I don't think it's stupid. In fact, I'm glad you asked how to do it, rather than asking me to do it for you. :)
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I've spotted what could potentially be a huge bug in the FR version of the hack. I'm not 100% certain exactly what it actually breaks, but it breaks something.
I can confirm that it completely breaks the functionality of Blaze, Torrent, Overgrow and probably (although I have yet to see the check itself) Swarm. It also breaks some sort of check which would normally halve the amount of damage dealt for certain types of attack under certain circumstances.

To see evidence for yourself, go to 0x3F102. You will see there are a bunch of type based checks, which read the category byte kept in R9. Under normal circumstances, the game will check the type, and if it matches, will branch link to 0x19F18, passing 0xE in R0, 0x0 in R1, 0x0 in R2 and a changeable byte (seems to depend on the type) in R3. What this checks and returns, I do not know.

However, due to the split changes implemented, none of these checks ever pass, and as such, whatever this piece of functionality is, as well as the abilities named above, simply do not work.
 
60
Posts
17
Years
  • Seen Mar 14, 2024
I don't know this post will help or not....
I also attacked the B/W System (the upgrade of DPSS)

This is a part of the readme file from Japanese Community DPSS about the changes... I simply used google translate...

Damage Calculation routine edited, FR offset 0x0803e458 (Emerald 0x080690bc), this routine fixes ThickFat calculation and Rock-type while Sandstorm is in effect... also talking about Register 11 (?)

Counter/Mirror Coat FR 0x0801ee94 and EM 0x08047b04
I guess we already fix this problem

Processing Accuracy
FR offset 0x0801d5d4 and EM offset 0x0804629e
it fixes "Hustle" Ability

Badges Effect
FR routines: 0x0803e458 0x080144f8
EM routines: 0x0803cb54 0x080690bc

Item processing
FR routine 0x0803e458 and EM 0x080690bc
fixes move-based item such as sharp beak, black belt, etc



■変更箇所

※以下に示す箇所はアセンブリプログラムです。スクリプト処理とは全く異なるので、アセンブリ
に詳しくない場合は絶対に触らないで下さい。

◆ダメージ計算
0x0803e458(EMにおいては0x080690bc)以降の処理を色々と変更。以下、変更の概略

・オフセットの無駄を 8byte 省く
・上記によって生じたスペースを命令を挿入したい箇所に移行
・それに伴って不正な参照をする命令を正常な参照位置に変更
・以下の処理を上記のスペースと前後の命令を書き換えることで実現
‐「レジストリ11をメモリに退避」
‐「レジストリ11に属性用の変数を読み込む」
‐「攻撃・特殊依存を決定する命令でタイプを使用する代わりに技属性を使用」

このサブルーチン内部にある特性「あついしぼう」のダメージ半減処理を以下のように変更

・未使用のオフセット1byte を命令を挿入したい箇所に移行
・不正な参照を正常な参照位置へ変更
・「あついしぼう」の特攻半減処理を技の威力を半減させる命令に変更

このサブルーチン内で特殊技でない時の分岐先をサブルーチン終了処理から天候処理に差替え

天候処理の内部に天候砂嵐時の岩タイプ特防1.5倍の擬似処理を追加
具体的には次の通りである

・天候が砂嵐である
・技の効果対象のタイプに岩が含まれている
・使用した技の属性が特殊である
・上記条件を全て満たす時、ダメージを1.5で除算する

◆倍返し処理
0x0801ee94(EMにおいては0x08047b04)以降のカウンターとミラーコートのサブルーチン処理
を以下のように変更

・タイプ変数の呼び出しを属性変数の呼び出しに変更
・タイプに基づく比較命令を属性に基づく比較命令に変更

◆命中率処理
0x0801d5d4(EMにおいては0x0804629e)以降の命中率に関する処理を以下のように変更

・タイプ変数の呼び出しを属性変数の呼び出しに変更
・特性「はりきり」処理内部にあるタイプに基づく比較命令を属性に基づく比較命令に変更

◆バッジ効果
攻撃、防御、特攻、特防については 0x0803e458(EMにおいては0x080690bc)以降、素早さに
ついては 0x080144f8(EMにおいては0x0803cb54)以降の処理において、バッジ取得によるの各
ステータスの倍率を 1.1倍から1倍に変更。

◆アイテム所持効果変更
電気玉の処理は0x0803e458(EMにおいては0x080690bc)以降のコードを変更。
以下のアイテムについて
「ぎんのこな」「メタルコート」「やわらかいすな」「かたいいし」「きせきのタネ」
「くろいメガネ」「くろおび」「じしゃく」「しんぴのしずく」「するどいくちばし」
「どくバリ」「とけないこおり」「のろいのおふだ」「まがったスプーン」「もくたん」
「りゅうのキバ」「シルクのスカーフ」「うしおのおこう」「のんきのおこう」
0x083a06f8(EMにおいては0x0855cee8)以降のアイテムデータの汎用変数を0xaから0x14
に変更。
 

MegaKuriboh

Yare Yare Daze
811
Posts
15
Years
I just found a glitch.

Apperently, if you use a Flash Fire boosted Fire attack the game crashes (Goes back to the gameboy screen)
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I just found a glitch.

Apperently, if you use a Flash Fire boosted Fire attack the game crashes (Goes back to the gameboy screen)

Mate, we have known about this glitch for Months! Darthatron's version of the split works nearly fully as intended, and doesn't carry the glitches mentioned above. The only glitch it does carry with it is easy enough to fix.
 
60
Posts
17
Years
  • Seen Mar 14, 2024
Does anyone also confirm that Hidden Power does minimal damage in the latest patch (I only tested Fire Red)?

the other things:
- rock-type won't get boosted sp.def while sandstorm
- sunny day and rain also won't affect fire and water moves' power
- abilities that boost certain type's power like "Blaze" don't work (as Jambo said)
- power-raising items also don't work...
 
Last edited:

Ivee

Ask me about Trailblazer :3
66
Posts
14
Years
  • Seen May 22, 2019
Rock types didn't get the special defense sandstorm boost til gen 4.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Does anyone also confirm that Hidden Power does minimal damage in the latest patch (I only tested Fire Red)?
Can't say I've ever tested it, so I don't know.

the other things:
- rock-type won't get boosted sp.def while sandstorm

This is an effect that apparently was introduced in Gen 4. It's not a bug, it's just how it worked in Gen 3.

- sunny day and rain also won't affect fire and water moves' power
- abilities that boost certain type's power like "Blaze" don't work (as Jambo said)
- power-raising items also don't work...

These definitely do not work under Darthatron's system, but there is a fix available. It's not ideal, but it works.
 
Last edited:
Back
Top