Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-10-10 09:54:54

pepitopon
Member
Registered: 2016-07-25
Post 33/38

Changing size of text files in Pokered

Im working with the dissasembly project Pokered. I want to resize a text file to let me write more dialogues. If i try to compile with a longer text file that the rom is programmed, cygwin shows me this:

$ make red
rgbasm -h -o red/text.o red/text.asm
C:\cygwin64\usr\local\bin\rgbasm.exe: Section 'Text 7' is too big (old size 16371 + 15 > 16384)
make: *** [Makefile:84: red/text.o] Error 1


The only "solution" is reduce my text idea as minimum to make a compilation, but i hope to find a way to make bigger text files.

I dont know where i have to modify to make a text file longer and let me write more texts. ¿Is that possible? ¿How?

Offline

#2 2016-10-10 16:46:11

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 401/432
Website

Re: Changing size of text files in Pokered

The problem is that you are trying to add too much text in bank $26 (TEXT_7) that it does not fit. Consider moving some of the includes in the text7 section to another section, such as text8 or text9. Alternatively, if you don't care to which bank your text goes you can create a new section without specifying the bank number like this:

SECTION "Spare Text", ROMX

then move some stuff from text7 to that new section.

Offline

#3 2016-10-11 06:07:54

pepitopon
Member
Registered: 2016-07-25
Post 34/38

Re: Changing size of text files in Pokered

Crystal_ wrote:

The problem is that you are trying to add too much text in bank $26 (TEXT_7) that it does not fit. Consider moving some of the includes in the text7 section to another section, such as text8 or text9. Alternatively, if you don't care to which bank your text goes you can create a new section without specifying the bank number like this:

SECTION "Spare Text", ROMX

then move some stuff from text7 to that new section.


Sorry, but i didn't understand the most of you said XD

I've been having this problem with texts for days, and always is the same error with "TEXT_7". I presume that all texts are located in bank $26? (i dont know) because cyg shows me the same error in text 7.

When i change another text map that has assigned more space, i have no problem with add more text, but there are text maps really small that i want to resize to one bigger.

I dont know where is located banks, how to change them without affecting other fields, move texts to other banks...


I dont know so much about hacking, so can you explain it step by step, please?

Last edited by pepitopon (2016-10-11 06:26:09)

Offline

#4 2016-10-11 07:29:27

Mmmmmm
Member
From: West Virginia
Registered: 2015-05-17
Post 120/259

Re: Changing size of text files in Pokered

By making a section with just "ROMX" and no bank specified, it will put the section wherever there's space for it. Moving some of the data from text_7 to the spare text section will allow the compiler to find a spot for it and move it there without you having to manually search for free space in a different bank.

Offline

#5 2016-10-11 08:29:11

pepitopon
Member
Registered: 2016-07-25
Post 35/38

Re: Changing size of text files in Pokered

Mmmmmm wrote:

By making a section with just "ROMX" and no bank specified, it will put the section wherever there's space for it. Moving some of the data from text_7 to the spare text section will allow the compiler to find a spot for it and move it there without you having to manually search for free space in a different bank.

I understand the concept. But, how can i do it? writting specifically what? And where?

If you could explain it step by step, i would be fully granted :D

Offline

#6 2016-10-11 14:19:03

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 402/432
Website

Re: Changing size of text files in Pokered

The problematic file is https://github.com/pret/pokered/blob/master/text.asm by the way. Forgot to mention it. For now, consider moving the last include of text7 to the top of the section below (i.e. move line 2371 to above line 2376).

But depending on how much text you want to add, you could also consider creating another section so that you can move there anything that doesn't fit in the current section. For example, copy the follwing somewhere in the text.asm file, like between sections text7 and text8:

SECTION "Whatever name", ROMX

and move the bottom three or four includes of section text7 below the new section you've just created like this:

SECTION "Text 7", ROMX, BANK[TEXT_7]
...
INCLUDE "text/maps/name_rater.asm"
INCLUDE "text/maps/vermilion_pokecenter.asm"

SECTION "Spare text", ROMX

INCLUDE "text/maps/fan_club.asm"
INCLUDE "text/maps/vermilion_mart.asm"
INCLUDE "text/maps/vermilion_gym_1.asm"

SECTION "Text 8", ROMX, BANK[TEXT_8]

INCLUDE "text/maps/vermilion_gym_2.asm"
INCLUDE "text/maps/vermilion_house.asm"
(...)

Anytime another bank gets filled up and you get the same error when compliling you can move stuff from that bank/section to the new one and the compiler will alocate it wherever it fits.

Offline

#7 2016-10-11 15:32:46

Danny-E 33
Administrator
Registered: 2012-06-09
Post 986/1,031

Re: Changing size of text files in Pokered

It's worth noting that this is pretty much always going to be a safe solution for text banks, but not always a safe solution for any bank.

If there was some code in the "top half" of the bank that references something that is in the "bottom half", you would almost definitely break the code because the code that includes that reference would assume it exists in the same bank (because it originally did). But if you put the bottom half in a new bank, that assumption is wrong.

Like I said, this isn't a problem for text banks because there is no code or references within that bank. But don't assume that you can apply this same solution in the future if a different bank fills up.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#8 2016-10-12 06:27:42

pepitopon
Member
Registered: 2016-07-25
Post 36/38

Re: Changing size of text files in Pokered

Crystal_ wrote:

The problematic file is https://github.com/pret/pokered/blob/master/text.asm by the way. Forgot to mention it. For now, consider moving the last include of text7 to the top of the section below (i.e. move line 2371 to above line 2376).

But depending on how much text you want to add, you could also consider creating another section so that you can move there anything that doesn't fit in the current section. For example, copy the follwing somewhere in the text.asm file, like between sections text7 and text8:

SECTION "Whatever name", ROMX

and move the bottom three or four includes of section text7 below the new section you've just created like this:

SECTION "Text 7", ROMX, BANK[TEXT_7]
...
INCLUDE "text/maps/name_rater.asm"
INCLUDE "text/maps/vermilion_pokecenter.asm"

SECTION "Spare text", ROMX

INCLUDE "text/maps/fan_club.asm"
INCLUDE "text/maps/vermilion_mart.asm"
INCLUDE "text/maps/vermilion_gym_1.asm"

SECTION "Text 8", ROMX, BANK[TEXT_8]

INCLUDE "text/maps/vermilion_gym_2.asm"
INCLUDE "text/maps/vermilion_house.asm"
(...)

Anytime another bank gets filled up and you get the same error when compliling you can move stuff from that bank/section to the new one and the compiler will alocate it wherever it fits.


So simple. In SECTION "Text 9", ROMX, BANK[TEXT_9] is a lot of free space to place big texts.

Thanks for this explanation! And all of you helped me too.

Offline

Board footer

Powered by FluxBB