Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2012-01-17 20:32:07

koolboyman
Member
Registered: 2010-10-16
Post 45/203

Above 256 Max Pokemon Theory

I had an idea a while back for what I believe, the easiest way to increase the maximum Pokemon slots to 512. 

My idea was to make use of the Pokemon's level byte since it is defined every time a Pokemon is called.  The highest bit of the byte is always off since the maximum level is 100 and for that bit to be on the level would have to be at least 128. 

What need would be done:
- Special code every time a Pokemon is called to disregard the last bit of the level variable when assigning a level, and putting that bit to use.  Wild Pokemon, Pokemon added to your party, Pokemon given as a gift, Pokemon in a trainer's party, etc.
- When the bit is on, to read from a separate table for the following:
* Names
* Base Stats table
* Crys
* Pictures
* Moves and Evolution Data
* Colors
* Icons on the menu
* RAM Addresses of the second Pokedex Seen/Own boolean arrays, or to just expand the existing ones.
* Print Pokedex Numbers + 256 whenever the Pokedex variable is displayed. 
* Anything else I can't remember at the moment.  Feel free to bring them up.
- The only instance I can think of at the moment where a Pokemon is defined without it's level is the new Pokedex Order and ABC order.  You would have to write new code to accept a ninth bit for those, and additional code to support the new ID number order.

Easier said than done obviously.  Would anyone be interested in it's implementation?  I'm sure it can be used for Red as well (The workaround for the trainer bytes for Brown was that the Pokemon with index numbers C9 and above would never be encountered in the wild.  When called any other way they appear as normal Pokemon).

Offline

#2 2012-01-18 04:54:33

Miksy91
Member
Registered: 2010-10-16
Post 740/2,339

Re: Above 256 Max Pokemon Theory

This is an interesting idea and feels like it could work too !
What about RAM though, is there (or can there be made) enough space for 256/8 * 2 bytes?

Last edited by Miksy91 (2012-01-18 04:55:13)

Offline

#3 2012-01-18 12:32:01

amvz08
Member
From: Philippines
Registered: 2011-06-27
Post 213/600

Re: Above 256 Max Pokemon Theory

does it means the dex can have at least 4 generations of complete pokemon per generation?


Trust me, I'm an Engineer

>>>Pinoy ka ba? Pasok ka dito<<<

Offline

#4 2012-01-18 14:14:02

koolboyman
Member
Registered: 2010-10-16
Post 46/203

Re: Above 256 Max Pokemon Theory

Miksy91 wrote:

This is an interesting idea and feels like it could work too !
What about RAM though, is there (or can there be made) enough space for 256/8 * 2 bytes?

Yeah there's enough room for that.

amvz wrote:

does it means the dex can have at least 4 generations of complete pokemon per generation?

Yep, with some room left afterwards.

Last edited by koolboyman (2012-01-18 14:16:51)

Offline

#5 2012-01-18 14:49:18

amvz08
Member
From: Philippines
Registered: 2011-06-27
Post 214/600

Re: Above 256 Max Pokemon Theory

wow thats nice, maybe we, all members of the forum can create a big hack applying these great discovery and each contribute their knowledge. But for me,i could only contribute graphical needs xp


Trust me, I'm an Engineer

>>>Pinoy ka ba? Pasok ka dito<<<

Offline

#6 2012-01-18 15:27:02

Sawakita
Administrator
Registered: 2010-10-16
Post 265/365

Re: Above 256 Max Pokemon Theory

I can help you porting the RGBY decompression routine to GSC (I actually have disassembled it few months ago, it's only missing the "XOR process" part, iirc), since it seems that RGBY compression is much more efficient than GSC compression. So, considering that you'll have twice the sprites that GSC originally had, you might need some better space optimization.

Offline

#7 2012-01-18 16:51:58

Gallego13
Member
Registered: 2011-12-11
Post 22/94

Re: Above 256 Max Pokemon Theory

When I first read the title of the topic I thought: I love you KBM
Now, seriously, it's a great idea, so I'll help in wherever I can.
Also, can I quote this message and post it in another community (Whack a Hack)? Maybe some spanish hackers can help making this easier.
Thanks ;)

Last edited by Gallego13 (2012-01-18 16:52:36)

Offline

#8 2012-01-18 17:18:13

Melash
Member
Registered: 2010-10-16
Post 73/132

Re: Above 256 Max Pokemon Theory

Very interesting. I would really like to see someone implement this into a Gold ROM. I wouldn't mind helping anyway I can.

Offline

#9 2012-02-26 10:31:09

koolboyman
Member
Registered: 2010-10-16
Post 51/203

Re: Above 256 Max Pokemon Theory

I started working on this and it's coming out well.  I figure I might as well work on it because it would be a great addition to Prism.  Pick a task if you want to help speed up the process.

As of now:
- Most instances of showing a Pokemon's level ignore the highest bit.  However stats and everything else will still check the highest bit at the moment.
- Rare Candy ignores the seventh bit.
- Pokemon name table is swapped if the highest bit is on in certain instances.

I store a single boolean bit at CBFF (The end of the map buffer which will most likely never get reached) and CBFE / CBFD for temporary variables during the process.  This is done because the level variable in several instances for a Pokemon is stored in different areas of the RAM and it would be confusing to determine which one to read from.  So I just have it set this variable once the game begins to use a level variable in any instance.  If it's on, I will make the game read from the new tables for Pokemon, else read from the normal table.  This process works even if you have multiple Pokemon in your party from separate tables, it'll at the moment, display the information correctly.

Having it read from different tables based on bit seems to be the easy part.  The hard part is going to have to write something for each and every single instance a Pokemon is called.

Last edited by koolboyman (2012-02-26 10:43:09)

Offline

#10 2012-02-26 14:04:15

Tauwasser
Member
Registered: 2010-10-16
Post 266/452

Re: Above 256 Max Pokemon Theory

The biggest problem with all approaches to extending the Pokémon table(s) is really that you have to go through everything, be it asm, scripts, data... I don't see how a flag in RAM will actually benefit you in any way. I think it could also be detrimental in the sense that you might need to perform some operations for Pokémon above 0x100 and some operations for "regular" numbers at seemingly the same time. For instance, you might need to set the flag for loading Pokémon 0x100's name, yet some interrupt occurs that also performs tasks on other data that is using a number <0x100 and thus needs to use the old table. You will run into the problem that you cannot coordinate which routines are called with the flag set or reset.

IMHO the only clean approach here is to edit everything to support two-byte (or 9bit) numbers and edit all routines to accept a different argument list that makes use of one of the 16bit registers for the Pokémon number.
It might actually be worthwhile to look into doing this within the framework of a decompilation project or the like.

cYa,

Tauwasser

Offline

#11 2012-03-15 18:32:33

FroggestSpirit
Member
Registered: 2012-03-12
Post 2/300
Website

Re: Above 256 Max Pokemon Theory

I think this would be rather interesting. Idk if it would help to get 1024 Pokemon, but isn't there also an extra bit where the PP for moves is stored?
It'd be nice to see a hack with all 649 (at time of typing) Pokemon. Although 2 Bytes may be better if moves were included...


This isn't easy to say, but…
Music and ASM hacker

Offline

#12 2012-03-15 19:37:50

stag019
Idea Killer
Registered: 2011-01-05
Post 152/630

Re: Above 256 Max Pokemon Theory

The extra bits in the PP are for PP-Ups.


You can try to hide yourself in this world of pretend; when the paper's crumpled up, it can't be perfect again.

Offline

#13 2012-10-17 00:29:22

Danny-E 33
Administrator
Registered: 2012-06-09
Post 177/1,119

Re: Above 256 Max Pokemon Theory

Well I just got excited cause I thought there might have been some progress made on this.
But nope. I just got Rick Rolled. Stupid spam bots.
But I guess now's as good a time as any other to ask. Has any progress been made on this?

Offline

Board footer

Powered by FluxBB