PDA

View Full Version : Research: The 4th gen class split in 3rd gen


Pages : [1] 2

JJames19119
October 15th, 2010, 11:21 PM
The japanese so far have done quite a few things we haven't, even in the field of hacking. Take a look around the Super Mario World hacking community and you'll see a few japanese hackers getting the jump on even the biggest hackers in the english community. When it comes to Pokemon, this doesn't change; they have implemented the class split that came with 4th gen into the 3rd gen games.

For anyone a little confused, I'll elaborate; The class split, known to the japanese as the DPSS (Diamond Pearl Skill Split) system, is the system that allows the game to decide if a move is physical or special based on the move itself, not it's type. Fire moves in 3rd gen have always been special, but with the coming of 4th gen, we had moves such as Flare Blitz that was physical, not special. Even older moves got this treatment; Hyper Beam was now special, with it's replacement for the physical side becoming Giga Impact. Blaze Kick and Leaf Blade, moves introduced in 3rd gen, were now physical as they should be.

Some say this implementation came a generation or two too late. A few esteemed hackers have went about and fixed this. And now I come to you with the code that will change a third generation game's mechanics to use the DPSS system.

From what I know, the move data itself must be changed in order to take full advantage of this system. The new mechanics use the second byte in the padding data at the end of a move entry. A Special Pound for example, would be formatted like so:

00 28 00 64 23 00 00 00 33 00 01 00

Note the 01 near the end, normally this is 00. In the move data, zero (00) is physical, and non-zero (01 and higher) is special.

As for the mechanics themselves, I'm not too sure on how they work myself, sadly. I hate to look like a fake, but really, the most I did was reverse engineering, adjustment and lots of cross comparing. However, I can assure you, I've tested it many times under many different circumstances, I can attest that it does indeed work as it's supposed to.

Before I start providing any patches, I will post some diff tables laying out the changes in bytes and byte sequences between an unmodified ROM and a ROM with the patch applied. These diffs are made using Fire Red ROMs.


00014E28 | 6E | 00014E28 | 64 |
------------------------------------------------------------------------
00014F10 | 6E | 00014F10 | 64 |
------------------------------------------------------------------------
0001DF38 | 78 | 0001DF38 | 7A |
------------------------------------------------------------------------
0001E0C0 | 08 | 0001E0C0 | 00 |
------------------------------------------------------------------------
0001F6C0 | 78 | 0001F6C0 | 7A |
------------------------------------------------------------------------
0001F908 | 08 | 0001F908 | 00 |
------------------------------------------------------------------------
0001F988 | 08 | 0001F988 | 00 |
------------------------------------------------------------------------
0003ECE8 | 57 | 0003ECE8 | 5F |
0003ECF0 | 4E 45 E0 B4 8B B0 | 0003ECF0 | 56 4D 44 46 F0 B4 |
0003ECF8 | 06 1C 01 91 02 92 13 98 | 0003ECF8 | 8B B0 06 1C 01 91 02 92 |
0003ED00 | 99 9A 9C 1B 04 | 0003ED00 | 98 99 9A 17 9C |
0003ED08 | 0C 03 93 00 04 03 0C | 0003ED08 | 04 1B 0C 03 93 00 04 |
0003ED10 | 09 06 0F 0E 12 06 0E | 0003ED10 | 03 0C 09 06 0F 0E 06 |
0003ED18 | 04 92 24 06 0E 00 25 | 0003ED18 | 12 0E 04 92 06 24 0E |
0003ED20 | 2B 0D D1 04 4A 05 49 | 0003ED20 | 25 00 2B 09 D1 0D 4A |
0003ED28 | 02 9B 58 00 C0 18 80 00 | 0003ED28 | 0D 49 02 9B 58 00 C0 18 |
0003ED30 | 40 18 78 10 80 05 E0 | 0003ED30 | 80 00 18 40 78 10 80 |
0003ED38 | 20 40 02 02 04 0C 25 08 | 0003ED38 | 01 E0 08 48 03 80 08 49 |
0003ED40 | 06 48 03 80 00 2F 0D D1 | 0003ED40 | 02 9A 50 00 80 18 80 00 |
0003ED48 | 05 49 02 9F 78 00 C0 19 | 0003ED48 | 40 18 82 7A 93 46 00 2F |
0003ED50 | 80 00 40 18 80 78 81 46 | 0003ED50 | 08 D1 80 78 81 46 0A E0 |
0003ED58 | 09 E0 | 0003ED58 | 00 00 |
------------------------------------------------------------------------
0003EE30 | 6E | 0003EE30 | 64 |
------------------------------------------------------------------------
0003EE68 | 6E | 0003EE68 | 64 |
------------------------------------------------------------------------
0003EE98 | 6E | 0003EE98 | 64 |
------------------------------------------------------------------------
0003EED0 | 6E | 0003EED0 | 64 |
------------------------------------------------------------------------
0003EF00 | 49 | 0003EF00 | 59 |
------------------------------------------------------------------------
0003F000 | 04 00 0C | 0003F000 | 00 80 46 |
0003F008 | 80 46 | 0003F008 | 7F 00 |
------------------------------------------------------------------------
0003F038 | 07 | 0003F038 | 08 |
0003F040 | 02 | 0003F040 | 03 |
0003F048 | 43 46 5B 08 98 46 09 98 | 0003F048 | 81 4C 23 88 5B 08 23 80 |
0003F050 | 04 78 37 2C 06 D1 96 20 | 0003F050 | 09 98 04 78 37 2C 06 D1 |
0003F058 | 78 43 64 21 A4 F1 DC FF | 0003F058 | 96 20 78 43 64 21 A4 F1 |
0003F060 | 00 04 07 0C 39 2C 14 D1 | 0003F060 | DB FF 00 04 07 0C 39 2C |
0003F068 | 00 20 90 0E 20 00 21 | 0003F068 | 14 D1 20 00 90 0E 20 |
0003F070 | 3A 22 00 23 DA F7 50 FF | 0003F070 | 00 21 3A 22 00 23 DA F7 |
0003F078 | 00 06 28 09 D0 96 20 | 0003F078 | 50 FF 06 00 28 09 D0 |
0003F080 | 41 46 43 08 1C 64 21 | 0003F080 | 96 20 46 41 43 08 1C |
0003F088 | A4 F1 C6 FF 00 04 0C | 0003F088 | 64 21 A4 F1 C6 FF 04 |
0003F090 | 80 46 09 9A 10 78 3A 28 | 0003F090 | 00 0C 80 46 09 9A 10 78 |
0003F098 | 14 D1 00 20 90 0E 20 | 0003F098 | 3A 28 14 D1 20 00 90 |
0003F0A0 | 00 21 39 22 00 23 DA F7 | 0003F0A0 | 0E 20 00 21 39 22 00 23 |
0003F0A8 | 37 FF 00 06 28 09 D0 | 0003F0A8 | DA F7 37 FF 06 00 28 |
0003F0B0 | 96 20 43 46 43 18 1C | 0003F0B0 | 09 D0 96 20 46 43 43 |
0003F0B8 | 64 21 A4 F1 AD FF 00 04 | 0003F0B8 | 18 1C 64 21 A4 F1 AD FF |
0003F0C0 | 0C 80 46 09 99 08 78 | 0003F0C0 | 04 00 0C 80 46 09 99 |
0003F0C8 | 3E 28 09 D1 F0 6C 00 28 | 0003F0C8 | 08 78 3E 28 09 D1 F0 6C |
0003F0D0 | 06 D0 96 20 78 43 64 21 | 0003F0D0 | 00 28 06 D0 96 20 78 43 |
0003F0D8 | A4 F1 9E FF 00 04 07 0C | 0003F0D8 | 64 21 A4 F1 9E FF 00 04 |
0003F0E0 | 0A 9A 10 78 3F 28 0C D1 | 0003F0E0 | 07 0C 0A 9A 10 78 3F 28 |
0003F0E8 | 01 9B D8 6C 00 28 08 D0 | 0003F0E8 | 0C D1 01 9B D8 6C 00 28 |
0003F0F0 | 96 20 05 99 48 43 64 21 | 0003F0F0 | 08 D0 96 20 05 99 48 43 |
0003F0F8 | A4 F1 8E FF 00 04 0C | 0003F0F8 | 64 21 A4 F1 8E FF 04 |
0003F100 | 05 90 4A 46 0D 2A 0E D1 | 0003F100 | 00 0C 05 90 4A 46 0D 2A |
0003F108 | 00 20 90 0E 20 00 21 | 0003F108 | 0E D1 20 00 90 0E 20 |
0003F110 | 22 FD 23 DA F7 00 FF | 0003F110 | 21 00 22 FD 23 DA F7 |
0003F118 | 06 28 03 D0 4C 49 | 0003F118 | FF 06 00 28 03 D0 |
0003F120 | 08 88 40 08 08 80 4B 46 | 0003F120 | 4B 49 08 88 40 08 08 80 |
0003F128 | 0A 2B 0E D1 00 20 90 | 0003F128 | 4B 46 0A 2B 0E D1 20 |
0003F130 | 0E 20 00 21 22 FE 23 | 0003F130 | 00 90 0E 20 21 00 22 |
0003F138 | DA F7 EE FE 00 06 28 | 0003F138 | FE 23 DA F7 EE FE 06 |
0003F140 | 03 D0 43 49 08 88 40 08 | 0003F140 | 00 28 03 D0 42 49 08 88 |
0003F148 | 08 80 48 46 0C 28 14 D1 | 0003F148 | 40 08 08 80 48 46 0C 28 |
0003F150 | 09 99 08 78 41 28 10 D1 | 0003F150 | 14 D1 09 99 08 78 41 28 |
0003F158 | B0 8D 03 21 A5 F1 56 FA | 0003F158 | 10 D1 B0 8D 03 21 A5 F1 |
0003F160 | 31 8D 00 04 0C 81 42 | 0003F160 | 56 FA 31 8D 04 00 0C |
0003F168 | 07 D8 39 4C 21 88 96 20 | 0003F168 | 81 42 07 D8 38 4C 21 88 |
0003F170 | 48 43 64 21 A4 F1 50 FF | 0003F170 | 96 20 48 43 64 21 A4 F1 |
0003F178 | 20 80 4A 46 0A 2A 14 D1 | 0003F178 | 50 FF 20 80 4A 46 0A 2A |
0003F180 | 09 9B 18 78 42 28 10 D1 | 0003F180 | 14 D1 09 9B 18 78 42 28 |
0003F188 | B0 8D 03 21 A5 F1 3E FA | 0003F188 | 10 D1 B0 8D 03 21 A5 F1 |
0003F190 | 31 8D 00 04 0C 81 42 | 0003F190 | 3E FA 31 8D 04 00 0C |
0003F198 | 07 D8 2D 4C 21 88 96 20 | 0003F198 | 81 42 07 D8 2C 4C 21 88 |
0003F1A0 | 48 43 64 21 A4 F1 38 FF | 0003F1A0 | 96 20 48 43 64 21 A4 F1 |
0003F1A8 | 20 80 48 46 0B 28 14 D1 | 0003F1A8 | 38 FF 20 80 48 46 0B 28 |
0003F1B0 | 09 99 08 78 43 28 10 D1 | 0003F1B0 | 14 D1 09 99 08 78 43 28 |
0003F1B8 | B0 8D 03 21 A5 F1 26 FA | 0003F1B8 | 10 D1 B0 8D 03 21 A5 F1 |
0003F1C0 | 31 8D 00 04 0C 81 42 | 0003F1C0 | 26 FA 31 8D 04 00 0C |
0003F1C8 | 07 D8 21 4C 21 88 96 20 | 0003F1C8 | 81 42 07 D8 20 4C 21 88 |
0003F1D0 | 48 43 64 21 A4 F1 20 FF | 0003F1D0 | 96 20 48 43 64 21 A4 F1 |
0003F1D8 | 80 4A 46 06 2A 14 D1 | 0003F1D8 | FF 20 80 4A 46 06 2A |
0003F1E0 | 09 9B 18 78 44 28 10 D1 | 0003F1E0 | 14 D1 09 9B 18 78 44 28 |
0003F1E8 | B0 8D 03 21 A5 F1 0E FA | 0003F1E8 | 10 D1 B0 8D 03 21 A5 F1 |
0003F1F0 | 31 8D 00 04 0C 81 42 | 0003F1F0 | 0E FA 31 8D 04 00 0C |
0003F1F8 | 07 D8 15 4C 21 88 96 20 | 0003F1F8 | 81 42 07 D8 14 4C 21 88 |
0003F200 | 48 43 64 21 A4 F1 08 FF | 0003F200 | 96 20 48 43 64 21 A4 F1 |
0003F208 | 20 80 12 4A 12 48 01 88 | 0003F208 | 08 FF 20 80 11 4A 12 48 |
0003F210 | 48 00 40 18 80 00 18 | 0003F210 | 01 88 48 00 40 18 00 |
0003F218 | 00 78 07 28 02 D1 05 98 | 0003F218 | 80 18 00 78 07 28 02 D1 |
0003F220 | 40 08 05 90 49 46 08 29 | 0003F220 | 05 98 40 08 05 90 59 46 |
0003F228 | D9 AE E0 0B 48 01 78 | 0003F228 | 29 00 D9 AD E0 0B 48 |
0003F230 | 04 1C 02 29 18 D1 19 20 | 0003F230 | 01 78 04 1C 02 29 17 D1 |
0003F238 | 30 56 06 28 12 DD 08 4A | 0003F238 | 19 20 30 56 06 28 11 DD |
0003F240 | 15 E0 00 00 | 0003F240 | 07 4A 14 E0 |
------------------------------------------------------------------------
0003F388 | 4F 09 | 0003F388 | 5F 03 |
0003F390 | 48 09 | 0003F390 | 58 00 |
0003F398 | 00 E1 | 0003F398 | 94 E0 |
------------------------------------------------------------------------
0003F4F0 | 11 01 20 08 40 | 0003F4F0 | 14 00 2C 3D D0 |
0003F4F8 | 14 1C 00 28 16 D0 4B 46 | 0003F4F8 | 4E 46 60 20 20 40 00 28 |
0003F500 | 2B 09 D0 0B 2B D0 | 0003F500 | D0 0A 2E 32 D0 2E |
0003F508 | 10 E0 00 00 | 0003F508 | 33 D0 33 E0 |
------------------------------------------------------------------------
0003F518 | E8 0F 28 18 45 10 05 E0 | 0003F518 | 18 20 20 40 00 28 14 D0 |
0003F520 | 28 01 40 1B 0A 21 A4 F1 | 0003F520 | 58 46 01 28 11 D1 0E 4A |
0003F528 | 77 FD 05 1C 21 88 9F 20 | 0003F528 | 0E 48 01 78 58 20 48 43 |
0003F530 | 08 40 00 28 06 D0 09 48 | 0003F530 | 83 18 18 78 05 28 02 D0 |
0003F538 | 00 88 4C 02 E8 0F | 0003F538 | 58 78 05 05 0A 20 |
0003F540 | 28 18 45 10 21 88 60 20 | 0003F540 | 68 43 0F 21 89 F1 42 F9 |
0003F548 | 08 40 00 28 12 D0 4E 46 | 0003F548 | 05 1C 07 48 00 88 4C 28 |
0003F550 | 0A 2E 05 D0 0B 2E D0 | 0003F550 | 0F D0 07 2C 0E D8 2E |
0003F558 | 0C E0 00 00 4A 3D 02 02 | 0003F558 | 0B D0 0B 2E 06 D0 09 E0 |
0003F560 | 28 01 40 1B 0A 21 A4 F1 | 0003F560 | 65 3B 02 02 CC 3C 02 02 |
0003F568 | 57 FD 05 1C 02 E0 E8 0F | 0003F568 | AA 3C 02 02 68 08 2D 18 |
0003F570 | 28 18 45 10 | 0003F570 | 00 E0 68 08 |
------------------------------------------------------------------------
0003F590 | A4 | 0003F590 | 89 |
0003F598 | 3F FD | 0003F598 | 19 F9 |
0003F5A0 | 38 | 0003F5A0 | 78 |
0003F5A8 | F0 BC 02 08 47 00 00 | 0003F5A8 | B3 46 F0 02 BC 08 47 |


The unmodified ROM is on the left. The patched ROM is on the right. Unchanged bytes not listed; only bytes that are different between the two versions are displayed. Note, this does not include any changes to the move structure.

For more clarification, here is the DPSS system in the japanese ROMs, the original data I copied from in other words. Again, using Fire Red.


00014648 | 6E | 00014648 | 64 |
------------------------------------------------------------------------
00014730 | 6E | 00014730 | 64 |
------------------------------------------------------------------------
0001D748 | 78 | 0001D748 | 7A |
------------------------------------------------------------------------
0001D8D0 | 08 | 0001D8D0 | 00 |
------------------------------------------------------------------------
0001EED0 | 78 | 0001EED0 | 7A |
------------------------------------------------------------------------
0001F118 | 08 | 0001F118 | 00 |
------------------------------------------------------------------------
0001F198 | 08 | 0001F198 | 00 |
------------------------------------------------------------------------
0003E458 | 57 4E 45 | 0003E458 | 5F 56 4D |
0003E460 | E0 B4 8B B0 06 1C 01 91 | 0003E460 | 44 46 F0 B4 8B B0 06 1C |
0003E468 | 02 92 13 98 99 9A | 0003E468 | 01 91 02 92 98 99 |
0003E470 | 9C 1B 04 0C 03 93 | 0003E470 | 9A 17 9C 04 1B 0C |
0003E478 | 00 04 03 0C 09 06 0F 0E | 0003E478 | 03 93 00 04 03 0C 09 06 |
0003E480 | 12 06 0E 04 92 24 06 | 0003E480 | 0F 0E 06 12 0E 04 92 |
0003E488 | 0E 00 25 2B 0D D1 | 0003E488 | 06 24 0E 25 00 2B |
0003E490 | 04 4A 05 49 02 9B 58 00 | 0003E490 | 09 D1 0D 4A 0D 49 02 9B |
0003E498 | C0 18 80 00 40 18 78 | 0003E498 | 58 00 C0 18 80 00 18 |
0003E4A0 | 10 80 05 E0 80 3F 02 02 | 0003E4A0 | 40 78 10 80 01 E0 08 48 |
0003E4A8 | 0C D6 20 08 06 48 03 80 | 0003E4A8 | 03 80 08 49 02 9A 50 00 |
0003E4B0 | 00 2F 0D D1 05 49 02 9F | 0003E4B0 | 80 18 80 00 40 18 82 7A |
0003E4B8 | 78 00 C0 19 80 00 40 18 | 0003E4B8 | 93 46 00 2F 08 D1 80 78 |
0003E4C0 | 80 78 81 46 09 E0 | 0003E4C0 | 81 46 0A E0 00 00 |
------------------------------------------------------------------------
0003E5A0 | 6E | 0003E5A0 | 64 |
------------------------------------------------------------------------
0003E5D0 | 6E | 0003E5D0 | 64 |
------------------------------------------------------------------------
0003E608 | 6E | 0003E608 | 64 |
------------------------------------------------------------------------
0003E640 | 6E | 0003E640 | 64 |
------------------------------------------------------------------------
0003E670 | 49 08 | 0003E670 | 59 00 |
------------------------------------------------------------------------
0003E770 | 04 00 0C 80 46 | 0003E770 | 00 80 46 7F 00 |
------------------------------------------------------------------------
0003E7A8 | 07 | 0003E7A8 | 08 |
0003E7B0 | 02 43 46 5B 08 | 0003E7B0 | 03 81 4C 23 88 |
0003E7B8 | 98 46 09 98 04 78 37 2C | 0003E7B8 | 5B 08 23 80 09 98 04 78 |
0003E7C0 | 06 D1 96 20 78 43 64 21 | 0003E7C0 | 37 2C 06 D1 96 20 78 43 |
0003E7C8 | 89 F1 B6 FB 00 04 07 0C | 0003E7C8 | 64 21 89 F1 B5 FB 00 04 |
0003E7D0 | 39 2C 14 D1 00 20 90 | 0003E7D0 | 07 0C 39 2C 14 D1 20 |
0003E7D8 | 0E 20 00 21 3A 22 00 23 | 0003E7D8 | 00 90 0E 20 00 21 3A 22 |
0003E7E0 | DA F7 A2 FF 00 06 28 | 0003E7E0 | 00 23 DA F7 A1 FF 06 |
0003E7E8 | 09 D0 96 20 41 46 43 | 0003E7E8 | 00 28 09 D0 96 20 46 |
0003E7F0 | 08 1C 64 21 89 F1 A0 FB | 0003E7F0 | 41 43 08 1C 64 21 89 F1 |
0003E7F8 | 00 04 0C 80 46 09 9A | 0003E7F8 | 9F FB 04 00 0C 80 46 |
0003E800 | 10 78 3A 28 14 D1 00 20 | 0003E800 | 09 9A 10 78 3A 28 14 D1 |
0003E808 | 90 0E 20 00 21 39 22 | 0003E808 | 20 00 90 0E 20 00 21 |
0003E810 | 00 23 DA F7 89 FF 00 06 | 0003E810 | 39 22 00 23 DA F7 88 FF |
0003E818 | 28 09 D0 96 20 43 46 | 0003E818 | 06 00 28 09 D0 96 20 |
0003E820 | 43 18 1C 64 21 89 F1 | 0003E820 | 46 43 43 18 1C 64 21 |
0003E828 | 87 FB 00 04 0C 80 46 | 0003E828 | 89 F1 86 FB 04 00 0C |
0003E830 | 09 99 08 78 3E 28 09 D1 | 0003E830 | 80 46 09 99 08 78 3E 28 |
0003E838 | F0 6C 00 28 06 D0 96 20 | 0003E838 | 09 D1 F0 6C 00 28 06 D0 |
0003E840 | 78 43 64 21 89 F1 78 FB | 0003E840 | 96 20 78 43 64 21 89 F1 |
0003E848 | 00 04 07 0C 0A 9A 10 78 | 0003E848 | 77 FB 00 04 07 0C 0A 9A |
0003E850 | 3F 28 0C D1 01 9B D8 6C | 0003E850 | 10 78 3F 28 0C D1 01 9B |
0003E858 | 00 28 08 D0 96 20 05 99 | 0003E858 | D8 6C 00 28 08 D0 96 20 |
0003E860 | 48 43 64 21 89 F1 68 FB | 0003E860 | 05 99 48 43 64 21 89 F1 |
0003E868 | 00 04 0C 05 90 4A 46 | 0003E868 | 67 FB 04 00 0C 05 90 |
0003E870 | 0D 2A 0E D1 00 20 90 | 0003E870 | 4A 46 0D 2A 0E D1 20 |
0003E878 | 0E 20 00 21 22 FD 23 | 0003E878 | 00 90 0E 20 21 00 22 |
0003E880 | DA F7 52 FF 00 06 28 | 0003E880 | FD 23 DA F7 51 FF 06 |
0003E888 | 03 D0 4C 49 08 88 40 08 | 0003E888 | 00 28 03 D0 4B 49 08 88 |
0003E890 | 08 80 4B 46 0A 2B 0E D1 | 0003E890 | 40 08 08 80 4B 46 0A 2B |
0003E898 | 00 20 90 0E 20 00 21 | 0003E898 | 0E D1 20 00 90 0E 20 |
0003E8A0 | 22 FE 23 DA F7 40 FF | 0003E8A0 | 21 00 22 FE 23 DA F7 |
0003E8A8 | 00 06 28 03 D0 43 49 | 0003E8A8 | 3F FF 06 00 28 03 D0 |
0003E8B0 | 08 88 40 08 08 80 48 46 | 0003E8B0 | 42 49 08 88 40 08 08 80 |
0003E8B8 | 0C 28 14 D1 09 99 08 78 | 0003E8B8 | 48 46 0C 28 14 D1 09 99 |
0003E8C0 | 41 28 10 D1 B0 8D 03 21 | 0003E8C0 | 08 78 41 28 10 D1 B0 8D |
0003E8C8 | 89 F1 30 FE 31 8D 00 04 | 0003E8C8 | 03 21 89 F1 2F FE 31 8D |
0003E8D0 | 0C 81 42 07 D8 39 4C | 0003E8D0 | 04 00 0C 81 42 07 D8 |
0003E8D8 | 21 88 96 20 48 43 64 21 | 0003E8D8 | 38 4C 21 88 96 20 48 43 |
0003E8E0 | 89 F1 2A FB 20 80 4A 46 | 0003E8E0 | 64 21 89 F1 29 FB 20 80 |
0003E8E8 | 0A 2A 14 D1 09 9B 18 78 | 0003E8E8 | 4A 46 0A 2A 14 D1 09 9B |
0003E8F0 | 42 28 10 D1 B0 8D 03 21 | 0003E8F0 | 18 78 42 28 10 D1 B0 8D |
0003E8F8 | 89 F1 18 FE 31 8D 00 04 | 0003E8F8 | 03 21 89 F1 17 FE 31 8D |
0003E900 | 0C 81 42 07 D8 2D 4C | 0003E900 | 04 00 0C 81 42 07 D8 |
0003E908 | 21 88 96 20 48 43 64 21 | 0003E908 | 2C 4C 21 88 96 20 48 43 |
0003E910 | 89 F1 12 FB 20 80 48 46 | 0003E910 | 64 21 89 F1 11 FB 20 80 |
0003E918 | 0B 28 14 D1 09 99 08 78 | 0003E918 | 48 46 0B 28 14 D1 09 99 |
0003E920 | 43 28 10 D1 B0 8D 03 21 | 0003E920 | 08 78 43 28 10 D1 B0 8D |
0003E928 | 89 F1 00 FE 31 8D 00 04 | 0003E928 | 03 21 89 F1 FF FD 31 8D |
0003E930 | 0C 81 42 07 D8 21 4C | 0003E930 | 04 00 0C 81 42 07 D8 |
0003E938 | 21 88 96 20 48 43 64 21 | 0003E938 | 20 4C 21 88 96 20 48 43 |
0003E940 | 89 F1 FA FA 20 80 4A 46 | 0003E940 | 64 21 89 F1 F9 FA 20 80 |
0003E948 | 06 2A 14 D1 09 9B 18 78 | 0003E948 | 4A 46 06 2A 14 D1 09 9B |
0003E950 | 44 28 10 D1 B0 8D 03 21 | 0003E950 | 18 78 44 28 10 D1 B0 8D |
0003E958 | 89 F1 E8 FD 31 8D 00 04 | 0003E958 | 03 21 89 F1 E7 FD 31 8D |
0003E960 | 0C 81 42 07 D8 15 4C | 0003E960 | 04 00 0C 81 42 07 D8 |
0003E968 | 21 88 96 20 48 43 64 21 | 0003E968 | 14 4C 21 88 96 20 48 43 |
0003E970 | 89 F1 E2 FA 20 80 12 4A | 0003E970 | 64 21 89 F1 E1 FA 20 80 |
0003E978 | 12 48 01 88 48 00 40 18 | 0003E978 | 11 4A 12 48 01 88 48 00 |
0003E980 | 80 00 18 00 78 07 28 | 0003E980 | 40 18 00 80 18 00 78 |
0003E988 | 02 D1 05 98 40 08 05 90 | 0003E988 | 07 28 02 D1 05 98 40 08 |
0003E990 | 49 46 08 29 D9 AE E0 | 0003E990 | 05 90 59 46 29 00 D9 |
0003E998 | 0B 48 01 78 04 1C 02 29 | 0003E998 | AD E0 0B 48 01 78 04 1C |
0003E9A0 | 18 D1 19 20 30 56 06 28 | 0003E9A0 | 02 29 17 D1 19 20 30 56 |
0003E9A8 | 12 DD 08 4A 15 E0 00 00 | 0003E9A8 | 06 28 11 DD 07 4A 14 E0 |
------------------------------------------------------------------------
0003EAF0 | 4F | 0003EAF0 | 5F |
0003EAF8 | 09 48 | 0003EAF8 | 03 58 |
0003EB00 | 09 00 E1 | 0003EB00 | 00 94 E0 |
------------------------------------------------------------------------
0003EC58 | 11 | 0003EC58 | 14 |
0003EC60 | 01 20 08 40 14 1C 00 28 | 0003EC60 | 00 2C 3D D0 4E 46 60 20 |
0003EC68 | 16 D0 4B 46 2B 09 D0 | 0003EC68 | 20 40 00 28 D0 0A 2E |
0003EC70 | 0B 2B D0 10 E0 00 00 | 0003EC70 | 32 D0 2E 33 D0 33 E0 |
------------------------------------------------------------------------
0003EC80 | E8 0F 28 18 | 0003EC80 | 18 20 20 40 |
0003EC88 | 45 10 05 E0 28 01 40 1B | 0003EC88 | 00 28 14 D0 58 46 01 28 |
0003EC90 | 0A 21 89 F1 51 F9 05 1C | 0003EC90 | 11 D1 0E 4A 0E 48 01 78 |
0003EC98 | 21 88 9F 20 08 40 00 28 | 0003EC98 | 58 20 48 43 83 18 18 78 |
0003ECA0 | 06 D0 09 48 00 88 4C | 0003ECA0 | 05 28 02 D0 58 78 05 |
0003ECA8 | 02 E8 0F 28 18 45 10 | 0003ECA8 | 05 0A 20 68 43 0F 21 |
0003ECB0 | 21 88 60 20 08 40 00 28 | 0003ECB0 | 89 F1 42 F9 05 1C 07 48 |
0003ECB8 | 12 D0 4E 46 0A 2E 05 D0 | 0003ECB8 | 00 88 4C 28 0F D0 07 2C |
0003ECC0 | 0B 2E D0 0C E0 00 00 | 0003ECC0 | 0E D8 2E 0B D0 0B 2E |
0003ECC8 | AA 3C 02 02 28 01 40 1B | 0003ECC8 | 06 D0 09 E0 65 3B 02 02 |
0003ECD0 | 0A 21 89 F1 31 F9 05 1C | 0003ECD0 | CC 3C 02 02 AA 3C 02 02 |
0003ECD8 | 02 E0 E8 0F 28 18 45 10 | 0003ECD8 | 68 08 2D 18 00 E0 68 08 |
------------------------------------------------------------------------
0003ED08 | 38 | 0003ED08 | 78 |
0003ED10 | F0 BC 02 | 0003ED10 | B3 46 F0 |
0003ED18 | 08 47 00 00 | 0003ED18 | 02 BC 08 47 |


There are quite a few changes, adjustments I made based on diffing an english ROM with a japanese one. But it should help in research.

http://srpgp.supersanctuary.net/Fire%20Red%20DPSS.ips

This is the patch. You patch it on top of an english Fire Red ROM. Note that this contains no modifications to the move data; you should do that yourself.

However, I should note, there is one strange and arbitrary bug with my version; Electric and Fire type moves will very suddenly restart the entire game. No danger is involved as far as I know, it just goes straight to the game initialization after the move is passed. This bug is not present in the japanese versions of the DPSS system and is the only imperfection between the code I modified and the code originating from the japanese ROMs. If anyone can fix this bug, I would highly appreciate it if you could post the needed changes to fix this. I believe this change could very well benefit the hacking community on whole and help keep hacking to the Advance generation of games, where research and development has come very far. It would also make a lot of new and still in development hacks a lot more interesting when it comes to battling.

Also, apologies for the awkward formatting in the diff tables, it was meant to be viewed in monospace but I can't really recall how you do that in vBulletin.

MoTivE
October 17th, 2010, 09:34 PM
This looks awesome! I would really like to help but I have only a little experience using a hex editor. Let me know if there's still anything I can do to help. Best of luck!

colcolstyles
October 18th, 2010, 11:16 PM
Huh, that's funny. I was just looking into this a couple weeks ago in Emerald. My hypothesis was that whenever the battle engine needed to figure out whether to use a pokémon's physical or special stat, it used the Type of the attack. I quickly figured out that types 0x00 (normal) through 0x08 (steel) were physical, 0x09 was "???", and the rest were special. Though I never finished the project I found that at '0x069a5a', there is the following code (more or less: I made up labels for better readability and left out a few unnecessary commands):

cmp r1, #0x8
blt physical
b continue

...

continue:
cmp r1, #0x9
bne special
... @ else, type == "???"

I assume that there are multiple instances of the following code. Again, I hypothesized that this check would need to be performed at least twice: once for the attacking pokémon's physical/special Attack stat and then again for the defending pokémon's physical/special Defense stat. But then there are variables such as whether Light Screen/Reflect is up. The above code is all that I've found so far but if I ever get the time, I'll look into it more in-depth.

Anyway, can you explain what some of those changed bytes do? Just showing us the changes in raw data between two ROMs is kinda boring. What, exactly, was changed?

JJames19119
October 18th, 2010, 11:49 PM
As stated, I'm truthfully unaware of what exactly was going on in the changed mechanics; I was hoping someone much more familiar with ASM could look into it and tell me myself. I got it to work through sheer ingenuity and a bit of trial and error.

However, having viewed the ASM code many times through a disassembler (to adjust the changed code to the English version's standards) I can give you a few basic ideas on what exactly was changed.

0x03E7A8: An additional line of code was added, it makes quite different comparisons compared to the original. Around 7-10 lines in, the original code is there, just shifted down. When the changed data stops, the last line had overwritten a 0000 string.

0x03E458: The lines changed here remove the first and last registries to edit, if I remember correctly anyways. r10 and r4 or something? I can't remember the exact numbers off the top of my head. It compounds the code, then there's further changes which take advantage of the free space.

0x014648: The seemingly random byte changes are all for a specific register...I think. It alters mainly ldr commands.

0x03EC80: Contains some complicated code I noticed wasn't in the original...this might be the block that needs adjusting to fix the glitch I mentioned as I never really touched it porting it over, but I can't tell for sure, this block just downright fries my brain.

I need to take ASM lessons, but since I figured this might be an important step forward for the hacking community, I didn't want to wait until I understood the code and could fix it myself before presenting it. There will always be someone better then me and I figure that if someone else could come forward, apply these changes and look at them in depth, then maybe it could be improved upon or even better, used for other things.

MoTivE
October 27th, 2010, 11:47 AM
I did notice that some of the code seemed to be shifted in the edited version. We really need someone who understands this stuff to explain exactly what's going on.

JJames19119
October 31st, 2010, 11:55 PM
So after a bit more tinkering I ended up fixing it myself. Turns out the pointers I adjusted weren't all that well adjusted (lol)

http://srpgp.supersanctuary.net/frdpss.zip

The IPS file contains the patch, patch it onto a clean Fire Red ROM to activate the classification split. In order to utilize it, you must edit the move data manually using a hex editor (until some tool comes out that can support this)

00 28 00 64 23 00 00 00 33 00 00 00

This is a sample data using Pound's structure. Edit the byte in bold! 00 if the move is physical, 01 if the move is special. Basically you change the second to last byte in each move block. This is very simple, I'm sure if someone's paying attention, they can design one of their tools to support this feature. It has absolutely no bearing on an original ROM and does not effect it's performance, making it backwards compatible.

The patch itself does not change the moves for you, that's your own problem. Provided mechanics and such haven't been moved around, you might be able to patch this onto just about any Fire Red ROM without massive ASM changes. (Make backups first though, don't hold me responsible!) I haven't checked yet, but this patch might be compatible with other third generation ROMs too, but don't quote me on that. Experiment! I'm sure that even if the patch itself isn't compatible, the mechanics in each third gen ROM should generally be the same, so it's very possible to port this system into, say, Emerald or even Ruby.

The text file contains the diffs between a clean and a modified ROM. The hex on the left is the original, the hex on the right is the modified. Use this to tell what, in hex, was changed. It's not highly specific of course, it's a basic diff comparison. But with enough engineering, you can use this to port the system over into other ROMs much more easily, or even tweak it a bit! It's up to you. It's there for research.

This patch is a flawless port, unlike my previous one. I can't tell you exactly how it works, as I merely ported it over through sheer engineering alone, without any sort of knowledge of ASM. With a disassembler and proper debugging tools, you should be able to figure it out on your own what's going on though if you're experienced enough. However, having gotten here through trial and error, I can tell you that I have thoroughly tested it and it should work 100% bug free, compared to the previous version.

I'm presenting this IPS patch here not just for research, but maybe in the hopes that this will improve current and future hacks in progress and make them so much more interesting and fun. With a small bit of work, you can port all the move classifications from 4th gen into 3rd gen and still have a completely different Fire Red game. Blaze Kick will finally be physical! The possibilities though are endless. Please put this to good use.

TheDarkShark
November 1st, 2010, 02:00 AM
I think I'll work out a patch that contains the data for every move and provide it here. But where is the move-table? I don't know, but I can do some researches (I won't need to, if someonetells me)

JJames19119
November 1st, 2010, 10:26 AM
But where is the move-table? I don't know, but I can do some researches (I won't need to, if someonetells me)

It begins at 0x250C10, where Pound starts. After that, every move is twelve bytes long; you change the 11th byte for the physical/special split.

Windslash
November 1st, 2010, 02:23 PM
Lol well I feel pretty dumb.

JJames19119
November 1st, 2010, 02:51 PM
After a little research I've expanded on James' findings

A lot of this is explained here (http://bulbapedia.bulbagarden.net/wiki/Move_data_structure_in_Generation_III). The DPSS system makes use of what that page calls the second padding byte. While it says it should be set to 00, in reality, they're never actually used, so it's totally safe to set them to anything you want, they'll just never have a bearing on the actual game on a clean ROM.

Hopeless Masquerade
November 1st, 2010, 07:40 PM
Here's a patch to convert all special moves to use their special stat attribute. I'm 99% sure I didn't break anything.
That's cool, good job.
Also, a big good job to the researcher!

Ivee
November 2nd, 2010, 10:26 PM
Hello.

I'm a friend of Windslash's (actually, I pointed this thread out to him). The earlier patch he posted with all the special moves was flawed, so he fixed it and asked me to post the patch. I personally tested out a move (Gust, which is one that was never special typed in gen 3 and older). I gave it to Squirtle, gave it max special attack and gave Bulbasaur minimum special defense. Then tested it again leaving Squirtle's SA and Bulbasaur's special defense was maxed. Bulbasaur was 1-hit KO'd first and the next time Gust did a little less than half damage.

Anyway, here's the patch, please give credit to Windslash and not me. And keep testing moves so we can be sure he doesn't need to do anymore work!

diegoisawesome
November 3rd, 2010, 03:53 PM
Hello.

I'm a friend of Windslash's (actually, I pointed this thread out to him). The earlier patch he posted with all the special moves was flawed, so he fixed it and asked me to post the patch. I personally tested out a move (Gust, which is one that was never special typed in gen 3 and older). I gave it to Squirtle, gave it max special attack and gave Bulbasaur minimum special defense. Then tested it again leaving Squirtle's SA and Bulbasaur's special defense was maxed. Bulbasaur was 1-hit KO'd first and the next time Gust did a little less than half damage.

Anyway, here's the patch, please give credit to Windslash and not me. And keep testing moves so we can be sure he doesn't need to do anymore work!
I see what he did, but did he set the status effect moves to 2 as well?

JJames19119
November 3rd, 2010, 03:59 PM
I see what he did, but did he set the status effect moves to 2 as well?

The mechanics don't differentiate between "special" and "status." This is because status moves normally do not cause damage anyways, and those that do cause damage based on a fixed formula that does not rely on attack or defense stats.

I suppose if you were to make a status screen hack to show the class of moves, it would be relevant, but until then, there's no reason to set any moves to anything other then 0 or 1. (It would treat any number higher then 1 as 1 anyways)

diegoisawesome
November 3rd, 2010, 04:07 PM
The mechanics don't differentiate between "special" and "status." This is because status moves normally do not cause damage anyways, and those that do cause damage based on a fixed formula that does not rely on attack or defense stats.

I suppose if you were to make a status screen hack to show the class of moves, it would be relevant, but until then, there's no reason to set any moves to anything other then 0 or 1. (It would treat any number higher then 1 as 1 anyways)
Ohh. I was confused, because, as said in your first post:
In the move data, 00 is physical, 01 is special and 02 is status.

JJames19119
November 3rd, 2010, 04:09 PM
Ohh. I was confused, because, as said in your first post:

Whoops, my mistake.

Truth is, even in the original japanese ROM that I lifted this from, 02 is never actually used. Thanks for pointing that out to me.

Jonny Buuz
November 17th, 2010, 08:17 PM
If we were to apply these patches, would we first patch firered with james' patch and then with windslash's? Or would simply patching with windslash's suffice?

absolutely brilliant work by the way, i've been looking into this for a long time... looks like i can stop tinkering now.

JJames19119
November 17th, 2010, 08:25 PM
If we were to apply these patches, would we first patch firered with james' patch and then with windslash's? Or would simply patching with windslash's suffice?

I believe windslash's patch won't work without mine, as all it does is change the move classifications. It doesn't alter the mechanics to use them, but that's my assuption, I dunno if he included my patch in his.

Rockxero
November 26th, 2010, 11:55 AM
Hello, does anyone know where to find the move table in an Emerald ROM, or have a pre-patched Emerald ROM with the Physical/Special split?

Shiny Quagsire
November 26th, 2010, 11:55 PM
Hello, does anyone know where to find the move table in an Emerald ROM, or have a pre-patched Emerald ROM with the Physical/Special split?

So far this is only for fire red. Hopefully someone will figure it out, (Doesn't really matter for me, since I'm using fire red ;))

Rockxero
November 27th, 2010, 09:35 AM
Ah, I guess I'll have to wait, then. I know there's a Japanese "Touhoumon" Emerald hack with the split, though.

JJames19119
November 30th, 2010, 05:45 AM
If you can understand the hex, then porting over the split to emerald is possible using only the data from the patch I provided. However, I intend on doing this myself sometime within the coming couple months, so if you wanna save yourself the work, feel free to wait, I'll get to it eventually.

NintendoBoyDX
December 29th, 2010, 01:35 AM
If you were to manually edit each moves data after using the patch to split physical/special, would you use 00 or 02 for status lowering or status afflicting moves(or any move in general that does not directly damage the opponent)?

JJames19119
December 29th, 2010, 03:05 AM
It doesn't really matter. You don't use 02 though, only 00 or 01. But since the move doesn't damage (normally) then the classification doesn't come into play, therefore regardless of what you set it to it won't make a difference to the mechanics themselves.

pokemon1412
January 17th, 2011, 08:25 PM
Is this split attack also possible in Emerald Rom...?

since I need them...

NintendoBoyDX
January 18th, 2011, 07:54 PM
Definitely possible, it just hasn't been done for emerald as of yet..

diegoisawesome
March 25th, 2011, 07:41 PM
Hello.

I'm a friend of Windslash's (actually, I pointed this thread out to him). The earlier patch he posted with all the special moves was flawed, so he fixed it and asked me to post the patch. I personally tested out a move (Gust, which is one that was never special typed in gen 3 and older). I gave it to Squirtle, gave it max special attack and gave Bulbasaur minimum special defense. Then tested it again leaving Squirtle's SA and Bulbasaur's special defense was maxed. Bulbasaur was 1-hit KO'd first and the next time Gust did a little less than half damage.

Anyway, here's the patch, please give credit to Windslash and not me. And keep testing moves so we can be sure he doesn't need to do anymore work!
Hey Windslash, ther are a lot of moves that haven't been switched. Take Confusion, for example.
This is extremely annoying and I think I'll need to switch back to the old system until the moves are fixed.

BlackHayate
March 28th, 2011, 01:44 PM
uhh confusion is still special (please correct me if I'm lost to what he's talking about)

diegoisawesome
March 28th, 2011, 02:53 PM
uhh confusion is still special (please correct me if I'm lost to what he's talking about)
Well, with this patch, everything was set to Physical (talking about the system's patch) and Windslash's patch is supposed to automatically convert all of the should-be special moves to are-special moves.

Quilava's Master
March 28th, 2011, 03:08 PM
Well, with this patch, everything was set to Physical (talking about the system's patch) and Windslash's patch is supposed to automatically convert all of the should-be special moves to are-special moves.

Well you could alway just do it manually like I did.

diegoisawesome
March 28th, 2011, 03:29 PM
Well you could alway just do it manually like I did.
I know, and I will someday.
But right now, I have a beta to release, and I needed to get it out to my beta testers this past weekend.

JJames19119
March 31st, 2011, 09:34 AM
I'm posting to notify everyone expecting an Emerald port of this that there will be none. At least, not from me.

No, it isn't that I got lazy or anything, trust me, I tried. Emerald's mechanics are a mess. Everything was reorganized and more over, a lot of vital parts that were changed in Fire Red's code are completely missing in Emerald's code. I tried my best to reverse engineer a lot of it, but I am unskilled in ASM, as all my hacking expertise, if you can call it that, mainly deals with hex editing, something that isn't qualified to make this work for Emerald.

So I'm going to offer my deepest apologies to anyone expecting to see this for Emerald. Trust me, I wanted to get it working for Emerald myself, as a friend of mine really wanted it. But I don't think it's a job that's within my boundaries. Hopefully, someone who's really, really good at ASM can take a whack at it.

BlackHayate
March 31st, 2011, 10:50 AM
Yeh there are some differences between the engines, I haven't looked at the programing but I noticed som differences throughout gameplay, for example: the double kick critical glitch (Double kick thinks its power per hit is 60 when the hit is a critical) doesn't work in FR/LG But Does in Emerald; also interestingly on D,P,Plat with double hit as well.

Ivee
April 1st, 2011, 10:55 AM
@diegoisawesome, can you specify all of the moves you found mistakes on?

diegoisawesome
April 2nd, 2011, 01:02 PM
Uh, I found Confusion, for sure. And some around that area as well.
As for others, I can't be sure.

Pogeygothaxed
April 2nd, 2011, 02:49 PM
I'm posting to notify everyone expecting an Emerald port of this that there will be none. At least, not from me.

No, it isn't that I got lazy or anything, trust me, I tried. Emerald's mechanics are a mess. Everything was reorganized and more over, a lot of vital parts that were changed in Fire Red's code are completely missing in Emerald's code. I tried my best to reverse engineer a lot of it, but I am unskilled in ASM, as all my hacking expertise, if you can call it that, mainly deals with hex editing, something that isn't qualified to make this work for Emerald.

So I'm going to offer my deepest apologies to anyone expecting to see this for Emerald. Trust me, I wanted to get it working for Emerald myself, as a friend of mine really wanted it. But I don't think it's a job that's within my boundaries. Hopefully, someone who's really, really good at ASM can take a whack at it.

Emerald always gets the shaft. >: btw, if the "mechanics are reorganized" then how come whenever you open it in a MoveEditor it's in the same order as the other games? Same with effects, etc. I understand they have different offsets, but they still use the same bytes to define what they do and where they are. x_x?

Xenesis
April 3rd, 2011, 12:57 AM
Just because the game has the same data tables (which likely get copied and pasted between games) doesn't mean that the game has the same code to read those data tables.

Do recall that Emerald added a bunch of features, fixed some bugs and introduced some new bugs.

Quilava's Master
April 26th, 2011, 02:58 PM
Just wanted to reply here and warn everyone of an error that I get with this patch. Applying James' patch casues an error with Minun. Whenever Minun uses a damage dealing move, such as Quick Attack & Spark, the game freezes. The music plays but the screen just hangs there. I've testes three different roms and the error happened in all three. When a different pokemon uses quick attack or spark nothing goes wrong. Even with Plusle the problem isn't present. I'm not sure who else it affects but I know for a fact it happens with Minun.

Joshuablevins
April 26th, 2011, 05:44 PM
Emerald always gets the shaft. >: btw, if the "mechanics are reorganized" then how come whenever you open it in a MoveEditor it's in the same order as the other games? Same with effects, etc. I understand they have different offsets, but they still use the same bytes to define what they do and where they are. x_x?

just because the games mechanics are reorganized doesn't mean that the program will convey it differently

Joshuablevins
April 27th, 2011, 12:11 PM
i also tested the minum problem and it did the same thing for me this cannot be a coincidental error

bcrobert
May 17th, 2011, 09:42 PM
Minun's also the only pokemon with the "Minus" ability. Is it possible that this has something to do with it or is it more likely due to Minun's species? If someone were to keep tooling around Minun's various traits and pointers, they might find something. I would, but I prefer to hack Emerald. So at the moment, I'm just a brainstormer in this matter.

And I'm aware that the ability being related is a strange guess, but it's also a strange glitch. Something about Minun has to be affecting the attack type, as it's incredibly strange that Plusle is unaffected. My theory is that it could be a programming error related to the ability and special/physical attack of Minun (the glitch was probably small enough that Nintendo's developers either missed it or ignored it).

EDIT. And perhaps the game's routine for checking the special attack modifier from "Minus" is different than the routine for "Plus" somehow? I'm just throwing things out there so don't overreact if I'm way off base with this one.

NintendoBoyDX
June 7th, 2011, 10:24 PM
I've searched and found all the places in Ruby code that match the places where Firered is edited by this patch. I applied the same edits hoping to port it, but that failed(go figure). I'm not sure if that's because the ram addresses are different or it uses a couple of different registers in certain spots (r6 for r7, r1 for r2, etc). Anyways, if anyone wants to try or is interested here are the addresses:

http://codepad.org/UmwoSKKN

linkandzelda
June 26th, 2011, 07:48 AM
Ive applied this, and the ability Flash Fire now causes the game to crash when the poke uses a fire move next (the opponent) or perhaps any move.

This, with the Minun bug makes me think something isn't quite flawless here. I'm just saying..

klemniops
July 8th, 2011, 03:12 PM
I played around with this a bit too, and it seems to me that the Minun glitch is definitely caused by the ability Minus. I changed its ability around using YAPE and when I switched it to something other than Minus it worked fine. Except for Flash Fire, as mentioned above; that seems to crash the game if you use a fire-type attack after receiving damage from a fire-type attack, but not before.

This patch should probably be tested with all abilities that react to damage. I'll certainly be doing some of that, since I plan to use this patch for the hack I'm working on (first-time hacker - and poster - here!).

I played around with this a bit too, and it seems to me that the Minun glitch is definitely caused by the ability Minus. I changed its ability around using YAPE and when I switched it to something other than Minus it worked fine. Except for Flash Fire, as mentioned above; that seems to crash the game if you use a fire-type attack after receiving damage from a fire-type attack, but not before.

This patch should probably be tested with all abilities that react to damage. I'll certainly be doing some of that, since I plan to use this patch for the hack I'm working on (first-time hacker - and poster - here!).

Edit: I did a bit of testing with some abilities that I thought might be relevant. Volt Absorb, Water Absorb, Plus, Huge Power, Hustle, and Pure Power all do not crash the game, although with Pure Power I couldn't really tell whether or not the effect actually worked.

Putin
July 8th, 2011, 06:27 PM
That, and the blaringly obvious error that grass- and fire-type STAB moves (or it could be certain Pokemon using STAB, I haven't ascertained yet) cause the game to crash in no$, which I prefer because it can emulate at about twice the speed of VBA.

Around the time you came out with this, I was already working with it in the same way (comparing the Japanese Touhoumon Renkou version and an unpatched Japanese rom), so I may try that again (or take a closer look at what you've taken note of). If I find anything, I will post it here, but you've done pretty much as much as I expected to be able to (get a buggy version working).

To document what I've tested in no$gba:
-Using a fire-type move with charmander causes a crash. Normal has no such effect
-Using grass-type move with Bulbasaur crashes; Normal and fire have no effect
-Using water-type move with Lapras and psychic-type move with Hypno has no effect

So obviously there are some types I haven't checked, and it's possible that it's just Pokemon up to a certain point in the dex.

Xiber
July 13th, 2011, 07:44 AM
The "STAB move"-error does not occur in VBA (though you might already know this) and I tested whether Confusion was regarded physical or not by editing with YAPE (too lazy to check hex) and Squirtle almost OHKOd Bulbasaur with Confusion, with ~5 Attack and ~30 Sp. Atk, therefore I would think Confusion is indeed Special.

I only applied the patch posted by Ivee, so perhaps you applying both patches messed something up.

The freeze with Minun does occur however, but I can deal with that since Minun is kinda redundant... I am not experienced by any means, but I will check some stuff in Hex and see if I can find any obvious things that cause this.

edit:

Further tests: Pure Power seems to not have an effect at all.

Putin
July 15th, 2011, 03:28 PM
Has anybody run into (or had the chance to) on the Touhoumon roms? Such as Pure Power, Flash Fire and Minus not working or causing issues. I know the STAB thing isn't a problem on any emulator with Renko version (which is the rom I was using), but it is possible that the other problems were solved by simply not using those abilities, since everything in Touhoumon is fakemon (sort of). I suppose I'll be looking into that tonight.

As for actually looking at the code involved in this, I haven't had much more chance to look at it, as I've been struggling to fix a variety of problems that cropped up in one of my hacks after an hardware failure (such as everything past about offset E-something, including basically a bunch of FF freespace and about a thousand bytes of actual game mechanics, being overwritten by 00's), which is taking all my time.

Gamer2020
July 16th, 2011, 08:32 AM
Can someone put up the Japanese patch? I don't feel like doing the changes to BPRJ manually just to look into this.

Putin
July 16th, 2011, 07:00 PM
Oh wow, I derped up hard in my previous comment.

If the Japanese hackers figured out how to implement this so far in advance of us, I doubt they'd put up with just working around really dumb problems like what we're having. Probably we just need to find the code where the info for those abilities is accessed in our game and in those games, and perhaps the information for STAB bonus as well, see that, oh, wow, it's different from the original code, and change it ourselves. I doubt it'll take more than a bit of trial-and-error from there to get a fully working patch.

With that said, I guess we should kind of try to figure out what has actually been done here, in ASM. Just maybe later. To paraphrase Bacon, science should be done in pursuit of practicality.

Can someone put up the Japanese patch? I don't feel like doing the changes to BPRJ manually just to look into this.Hang on, I'll make a patch and edit my post.

EDIT:
Sorry, I'm still getting the hang of using Linux again.
http://www.mediafire.com/?q4zhxnh2gndua2s
I did the patch on BPRE 1.0 so that anybody else interested doesn't need to find BPRJ.

Amabane~*
July 24th, 2011, 01:26 PM
I found the ROMs of Touhoumon Emerald on my PC, normal & DPSS versions. So, I made a pair of IPS patches from them. Feel free to use it to improve the DPSS FR patch, AND make an Emerald version too:

http://www.mediafire.com/?z4ckut6o2yi6gcx

Remember it to use it on a Japanese Emerald ROM. Sorry if I can't help more, but good luck for you all on the hacking works!

JJames19119
August 9th, 2011, 12:08 AM
Hello, I'm (marginally) back for the time being. I see my "perfect" patch wasn't perfect after all but this within itself is a misdemeanor because nothing programmers ever come out with is truly perfect, EVERYTHING will always have bugs, even the more professional of applications.

But enough about that, let's work on the responses.

Around the time you came out with this, I was already working with it in the same way (comparing the Japanese Touhoumon Renkou version and an unpatched Japanese rom), so I may try that again (or take a closer look at what you've taken note of). If I find anything, I will post it here, but you've done pretty much as much as I expected to be able to (get a buggy version working).

This is exactly what I did so I think the most I did for you was save you about 5-ish hours of work and thorough testing. From what I've seen and played, the Japanese revision of the code that adds the system is indeed well put together, as none of the bugs posted in this thread are apparent in the Japanese ROM, which leads me to believe that more then just the registry values and memory positions are different between the hard coded mechanics of the US and the JP ROMs.

The "Minus" bug truly baffles me; I can't think of a reason why it would do this. If the Plus ability isn't bugged but Minus is, then my patch might have altered the position of Minus' code, which is causing the game to crash because the pointer to Minus' code is now incorrect. I'm not sure how this could actually be possible though, so don't quote me on this. It still confuses me.

Flash Fire, however, I can explain. Flash Fire's code references the edited part of the mechanics as part of bypassing the damage. Flash Fire is meant to make the Pokemon immune to Fire moves, so in order to do this, it references the damage dealing code; which this patch edits. Fixing Flash Fire means changing the address that Flash Fire's code references so that it can properly bypass defense. It's relatively easy to do so long as you know where Flash Fire's code is; I don't know it personally however. Once you know, it's just a matter of comparing an unpatched ROM to the patched one and finding the values that Flash Fire's code references.

no$gba has far from perfect emulation. From what I remember, the version of touhoumon that I grabbed this code from doesn't work in no$gba either. Suffice it to say, you sacrifice some compatibility in using this patch. If you had the debugger version of no$gba though, with some ASM knowledge, it's quite possible to make a patch that is compatible with it.

The Japanese continue to impress me. I was never aware there were DPSS versions of Touhoumon Emerald. Unless Putin wants to give a whack at it this time, I could very well cross compare both those patches and make a DPSS patch for Emerald. It'll likely contain the same bugs, or possibly new ones, however, which is a job for a good ASM hacker. I'm merely here for the boring jobs no one else wants to do. ;o

Putin
August 16th, 2011, 06:45 PM
Hey, good to see you back. I didn't work on this like I said I would because some pretty serious real-life stuff came up (and is still up), but I will get to it when I get to it, if someone doesn't get there first.

JJames19119
September 2nd, 2011, 04:42 PM
Man. I tried cross comparing the (U) and (J) versions of the Emerald ROM only to find out that neither of them are really similar. I even looked in the VBA debugger, the same exact spots in the mechanics both use entirely different coding. Changes in code between the (J) and (U) versions of Emerald are not interchangable because of this so getting DPSS into Emerald is probably going to take a lot of additional work, unless I'm missing something.

Jambo51
September 3rd, 2011, 05:56 AM
Correct me if I'm wrong, but I could only find one relevant check in the entire ROM for the class of the attack (as there was no class split outside of battles at all).

I'm struggling to understand the relevance of all the code you hacked in, since the only thing we're changing is how the game determines what attack falls into which class. Regardless of how a move actually works, all we want to change here is the type-based class system into a byte in the move's data based system. Is this correct?

If so, the mechanics for special. atk/def and atk/def already exist within the game. There doesn't seem to be any need whatsoever to hack those mechanics. All we need to do is change the one check, so that it reads the byte in a different way. As an ASM hacker, I can assure you from experience that the rest of the changes are pretty much irrelevant.

JJames19119
September 3rd, 2011, 08:44 AM
I have no idea if ANYTHING you said is true or not. All I know is that if I change the hexidecimal bytes in the (U) ROM of Fire Red to match those of the (J) ROM at the appropriate places then it works. I don't know why it works; I just know it works because I tested it before. I never actually experimented with any other changes because I'm no ASM hacker.

If you believe in such things, then why not demonstrate it? Pitch in, help us, this isn't one person trying to do something for their own personal gains, I want this to be a community effort that all of the community in whole can benefit from. I've said this multiple, multiple times, but the perfection of the patch can only be achieved with an experienced ASM hacker and I am not one of them, so any help is greatly appreciated not just by me, but anyone who uses this patch to make their hack better.

Jambo51
September 6th, 2011, 05:07 AM
I have no idea if ANYTHING you said is true or not. All I know is that if I change the hexidecimal bytes in the (U) ROM of Fire Red to match those of the (J) ROM at the appropriate places then it works. I don't know why it works; I just know it works because I tested it before. I never actually experimented with any other changes because I'm no ASM hacker.

If you believe in such things, then why not demonstrate it? Pitch in, help us, this isn't one person trying to do something for their own personal gains, I want this to be a community effort that all of the community in whole can benefit from. I've said this multiple, multiple times, but the perfection of the patch can only be achieved with an experienced ASM hacker and I am not one of them, so any help is greatly appreciated not just by me, but anyone who uses this patch to make their hack better.

Please don't think I was trying to suggest you were having a go at me, because I wasn't. I was genuinely impressed with the effort you put into the patch, even if you didn't truly understand why you were changing stuff.

As far as I can tell, however, most of the patch is entirely unnecessary.
I was actually asking for people to back up my theory, as if I was right, then it only takes a simple small routine, rather than a large patch.

The Physical/Special split has existed since Generation 1, has it not? (It wasn't based on an attack by attack basis of course, but used the type to determine it). My theory is that the code needed for the actual mechanics of it has always existed in the ROM, but that the split was done "wrong", so I simply modified that one check rather than all of the mechanics.

I haven't released it yet because I'm still testing it along with the rest of the 649 Patch (Moves, abilities and everything else too). Once I'm sure it's bug free, I'll release it, but not before.

JJames19119
September 6th, 2011, 05:19 AM
It's okay, don't mind me, I'm just an avid follower of the prospect that people back up their claims, though if you're not sure yourself then that's understandable.

If you're working on a patch yourself that does this already then it'll likely be ten times more effective then my patch as it'll be developer brewn by someone in this community (and more importantly, someone who speaks english) and won't rely on wild mass guessing. I'm sure I've made this disclaimer too many times to count already but the patch I've made is based entirely off of assumed hex code that I only know works because I've personally tested it. I really don't have any idea how it actually works because I'm horribly unskilled in ASM; obviously a patch made by someone competent at ASM will work infinitely better then a patch made by someone who's working off of pure trial and error, so I will be exceedingly thankful myself, if everyone else wouldn't be, for your patch, so lots of good luck to you on that.

tl;dr: I will stop acting like a dork now. :V

treeckopa
September 17th, 2011, 01:20 AM
Is it now possible to implement the class split into Emerald?
Where can I find the offsets of all the moves in Emerald?

Big_Bad_Lith
September 25th, 2011, 05:40 PM
I made an account just so that I could bump this topic.

I desperately want the physical/special split in english rom hacks, with all my heart. I have little experience, but I think I can see what Jambo was getting at.

In the code, there must be something like this:

Pokemon_attacks{
If(move.type = fire){
use_special_atk()
}
if(move.type = fighting){
use_physical_atk()
}
etc
etc
}

and what we want to do is make it so that it goes like this:

Pokemon_attacks{
If(move.split = special){
use_special_atk()
}
if(move.split = physical){
use_physical_atk()
}
}

First we have to find where in the code this actually happens. after that, we'd need to find a way to assign the binary variable "split" to a move. I propose we could use the "makes contact" variable. Sure, moves like earthquake would make contact suddenly, but that's a small price to pay for the glory of a physical/special split.

It would look something like this:

Pokemon_attacks{
If(move.contact = no){
use_special_atk()
}
if(move.contact = yes){
use_physical_atk()
}
}


I realize that the actual code probably looks more like the matrix than javascript, but something analogous to what I suggest ought to exist somewhere in that mess. I'd help if I could, but I have no idea where to start.

PLEASE, people who know their way around code, MAKE THIS A REALITY.

JJames19119
September 25th, 2011, 06:00 PM
First of all, ASM is not that simple. Variables don't just come and go like that, if there's not enough room for a value in the registers, then you've got a problem.

More over, there's no need to use the contact byte in the attack data because there's enough space in the data struct to allow three more values that can reach 255, which is more then what we need since all we really need is just a boolean. The contact byte can stay the same so long as the code can be altered to take advantage of the new flag in the struct, which is what my patch for Fire Red does, albiet in a highly messy and unoptimized way. But what this means is that it's most certainly possible.

Darthatron
September 25th, 2011, 07:14 PM
Here's the hack for Emerald that I whipped up in about an hour. The little testing I did shows it to be working fine, but who knows. At least it's a base for someone. It uses the same byte as the FireRed hack (the second padding byte.)

kthx

0804674E: 80 7A
080695E8: 80 7A
08069A5A: 00 29
08069A5C: 00 D0
08069BC4: 01 2F
08069BC6: 00 DC
08069BCC: 01 28
08069BCE: 00 D0

JJames19119
September 25th, 2011, 07:31 PM
You made it working with just those bytes alone?

I seriously can't doubt Jambo now.

Can someone test whether or not the bugs with my patch are still present in that change? I wanna find out if the bytes I copied were faulty or if it's the ROM itself. I'll make an IPS patch for Emerald for anyone too lazy to pick up a hex editor and do it themselves.

Edit: Man, looking back on it, it feels silly to upload a 41 byte file but...

http://srpgp.supersanctuary.net/emerdpss.ips

Does NOT include any attack data structure support. You will have to edit in actually changing the moves' phys/spec classification yourself.

Big_Bad_Lith
September 25th, 2011, 08:23 PM
please excuse my ignorance, I am the newest of noobs. How can I access the move data? What do I do with the ips file?

also thank you very much everyone for working on this.

JJames19119
September 25th, 2011, 08:46 PM
Changing the moves requires some form of hex editing and a LOT of patience and time. I suggest looking here (http://bulbapedia.bulbagarden.net/wiki/Move_data_structure_in_Generation_III).

The IPS file is a patch. It's obvious you haven't dealt with ROM hacking for very long so I just suggest looking up "IPS Patch" on Google and waiting for someone to post another patch that deals with all the moves. I'd do it myself but I'm probably going to be testing and making sure this works (and hoping I'm not embarrassing myself and falling for a trap or something)

Big_Bad_Lith
September 25th, 2011, 09:53 PM
turns out I'm not only new, I'm also impatient and foolhardy.

I got the ips patch thing done.
I found a hex editor, and know what byte I should be changing, and I found where the moves start (at pound), but I don't know what all the moves are.

Is there some sort of table that shows this, similar to the fingerprint section in the link you posted? or at least a list of all the moves in order, so that I can go down the list and see which ones I want to make special or physical.

thanks in advance!

JJames19119
September 25th, 2011, 09:56 PM
This page (http://bulbapedia.bulbagarden.net/wiki/List_of_moves) actually lists all the move by their index number very helpfully, so this will help you in your endeavor. Good luck!

Jambo51
September 25th, 2011, 11:35 PM
What about showing the little category image where necessary? Does anyone understand the code well enough to be able to draw an extra image on the screen. At the moment, the split is completely hidden from the eyes of the player.

To that end, I set all status moves on my patch as category 2 rather than 0, as status moves should never directly harm the opponent, this works as the damage calculation routines are never called when using the status moves.

Obviously, the plan would be to store the images somewhere in the Rom and when using them, check the category byte to get the correct image. Thing is, this requires us to know the game's procedure for writing images to the screen.

Thoughts?

treeckopa
September 26th, 2011, 01:30 AM
I've found a DPSS patch for Japanese Emerald
After patching it to a Japanese Emerald, I've found the following:
http://www.pokecommunity.com/attachment.php?attachmentid=62118&stc=1&d=1317028876
The left one is the patched one and the right one is the original one.
It shows a few lines only...

For the first line, we can locate "00 06 00 28 07 D1 6E 20 41 46 41 43 08" at around 0x03D060 in an English Emerald.
I think it's possible to change the "6E" to "64", and then modify the rest using the same method....

Actually I don't know if that works, but a Chinese hacker has successfully implanted DPSS into an English Emerald. It may be a possible way to implant DPSS into an English Emerald, though it's quite troublesome...

Here I've attached the DPSS patch for Japanese Emerald. Hope that it can help.

JJames19119
September 26th, 2011, 03:33 AM
I've found a DPSS patch for Japanese Emerald

That's nice and all but I tested this post's (http://www.pokecommunity.com/showpost.php?p=6864164&postcount=61) changes and they work quite perfectly. Without the same bugs as my fire red patch too.

Big_Bad_Lith
September 26th, 2011, 06:55 PM
That's nice and all but I tested this post's changes and they work quite perfectly. Without the same bugs as my fire red patch too.

do they? I don't mean to be rude to either you or Dathatron, but when I put the patch onto a fresh copy of emerald, the damage got waaaay too low!

I was dealing maybe 1 or 2 points per hit, against the very first lv. 2 Zigzagoon! And I'm sure it isn't my messing around with the hex tables, because like I said, I tried it on a completely fresh copy. and even when I then went in and cranked up scratch's base power and Torchic's attack stat, it still did little damage!

JJames19119
September 26th, 2011, 06:59 PM
I just tried it myself. It works just fine. Even repatched my IPS file onto a fresh copy myself, it works exactly as it should. Are you sure your copy hasn't been fiddled with?

Big_Bad_Lith
September 26th, 2011, 07:42 PM
I just re-downloaded both the rom and the patch - same result as before. Could you upload a pre-patched version, ie, a copy of what you just got working properly?

Darthatron
September 26th, 2011, 07:59 PM
do they? I don't mean to be rude to either you or Dathatron, but when I put the patch onto a fresh copy of emerald, the damage got waaaay too low!

I was dealing maybe 1 or 2 points per hit, against the very first lv. 2 Zigzagoon! And I'm sure it isn't my messing around with the hex tables, because like I said, I tried it on a completely fresh copy. and even when I then went in and cranked up scratch's base power and Torchic's attack stat, it still did little damage!

Like I said, I did it in about an hour, and I only tested it with Pound. So it's very possible I broke something. I'll have a look at it soon. :)

And you weren't being rude. But the values are 00 = Physical; 01 = Special; 02+ = Status; Anything that's given a value of 02 or higher will deal one damage.

JJames19119
September 26th, 2011, 08:07 PM
I just re-downloaded both the rom and the patch - same result as before. Could you upload a pre-patched version, ie, a copy of what you just got working properly?

I think maybe you should give a look at the rules if you're asking such a question.

Big_Bad_Lith
September 26th, 2011, 09:12 PM
I think maybe you should give a look at the rules if you're asking such a question.

ah, well then. I'll just wait for Darthatron and you other people who know what you're doing, then. :P

treeckopa
September 27th, 2011, 02:58 PM
Can this method work on Hidden Power, so that Hidden Power is always Special no matter which type it is?

JJames19119
September 27th, 2011, 03:03 PM
I believe so, since it no longer checks the type but the move in specific for what classification it uses.

Leafbarrett
October 25th, 2011, 05:22 AM
Ohai thar. Lookie what I got.
http://www.mediafire.com/?ztqiczuu654osep
Physical/special split for Emerald, complete with move changes. Please ignore the changed Ralts family sprites, as I was silly and forgot to use a completely fresh ROM for the edits, ahurrhurr.
EDIT: Oh ffs. Special attacks work fine, but physical attacks are counted as status attacks, and do pathetic damage. I know I set physical attacks to 00 like I was supposed to... Didn't someone else have this problem?
EDIT2: I patched the engine by itself (as in, not my changed one) into a perfectly fresh rom (meaning all attacks are considered physical, or should be) and everything does absolutely pathetic damage. I think it's an issue with the patch. And of course, neither of the people who would know what's going on- JJames or Darthatron- are anywhere to be found, because it'd be helpful if they could be contacted, therefore it can't happen.

Gamer2020
October 25th, 2011, 09:17 AM
I should announce that the move editor in the new version of PGE (http://thepkmnworld.co.uk/forum/showthread.php?t=2009) has support for the class split. You can select whether you want the move to be special or physical.

JJames19119
October 25th, 2011, 10:58 AM
Yeah, there is a weird glitch with Darthathon's patch. I can't explain it honestly. The split works properly for what I believe are moves with no effect? But any moves that DO have an effect and are physical all do utterly low damage. I can't say for sure since I've gotten moves with no effect still doing no damage. This only bothers physical moves; special moves work just fine. I didn't encounter this in my initial testing, weirdly enough.

ROMs are just very confusing to me now.

Ongekibou
October 26th, 2011, 12:18 AM
Setting a move type to ??? does the same thing (low damage). Perhaps its related?

DavidJCobb
October 26th, 2011, 07:17 PM
Setting a move type to ??? does the same thing (low damage). Perhaps its related?If that's the case, then perhaps the low damage is the result of some sort of error checker/handler?

Darthatron
October 26th, 2011, 07:38 PM
This what happens when you don't test things. :\ Sorry guys. I'll take a look at it some time soon.

Ongekibou
October 27th, 2011, 03:22 AM
If that's the case, then perhaps the low damage is the result of some sort of error checker/handler?

Well the ??? type is inbetween the physical types and special types. If you add another type, it defaults to Special. It's likely some crazy stuff in the original code that tells the game which types to make Physical that's screwing up the code.

Leafbarrett
November 29th, 2011, 08:48 AM
Soooo... basically, nobody has any idea why this is happening. Sigh. So much for doing a Nuzlocke screenshot run of a DPSS Emerald...
Yeah, there is a weird glitch with Darthathon's patch. I can't explain it honestly. The split works properly for what I believe are moves with no effect? But any moves that DO have an effect and are physical all do utterly low damage. I can't say for sure since I've gotten moves with no effect still doing no damage. This only bothers physical moves; special moves work just fine. I didn't encounter this in my initial testing, weirdly enough.

ROMs are just very confusing to me now.Pound doesn't work either, so it's all physical moves.

Krika
December 5th, 2011, 03:48 PM
Hang on. Could someone summarize what progress has been made with this? As best I can tell, there is a patch that implements the DPSS in Firered, and another that does it in Emerald, but that both are bugged. What exactly are the bugs in each of them? (Basically, is either in a usable condition to be plugged into a hack?)

Agastya
December 5th, 2011, 11:37 PM
Hang on. Could someone summarize what progress has been made with this? As best I can tell, there is a patch that implements the DPSS in Firered, and another that does it in Emerald, but that both are bugged. What exactly are the bugs in each of them? (Basically, is either in a usable condition to be plugged into a hack?)

The Fire Red one handles Special and Physical correctly, but if a Fire attack hits Flash Fire or an Electric attack hits Volt Absorb, the game crashes. I'm not sure about Water Absorb.

The Emerald one handles Special correctly, but Physical attacks don't work correctly and will all do 1~2 damage as if they were ???-type attacks. I think it doesn't have the Flash Fire issue.


FR is usable if you can avoid the ability clashes, and Emerald kind of.. isn't.

Krika
December 6th, 2011, 11:47 AM
Alright, cool. That's helpful. Thanks

Darthatron
December 6th, 2011, 06:08 PM
Sorry for the delay. This appears to fix the problem with my Emerald patch.

[S-HIGHLIGHT]0804674E: 80 78[/S-HIGHLIGHT]
080695E8: 80 7A
08069A5A: 00 29
08069A5C: 00 D0
[S-HIGHLIGHT]08069BC4: 02 2F
08069BC6: 00 DB[/S-HIGHLIGHT]
08069BCC: 01 28
08069BCE: 00 D0

Changes are [S-HIGHLIGHT]highlighted[/S-HIGHLIGHT].

Post here if something is still wrong. (Once again I didn't test it very much.)

Jambo51
December 12th, 2011, 08:48 AM
Just came across something slightly disturbing. There's a second check in the code in FR after the known one, in the "special" part of the code, which is the cause of some of the bugs with the "cut down" versions of the code we have developed.

The bug was caused by the first check being correct for the new version, but the second being incorrect. This was why we were seeing 2 HP damage attacks in FR. This may also be the case in Emerald, though I haven't checked.

For the record, I changed it to branch off specifically for type 0x9 (???) but to execute normally for anything else. This fixed the bug immediately.

ArmoredGuns
December 12th, 2011, 05:04 PM
Sorry for the delay. This appears to fix the problem with my Emerald patch.

[S-HIGHLIGHT]0804674E: 80 78[/S-HIGHLIGHT]
080695E8: 80 7A
08069A5A: 00 29
08069A5C: 00 D0
[S-HIGHLIGHT]08069BC4: 02 2F
08069BC6: 00 DB[/S-HIGHLIGHT]
08069BCC: 01 28
08069BCE: 00 D0

Changes are [S-HIGHLIGHT]highlighted[/S-HIGHLIGHT].

Post here if something is still wrong. (Once again I didn't test it very much.)

Thank you very much. Will you update Attack Editor Pro so that now it includes the physical/special split? I'm looking forward to it!!

Gamer2020
December 12th, 2011, 05:48 PM
Thank you very much. Will you update Attack Editor Pro so that now it includes the physical/special split? I'm looking forward to it!!
PGE supports the physical/special split.

ArmoredGuns
December 12th, 2011, 06:25 PM
PGE supports the physical/special split.

Yes but I suppose it's the old version, since Darthatron posted the working code 5 days ago.

Gamer2020
December 12th, 2011, 07:51 PM
Yes but I suppose it's the old version, since Darthatron posted the working code 5 days ago.
That doesn't make a difference.

ArmoredGuns
December 13th, 2011, 02:57 PM
That doesn't make a difference.

I tested it and it doesn't work.

I changed Scratch to special, and Torchic does the same damage as if it were a physical move (after having edited torchic to have a 200 sp. attack base and a different ability).

I'm using emerald BTW.

Darthatron
December 13th, 2011, 03:20 PM
Thank you very much. Will you update Attack Editor Pro so that now it includes the physical/special split? I'm looking forward to it!!

Nah... Probably never. I don't have the original source, and I don't really see it as vital since there are other editors.

Chaos Rush
December 13th, 2011, 03:24 PM
I tested it and it doesn't work.

I changed Scratch to special, and Torchic does the same damage as if it were a physical move (after having edited torchic to have a 200 sp. attack base and a different ability).

I'm using emerald BTW.
That's because I'm assuming you haven't put in Darthatron's changes. Both the new code and the old code have the attacks read in the same format, hence why PGE works with both.

(ps I tested it on Ruby and it works, even with PGE. I figured out how to do it on Ruby by finding similar data to the offsets Darthatron posted, I made a thread in the Sideshowcase but it hasn't been approved yet, so PM me if you want my patch or think I'm lying or something)

ArmoredGuns
December 14th, 2011, 12:33 PM
Well, can someone make an IPS patch for Emerald? Thanks!

Gamer2020
December 14th, 2011, 06:21 PM
I tested it and it doesn't work.

I changed Scratch to special, and Torchic does the same damage as if it were a physical move (after having edited torchic to have a 200 sp. attack base and a different ability).

I'm using emerald BTW.
Well then you've done something wrong obviously since other people have gotten it to work.

Agastya
December 14th, 2011, 08:19 PM
Darthatron's patch for Emerald works excellently, but there's a.. small, I guess, bug with Counter and Mirror Coat in it.

Counter won't reflect physical attacks if they're using a type that was formerly special, and Mirror Coat won't reflect special attacks if they're using a type that was formerly physical.

In the same vein if a special attack with a formerly physical type hits Counter, then it'll reflect it, and same with Mirror Coat/physicals with formerly special types.

Considering that Counter/Mirror Coat don't get used that often in the course of normal gameplay, it can be somewhat hard to notice, and probably only really a huge deal if you like using those moves often yourself.

I don't know if this happened with the JP versions of DPSS patches, because I saw Counter a grand total of zero times, so..

Darthatron
December 14th, 2011, 08:55 PM
ArmoredGuns: Nah... I can't be bothered making a patch. Someone else can.

Darthatron's patch for Emerald works excellently, but there's a.. small, I guess, bug with Counter and Mirror Coat in it.

Counter won't reflect physical attacks if they're using a type that was formerly special, and Mirror Coat won't reflect special attacks if they're using a type that was formerly physical.

In the same vein if a special attack with a formerly physical type hits Counter, then it'll reflect it, and same with Mirror Coat/physicals with formerly special types.

Considering that Counter/Mirror Coat don't get used that often in the course of normal gameplay, it can be somewhat hard to notice, and probably only really a huge deal if you like using those moves often yourself.

I don't know if this happened with the JP versions of DPSS patches, because I saw Counter a grand total of zero times, so..
I dunno what they do. Explain, please? Also, does it crash, or just... do nothing? Glad it 'works', though. :P

Agastya
December 14th, 2011, 09:02 PM
It doesn't crash. Nothing bad happens, the moves simply fail.

For example, A Fire-typed Physical move, like, say, Blaze Kick, will cause Counter to fail, but Mirror Coat will deal the double damage back.

Similarly, a Ghost-typed Special move like Shadow Ball will cause Mirror Coat to fail, but it can be Countered back for doubled damage.

I haven't tripped over anything else yet, and this is honestly more of an annoyance than anything else. The moves aren't seen very often.

Darthatron
December 15th, 2011, 03:32 AM
I'll look at their code some time. But it doesn't really seem that important. So yeah. Thanks for telling me, though. :)

Krika
December 15th, 2011, 01:55 PM
I'd hazard a guess that they're probably coded to run off of typing, not physical/special (since there isn't a distinction between them in the non-hacked game).

colcolstyles
December 16th, 2011, 03:50 PM
I think I found the bit of code responsible for the Counter/Mirror Coat glitch. At 0x47f02, the game loads the elemental type of the move with a "ldrb r6, [r0, #0x2]" instruction. Change the offset to wherever your custom physical/special/status byte is. Then, go to 0x48148 and change the "cmp r6, #0x8" instruction to "cmp r6, #0x0". Honestly, I don't understand the differences between the two branches but when I changed the conditional, it fixed the glitch.

edit: Ah, what the hell. I've attached my patch for whoever wants to test it.

ArmoredGuns
December 16th, 2011, 10:34 PM
I think I found the bit of code responsible for the Counter/Mirror Coat glitch. At 0x47f02, the game loads the elemental type of the move with a "ldrb r6, [r0, #0x2]" instruction. Change the offset to wherever your custom physical/special/status byte is. Then, go to 0x48148 and change the "cmp r6, #0x8" instruction to "cmp r6, #0x0". Honestly, I don't understand the differences between the two branches but when I changed the conditional, it fixed the glitch.

edit: Ah, what the hell. I've attached my patch for whoever wants to test it.

Thanks a lot for your patch!!

After applying your patch and comparing it with the original in Hex Workshop, I see both changes that you mention up there, but there are also many other changes (like "insert" at offset 009c1000 and "replace" at many 0031XXXX), may I bother asking you what are those changes (other than the light screen/reflect data that I read on your txt file)? Thanks!

colcolstyles
December 16th, 2011, 11:15 PM
Thanks a lot for your patch!!

After applying your patch and comparing it with the original in Hex Workshop, I see both changes that you mention up there, but there are also many other changes (like "insert" at offset 009c1000 and "replace" at many 0031XXXX), may I bother asking you what are those changes (other than the light screen/reflect data that I read on your txt file)? Thanks!

I uploaded a new archive with the asm files that I used. The 'physpec.asm' file details the exact changes but I also did a file compare with WindHex to see exactly what I changed. I'll sum up the differences here:

047f02 Changed a 'ldrb' instruction to load the custom byte
048148 Changed a 'cmp' instruction to test for 0x0 (physical)
0695e8 Changed a 'ldrb' instruction to load the custom byte
069602 Inserted a "ldr + bx" hijack, branches to 0x9c1000
069a5a Changed a 'cmp' instruction to test for 0x0 (physical)
069a5e Changed a 'b' instruction to branch to a different routine
31xxxx All the changes to the attack data table
9c1000 The hijacked routine, branched to from 0x69604

Darthatron
December 17th, 2011, 07:42 PM
I uploaded a new archive with the asm files that I used. The 'physpec.asm' file details the exact changes but I also did a file compare with WindHex to see exactly what I changed. I'll sum up the differences here:

047f02 Changed a 'ldrb' instruction to load the custom byte
048148 Changed a 'cmp' instruction to test for 0x0 (physical)
0695e8 Changed a 'ldrb' instruction to load the custom byte
069602 Inserted a "ldr + bx" hijack, branches to 0x9c1000
069a5a Changed a 'cmp' instruction to test for 0x0 (physical)
069a5e Changed a 'b' instruction to branch to a different routine
31xxxx All the changes to the attack data table
9c1000 The hijacked routine, branched to from 0x69604

What did you need to hijack a routine for? I'm a bit confused.

colcolstyles
December 17th, 2011, 11:51 PM
What did you need to hijack a routine for? I'm a bit confused.

While writing up a reply to this question, I realized that the hijack was a very kludgey means of accomplishing something which could be done a lot more simply. So I removed the hijack part and replaced it with a simple byte edit at 0x69bcc which does the same thing. Once again, I've re-uploaded my patch. Since the .asm files are obsolete, I've included the changes in the README instead.

Chaos Rush
December 18th, 2011, 12:38 AM
These are the offsets you need to change to activate it on Pokemon Ruby:

3BA94: 80 7A
3BFBE: 00 29
3BFC0: 00 D0
3C124: 02 2E
3C126: 00 DB
3C12C: 01 28
3C12E: 00 D0

And for those who care, here's a patch for Ruby that has the physical/special split implemented, and has all the attacks categorized into physical/special/status:
http://www.pokecommunity.com/showthread.php?t=268940

Credit goes to Darthatron for posting how to do it on Emerald, since I found the Ruby offsets by searching for similar bytes to the offsets that Darthatron posted. And I'm assuming the recently found Mirror Coat/Counter glitch is present with this patch also.

Darthatron
December 21st, 2011, 03:12 AM
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.

http://i.imgur.com/2P1q7.png http://i.imgur.com/wvgzs.png http://i.imgur.com/tvfIU.png

Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.

Jambo51
December 21st, 2011, 07:49 AM
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.

http://i.imgur.com/2P1q7.png http://i.imgur.com/wvgzs.png http://i.imgur.com/tvfIU.png

Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.

Just out of curiosity - Why do you say working on?
This looks pretty d**n good to me. Obviously, I can't see any potential bugs which could arise from this, but it looks fine to me.

Anyway - when it's finished, will you release the code? As it's something which would come in very handy in my 649 Patch. I would (of course) credit you if you did release it. :)

Chaos Rush
December 21st, 2011, 09:00 AM
Here's what I'm working on now. For FireRed. Will port to other games... Maybe.

http://i.imgur.com/2P1q7.png http://i.imgur.com/wvgzs.png http://i.imgur.com/tvfIU.png

Kind of just the (metaphorical) icing on the (metaphorical) cake that we've already made. Letting people see what is Physical/Special/Status.
On my Ruby hack/project thing, I was thinking of modifying the fourth page on the summary to detail the physical/special indicators rather than Contest info (thus effectively breaking Pokemon Contests in the process), but since you said you might port to other versions I'm not sure if I want to follow through on that.

EDIT: This is what I meant:
http://img849.imageshack.us/img849/60/14142752.png
^If I did this, then Pokemon Contests will become broken.

Darthatron
December 21st, 2011, 10:07 PM
Just out of curiosity - Why do you say working on?
This looks pretty d**n good to me. Obviously, I can't see any potential bugs which could arise from this, but it looks fine to me.

Anyway - when it's finished, will you release the code? As it's something which would come in very handy in my 649 Patch. I would (of course) credit you if you did release it. :)

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:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]

Here's the source:
.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: http://i.imgur.com/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. :)

Jambo51
December 22nd, 2011, 01:53 PM
So, say I could find where the game writes the data to the screen normally, and hijacked that code, I could potentially make it appear at the same time as the rest of the information, instead of one frame before it?

The images also appear in cancel, which they shouldn't. However, the images themselves worked fine.

To prevent the image showing for cancel - simply include a cmp r3, #0x0 after loading the attack ID into the register, and if it's 0, branch to Finish. I changed it to do this, and it worked satisfactorily.

Incidentally - 1 frame, does it REALLY bother you that much? It has to be barely noticeable, surely?

EDIT: I take it back - It is kinda annoying :(

Darthatron
December 22nd, 2011, 08:56 PM
I'm sure with our combined brains, we can work it out. :P I don't have time until after Christmas, however.

ArmoredGuns
December 23rd, 2011, 01:45 AM
Seems awesome!!! I'm looking forward to an Emerald port :)

JJames19119
December 24th, 2011, 10:29 PM
This might sound arrogant coming from the person who started this thread and then promptly left it to grow up into a big strong man on it's own (they grow up so fast *sniff*) but when can we expect a clean DPSS patch into Fire Red? I will take the first step into admitting that my patch was nothing more then presented research designed to help anyone interested reach the goal of a clean modification that others can use to improve their own hacks. The patch itself (that I made) is horrifically broken and unprofessional, unfit for any serious hack to use. I blame this on my complete lack of education in ASM and how the GBA works, and probably wasn't even necessary for someone as smart as Darthatron, whom I am highly thankful for in whipping up an Emerald patch. My gratitude extends to everyone else too who's been working on this project and I'm glad I at least put forth the voice and research to make this possible. (Even if it might've happened anyways regardless of my attendance)

If there's already a clean DPSS patch for FR like there is now for Emerald, then disregard me, I lick lollipops. If not though, I'd like to know if it's in the works at least. Judging from the small amount of bytes Darthatron's Emerald DPSS changes, it'll be a lot more efficient then my bulky, strung together patch.

Wiznatts
December 26th, 2011, 06:54 PM
I'm pretty sure Jambo has it implemented in his Pokedex hack, though I'd assume its pretty similar to what is out there for Ruby and Emerald. I'd ask him if he could put it out.

Jambo51
December 27th, 2011, 01:04 AM
Nah, I'm still trying to work out issues with it. Some physical attacks do little or no damage at times. Oddly, this occurs more often with attacks which were physical before the split too. I'm still trying to track down the code for Mirror Coat/Counter, as that will no doubt be buggy, same as any other gen 3 Rom.

Darthatron
December 27th, 2011, 03:27 AM
Did you want me to port my Emerald version to FireRed, or are you set?

Krika
December 28th, 2011, 05:16 PM
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
December 29th, 2011, 02:44 PM
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
December 31st, 2011, 08:36 PM
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

[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #FF6633"]FireRed (US)[/css-span]
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0

[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #CC0000"]Ruby (US)[/css-span] 1
0803BA94: 80 7A
0803BFBE: 00 29
0803BFC0: 00 D0
0803C124: 02 2E
0803C126: 00 DB
0803C12C: 01 28
0803C12E: 00 D0

[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #339900"]Emerald (US)[/css-span] 2
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 (http://www.pokecommunity.com/member.php?u=47122) for the Ruby port; I don't even have a Ruby ROM. xD
2 Credit to colcolstyles (http://www.pokecommunity.com/member.php?u=91213) for the Emerald hack; I based everything off of his post (http://www.pokecommunity.com/showpost.php?p=6232678&postcount=3).

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...

Jambo51
January 1st, 2012, 10:35 AM
[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #FF6633"]FireRed (US)[/css-span]
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. :)

Darthatron
January 6th, 2012, 01:46 AM
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..?
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:
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:
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.

Jambo51
January 6th, 2012, 07:57 AM
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.
0801F6C2: 86 7A
0801F908: 00 2E
0801F90A: 41 D1


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.

.align 2
.thumb
Start:
push {r0-r4}
ldr r0, .CurMoveIndex
ldrb r1, [r0]
lsl r1, r1, #1
ldr r0, .Move_List_Loc
ldr r0, [r0]
ldr r3, .number
add r0, r0, r3
add r0, r0, r1
ldrh r3, [r0]
cmp r3, #0x0
beq Finish
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
.number: .word 0x00003258
.CurMoveIndex: .word 0x0203B16D
.Move_List_Loc: .word 0x0203B140
.VRAM: .word 0x06001800
.SplitImages: .word 0x08YYYYYY
.Some_Offset: .word 0x0203B148
.Return_Addr: .word 0x0813A17D

Darthatron
January 6th, 2012, 08:52 PM
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.

Eelektross
January 8th, 2012, 05:58 AM
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!

pokemon1412
January 21st, 2012, 03:17 PM
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:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]

Here's the source:
.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: http://i.imgur.com/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...

http://i289.photobucket.com/albums/ll207/pokemon1412/splittest.jpg

thank you~

iJordahn
February 18th, 2012, 11:18 AM
HAPPY NEW YEAR!

[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #FF6633"]FireRed (US)[/css-span]
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
February 18th, 2012, 05:44 PM
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
February 19th, 2012, 02:02 PM
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.

pokemon1412
February 19th, 2012, 07:32 PM
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
February 27th, 2012, 08:22 PM
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
February 28th, 2012, 03:44 AM
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.

pokemon1412
February 29th, 2012, 01:02 AM
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...

Ivee
February 29th, 2012, 10:36 AM
Rock types didn't get the special defense sandstorm boost til gen 4.

Jambo51
February 29th, 2012, 10:45 AM
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.

Darthatron
February 29th, 2012, 04:04 PM
Looks like I'll have to completely rework my patch to get these bugs fixed...

Chaos Rush
March 3rd, 2012, 11:10 PM
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.
I can confirm that this bug is present in the Ruby version of the hack as well, so it most likely is also present in the Emerald one too, since the Emerald one was by Darthatron, and the Ruby hack I did is based off of Darthatron's.

Agastya
March 8th, 2012, 06:35 AM
I guess while we're talking about it, Weather Ball's damage is minimal just like Hidden Power's. Probably a side effect of it being so small compared to the JP ones, none of the type-related checks are in it, just damage and type effectiveness.

Also, what does Sandstorm not increasing SDef until 4th gen have to do with anything? Isn't this a a thread for research into a hack emulating 4th gen mechanics in 3rd gen ROMs? The JP hacks posted by pokemon1412 (on this page, post #134) have those implemented along with offsets in JP ROMs about what does what. People with actual technical knowledge about what's going on in the ROMs could probably just look at those and reverse-engineer them.


big talk for somebody who doesnt know whats actually going on in a rom, huh

Jambo51
March 8th, 2012, 12:12 PM
I guess while we're talking about it, Weather Ball's damage is minimal just like Hidden Power's. Probably a side effect of it being so small compared to the JP ones, none of the type-related checks are in it, just damage and type effectiveness.

Cheers, I'll investigate it and see if this is still the case after I've applied my fix.

Also, what does Sandstorm not increasing SDef until 4th gen have to do with anything? Isn't this a a thread for research into a hack emulating 4th gen mechanics in 3rd gen ROMs? The JP hacks posted by pokemon1412 (on this page, post #134) have those implemented along with offsets in JP ROMs about what does what. People with actual technical knowledge about what's going on in the ROMs could probably just look at those and reverse-engineer them.

All I was saying is rather than being a bug, it was an oversight. We should still apply it, but it's not a bug. That was all I was getting at.

farmerluk
April 16th, 2012, 04:10 AM
Sorry to ask, but with the various links to different patches, what patch(es) and script do I need to implement this is Fire red? New to this, and want to do a good job with my rom.

-----------

Reread the board with a clear head (stupid that I read this last night while tired). Got the code, just need to implement it. Aware of the glitches involving torrent,blaze etc, and sunny day/rain dance.
Many thanks to you all, your persistence is incredible.


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

Could you possibly please point me in the direction of the fix?



Also one last question. Does the version of the rom matter? I backed up my own ruby and fire red, they're EU rather than US.

Jambo51
April 17th, 2012, 01:35 PM
Could you possibly please point me in the direction of the fix?

I haven't released it yet, hence why you can't find it. I'll dig it up and tag it onto the end of this post when I find it.

Also one last question. Does the version of the rom matter? I backed up my own ruby and fire red, they're EU rather than US.

Yes, it matters. Everything we have researched will explicitly only work on the US version of the ROM. The thing is, you MAY have a US version. The english european ROM was actually the american one!

Boot up your FR ROM. If it is in english and it does NOT say Game Freak Presents, then you should be good to go.

Agastya
April 25th, 2012, 06:04 AM
Not to sound rude or anything, but it sure is taking you a while to dig up and post a fix that you supposedly had a few months ago..

Actually, why didn't you just post the actual fix then, anyway? It would have saved everybody a lot of time, and it probably would have already been ported to the other third gen games by now, too.

Jambo51
April 25th, 2012, 08:43 AM
Not to sound rude or anything, but it sure is taking you a while to dig up and post a fix that you supposedly had a few months ago..

Actually, why didn't you just post the actual fix then, anyway? It would have saved everybody a lot of time, and it probably would have already been ported to the other third gen games by now, too.

I haven't posted it since then because I was:
1) Testing the damned thing to make sure it worked
2) Being busy with exams and coursework
3) Having a life beyond hacking

.text
.align 2
.thumb
.thumb_func
.global LCDPSSGlitchFix
main:
ldr r0, [sp, #0x8]
lsl r1, r0, #0x1
add r1, r1, r0
lsl r1, r1, #0x2
ldr r0, attackdata
add r0, r0, r1
ldrb r0, [r0, #0x2]
mov r11, r0
mov r2, r11
cmp r2, #0xD
bne continue
mov r0, #0x0
str r0, [sp, #0x0]
ldr r0, return
bx r0
continue: ldr r3, returntwo
bx r3
.align
return: .word 0x0803F10D
returntwo: .word 0x0803F127
attackdata: .word 0x08250C04


At 0x3F102, change the code to 01 4A 10 47 00 00 XX XX XX 08.

That isn't all though, you also need to change:

0803F126: 5B 46
0803F14A: 58 46
0803F17A: 5A 46
0803F1AA: 58 46
0803F1DA: 5A 46

You should be good to go after that.

DoesntKnowHowToPlay
April 25th, 2012, 01:33 PM
I see a number of problems with this fix- it doesn't appear to resolve hold items or weather, which will still check against register 9. Weather Ball and Hidden Power will also probably break, as they operate by changing register 9. Thick Fat is also untouched, and will thus never work as it checks register 9 for type (and even if that was fixed it'd only weaken special attacks).

Implementation-wise I'm not too fond of this either- if we used register 11 for the physical/special byte, and register 9 for the type, things like Mud Sport and pinch abilities would solve themselves. It'd also be nice if we could do this without method hijacking, so that non-ASM savvy people can implement this with little difficulty.

Anyway, I've spent the last week working on this, and have a working fix here: s7.zetaboards.com/Nuzlocke_Forum/topic/8679031/1/#new

Jambo51
April 26th, 2012, 04:14 AM
My exact words were that it wouldn't be perfect, nor was it ideal. What someone needs to do (as boring as it is) is sit and go through the entire damage calculation part of the routine, and see if we can catch any such bugs. It is entirely possible that there are others which we have missed at some stage in this routine.

Anyway, I've spent the last week working on this, and have a working fix here: s7.zetaboards.com/Nuzlocke_Forum/topic/8679031/1/#new

What possible use is this for people such as myself who cannot access the page because we're not members? Would you kindly post it here, and we can go from there?

DarkenedWolf
April 26th, 2012, 10:42 AM
Well it doesn't really matter now that we have a perfect split!

Jambo51
April 26th, 2012, 03:21 PM
Well it doesn't really matter now that we have a perfect split!

We don't, sadly. All we have achieved so far is to put out fires, as it were. We're not actually solving the original problem.

I still propose that someone fully dissassembles the relevant part of the ROM and ensures that all the checks and such are correct, and if not, we can then fix then and be sure of said things working. However, until someone does this, we could have missed any small check.

DarkenedWolf
April 26th, 2012, 06:10 PM
My exact words were that it wouldn't be perfect, nor was it ideal. What someone needs to do (as boring as it is) is sit and go through the entire damage calculation part of the routine, and see if we can catch any such bugs. It is entirely possible that there are others which we have missed at some stage in this routine.



What possible use is this for people such as myself who cannot access the page because we're not members? Would you kindly post it here, and we can go from there?
this is what people who dont have pc accounts have to deal with all the time

We don't, sadly. All we have achieved so far is to put out fires, as it were. We're not actually solving the original problem.

I still propose that someone fully dissassembles the relevant part of the ROM and ensures that all the checks and such are correct, and if not, we can then fix then and be sure of said things working. However, until someone does this, we could have missed any small check.

Maybe all you have done is put out fires, but the split Doesn't created actually implements the split without skipping vital checks, like type items or pinch abilities. The only thing it doesnt do is add the SDef boost for rock types during sandstorm.

Jambo51
April 26th, 2012, 06:59 PM
this is what people who dont have pc accounts have to deal with all the time

Really? Even before I signed up for an account, I could READ PC, if nothing else. Admittedly, that was some time ago, and could have changed since then...

Maybe all you have done is put out fires, but the split Doesn't created actually implements the split without skipping vital checks, like type items or pinch abilities. The only thing it doesnt do is add the SDef boost for rock types during sandstorm.

Forgive me for being cynical, but until I see it, I won't believe it. However, don't get me wrong, I've been looking at this code on and off for ages, and I got sick of it, because it's just so boring. So props to you (or whomever made it) if there is a 100% working one.

Wiznatts
April 26th, 2012, 11:22 PM
As a mod over at the forum that Doesnt linked to, I can assure you it works as he described. Basically, he just sat down and analyzed the JP split that was posted in this and applied the same logic to an English ROM. Its not a straight hex copy either, which was the problem with the first patch from over a year ago.

He would have just posted it here, but post count limits don't let him link to other sites or to attach files so he really couldn't. I'll ask him if he wants me to post it for him.

InMooseWeTrust
April 29th, 2012, 08:06 AM
Really? That would be great. Can you PM me when it's posted? I don't read every thread that often so it would be really helpful for me.

SpectreX
June 19th, 2012, 02:07 PM
How do you put in that Emerald Phy./Spe. split?

Kindrindra
June 20th, 2012, 11:40 AM
How do you put in that Emerald Phy./Spe. split?

The numbers on the left are the hex locations, the numbers on the right are the hex values you need to put in. If you don't have a hex editor, you'll need one- I use XVI32 myself.

morikun
June 21st, 2012, 10:50 PM
I know barely anything about the actual steps of ROM-hacking, but I do understand what this could/would do for the actual community and the hacks themselves , and I am very excited to see if this pans out the way i hope!

shinyabsol1
August 14th, 2012, 01:56 PM
So is there a 100% working version of this for FR?

Bozster
August 24th, 2012, 11:17 AM
Sorry if this seems a stupid question, but I'm a bit confused. With what sort of hex editor are you supposed to find these eight digit pointers (in Emerald)? I'm sorry, but I'm having trouble finding them and I've looked up some hex editing tutorials which haven't given me any answers. Thanks!

timson733333
October 14th, 2012, 11:29 AM
Sorry if this seems a stupid question, but I'm a bit confused. With what sort of hex editor are you supposed to find these eight digit pointers (in Emerald)? I'm sorry, but I'm having trouble finding them and I've looked up some hex editing tutorials which haven't given me any answers. Thanks!

HxD works. Any hex editor where you can "go to" a byte works, basically.

Does anyone know the offsets for Ruby where you change to fix the Blaze/Torrent/Overgrow glitch? I saw the ones for the physical/special class split but can't find the ones for fixing the glitch.

dreamengine
December 12th, 2012, 11:57 PM
I haven't posted it since then because I was:
1) Testing the damned thing to make sure it worked
2) Being busy with exams and coursework
3) Having a life beyond hacking

.text
.align 2
.thumb
.thumb_func
.global LCDPSSGlitchFix
main:
ldr r0, [sp, #0x8]
lsl r1, r0, #0x1
add r1, r1, r0
lsl r1, r1, #0x2
ldr r0, attackdata
add r0, r0, r1
ldrb r0, [r0, #0x2]
mov r11, r0
mov r2, r11
cmp r2, #0xD
bne continue
mov r0, #0x0
str r0, [sp, #0x0]
ldr r0, return
bx r0
continue: ldr r3, returntwo
bx r3
.align
return: .word 0x0803F10D
returntwo: .word 0x0803F127
attackdata: .word 0x08250C04


At 0x3F102, change the code to 01 4A 10 47 00 00 XX XX XX 08.

That isn't all though, you also need to change:

0803F126: 5B 46
0803F14A: 58 46
0803F17A: 5A 46
0803F1AA: 58 46
0803F1DA: 5A 46

You should be good to go after that.

What does this fix do? Is the ASM code part of the fix?

DoesntKnowHowToPlay
January 1st, 2013, 05:05 PM
Now that I have enough posts to put this here I might as well for convenience's sake, it was rather rude of me to not just bypass the filter to get these links up:

FR: http://www.mediafire.com/download.php?7e0m7xhmyaga2af
Em: http://www.mediafire.com/download.php?ipcjia5b778zj8o

Like with the other implementations in this thread, they work off the eleventh byte of the move data. They also implement the Special Defense boost in Sand, and jump through a number of other hoops to not break existing abilities and attacks, which is why I provide them as patches and not simple hex edits. Be aware that these patches do not touch the move table- you'll have to toggle the moves as physical or special yourself. I recommend using a hex editor or Nightmare for this, but PGE can also do the job (slowly).

Credits go to Tailes for most of the work on the Emerald split.

Also yes you can use these for your hacks just give credit you don't need to pm me for permission and plz don't

shinyabsol1
January 1st, 2013, 05:36 PM
Like with the other implementations in this thread, they work off the eleventh byte of the move data. They also implement the Special Defense boost in Sand, and jump through a number of other hoops to not break existing abilities and attacks, which is why I provide them as patches and not simple hex edits. Be aware that these patches do not touch the move table- you'll have to toggle the moves as physical or special yourself. I recommend using a hex editor or Nightmare for this, but PGE can also do the job (slowly).

Will this split still work even if I have repointed the move data, attack names, etc?

Just want to make sure before I patch this to my ROM.

DoesntKnowHowToPlay
January 1st, 2013, 05:39 PM
Will this split still work even if I have repointed the move data, attack names, etc?

Just want to make sure before I patch this to my ROM.

You might need to fix a couple pointers to the old move data table, but it should still work.

Chaos Rush
January 1st, 2013, 08:15 PM
Now that I have enough posts to put this here I might as well for convenience's sake, it was rather rude of me to not just bypass the filter to get these links up:

FR: http://www.mediafire.com/download.php?7e0m7xhmyaga2af
Em: http://www.mediafire.com/download.php?5t81dh2ep0svp68

Like with the other implementations in this thread, they work off the eleventh byte of the move data. They also implement the Special Defense boost in Sand, and jump through a number of other hoops to not break existing abilities and attacks, which is why I provide them as patches and not simple hex edits. Be aware that these patches do not touch the move table- you'll have to toggle the moves as physical or special yourself. I recommend using a hex editor or Nightmare for this, but PGE can also do the job (slowly).

Credits go to Tailes for most of the work on the Emerald split.
Is the FireRed one safe to apply if you've already applied an earlier version of that patch? (The one you posted on the Nuzlocke forums)

PokemonMasters
January 1st, 2013, 08:21 PM
Yeah. He said its alright.

dreamengine
January 2nd, 2013, 12:04 AM
You might need to fix a couple pointers to the old move data table, but it should still work.

What do you mean by that? Do you need to change the new pointers back to the old ones before applying the patch or does it mean that the patch overwrites the changed pointers and you have to go back and change them again?

DoesntKnowHowToPlay
January 2nd, 2013, 06:43 AM
Is the FireRed one safe to apply if you've already applied an earlier version of that patch? (The one you posted on the Nuzlocke forums)

It's the same as the most recent version from there, so if you have that one you won't need to. It should be safe though.

What do you mean by that? Do you need to change the new pointers back to the old ones before applying the patch or does it mean that the patch overwrites the changed pointers and you have to go back and change them again?

I meant that the patch may introduce new pointers to the old move table that you'll want to hunt down after applying it, but it looks like it uses the exiting pointers so that shouldn't actually be a problem.

Ivee
January 2nd, 2013, 11:04 AM
You people are incredibly amazing. So it doesn't mess with the starter abilities/Flash Fire, or moves like Hidden Power? I plan to play with this tonight.

shinyabsol1
January 2nd, 2013, 01:35 PM
What do you mean by that? Do you need to change the new pointers back to the old ones before applying the patch or does it mean that the patch overwrites the changed pointers and you have to go back and change them again?

I meant that the patch may introduce new pointers to the old move table that you'll want to hunt down after applying it, but it looks like it uses the exiting pointers so that shouldn't actually be a problem.

I can confirm that this patch works with repointed move data. I tested it out yesterday (without needing to correct any new pointers) and encountered no problems.

tajaros
January 2nd, 2013, 03:09 PM
I can confirm that this patch works with repointed move data. I tested it out yesterday (without needing to correct any new pointers) and encountered no problems.

What if you repointed the move table after you applied the patch? :3

zabimaru1000
January 12th, 2013, 07:26 PM
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

[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #FF6633"]FireRed (US)[/css-span]
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0


Hi Darthatron, I'd really like to test out the Physical-Special Split on Fire Red, but I'm having trouble changing the bytes. I am using Hex Workshop and can't seem to locate what you typed in for Fire Red. I just started learning HEX Editing just to try out this P/S feature for 3rd generation games.

PokemonMasters
January 12th, 2013, 08:35 PM
Hi Darthatron, I'd really like to test out the Physical-Special Split on Fire Red, but I'm having trouble changing the bytes. I am using Hex Workshop and can't seem to locate what you typed in for Fire Red. I just started learning HEX Editing just to try out this P/S feature for 3rd generation games.

dont add 08 when searching. 08 just means its in the game ;)

zabimaru1000
January 15th, 2013, 04:36 PM
dont add 08 when searching. 08 just means its in the game ;)

Are you sure I'm searching for HEX values? It still says the specified search string was not found even when I did not add 08.

shinyabsol1
January 15th, 2013, 04:58 PM
Are you sure I'm searching for HEX values? It still says the specified search string was not found even when I did not add 08.

You misunderstand. You don't search for the bytes in the ROM, you goto the specified location. That's where you would remove the 08. So use your hex editor's "goto" function to find the place at which you need to change the bytes.

So for the first one, goto offset 03ED54 and change the bytes there to 80 7A.

zabimaru1000
January 16th, 2013, 07:40 PM
You misunderstand. You don't search for the bytes in the ROM, you goto the specified location. That's where you would remove the 08. So use your hex editor's "goto" function to find the place at which you need to change the bytes.

So for the first one, goto offset 03ED54 and change the bytes there to 80 7A.

Thanks mate. I've got the "go to" part down, but I can't really find the exact bytes I need to change. When I go to 03ED54, I find 0003ED52 instead. Am I supposed to find those exact digits?

EDIT: I've found the exact offset in 0003ED52, I'm at 03ED54 and where do I change the bytes to 80 and 7A? I can only change either 80 or 7A, do I have to change both at one offset?

shinyabsol1
January 17th, 2013, 03:29 PM
Thanks mate. I've got the "go to" part down, but I can't really find the exact bytes I need to change. When I go to 03ED54, I find 0003ED52 instead. Am I supposed to find those exact digits?

EDIT: I've found the exact offset in 0003ED52, I'm at 03ED54 and where do I change the bytes to 80 and 7A? I can only change either 80 or 7A, do I have to change both at one offset?

When you goto 03ED54, the cursor will move to the place where you need to start changing bytes (or it might be highlighted or something depending on what hex editor you're using -- I'm using HxD). From that point,overwrite bytes with the specified bytes (80 7A).

So in an unmodified FR ROM, 03ED54 should take you to an 80 byte, followed by 78 81 46 etc...

So put the 80 7A bytes there. You will end up with 80 7A 81 46 etc...

zabimaru1000
January 17th, 2013, 09:40 PM
When you goto 03ED54, the cursor will move to the place where you need to start changing bytes (or it might be highlighted or something depending on what hex editor you're using -- I'm using HxD). From that point,overwrite bytes with the specified bytes (80 7A).

So in an unmodified FR ROM, 03ED54 should take you to an 80 byte, followed by 78 81 46 etc...

So put the 80 7A bytes there. You will end up with 80 7A 81 46 etc...

Okay, so I've entered all of the bytes. Is that all there is to it? If so, then are the moves in 3rd gen split into Physical and Special moves? Like Shadow Ball is special and Waterfall is physical?

tajaros
January 17th, 2013, 10:48 PM
Okay, so I've entered all of the bytes. Is that all there is to it? If so, then are the moves in 3rd gen split into Physical and Special moves? Like Shadow Ball is special and Waterfall is physical?

No, you have to edit it manually you can use either a hex editor or PGE.

zabimaru1000
January 17th, 2013, 11:05 PM
No, you have to edit it manually you can use either a hex editor or PGE.

So I basically did this on HEX editor and saved it:

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

I've changed the following bytes. Do I have to manually change the moves I want to Physical/Special? What do I do next?

shinyabsol1
January 18th, 2013, 04:46 PM
I've changed the following bytes. Do I have to manually change the moves I want to Physical/Special? What do I do next?

Like tajaros said, you have to manually edit which moves are physical/special/status with either a hex editor or PGE.

So if you want to use PGE, load your ROM and go to the Attack Editor under the Internal Programs tab. Then, for every move, go through and change the Category to physical/special/status.

Agastya
January 18th, 2013, 06:17 PM
is there a good reason that none of you pointed him towards the physical/special patch posted by doesntknowhowtoplay (http://www.pokecommunity.com/showpost.php?p=7465618&postcount=163) that actually works instead of turning this thread into a hex editing tutorial if you were just going to say "use pge" when he got to move class?

zabimaru1000
January 20th, 2013, 09:53 PM
I applied the patch. Gyarados' Waterfall became physical, but Dragonite and Gengar's Dragon Claw and Shadow Ball are still special for some reason. I tried the moves on Pokemon with equal and even weaker levels than my team. It took less than half HP even for STAB moves.

Jambo51
January 20th, 2013, 10:48 PM
I applied the patch. Gyarados' Waterfall became physical, but Dragonite and Gengar's Dragon Claw and Shadow Ball are still special for some reason. I tried the moves on Pokemon with equal and even weaker levels than my team. It took less than half HP even for STAB moves.

You need to manually reassign all the moves and their categories. With the patch in place, all moves will be treated as physical, as the patch adds the necessary code to execute the split, but doesn't change the move data itself to recategorise them.

zabimaru1000
January 20th, 2013, 10:59 PM
You need to manually reassign all the moves and their categories. With the patch in place, all moves will be treated as physical, as the patch adds the necessary code to execute the split, but doesn't change the move data itself to recategorise them.

Do I use HEX Editor or PGE with the patch applied? How do I know if I'm reassigning the moves?

Jambo51
January 21st, 2013, 03:34 AM
You can just use PGE. The move editor (on the internal tools tab) has a drop does box which lets you select the category of the move.

Noossab Blue
January 26th, 2013, 08:11 PM
Originally there was work on a ruby patch for this...is there a working version of that or is it just emerald and firered?

Also, by chance has anyone posted a patch that has the moves changed already?

LCCoolJ95
February 1st, 2013, 10:39 AM
Is this possible in Emerald? I was thinking about making my own Emerald remake, and the use of a real physical special split system would help a lot.

EDIT: Never mind, found it -_-

MrDollSteak
February 5th, 2013, 04:13 AM
Does this version of the split also come with the boxes in
the move window on the sprite screen? Or was that exclusively
on Jambo's 649 patch.

Garuga17
February 7th, 2013, 10:02 PM
Does this version of the split also come with the boxes in
the move window on the sprite screen? Or was that exclusively
on Jambo's 649 patch.


yeah, i'm wondering that too, that must be looks cool, anybody know how to do it?

Voltron
May 13th, 2013, 06:42 PM
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:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]

Here's the source:
.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:
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.

Bump.... How do you insert this into the fire red rom?

DoesntKnowHowToPlay
May 14th, 2013, 11:51 AM
So if you grabbed version 1.3 of the Emerald split from me on the previous page there's a rather subtle bug that you'll need to fix- at x4814E, there is an 00 that should be an 08. This causes the game to treat damage as an address and fails various checks for arbitrary amounts of damage- the main effects are Counter, Rough Skin, and Focus Punch acting as if no damage was dealt.

I've updated the patch I posted, but don't try to fix this bug by just applying 1.4 on top of a ROM with 1.3 as the byte was 08 in vanilla, so it won't work.

Uikri
May 20th, 2013, 12:30 PM
Alright, I'm confused. Out of the countless patches posted, which one(s) do I use, which games do they work for, what bugs are still around, what, if anything, do I have to do after applying the patch, and what do I need to do so? Can I run a patched ROM through pokehacks(DOT)dabomstew(DOT)com(SLASH)randomizer(SLASH)acks(DOT)php to randomize and have the Phys/Spec split at the same time? Also, which program should I use to apply the patch? The only one I know of is LunarIPS, but my copy of that is bound to be ancient and outdated, and I've no idea if Lunar can do GBA patches.

nyczxjay
May 21st, 2013, 08:05 AM
So after I apply DoesntKnowHowToPlay's patch to the ROM, I just use PGE Attack Editor and simply toggle all the moves as Physical/Special/Status? I'm not adding any new moves at the moment into the game so I can just leave the "Effect Table" as 0 right?

EDIT: One more question just as a confirmation: The patch also adds the Sandstorm Sp. Def boost into the game as well right?

Uzumaki Naruto Jr.
May 21st, 2013, 08:19 AM
Okay, I want to use this patch, but I would like to know if the previously stated bugs are in it, like electric/fire moves restarting the game, etc. If yes, then I might not use the patch. And is this patch already have moves pre-set to if they are physical or special. Also, is this compatible with FireRed. And where do I get a updated download link, or is the download link provided int he first post updated.. Thanks. =3

nyczxjay
May 28th, 2013, 11:55 AM
Is there a physical/special patch for Ruby lurking around somewhere? I've searched and the original one by Chaos Rush has been removed.

Glitch Kitty
June 13th, 2013, 12:37 PM
In PGE do I only change the category of the move to make it physical/special or status or also its effect table ? I kept it at 0...should I have switched it to 1 or 2 ? Because I think my level 8 Pineco is receiving pitifuly low amounts of damage (1 or 2) from a level 2 Furret using Fury swipes...and it's supposed to be a physical move..

ShyRayq
June 13th, 2013, 03:05 PM
In PGE do I only change the category of the move to make it physical/special or status or also its effect table ? I kept it at 0...should I have switched it to 1 or 2 ? Because I think my level 8 Pineco is receiving pitifuly low amounts of damage (1 or 2) from a level 2 Furret using Fury swipes...and it's supposed to be a physical move..

You only change the category. And you should be able to change it so you know what category you're changing the move to. And you're probably doing low damage because Pineco has a bit high defense I believe. But I might be wrong.

dd409
July 27th, 2013, 06:35 PM
Original post by Darthatron:
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:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]Here's the source:
.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+1Change the .SplitImages (0xYYYYYYYY) pointer to where ever you have the images.
The images are uncompressed. And should look like this:
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.


Suggested fix by Jambo:
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.
0801F6C2: 86 7A
0801F908: 00 2E
0801F90A: 41 D1
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.

.align 2
.thumb
Start:
push {r0-r4}
ldr r0, .CurMoveIndex
ldrb r1, [r0]
lsl r1, r1, #1
ldr r0, .Move_List_Loc
ldr r0, [r0]
ldr r3, .number
add r0, r0, r3
add r0, r0, r1
ldrh r3, [r0]
cmp r3, #0x0
beq Finish
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
.number: .word 0x00003258
.CurMoveIndex: .word 0x0203B16D
.Move_List_Loc: .word 0x0203B140
.VRAM: .word 0x06001800
.SplitImages: .word 0x08YYYYYY
.Some_Offset: .word 0x0203B148
.Return_Addr: .word 0x0813A17D


I'm trying to add in these images to an Emerald rom, but I seem to have hit a wall. I've added in the actual image with TileMolester already, but as I understand it the offsets in the code here are for a Fire Red rom. I assume they aren't interchangeable with Emerald, so how would I go about finding the equivalent offsets? Also, how do I find the addresses of the bytes for the code pointers?

LCCoolJ95
July 28th, 2013, 07:18 AM
Hey, I found this in the thread today:

[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #FF6633"]FireRed (US)[/css-span]
0803ED54: 80 7A
0803F226: 00 29
0803F228: 00 D0
0803F38C: 02 2F
0803F38E: 00 DB
0803F394: 01 28
0803F396: 00 D0[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #CC0000"]Ruby (US)[/css-span] 1
0803BA94: 80 7A
0803BFBE: 00 29
0803BFC0: 00 D0
0803C124: 02 2E
0803C126: 00 DB
0803C12C: 01 28
0803C12E: 00 D0[css-span="padding: 2px; border: 1px solid #000000; color: #FFFFFF; background-color: #339900"]Emerald (US)[/css-span] 2
080695E8: 80 7A
08069A5A: 00 29
08069A5C: 00 D0
08069BC4: 02 2F
08069BC6: 00 DB
08069BCC: 01 28
08069BCE: 00 D01 Credit to Chaos Rush (http://www.pokecommunity.com/member.php?u=47122) for the Ruby port; I don't even have a Ruby ROM. xD
2 Credit to colcolstyles (http://www.pokecommunity.com/member.php?u=91213) for the Emerald hack; I based everything off of his post (http://www.pokecommunity.com/showpost.php?p=6232678&postcount=3).
Seriously? All I have to do is this to get the Physical/Special Split to work in these games? Is there more to it than this, or is this really it?

Uikri
July 28th, 2013, 08:36 AM
Hey, I found this in the thread today: Seriously? All I have to do is this to get the Physical/Special Split to work in these games? Is there more to it than this, or is this really it?

There is more to it than this. First, apply Doesn'tKnowHowToPlay's patch for either Fire Red or Emerald. Then, open the ROM in Pokémon Game Editor (PGE). Go to the Attack Editor internal program, and manually switch every attack's category to the proper one, since the patch changes everything to physical for some reason. You may also want to change the casing of the words so that "FLAMETHROWER" becomes "Flamethrower", and so on.

Jambo51
July 28th, 2013, 09:21 AM
since the patch changes everything to physical for some reason.

This, I take issue with. It's not for some inexplicable reason, it's because the byte in question is normally set to 0, and 0 stands for Physical in the new split system. It's very simple.

Uikri
July 28th, 2013, 09:30 AM
This, I take issue with. It's not for some inexplicable reason, it's because the byte in question is normally set to 0, and 0 stands for Physical in the new split system. It's very simple.

However, at the time of writing, I did not know this. Hence, instead of spouting nonsense, I made it clear that I did not know exactly why this happens.

shamus24
July 29th, 2013, 06:05 AM
just want to say thanks for all the work and research that has been put in to this implementation - it's easy to apply and makes a huge difference in the level of enjoyment players (or, at least, i) have while playing hacked games.

LCCoolJ95
July 29th, 2013, 02:28 PM
There is more to it than this. First, apply Doesn'tKnowHowToPlay's patch for either Fire Red or Emerald. Then, open the ROM in Pokémon Game Editor (PGE). Go to the Attack Editor internal program, and manually switch every attack's category to the proper one, since the patch changes everything to physical for some reason. You may also want to change the casing of the words so that "FLAMETHROWER" becomes "Flamethrower", and so on.Well, that I knew about. But, that's it?

Commander F
July 29th, 2013, 11:01 PM
Giga Drain is physical now? =/

dd409
July 30th, 2013, 11:20 AM
Giga Drain is physical now? =/

A side effect of the patch is that all moves are treated as physical until you go through and hex-edit certain bytes (or use PGE) to reassign each individual move as physical, special, or status. The patch doesn't change each move, just the way the game handles them. See the explaination a few posts above.

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.
0801F6C2: 86 7A
0801F908: 00 2E
0801F90A: 41 D1
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.

.align 2
.thumb
Start:
push {r0-r4}
ldr r0, .CurMoveIndex
ldrb r1, [r0]
lsl r1, r1, #1
ldr r0, .Move_List_Loc
ldr r0, [r0]
ldr r3, .number
add r0, r0, r3
add r0, r0, r1
ldrh r3, [r0]
cmp r3, #0x0
beq Finish
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
.number: .word 0x00003258
.CurMoveIndex: .word 0x0203B16D
.Move_List_Loc: .word 0x0203B140
.VRAM: .word 0x06001800
.SplitImages: .word 0x08YYYYYY
.Some_Offset: .word 0x0203B148
.Return_Addr: .word 0x0813A17D


I'm still trying to port this bit of asm to Emerald, but I'm not having much luck finding the equivalent addresses. So far I've found that 0x08250C04 for FR should be 0x0831C898 in Emerald, but I can't seem to figure out the others. Anyone have any insight there?

Tlachtli
August 5th, 2013, 07:34 PM
Change these bytes:
@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]

I'm trying to do an Emerald hack and see no one has successfully ported the sprites for Emerald yet (or at least done so and posted it here). I want to do it myself, but I have a question: what is the purpose of changing those first two bytes? I'm trying to find their Emerald equivalents, but no luck yet. I've tried putting read breaks on them in a FR rom, but never seem to trigger a read so I can't tell what they do.

Also I've been looking at the logistics of it, and I'm trying to decide where the sprite would look best. The Emerald move screen isn't as accommodating as the FR one.

EDIT: So in a huge oversight, I forgot that names could be longer than Raichu's... :/ Looks like 2 may be the better option, although I don't really like the positioning of it. That, or maybe print it over the little markings above the Poke portrait; I dunno about you guys, but I have literally never used the markings before.

http://img4.imageshack.us/img4/7171/bfhg.png

Deokishisu
August 11th, 2013, 05:49 AM
I'm trying to do an Emerald hack and see no one has successfully ported the sprites for Emerald yet (or at least done so and posted it here). I want to do it myself, but I have a question: what is the purpose of changing those first two bytes? I'm trying to find their Emerald equivalents, but no luck yet. I've tried putting read breaks on them in a FR rom, but never seem to trigger a read so I can't tell what they do.

I have an idea of numbers should work for BPEE, but since I haven't found the right address for the routine pointer in Emerald yet I haven't tested it:
.MoveBase: .word 0x0831C898
.number: .word 0x00003258
.CurMoveIndex: .word 0x0201170C
.Move_List_Loc: .word 0x0201042C
.VRAM: .word 0x06001800 [1]
.SplitImages: .word 0x08E3CFB0 (just where I have it stored)
.Some_Offset: .word 0x0203cf1c [2]
.Return_Addr: .word 0x081C3F6C [2][1] I assume this is empty VRAM used to store the sprites? It doesn't seem to be used in a clean rom.
[2] I have potential 2 addresses in mind here, but I haven't been able to test to see which works, if at all.

Also I've been looking at the logistics of it, and I'm trying to decide where the sprite would look best. The Emerald move screen isn't as accommodating as the FR one.

EDIT: So in a huge oversight, I forgot that names could be longer than Raichu's... :/ Looks like 2 may be the better option, although I don't really like the positioning of it. That, or maybe print it over the little markings above the Poke portrait; I dunno about you guys, but I have literally never used the markings before.

http://img4.imageshack.us/img4/7171/bfhg.png

Honestly? I'd make a smaller icon and slap it in that gap after "POWER". That seems the most intuitive to me anyway, as, with the icon, it'll read "POWER (Physical)" "POWER (Special)" if you're looking at it. Plus, those icons are unnecessarily huge as it is. They certainly don't have to be that big on our tiny GBA screen.

EDIT: I took a minute and shrunk down the icons. I literally just took them in horizontally by six pixels and fixed up the special one so that it's centered. The icon image is set up so that it can be pasted directly over the one Darth provided, if you've already inserted it. It's attached to this post now, along with a mockup of how it would look next to POWER (with the base image shamelessly stolen from your post).

Tlachtli
August 11th, 2013, 08:56 AM
Honestly? I'd make a smaller icon and slap it in that gap after "POWER". That seems the most intuitive to me anyway, as, with the icon, it'll read "POWER (Physical)" "POWER (Special)" if you're looking at it. Plus, those icons are unnecessarily huge as it is. They certainly don't have to be that big on our tiny GBA screen.

EDIT: I took a minute and shrunk down the icons. I literally just took them in horizontally by six pixels and fixed up the special one so that it's centered. The icon image is set up so that it can be pasted directly over the one Darth provided, if you've already inserted it. It's attached to this post now, along with a mockup of how it would look next to POWER (with the base image shamelessly stolen from your post).

Now I'm wondering why I didn't think of that :P The mock-up looks great.

EDIT: Never mind. I'm pretty sure most of that was wrong.

Uikri
August 21st, 2013, 06:36 PM
So, I'm getting reports from people I've shared my edited Emerald ROM with that the split didn't work. Have we confirmed that after applying the patch, PGE can be used instead of a hex-editor to change the category of each move to the proper one?

Tlachtli
August 22nd, 2013, 06:42 PM
So, I'm getting reports from people I've shared my edited Emerald ROM with that the split didn't work. Have we confirmed that after applying the patch, PGE can be used instead of a hex-editor to change the category of each move to the proper one?

The patch seemed to work on mine. I tested it with Torchic and Scratch. I made two Roms, one where Scratch was physical and one where it was special. I set Torchic's base special attack to 255 and base attack to 1 (just to be sure that Scratch would be treated differently from the vanilla Rom). The physical Scratch did almost nothing while the special one just one-shotted May's Mudkip. I haven't tested Counter or any abilities yet.

LykO
October 14th, 2013, 10:10 PM
Anyway if I want to test the Physical / Special Split full which should I use?

Shufflejoy
October 15th, 2013, 06:56 AM
This is probably a moot point since this is essentially a finished development now, but I was thinking... there's already a system in the 3rd Gen games to determine whether or not a move makes contact (necessary for abilities like Static)... are there any Physical moves that don't make contact? Any Special moves that do? While it offers more power to be able to have a move make contact *and* be Special, if there are no vanilla moves which are that way (or vice versa), wouldn't it be simpler to read that byte instead?

(**I didn't actually check to see if there were any moves like this, so I may have just overlooked some. I'm only really familiar with the 1/2/3rd Gen moves, anyway.)

LCCoolJ95
October 15th, 2013, 07:06 AM
This is probably a moot point since this is essentially a finished development now, but I was thinking... there's already a system in the 3rd Gen games to determine whether or not a move makes contact (necessary for abilities like Static)... are there any Physical moves that don't make contact? Any Special moves that do? While it offers more power to be able to have a move make contact *and* be Special, if there are no vanilla moves which are that way (or vice versa), wouldn't it be simpler to read that byte instead?

(**I didn't actually check to see if there were any moves like this, so I may have just overlooked some. I'm only really familiar with the 1/2/3rd Gen moves, anyway.)Within Pokemon Game Editor's Attack Editor, it has a list of checkboxes. One of them has the option of whether or not that move makes contact with the opponent.

Shufflejoy
October 15th, 2013, 07:13 AM
Within Pokemon Game Editor's Attack Editor, it has a list of checkboxes. One of them has the option of whether or not that move makes contact with the opponent.

Yes, I know; what I'm saying is this.

Typically, one would expect that:

Physical moves would always make contact
Special moves will never make contact


If this is actually the case, it would be simpler to implement this if the routine read whether it made contact or not to determine which attack stat to use. This offers less power than the current method (in that, as it stands a move can both make contact and use the Special Attack stat), but it would be much easier to implement as the data is already in the game.

I'll look into this some more, to see if there are any moves that go against what I'm thinking. If there are any in the official games, then this is all just moot. But if all Physical moves make contact, and all Special moves do not, then I believe the best solution would be to read that byte and save people the trouble of manually setting the moves if they don't have to.

DoesntKnowHowToPlay
October 15th, 2013, 07:16 AM
rock throw, rock slide, earthquake, razor leaf, etc. are all physical but don't make contact

if you go into the future there's also grass knot which is special but does make contact

Shufflejoy
October 15th, 2013, 07:18 AM
rock throw, rock slide, earthquake, razor leaf, etc. are all physical but don't make contact

if you go into the future there's also grass knot which is special but does make contact

Understood. Now that I know for sure, I suppose I'll just go ahead and edit the moves manually. Thanks!

Teh Blazer
October 15th, 2013, 04:17 PM
Can I apply DOesntKnowHowToPlay's patch to an edited ROM or can it only be applied to a vanilla FR ROM?

Shufflejoy
October 15th, 2013, 06:12 PM
Can I apply DOesntKnowHowToPlay's patch to an edited ROM or can it only be applied to a vanilla FR ROM?

As long as you haven't patched the routines for calculating the attack stat to use in battle, I believe you should be fine (though you will have to manually set each move to either Phys/Spec in PGE, a hex editor, or using Nightmare).

Of course, the simplest way to answer your question is to just say: Probably. Back up your ROM first, though.

Haradion
October 18th, 2013, 11:50 AM
Hey there.
Noob Alert.

I have just found this thread - after less than a week of entering the world of Hacking, so I am feeling a little overwhelmed.

I don't want to break my game - so I don't particularly want to try this out yet, unless there is a clear, comprehensive tutorial on it.
Sorry to be the annoying noob.

Is there a Tutorial for applying this yet (That assumes the person has 0 knowledge of Hacking)?
:D
Hoping that this will jump start my hacking carreer. :D

LykO
October 18th, 2013, 03:06 PM
Very good, but some good soul could do a huge favor to create an IPS with these following items?

Physical/Special Split Of DoesntKnowHowToPlay

Physical/Special Split Icons Of Darthatron And Suggested fix by Jambo51

Teh Blazer
October 18th, 2013, 05:07 PM
Very good, but some good soul could do a huge favor to create an IPS with these following items?

Physical/Special Split Of DoesntKnowHowToPlay

Physical/Special Split Icons Of Darthatron And Suggested fix by Jambo51

Ask and you shall receive.

http://www.mediafire.com/?m2q5vmmm564iu6k

A couple things to note:
-The inserts started at 800000
-I was watching tv while doing the manuak editing of the moves, so some might be wrong
-No need to credit me, I didn't do much besides apply the DoesntKnowHowToPlay patch and assemble Darthatron's routine with the Jambo fix. But if you want to credit me anyways, I wouldn't mind. :3

LykO
October 18th, 2013, 05:34 PM
More than beauty, now! you're the guy Teh Blazer! I'm very grateful at the end put your deserved credit! again thank you! is very functional!

Chrisario
December 1st, 2013, 01:46 AM
Do you may be how to put the special physical icon in the moves
If you do help me then

tinyranitar
December 2nd, 2013, 11:16 PM
Can I patch the Physical/Special Split into other Hacked Rom without it like Light Platinum or just clean ROM?

unIQuE-_-SK
January 25th, 2014, 11:41 PM
Ask and you shall receive.

A couple things to note:
-The inserts started at 800000
-I was watching tv while doing the manuak editing of the moves, so some might be wrong
-No need to credit me, I didn't do much besides apply the DoesntKnowHowToPlay patch and assemble Darthatron's routine with the Jambo fix. But if you want to credit me anyways, I wouldn't mind. :3
One small stupid question, Is this for Emerald or FireRed? :)
Haven't found the mentioning of it anywhere. :(

The Zororoaster
February 2nd, 2014, 09:36 PM
One small stupid question, Is this for Emerald or FireRed? :)
Haven't found the mentioning of it anywhere. :(

It is for FireRed, there is currently no patch that adds icons for Emerald.

Speaking of which, has there been any progress on that?

sonicfan7895
February 14th, 2014, 07:26 PM
I have a couple of questions:
I have applied Doesn'tKnowHowtoPlay's patch of this, and I can't seem to open up PGE's Attack Editor for FireRed (BPRE). However, I am experienced in editing hex.
1) Do I just need to edit the 11th byte to make sure the game can distinguish between Physical/Special?
2) What do I need to change to determine whether or not the move actually makes contact?

I'm sort of in a time crunch, as I'm in many activities outside of school, so an immediate response or a response within the next two days would be great!

Golden Warrior
February 25th, 2014, 02:04 PM
I feel very out of place posting here, but I do want this working, I can see great progress has been made, but that's all I can tell. I'm no good with Hex or ASM so my question is: Is there a patch of this for Ruby in existance? DragonRush's was deleted and I see that Darthatron posted some for Ruby but I have no clue what to do with it.

That's all, I thank anyone who answers this in advance and I'm sorry if this is out of place.

Tlachtli
February 25th, 2014, 10:32 PM
EDIT: See post below for better version of the Phys/Spec icons.

RemixinROMulus
February 26th, 2014, 03:31 PM
I don't see anything wrong with how the icons look in those screenshots.
I'm still a beginner hacker, but as I recall, each sprite has a pointer to a specific palette. Hmmm... Maybe try searching for that pointer with your hex editor and try changing it? I know that Nameless Sprite Editor allows you to swap palettes, but IDK if it will find your icon.

SBird
February 27th, 2014, 10:09 AM
I would recommend you to study the OAM structure and use sprite objects to draw those Icons, anyways in tile-based modes the palette is determined by the tilemap, otherwise it can be set in one of the OAM attributes, you can get detailled information on the GBAs tech data on gbatek (http://nocash.emubase.de/gbatek.htm)

~SBird

andrewinoue
March 18th, 2014, 07:56 AM
when i patched it, it looked like it didn't work, but the reason why i say that is because when i look at other people's rom hacks they have on the side of the moves the have the sign of physical and special. Can somebody help me!

RichterSnipes
March 23rd, 2014, 04:21 PM
Seeing as no one has uploaded an accurate patch for updating the now-used move type bytes yet (the one on the first page has reported errors), here's an updated one that should be 100% accurate for all moves in the standard game:

Download (https://dl.dropboxusercontent.com/s/5y7h2j6kqlzctcy/Pok%C3%A9mon%20FireRed%20-%20Split%20Move%20Affinity%20Changes.ips?dl=1&token_hash=AAEX1TA9R61MV_Lzwm0Yo9JgYzu5AEEJJryswAi7aiV5Aw)

For use with FireRed (BPRE). That should save some time from having to edit all the moves with PGE or a Hex editor.

when i patched it, it looked like it didn't work, but the reason why i say that is because when i look at other people's rom hacks they have on the side of the moves the have the sign of physical and special. Can somebody help me!
That's because Darthatron's move type icon implementation is separate from DoesntKnowHowToPlay's patch. You'll have to apply that yourself to get that change. Alternatively, you could use the combined patch Teh Blazer uploaded on the previous page.

Tlachtli
April 26th, 2014, 06:10 AM
http://i.imgur.com/6cOQHmz.png http://i.imgur.com/zxfsbAH.png http://i.imgur.com/Z9tY84F.png

A long-awaited treat for my fellow Emerald modders, I'm back with a much better version of my Emerald Phys/Spec icons. Credit where it's due, the original idea came from Darthatron as did the source image, and thanks also to Deokishisu for the shortening and placement ideas. Here goes:

First, you'll need to insert this ASM somewhere
.text
.align 2
.thumb
.thumb_func

Prestart:
add r0, r0, r5
lsl r0, r0, #0x03
ldr r1, .Replaced_Address
add r4, r0, r1
push {r0-r5}
ldr r0, .SplitImages
ldr r1, .OBJVRAM
mov r2, #0xC0
swi #0xB

ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
mov r2, #0x10
lsl r2, #8
add r2, #0xD
add r0, r2
ldrb r0, [r0]
cmp r0, #0x0
bne StatFinish

mov r2, #0x10
lsl r2, #8
add r2, #0xA
cmp r6, #0x0
beq StatPreStart

Start:
ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
add r0, r2
cmp r6, #0x1
bne Continue
add r0, #0x1

Continue:
ldrb r1, [r0]
cmp r1, #0x0
bne GetMove
mov r2, #0x20
lsl r2, #8
add r0, r2
ldrb r1, [r0]

GetMove:
cmp r1, #0x4
beq GetFifthMove
lsl r1, r1, #1
ldr r0, .Move_List_DMA
ldr r2, [r0]
add r2, #0x84
mov r0, r2
add r0, r1
ldrh r3, [r0]

Body:
mov r0, #0x0
lsl r0, r3, #1
add r0, r3
lsl r0, r0, #2
ldr r1, .MoveBase
add r0, r1
ldrb r4, [r0, #10]
lsl r4, #1

mov r0, #0x40
lsl r0, #20
ldr r1, [r0]
mov r2, #0x20
orr r1, r2
stm r0!, {r1}

ldr r0, .OAMMemAddress
ldr r1, .IconOAM1
ldr r2, .IconOAM2
cmp r4, #0x2
beq SpecAdd
cmp r4, #0x4
beq StatAdd

Draw:
stmia r0!, {r1, r2}
ldr r0, .OAMMemAddress
mov r1, #0x70
lsl r1, #20
add r1, #0xD8
mov r2, #0x4
swi #0xb

StatFinish:
cmp r6, #0x1
beq MoveFinish
cmp r6, #0x2
beq LearnFinish
pop {r0-r6}
ldr r0, .Return_Address_Stat
bx r0

GetFifthMove:
cmp r6, #0x2
bne StatFinish
ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
mov r2, #0x10
lsl r2, #8
add r2, #0xA
add r0, r2
sub r0, #0x2
ldrh r3, [r0]
cmp r3, #0x0
bne Body
mov r2, #0x20
lsl r2, #8
add r0, r2
ldrh r3, [r0]
cmp r3, #0x0
bne Body
b Start

StatPreStart:
mov r3, #0x20
lsl r3, #8
add r2, r3
b Start

LearnFinish:
pop {r0-r6}
ldr r0, .Return_Address_Learn
bx r0

MoveFinish:
pop {r0-r6}
ldr r0, .Return_Address_Move
bx r0

SpecAdd:
mov r3, #0x20
lsl r3, #8
add r3, #0x04
add r2, r3
b Draw

StatAdd:
add r2, #0x08
b Draw

.align 2
.MoveBase: .word 0x0831C898
.CurMoveIndex_DMA: .word 0x0300090C
.Move_List_DMA: .word 0x0203CF1C
.Replaced_Address: .word 0x03005E08
.Return_Address_Stat: .word 0x081C0F57
.Return_Address_Move: .word 0x081C12F7
.Return_Address_Learn: .word 0x081C175D
.IconOAM1: .word 0x40280078
.IconOAM2: .word 0x0000D580
.OBJVRAM: .word 0x06013000
.OAMMemAddress: .word 0x030023E4
.SplitImages: .word 0x[insert address to images]

At the bottom, you'll need to change .SplitImages to the address where you insert the icons attached below (as an uncompresed image). Don't worry about the coloring, they'll use the palette already located at 0xDC4338.

SplitImages:
http://i.imgur.com/TuTazY7.png

And make the following hex edits:
Change 0x1C0F88, 0x1C1328 and 0x1C17A0 to [inserted ASM address +1]
Change 0x1C0F54, 0x1C12F4 and 0x1C175A to 08 47
Change 0x1C0F4E to 40 B4 00 26
Change 0x1C12EE to 40 B4 01 26
Change 0x1C1754 to 40 B4 02 26

It can also support extended movesets just fine (see screenshot above), all you need to do is change .MoveBase to the start of your repointed move table.

And that should be all you need. I've tested it and it should work properly on the Battle Moves page, while re-ordering moves, and when teaching new moves. If there are any issues, let me know. Permission to use it in a hack isn't needed, though credit is appreciated.

mamamama
April 26th, 2014, 08:44 PM
http://i.imgur.com/6cOQHmz.png http://i.imgur.com/zxfsbAH.png http://i.imgur.com/Z9tY84F.png

A long-awaited treat for my fellow Emerald modders, I'm back with a much better version of my Emerald Phys/Spec icons. Credit where it's due, the original idea came from Darthatron as did the source image, and thanks also to Deokishisu for the shortening and placement ideas. Here goes:

First, you'll need to insert this ASM somewhere


When I move the .asm file into HackMew's Thumb, it does not create any .bin output. It works when I use other ASM routines though. Do you know what the issue could be?

I did the following:
1. Cope/Pasted your routine into Notepad.
2. Changed movebase to 0x08E66000 (where my table is located)
3. Changed .Splitimage to 0x081600000 (where I placed the image. It's a 32 MB ROM).
4. Clicked Save As, changed txt to all files and named it test.asm. Put it in the same folder as Thumb.
5. Moved it to Thumb, which just quickly opens up and closes down the command window without creating the .bin output.

HidoranBlaze
April 26th, 2014, 09:24 PM
http://i.imgur.com/6cOQHmz.png http://i.imgur.com/zxfsbAH.png http://i.imgur.com/Z9tY84F.png

A long-awaited treat for my fellow Emerald modders, I'm back with a much better version of my Emerald Phys/Spec icons. Credit where it's due, the original idea came from Darthatron as did the source image, and thanks also to Deokishisu for the shortening and placement ideas. Here goes:

First, you'll need to insert this ASM somewhere
.text
.align 2
.thumb
.thumb_func

Prestart:
add r0, r0, r5
lsl r0, r0, #0x03
ldr r1, .Replaced_Address
add r4, r0, r1
push {r0-r5}
ldr r0, .SplitImages
ldr r1, .OBJVRAM
mov r2, #0xC0
swi #0xB

ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
mov r2, #0x10
lsl r2, #8
add r2, #0xD
add r0, r2
ldrb r0, [r0]
cmp r0, #0x0
bne StatFinish

mov r2, #0x10
lsl r2, #8
add r2, #0xA
cmp r6, #0x0
beq StatPreStart

Start:
ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
add r0, r2
cmp r6, #0x1
bne Continue
add r0, #0x1

Continue:
ldrb r1, [r0]
cmp r1, #0x0
bne GetMove
mov r2, #0x20
lsl r2, #8
add r0, r2
ldrb r1, [r0]

GetMove:
cmp r1, #0x4
beq GetFifthMove
lsl r1, r1, #1
ldr r0, .Move_List_DMA
ldr r2, [r0]
add r2, #0x84
mov r0, r2
add r0, r1
ldrh r3, [r0]

Body:
mov r0, #0x0
lsl r0, r3, #1
add r0, r3
lsl r0, r0, #2
ldr r1, .MoveBase
add r0, r1
ldrb r4, [r0, #10]
(MoveBase+12*halfword)+0x10*/
lsl r4, #1

mov r0, #0x40
lsl r0, #20
ldr r1, [r0]
mov r2, #0x20
orr r1, r2
stm r0!, {r1}

ldr r0, .OAMMemAddress
ldr r1, .IconOAM1
ldr r2, .IconOAM2
cmp r4, #0x2
beq SpecAdd
cmp r4, #0x4
beq StatAdd

Draw:
stmia r0!, {r1, r2}
ldr r0, .OAMMemAddress
mov r1, #0x70
lsl r1, #20
add r1, #0xD8
mov r2, #0x4
swi #0xb

StatFinish:
cmp r6, #0x1
beq MoveFinish
cmp r6, #0x2
beq LearnFinish
pop {r0-r6}
ldr r0, .Return_Address_Stat
bx r0

GetFifthMove:
cmp r6, #0x2
bne StatFinish
ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
mov r2, #0x10
lsl r2, #8
add r2, #0xA
add r0, r2
sub r0, #0x2
ldrh r3, [r0]
cmp r3, #0x0
bne Body
mov r2, #0x20
lsl r2, #8
add r0, r2
ldrh r3, [r0]
cmp r3, #0x0
bne Body
b Start

StatPreStart:
mov r3, #0x20
lsl r3, #8
add r2, r3
b Start

LearnFinish:
pop {r0-r6}
ldr r0, .Return_Address_Learn
bx r0

MoveFinish:
pop {r0-r6}
ldr r0, .Return_Address_Move
bx r0

SpecAdd:
mov r3, #0x20
lsl r3, #8
add r3, #0x04
add r2, r3
b Draw

StatAdd:
mov r3, #0x20
lsl r3, #8
add r3, #0x08
add r2, r3
b Draw

.align 2
.MoveBase: .word 0x0831C898
.CurMoveIndex_DMA: .word 0x0300090C
.Move_List_DMA: .word 0x0203CF1C
.Replaced_Address: .word 0x03005E08
.Return_Address_Stat: .word 0x081C0F57
.Return_Address_Move: .word 0x081C12F7
.Return_Address_Learn: .word 0x081C175D
.IconOAM1: .word 0x40280078
.IconOAM2: .word 0x0000D580
.OBJVRAM: .word 0x06013000
.OAMMemAddress: .word 0x030023E4
.SplitImages: .word 0x[insert address to images]

At the bottom, you'll need to change .SplitImages to the address where you insert the icons attached below (as an uncompresed image). Don't worry about the coloring, they'll use the palette already located at 0xDC4338.

SplitImages:
http://i.imgur.com/TuTazY7.png

And make the following hex edits:
Change 0x1C0F88, 0x1C1328 and 0x1C17A0 to [inserted ASM address +1]*/
Change 0x1C0F54, 0x1C12F4 and 0x1C175A to 08 47
Change 0x1C0F4E to 40 B4 00 26
Change 0x1C12EE to 40 B4 01 26
Change 0x1C1754 to 40 B4 02 26

It can also support extended movesets just fine (see screenshot above), all you need to do is change .MoveBase to the start of your repointed move table.

And that should be all you need. I've tested it and it should work properly on the Battle Moves page, while re-ordering moves, and when teaching new moves. If there are any issues, let me know. Permission to use it in a hack isn't needed, though credit is appreciated. I'm having an issue with inserting as well. I'm getting this error message when I try to assemble my asm file:
icons.asm: Assembler messages:
icons.asm:0: Warning: end of file not at end of line; new line inserted
icons.asm:69: Error: junk at end of line, first unrecognized character is '<'

I've successfully inserted asm routines before, so I doubt I did something wrong.

EDIT: Ok, I figured out what went wrong. The first one was because I didn't put a blank line at the end, no harm there.
The second one was because of an error made in the asm routine: Tlachtli at line 69, you forgot to put /* in front of your comment. Fixing that made everything work out.

Tlachtli
April 26th, 2014, 10:08 PM
I'm having an issue with inserting as well. I'm getting this error message when I try to assemble my asm file:
icons.asm: Assembler messages:
icons.asm:0: Warning: end of file not at end of line; new line inserted
icons.asm:69: Error: junk at end of line, first unrecognized character is '<'

I've successfully inserted asm routines before, so I doubt I did something wrong.

EDIT: Ok, I figured out what went wrong. The first one was because I didn't put a blank line at the end, no harm there.
The second one was because of an error made in the asm routine: Tlachtli at line 69, you forgot to put /* in front of your comment. Fixing that made everything work out.

I thought I had removed all of my comments, but I guess I must have only deleted part of that one. I've fixed the routine in the earlier post now too, so it ought to compile properly now.

Edit: LCCoolJ95 has pointed out a bug where the Stat icon is showing up yellow instead of grey. I'm working on that one, should have it fixed soon.

Edit 2: Found the issue, and it's fixed now. I updated the ASM on my earlier post, so the Status icon should look normal now.

BXL
May 6th, 2014, 11:59 AM
I recommend using a hex editor or Nightmare for this, but PGE can also do the job (slowly).

What Hex editor would you recommend? I have tried it on Nightmare but that's too difficult for me, and I have googled for like straight two hours and I couldn't find on. Please help me.

Could someone give me an already Splitted version of pokemon emerald with the Icons and all? I can't hex edit whatsoever even if my life depended on it. I seriously need help for this. Please Help Me i would really appreciate it

LCCoolJ95
May 11th, 2014, 09:10 AM
I should really post this here:

http://www.youtube.com/watch?v=C4BIBxkLMOo&list=UUAvHC6XQV1c8ZtHQ9nBhvWg

Thanks to DoesntKnowHowToPlay for his Emerald patch and Tlachtli for his ASM Routine.

Shufflejoy
May 11th, 2014, 05:25 PM
*images snipped for brevity*

A long-awaited treat for my fellow Emerald modders, I'm back with a much better version of my Emerald Phys/Spec icons. Credit where it's due, the original idea came from Darthatron as did the source image, and thanks also to Deokishisu for the shortening and placement ideas. Here goes:

First, you'll need to insert this ASM somewhere
.text
.align 2
.thumb
.thumb_func

Prestart:
add r0, r0, r5
lsl r0, r0, #0x03
ldr r1, .Replaced_Address
add r4, r0, r1
push {r0-r5}
ldr r0, .SplitImages
ldr r1, .OBJVRAM
mov r2, #0xC0
swi #0xB

ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
mov r2, #0x10
lsl r2, #8
add r2, #0xD
add r0, r2
ldrb r0, [r0]
cmp r0, #0x0
bne StatFinish

mov r2, #0x10
lsl r2, #8
add r2, #0xA
cmp r6, #0x0
beq StatPreStart

Start:
ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
add r0, r2
cmp r6, #0x1
bne Continue
add r0, #0x1

Continue:
ldrb r1, [r0]
cmp r1, #0x0
bne GetMove
mov r2, #0x20
lsl r2, #8
add r0, r2
ldrb r1, [r0]

GetMove:
cmp r1, #0x4
beq GetFifthMove
lsl r1, r1, #1
ldr r0, .Move_List_DMA
ldr r2, [r0]
add r2, #0x84
mov r0, r2
add r0, r1
ldrh r3, [r0]

Body:
mov r0, #0x0
lsl r0, r3, #1
add r0, r3
lsl r0, r0, #2
ldr r1, .MoveBase
add r0, r1
ldrb r4, [r0, #10]
lsl r4, #1

mov r0, #0x40
lsl r0, #20
ldr r1, [r0]
mov r2, #0x20
orr r1, r2
stm r0!, {r1}

ldr r0, .OAMMemAddress
ldr r1, .IconOAM1
ldr r2, .IconOAM2
cmp r4, #0x2
beq SpecAdd
cmp r4, #0x4
beq StatAdd

Draw:
stmia r0!, {r1, r2}
ldr r0, .OAMMemAddress
mov r1, #0x70
lsl r1, #20
add r1, #0xD8
mov r2, #0x4
swi #0xb

StatFinish:
cmp r6, #0x1
beq MoveFinish
cmp r6, #0x2
beq LearnFinish
pop {r0-r6}
ldr r0, .Return_Address_Stat
bx r0

GetFifthMove:
cmp r6, #0x2
bne StatFinish
ldr r0, .CurMoveIndex_DMA
ldr r0, [r0]
mov r2, #0x10
lsl r2, #8
add r2, #0xA
add r0, r2
sub r0, #0x2
ldrh r3, [r0]
cmp r3, #0x0
bne Body
mov r2, #0x20
lsl r2, #8
add r0, r2
ldrh r3, [r0]
cmp r3, #0x0
bne Body
b Start

StatPreStart:
mov r3, #0x20
lsl r3, #8
add r2, r3
b Start

LearnFinish:
pop {r0-r6}
ldr r0, .Return_Address_Learn
bx r0

MoveFinish:
pop {r0-r6}
ldr r0, .Return_Address_Move
bx r0

SpecAdd:
mov r3, #0x20
lsl r3, #8
add r3, #0x04
add r2, r3
b Draw

StatAdd:
add r2, #0x08
b Draw

.align 2
.MoveBase: .word 0x0831C898
.CurMoveIndex_DMA: .word 0x0300090C
.Move_List_DMA: .word 0x0203CF1C
.Replaced_Address: .word 0x03005E08
.Return_Address_Stat: .word 0x081C0F57
.Return_Address_Move: .word 0x081C12F7
.Return_Address_Learn: .word 0x081C175D
.IconOAM1: .word 0x40280078
.IconOAM2: .word 0x0000D580
.OBJVRAM: .word 0x06013000
.OAMMemAddress: .word 0x030023E4
.SplitImages: .word 0x[insert address to images]

At the bottom, you'll need to change .SplitImages to the address where you insert the icons attached below (as an uncompresed image). Don't worry about the coloring, they'll use the palette already located at 0xDC4338.

SplitImages:
http://i.imgur.com/TuTazY7.png

And make the following hex edits:
Change 0x1C0F88, 0x1C1328 and 0x1C17A0 to [inserted ASM address +1]
Change 0x1C0F54, 0x1C12F4 and 0x1C175A to 08 47
Change 0x1C0F4E to 40 B4 00 26
Change 0x1C12EE to 40 B4 01 26
Change 0x1C1754 to 40 B4 02 26

It can also support extended movesets just fine (see screenshot above), all you need to do is change .MoveBase to the start of your repointed move table.

And that should be all you need. I've tested it and it should work properly on the Battle Moves page, while re-ordering moves, and when teaching new moves. If there are any issues, let me know. Permission to use it in a hack isn't needed, though credit is appreciated.

I'm having some trouble getting this to work properly in my ROM. I followed the instructions as best I could, and here are some details:

* I used NSE 2.1 to insert the image at xF58BB4
* I inserted the routine at xF58D34 after setting the last line to ".SplitImages: .word 0xF58BB4" (I also tried 0x08F58BB4)
* I changed the bytes at x1C0F88, x1C1328, and x1C17A0 to 08F58D35

When I load up the game and select a move on the Summary screen, it freezes like this: http://i.cubeupload.com/RWXy5e.png

Any help figuring out what I'm doing wrong would be really appreciated. Thanks!

mamamama
May 11th, 2014, 11:03 PM
I'm having some trouble getting this to work properly in my ROM. I followed the instructions as best I could, and here are some details:

* I used NSE 2.1 to insert the image at xF58BB4
* I inserted the routine at xF58D34 after setting the last line to ".SplitImages: .word 0xF58BB4" (I also tried 0x08F58BB4)
* I changed the bytes at x1C0F88, x1C1328, and x1C17A0 to 08F58D35

When I load up the game and select a move on the Summary screen, it freezes like this: http://i.cubeupload.com/RWXy5e.png

Any help figuring out what I'm doing wrong would be really appreciated. Thanks!

I had the same problem first time I tried it. I'm 90% sure you've place the hex edits in slightly wrong positions. Take screenshots of your hex-edits and I can compare it to my current working ones.

Shufflejoy
May 26th, 2014, 09:29 PM
I had the same problem first time I tried it. I'm 90% sure you've place the hex edits in slightly wrong positions. Take screenshots of your hex-edits and I can compare it to my current working ones.

Hey, sorry it took me so long to get back to you with this. I tried it again and ran into the same problem.

https://www.dropbox.com/sh/uqvpgx35blxcdvi/AACZZumeB37V1CZWdBCduyzia

In that folder, the diff windows show the hex changes I made (with the changed version on top), and the screenshots show the process of inserting the image and the ASM routine.

When I try to test it in game, this happens: https://www.dropbox.com/s/cz9jbms6xhy88n0/oops.mp4

The game freezes in that video, but sometimes it just restarts the game immediately upon pressing A.

Any help with this would really be appreciated!

dontstay96
May 28th, 2014, 02:36 PM
Now that I have enough posts to put this here I might as well for convenience's sake, it was rather rude of me to not just bypass the filter to get these links up:

FR: http://www.mediafire.com/download.php?7e0m7xhmyaga2af
Em: http://www.mediafire.com/download.php?ipcjia5b778zj8o

Like with the other implementations in this thread, they work off the eleventh byte of the move data. They also implement the Special Defense boost in Sand, and jump through a number of other hoops to not break existing abilities and attacks, which is why I provide them as patches and not simple hex edits. Be aware that these patches do not touch the move table- you'll have to toggle the moves as physical or special yourself. I recommend using a hex editor or Nightmare for this, but PGE can also do the job (slowly).

Credits go to Tailes for most of the work on the Emerald split.

Also yes you can use these for your hacks just give credit you don't need to pm me for permission and plz don't

Hello I downloaded the emerald patch, but it doesn't seem to work (i patch it with lunar IPS, right?), at least absorb still counts as a physical attack, do I need to have another version or the rom or something? thanks! and sorry for bothering you

Shiny Quagsire
May 28th, 2014, 03:11 PM
Hello I downloaded the emerald patch, but it doesn't seem to work (i patch it with lunar IPS, right?), at least absorb still counts as a physical attack, do I need to have another version or the rom or something? thanks! and sorry for bothering you
I'm not sure if you noticed this but there's kinda a thing in the post you quoted...
Be aware that these patches do not touch the move table- you'll have to toggle the moves as physical or special yourself.

dontstay96
May 28th, 2014, 05:30 PM
I'm not sure if you noticed this but there's kinda a thing in the post you quoted...

Oops, I'm an idiot ~_~ sorry :P

RaileysXerilyasRX
May 29th, 2014, 01:17 AM
Now that I have enough posts to put this here I might as well for convenience's sake, it was rather rude of me to not just bypass the filter to get these links up:

FR: http://www.mediafire.com/download.php?7e0m7xhmyaga2af
Em: http://www.mediafire.com/download.php?ipcjia5b778zj8o

Like with the other implementations in this thread, they work off the eleventh byte of the move data. They also implement the Special Defense boost in Sand, and jump through a number of other hoops to not break existing abilities and attacks, which is why I provide them as patches and not simple hex edits. Be aware that these patches do not touch the move table- you'll have to toggle the moves as physical or special yourself. I recommend using a hex editor or Nightmare for this, but PGE can also do the job (slowly).

Credits go to Tailes for most of the work on the Emerald split.

Also yes you can use these for your hacks just give credit you don't need to pm me for permission and plz don't

Does the FireRed patch fills free space or not? I'll try this later but what I mean to ask is does the patch takes 700000-FFFFFF (any free space near 700000). Well, If you can't understand what am I saying. That's fine. I'll try to clear my explanation later. :3

athill1
May 30th, 2014, 06:54 PM
So I just put this in Ruby:
0803BA94: 80 7A
0803BFBE: 00 29
0803BFC0: 00 D0
0803C124: 02 2E
0803C126: 00 DB
0803C12C: 01 28
0803C12E: 00 D0

It seems to work and I was wondering if there known problems like weather not affecting damage or Blaze/Torrent/Overgrow ect. being out of wack. If these bugs affect me how can I fix them?