Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Help/Question
  • → Has anyone made Bill's PC in GSC not depend on -1 as the Cancel value?

#1 2016-05-16 13:02:10

Rangi
Member
Registered: 2016-05-09
Post 6/823

Has anyone made Bill's PC in GSC not depend on -1 as the Cancel value?

So with single-byte Pokémon IDs, there are 256 possible values. 0 is unusable, since it means "no Pokémon". 1 to 251 are the Gen II Pokémon. 253 is used for Eggs. It's easy enough to move the Egg to 254, making it possible to use 252 and 253 for a couple extra Pokémon. Ideally you could move it to 255 and free up a third slot.

But 255 is also unusable, because Bill's PC interprets it as the Cancel value. So if your party contains an Egg followed by more Pokémon, none of them will show up. And depositing, withdrawing, and reorganizing your party with the PC starts to overwrite your Pokémon with more Eggs, and I'm sure there would be more issues if I continued to play the game with this edit.

Has anyone modified the PC system to, say, use 0 as the Cancel value? I'm not quite sure why it doesn't do so already. Or is there a good reason why 0 and 255 are reserved values, and I should give up on making space for three more Pokémon?

Edit: Okay, maybe there is a good reason. There's space on the screen for five Pokémon, so if you only have one to three, you'll see them listed, followed by Cancel, followed by at least one blank space. -1 is for Cancel and 0 is for the blank spaces. Still, it might be possible to edit the code so that (a) only the first 0 gets displayed as "Cancel", with the rest blank, and (b) you can't scroll past the first 0. This would make -1, aka 255, a valid Pokémon value, unless I'm (probably) overlooking something.

Last edited by Rangi (2016-05-16 13:11:44)


ROM hack: Pokémon Polished Crystal (GitHub) — version 2.2.0 released!

Offline

#2 2016-05-16 13:32:31

Miksy91
Member
Registered: 2010-10-16
Post 2,254/2,317

Re: Has anyone made Bill's PC in GSC not depend on -1 as the Cancel value?

Not really time to pay attention to this problem specifically, but is having three extra pokemon really more worth it than having just two? And if so, do you think 3 new pokemon is enough and you won't need room for more?

In my opinion it might be better not to even try to make space for three new pokemon by using bytes 00 or FF for yet another pokemon although it might work out. The thing is that using byte 00 for indexing Egg for instance could cause problems with some other data structures (if it wouldn't be an issue here).

Another way to add more than 2 new pokemon in the game is simply by using more than 8 bits for describing each one. Koolboyman introduces a method for using an additional bit for pokemon IDs here (https://hax.iimarck.us/topic/1284/), but just like Tauwasser mentions,

Tauwasser wrote:

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 would be a better approach to use 2 bytes for storing the ID for each pokemon everywhere in the game. Doing this with the disassembly wouldn't really be that difficult - at least I don't think it would. But it would require re-writing lots of code here and there. This involves basically every routine that handles pokemon IDs in one way or another.

Last edited by Miksy91 (2016-05-16 13:36:10)

Offline

#3 2016-05-16 15:13:16

Rangi
Member
Registered: 2016-05-09
Post 7/823

Re: Has anyone made Bill's PC in GSC not depend on -1 as the Cancel value?

Well, every slot counts. I'm already removing some mediocre Pokémon to make room for better ones, but very few Pokémon are so bad that they won't even be missed. (*cough* Cleffa and Igglybuff) And 255 is more of a round number than 254, if you're used to hexadecimal. Yes, these are minor complaints, and I should really just deal with the 254 limit, but having room for one more Pokémon can't hurt.

Koolboyman's idea is interesting. Thanks for linking it, I hadn't seen that before. Recently ShantyTown also started extending the pokered engine to use 2-byte Pokémon IDs. But I think doing this for Crystal would take even longer than modifying the PC, and I'd be too tempted to actually use all that extra space for 721+ Pokémon. 254/255 is a decent constraint to work with.

(Right now I've narrowed it down to a set of eight {Porygon-Z, Munchlax, Mantyke, Stantler, Lickitung, Delibird, Wobbuffet, Shuckle} from which I have room for four. Five if this 255 plan works.)

Last edited by Rangi (2016-05-16 15:16:52)


ROM hack: Pokémon Polished Crystal (GitHub) — version 2.2.0 released!

Offline

  • Index
  • → Help/Question
  • → Has anyone made Bill's PC in GSC not depend on -1 as the Cancel value?

Board footer

Powered by FluxBB