How To

Removing unused font characters

1

GAMELEGEND 2022-03-29 16:00 (Edited)

im not going to be using every font character for my next game so i was wondering if removing unused characters to make more space to draw different things would screw anything up.
i don't see why it would but you never know so im just checking


was8bit 2022-03-29 16:26 (Edited)

So, you have a lot of freedom when using a font character set...

1) you can choose to not use PRINT or NUMBER, meaning you either dont need any text or numbers, you can manually draw what you need .. example, manually drawing the text inside the buttons graphics ... this frees up ALL four pages of graphic characters for your game

2) you may change WHERE the font set starts with the FONT # command, by default, the default font set starts at #192 ... but lets say you ONLY want to use NUMBER... in this case, you can reset to FONT 224, and manually create the number graphics #0 to #9 starting with character #240... this frees up all graphics memory except the bottom characters #240 to 249 which will now be used for your NUMBER command... just make sure the numbers dont go negative, and this will work perfectly :)

3) finally, It is possible to have more than one characters file... the only thing is the game screen can only use one file a time (it isn't possible to use two files for graphic display simultaneously).. SO, if you have limited moments where the game changes from gameplay mode to reading text mode, or whatever your changing needs are, you can use the COPY command to load a new graphic file ...

IF file#4 is a character graphics file... this loads it as your game's graphics
COPY ROM(4),SIZE(4) TO $8000

This reloads the default graphic file as your game's graphics
COPY ROM(2),SIZE(2) TO $8000

.... so many options ;)



was8bit 2022-03-29 16:33 (Edited)

Also, you can simply just draw over existing characters you know you wont be using... if you load a font set onto page 4, this doesnt restrict use of page 4... even with the font set there, commands like CELL X,Y, # where # can me ANY # 0-255 .. same with SPRITE 0,X,Y,# ... # can still be any number 0-255

The only issue is that if you go ahead and draw over some of the font characters, and write your code to use those graphics... IF for any reason you change your mind and decide you need those font graphics, you will have to move your game graphic to a different spot and then rewrite your code to account for that change...

(I've have to do that a few times, rewrite my code after later i realized i needed some font graphics i had originally repurposed)


McPepic 2022-03-29 17:00

I just want to add that if you want to draw characters from page 4 onto the background, it will look weird in the editor. This is because the graphics that you’re seeing are from the graphics editor itself. When you draw the background, the characters will appear correctly with your characters in-game.


Log in to reply.