Register - Login
Views: 99792127
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 04:44:31 AM
Jul - General Game/ROM Hacking - Adding new Pokemon in Generation I New poll - New thread - New reply
Pages: 1 2Next newer thread | Next older thread
stag019

Red Koopa
Level: 26


Posts: 10/129
EXP: 91339
For next: 10936

Since: 09-11-11


Since last post: 5.6 years
Last activity: 2.1 years

Posted on 11-27-11 03:07:46 AM Link | Quote
My last thread kinda got overlooked, so let's try this.

ZIP file (7KB)

A tutorial on how to extend all the different data structures within Pokemon Generation I to add new ones. Includes an automatic exe file to do it for you, as well as the C source code. Should be compilable on other system with minimal tweaking.

Combined with my graphics compressor, you should be able to add Pokemon and completely customize them now. The biggest problem though is that only 152 Pokemon fit into the Pokedex's RAM (19 bytes * 8 bits per byte = 152 bits). Once I figure that out, it should work perfectly.

Other things I may need to add to this is bank checking (currently the banks the graphics are in are "hard coded"), and custom palettes (you can select which of the current palette set you want now).

But someone please give it a try!
Lunaria

Moon Bunny! :3
Level: 139


Posts: 4176/5754
EXP: 32051835
For next: 415610

Since: 07-28-07

Pronouns: she/her
From: pile of fluff

Since last post: 6 days
Last activity: 5 days

Posted on 11-27-11 07:42:58 AM Link | Quote
IIRC is not pokemon defined by one value and is there for limited to the standard 256 entries without expanding and recoding a whole lot?

____________________
The fun has been doubled!
stag019

Red Koopa
Level: 26


Posts: 12/129
EXP: 91339
For next: 10936

Since: 09-11-11


Since last post: 5.6 years
Last activity: 2.1 years

Posted on 11-27-11 07:53:49 AM Link | Quote
Originally posted by Lunaria
IIRC is not pokemon defined by one value and is there for limited to the standard 256 entries without expanding and recoding a whole lot?

If you mean one byte, yes. But in Generation I there's only 151 and adding more means a whole lot of repointing. There's a lot more to a single Pokemon than you'd think, even with the generic "base stats data structure" hunking a lot of it together. This program/tutorial is here to streamline the process.

Also, the program itself is updated to make the last byte of the base stats data structure to be the bank you'll find the image in. Thanks to Sawakita for the (simple, but still extremely helpful) ASM. The C source code is also updated, but I haven't put it in the tutorial yet. "Of course, with the program, I was able to automatically put the default bank for each directly in the base stats structure with only two functions and an automatic loop. That would be rather difficult to explain in a tutorial without Adding 151 steps. "

P.S. I believe Ckoolboyman did actually go through the trouble of making Pokemon ID's two bytes for Pokemon Prism, but don't quote me on that.
Lunaria

Moon Bunny! :3
Level: 139


Posts: 4178/5754
EXP: 32051835
For next: 415610

Since: 07-28-07

Pronouns: she/her
From: pile of fluff

Since last post: 6 days
Last activity: 5 days

Posted on 11-27-11 08:09:14 AM Link | Quote
Oh yes, while I lack any experience hacking it, I do know how much each pokemon have in therms of values clogging up up space; due to how random and situational pokemons grow.

And while I don't have any intentions of stacking yet another project on me, it's nice to see progress within this section I suppose.

Prisms case is a bit different though, since G/S/C already had quite a few more entries, not having very many new free spaces left. Speaking of which, (not to try and go off topic, but, oh well.) what happen to that hack?

____________________
The fun has been doubled!
tatanga

Level: 16


Posts: 36/39
EXP: 16524
For next: 3732

Since: 09-24-09


Since last post: 9.6 years
Last activity: 8.8 years

Posted on 11-27-11 01:30:44 PM Link | Quote
I saw your original thread, and was intending to test out your submission. I've been extremely busy with university this year, but once I'm on break I'll definitely be messing around with this. Correct me if I'm wrong, but is your graphics compressor the first tool created to allow for inserting different Pokemon pictures in the original generation? If so, be very proud of yourself! I'll be playing around with it over Winter break and will hopefully provide some better criticism then.
Keitaro

Fire Snake
LOVELY ARRANGEMENT. VOLCANO BAKEMEAT
Level: 70


Posts: 1045/1191
EXP: 2901500
For next: 114311

Since: 09-09-08

From: California

Since last post: 4.1 years
Last activity: 3.8 years

Posted on 11-27-11 03:25:50 PM Link | Quote
So your graphics tool allows any graphic compressed in that format to be replaced? is it possible to edit the trainer graphics as well as the Pokemon, then? And even then, the back pictures? I'm aware that uses some weird magnification system that looks hideous, but there's probably ways to bypass that too I'm sure...of course, the increased size would have to call for those images likely to be repointed/the game expanded
ReiNi
さよなら*へヴン
Level: 124


Posts: 3728/4444
EXP: 21768996
For next: 67605

Since: 07-21-07


Since last post: 6.7 years
Last activity: 3.3 years

Posted on 11-27-11 04:34:14 PM Link | Quote
It's not democracy, it's DiGiorno.
Originally posted by Keitaro
there's probably ways to bypass that too I'm sure...

Well, koolboyman did it in Pokémon Brown, along expanding the pokédex by a lot...

But in any case, I don't see why would it be different to deal with the back/trainer images than with the front pokémon ones. They should be the same... unless the thing that resizes the back images doesn't work well and breaks horribly.
(Then again, I haven't tried the graphics thing yet despite being interested in the original thread... Partially because I'm kind of clueless on this level of hacking to know what to do with the compressed image)

____________________
stag019

Red Koopa
Level: 26


Posts: 14/129
EXP: 91339
For next: 10936

Since: 09-11-11


Since last post: 5.6 years
Last activity: 2.1 years

Posted on 11-27-11 08:13:03 PM Link | Quote
Originally posted by tatanga
Correct me if I'm wrong, but is your graphics compressor the first tool created to allow for inserting different Pokemon pictures in the original generation? If so, be very proud of yourself!
No, Sawakita released his tool a few hours before I planned on releasing mine.
Originally posted by Keitaro
So your graphics tool allows any graphic compressed in that format to be replaced? is it possible to edit the trainer graphics as well as the Pokemon, then? And even then, the back pictures? I'm aware that uses some weird magnification system that looks hideous, but there's probably ways to bypass that too I'm sure...of course, the increased size would have to call for those images likely to be repointed/the game expanded
Yes, any image is possible to be edited. The trainers have to be in the same bank, but the last byte of the base stats data structure controls which bank the front/backpics are in, like I mentioned in my second post. As far as the back pictures, yes, it will still get magnified 2x like the current way the game does it. I plan on fixing this eventually. And in Pokemon there's a lot of free space; you're really unlikely to need to expand the ROM.
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 4409/5390
EXP: 29075295
For next: 259710

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 11-30-11 01:40:09 AM Link | Quote
Post #4409 · 11-29-11 08:40:09 PM
Since generation 1 doesn't use a clock, you could convert it to use the MBC5 chip with very little effort. IIRC that gives you up to 4MB of ROM space.

____________________
Keitaro

Fire Snake
LOVELY ARRANGEMENT. VOLCANO BAKEMEAT
Level: 70


Posts: 1046/1191
EXP: 2901500
For next: 114311

Since: 09-09-08

From: California

Since last post: 4.1 years
Last activity: 3.8 years

Posted on 11-30-11 09:08:17 PM Link | Quote
good to know, about the free space stuff. I hacked the GB Pokemon games extensively back in the day (my main focus is the GBA ones now) and I remember very much that Red had a lot of weird programming quirks, so I just assumed the free space was limited.
IIMarckus
Member
Level: 25


Posts: 79/111
EXP: 82290
For next: 7330

Since: 10-11-08


Since last post: 3.0 years
Last activity: 1.8 years

Posted on 12-01-11 12:11:04 AM Link | Quote
Originally posted by Rena
Since generation 1 doesn't use a clock, you could convert it to use the MBC5 chip with very little effort. IIRC that gives you up to 4MB of ROM space.

Up to 8 MiB, actually. But you shouldn’t need it, because:

Originally posted by Keitaro
good to know, about the free space stuff. I hacked the GB Pokemon games extensively back in the day (my main focus is the GBA ones now) and I remember very much that Red had a lot of weird programming quirks, so I just assumed the free space was limited.

Space was limited in the Japanese Red and Green. They were counting bytes, and according to interviews only had enough space for Mew after removing debug stuff. The English versions, though, are doubled in size, so there are banks upon banks of free space. My (very) rough calculations show at least a quarter, and almost half, of Pokémon Red is free space.

____________________
[hax.]iimarck.us

stag019

Red Koopa
Level: 26


Posts: 23/129
EXP: 91339
For next: 10936

Since: 09-11-11


Since last post: 5.6 years
Last activity: 2.1 years

Posted on 12-01-11 06:19:02 AM Link | Quote
I got in trouble for posting it at smwcentral, so I probably would here too, but I once made a PHP script that made a 1024x1024 image, then ran through the ROM, taking each byte, and converting it to a grayscale value with the red, green, and blue equaling that byte's value. Just because I was bored. But as a side effect, it made it very clear where free space was. It's also funny in that PNG's compression of the ROM is similar to it being zipped, from 1024KiB (1MiB) to around 370KiB to 372KiB.
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 4412/5390
EXP: 29075295
For next: 259710

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 12-01-11 07:26:41 AM Link | Quote
Post #4412 · 12-01-11 02:26:41 AM
I believe PNG uses the same algorithm as zip, so that would make sense...

____________________
Xenesis

Roy Koopa
Actually a Doctor
Level: 101


Posts: 1463/2732
EXP: 10486569
For next: 231106

Since: 07-28-07

Pronouns: She/Her
From: Orange Star's Retirement Villa

Since last post: 9 days
Last activity: 18 hours

Posted on 12-01-11 09:27:53 PM Link | Quote
Originally posted by stag019
I got in trouble for posting it at smwcentral, so I probably would here too, but I once made a PHP script that made a 1024x1024 image, then ran through the ROM, taking each byte, and converting it to a grayscale value with the red, green, and blue equaling that byte's value. Just because I was bored. But as a side effect, it made it very clear where free space was. It's also funny in that PNG's compression of the ROM is similar to it being zipped, from 1024KiB (1MiB) to around 370KiB to 372KiB.


You know, that'd actually be rather handy. Staring at a hex editor looking for strings of 0xFF is tricky, things tend to blur together after a while...
paulguy

Green Birdo
Level: 93


Posts: 1986/2294
EXP: 8032294
For next: 20516

Since: 09-14-07

From: Buffalo, NY

Since last post: 9.7 years
Last activity: 9.7 years

Posted on 12-16-11 12:49:34 AM Link | Quote
Paulguy's Post configuration
Could be useful for certain types of empty space. Though to my understanding, a lot of ROMs might even depend on chunks of zeroes being there, or free space being just uninitialized memory, that could look like other chunks of graphics or program code (possibly even random crap off of a development machine.). Or just filled with random.

But yeah, exploring a ROM's contents as an overview in something like tile molester in certain modes probably could produce some interesting results for seeking out free space or patterns one might miss in a hex editor.

____________________
stag019

Red Koopa
Level: 26


Posts: 27/129
EXP: 91339
For next: 10936

Since: 09-11-11


Since last post: 5.6 years
Last activity: 2.1 years

Posted on 12-16-11 12:55:19 AM Link | Quote
Originally posted by paulguy
Could be useful for certain types of empty space. Though to my understanding, a lot of ROMs might even depend on chunks of zeroes being there, or free space being just uninitialized memory, that could look like other chunks of graphics or program code (possibly even random crap off of a development machine.). Or just filled with random.

But yeah, exploring a ROM's contents as an overview in something like tile molester in certain modes probably could produce some interesting results for seeking out free space or patterns one might miss in a hex editor.

True. Keep in mind though that zeroes being there would still be visible (black rather than wight white), as was the case with Pokemon. But doing the way I did made it easier to view it all at once (although less width would probably make it more visible, but in Pokemon's case, there's so much free space it was easy to find). Also I'm pretty certain free space can't be uninitialized memory in the ROM...
Xenesis

Roy Koopa
Actually a Doctor
Level: 101


Posts: 1515/2732
EXP: 10486569
For next: 231106

Since: 07-28-07

Pronouns: She/Her
From: Orange Star's Retirement Villa

Since last post: 9 days
Last activity: 18 hours

Posted on 12-16-11 03:15:08 AM Link | Quote
I think what he means is that some games use a pre-defined area of ROM with a set of data to initialise RAM. Hence, what might look like 0x100 of 0x00 as free space may actually be used.

Seems like a strange way to do it though.
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 4430/5390
EXP: 29075295
For next: 259710

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 12-16-11 08:19:00 AM Link | Quote
Post #4430 · 12-16-11 03:19:00 AM
Yes, some games do have blocks of all 00/FF that aren't free. They might be tilemaps or uncompressed graphics. Optimizing for speed at the expense of space can produce such things. Super Mario World is one example I recall (some Mario tilemaps have long runs of zeros in them).

I've never seen a ROM have random garbage in its empty areas though. Most are filled with 00 or FF. (Some N64 ROMs end with a lot of 00 followed by a lot of FF. I haven't investigated to see if the zeros are used somewhere... the FF would be where the original image ended and nothing was burned to the chip, but I don't know why the image would be padded to some length other than the capacity of the chip...)

____________________
paulguy

Green Birdo
Level: 93


Posts: 1991/2294
EXP: 8032294
For next: 20516

Since: 09-14-07

From: Buffalo, NY

Since last post: 9.7 years
Last activity: 9.7 years

Posted on 12-16-11 09:04:39 AM Link | Quote
Paulguy's Post configuration
Ah I thought I heard of people finding stuff in "free" areas of ROMs that were just uninitialized blocks of memory from some development machine.

____________________
Rachel Mae

Creature of Chaos
Level: 141


Posts: 4700/5929
EXP: 33603650
For next: 516364

Since: 07-03-07

Pronouns: she/her
From: Foxglen

Since last post: 21 days
Last activity: 11 hours

Posted on 12-16-11 05:47:22 PM Link | Quote
The free space in many of Capcom's SNES games is filled with either copyright info or random code and data. The latter was probably done to throw off disassemblers.

____________________
Pages: 1 2Next newer thread | Next older thread
Jul - General Game/ROM Hacking - Adding new Pokemon in Generation I New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

32 database queries, 7 query cache hits.
Query execution time: 0.092326 seconds
Script execution time: 0.038534 seconds
Total render time: 0.130860 seconds