Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2011-08-20 20:33:30

Cheesewig
Member
Registered: 2011-08-06
Post 30/53

Pokémon Gold ROM Resizing Help

When I resized the Pokémon Gold ROM I edited 0x148 to 07. I still can't seem to insert any scripts there. PKSV Crashes.

Anyone?


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#2 2011-08-20 20:55:25

273/700

Re: Pokémon Gold ROM Resizing Help

Did you actually change the size of the file?

(Whether you did or not, PKSV shouldn’t crash like that. Report it to score_under so he can fix it.)

#3 2011-08-20 21:03:23

Cheesewig
Member
Registered: 2011-08-06
Post 31/53

Re: Pokémon Gold ROM Resizing Help

PKSV Is alright now.  I can now place scripts but say I wanted a person in New Bark Town to excecute a script at 0x200000 what should I put in the script box in Johtomap?


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#4 2011-08-21 07:10:41

Miksy91
Member
Registered: 2010-10-16
Post 496/2,311

Re: Pokémon Gold ROM Resizing Help

Cheesewig wrote:

PKSV Is alright now.  I can now place scripts but say I wanted a person in New Bark Town to excecute a script at 0x200000 what should I put in the script box in Johtomap?

I never resized the g/s/c rom myself but remember that it wasn't that simple.
You also have to write 0x200000 bytes of blank data in the end of the rom to make it the size of 4MB (not certain if inputting that much data is necessary or just to the data you point to...) and do something else to make the game recognize the banks between bytes 80 and FF.
A normal gameboy cartridge consists of max. 127 banks (00-7F), and that's why all the game boy games are of at max. 2MB.

I remember Tauwasser writing a solution somewhere but can't remember anymore...

Last edited by Miksy91 (2011-08-21 07:11:50)

Offline

#5 2011-08-21 08:21:39

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 927/3,479

Re: Pokémon Gold ROM Resizing Help

Scripts for a certain map must all be in the same bank, as events only use a 2-byte pointer to call them. In order to call a script that is in another bank than the events themselves, you would have to have them use a script in that bank that would just call the script you wanted and then end.

Offline

#6 2011-08-21 10:06:56

Cheesewig
Member
Registered: 2011-08-06
Post 32/53

Re: Pokémon Gold ROM Resizing Help

How can I make a script at 0x123000 call a script at 0x200000?


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#7 2011-08-21 11:40:09

Sawakita
Administrator
Registered: 2010-10-16
Post 192/364

Re: Pokémon Gold ROM Resizing Help

Miksy91 wrote:
Cheesewig wrote:

PKSV Is alright now.  I can now place scripts but say I wanted a person in New Bark Town to excecute a script at 0x200000 what should I put in the script box in Johtomap?

I never resized the g/s/c rom myself but remember that it wasn't that simple.
You also have to write 0x200000 bytes of blank data in the end of the rom to make it the size of 4MB (not certain if inputting that much data is necessary or just to the data you point to...) and do something else to make the game recognize the banks between bytes 80 and FF.
A normal gameboy cartridge consists of max. 127 banks (00-7F), and that's why all the game boy games are of at max. 2MB.

Not really. Check this out:

Game Boy Programming Manual wrote:

ROM Size (0148H)
Store the code for the program ROM size from the table below.

0148H  ROM Size

00H    256 KBit
01H    512 KBit
02H    1 MBit
03H    2 MBit
04H    4 MBit
05H    8 MBit
06H    16 MBit
07H    32 Mbit
08H    64 Mbit

And check this, too.

Miksy91 wrote:

I remember Tauwasser writing a solution somewhere but can't remember anymore...

Tauwasser's solution.

Last edited by Sawakita (2011-08-21 11:40:42)

Offline

#8 2011-08-21 12:41:55

Cheesewig
Member
Registered: 2011-08-06
Post 34/53

Re: Pokémon Gold ROM Resizing Help

I changed those offsets to oxoo's but what do I do next?


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#9 2011-08-21 16:10:28

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 928/3,479

Re: Pokémon Gold ROM Resizing Help

Cheesewig wrote:

How can I make a script at 0x123000 call a script at 0x200000?

Use the scripting compendium.

00-05 Pointer codes:                                                     Top

--------------------



Codes :



00 = 2byte pointer points to script; when pointed script ends --> return to old script

01 = 3byte pointer points to script; when pointed script ends --> return to old script

02 = 2byte pointer points to 3byte pointer; when pointed script --> return to old script

03 = 2byte pointer points to script; new script is part of main script

04 = 3byte pointer points to script; new script is part of main script

05 = 2byte pointer points to 3byte pointer; new script is part of main script



You would use one of the codes that used a 3byte pointer to a new script, so it can load from any bank, as a 2byte pointer can only point within the same bank.

Offline

#10 2011-08-21 19:55:16

Cheesewig
Member
Registered: 2011-08-06
Post 35/53

Re: Pokémon Gold ROM Resizing Help

... Errr... When I go to new bark town and execute the script it crashes with "Unknown opcode fc 8019"

Here is my script:

#org 0x123040
'-----------------------------------
3call 0x400080 ' 0x200000
playsound 0x1
end

#org 0x200000
'-----------------------------------
faceplayer
loadfont
3writetext 0x402080 ' 0x200020
closetext
loadmovesprites
end


#org 0x200020
= 0x123000 has\ncallled a\lscript at\p0x200000!\e


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#11 2011-08-21 20:19:19

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 929/3,479

Re: Pokémon Gold ROM Resizing Help

Hmm. I don't use PKSV really but that looks like it is doing what its supposed to be... maybe its the wrong type of call command? Or maybe something went wrong with the expansion. I've never expanded the rom, never saw a need to since there has always been plenty of blank space for anything I've wanted to do. Maybe Tauwasser or Sawakita can be of more help.

Offline

#12 2011-08-21 20:21:20

Cheesewig
Member
Registered: 2011-08-06
Post 36/53

Re: Pokémon Gold ROM Resizing Help

Well Never mind. Right now I need to convert a 2 byte pointer...


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#13 2011-08-21 20:25:10

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 930/3,479

Re: Pokémon Gold ROM Resizing Help

If you can figure out a 3 byte pointer, you can figure out a 2 byte pointer. A 2 byte pointer is just the last 2 bytes of a 3 byte pointer.

Offline

#14 2011-08-21 20:28:29

Cheesewig
Member
Registered: 2011-08-06
Post 37/53

Re: Pokémon Gold ROM Resizing Help

Well... If "00 48" is the pointer then it's not very helpful... And it is...


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#15 2011-08-21 20:33:12

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 931/3,479

Re: Pokémon Gold ROM Resizing Help

00 48 is a pointer. And I fail to see how that is not helpful. It points to a location based on which bank the pointer itself is in. 99% of the text in the game is called by 2byte pointers, all of the scripts for events are called by 2byte pointers etc. It would be pointless to specify the bank each time when they are in the bank that is already loaded.

If your problem is trying to find a location based on a 2byte pointer, you would take the bank that the pointer itself is in and use that as the bank byte so you could find the location it is pointing to.

Offline

#16 2011-08-21 20:41:52

Cheesewig
Member
Registered: 2011-08-06
Post 38/53

Re: Pokémon Gold ROM Resizing Help

I've worked it out. Don't know what I was doing. Wow, Pointers are easier than I thought.


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#17 2011-08-21 20:54:01

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 932/3,479

Re: Pokémon Gold ROM Resizing Help

Glad you got it sorted.

Offline

#18 2011-08-21 21:09:40

Cheesewig
Member
Registered: 2011-08-06
Post 39/53

Re: Pokémon Gold ROM Resizing Help

So, I don't mind using a hex editor so how would I make this script work?


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#19 2011-08-21 22:05:39

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 933/3,479

Re: Pokémon Gold ROM Resizing Help

Well, your first script would be:
01 XX YY ZZ (where XX YY ZZ is the 3byte pointer to your other script) //Calls script in another bank, then comes back to this one when finished.
84 00 01 //Plays sound effect 01.
90 //"Return Code 2" Used for end of script.

And your second script would be:

6A //FacePlayer.
47 //LoadFont
4C XX YY  (Where XX YY is a 2byte pointer to your text) //LoadText
53 //CloseTextBox
49 //UnloadFont
90 //Return Code 2

Offline

#20 2011-08-22 18:23:23

Cheesewig
Member
Registered: 2011-08-06
Post 40/53

Re: Pokémon Gold ROM Resizing Help

It doesn't give me an unsupported opcode now... The game restarts with weird colours...


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#21 2011-08-22 19:07:36

Tauwasser
Member
Registered: 2010-10-16
Post 171/448

Re: Pokémon Gold ROM Resizing Help

Please show the work you did, i.e. what you inserted where and when the error occurs and we'll be much more able to help you.

cYa,

Tauwasser

Offline

#22 2011-08-22 19:13:03

Cheesewig
Member
Registered: 2011-08-06
Post 41/53

Re: Pokémon Gold ROM Resizing Help

Okay At 0x123040 I inserted this:

01 80 00 40 84 01

Which points to 0x200000 where this:

7E 05 00 90 40 53 49 90

Which should play music 0x5 then return to 0x123040 and play sound 0x1...


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#23 2011-08-22 19:40:03

Tauwasser
Member
Registered: 2010-10-16
Post 172/448

Re: Pokémon Gold ROM Resizing Help

You should put another 0x00 0x90 after your current code. The 0x00 will complete the 0x84 code, and 0x90 will  actually end the script. You might not hear the sound effect though.
cYa,

Tauwasser

Offline

#24 2011-08-22 19:42:06

Cheesewig
Member
Registered: 2011-08-06
Post 42/53

Re: Pokémon Gold ROM Resizing Help

Sorry, I've done that, I forgot that bit.


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

#25 2011-08-23 09:03:55

Cheesewig
Member
Registered: 2011-08-06
Post 44/53

Re: Pokémon Gold ROM Resizing Help

So, is there anything else wrong with it?


My name is Aochider I was called. Dr. PET was loved an esteemed by us all!
Team Cheesemon | Cheesewig's Domain Forum |

Offline

Board footer

Powered by FluxBB