How to avoid bundling fonts

Post Reply
MontyOnTheRun
New member
Posts: 4
Joined: Fri Mar 15, 2024 9:15 am

How to avoid bundling fonts

Post by MontyOnTheRun »

I'm have my own text drawing system, is there any way to avoid including the default?
The docs only seem to mention how to customize it, but not how to disable it.
I'm running out of ROM space on the Master System...
User avatar
dom
Well known member
Posts: 2148
Joined: Sun Jul 15, 2007 10:01 pm

Re: How to avoid bundling fonts

Post by dom »

There's usually a way to disable most things, but first, what's your current command line used to compile and link?
MontyOnTheRun
New member
Posts: 4
Joined: Fri Mar 15, 2024 9:15 am

Re: How to avoid bundling fonts

Post by MontyOnTheRun »

MontyOnTheRun
New member
Posts: 4
Joined: Fri Mar 15, 2024 9:15 am

Re: How to avoid bundling fonts

Post by MontyOnTheRun »

Sorry, wrong branch - this is the correct: https://github.com/TheFakeMontyOnTheRun ... kefile.sm3
User avatar
dom
Well known member
Posts: 2148
Joined: Sun Jul 15, 2007 10:01 pm

Re: How to avoid bundling fonts

Post by dom »

A Makefile and source always make life a lot easier!

Instead of -pragma-define:CRT_FONT=0 use -pragma-export:CRT_FONT=0

Here's some more for you:

Code: Select all

        -pragma-export:ansi_SCROLLUP=0 \
        -pragma-define:CRT_ENABLE_STDIO=0 \
        -pragma-export:__tms9918_mode2_printc=0
I can still see some stuff being pulled in that probably ought not be there but I'll need to dig further.
User avatar
dom
Well known member
Posts: 2148
Joined: Sun Jul 15, 2007 10:01 pm

Re: How to avoid bundling fonts

Post by dom »

Here's what I've come up with:

Code: Select all

     -pragma-redirect:fputc_cons=l_ret \
    -pragma-define:CRT_ENABLE_STDIO=0 \
    -pragma-export:CLIB_GENCON_CAPS=0
1. Disable any builtin screenpirinter (since you have your own), this means that the font isn't pulled in
2. Disable setting up stdio in the cat
3. This is weird one and took a while to find. Setting the screenmode sets up various sizes and parameters. One of those is the capabilities of the screen driver (bold/underline/colour etc). Setting that variable needs a definition for CLIB_GENCON_CAPS initially. This is set in one the console files, which results in a whole chunk of screen driver code being included.

Those 3 options have taken the binary down from 32380 to 30841 which should give you a bit more room.
MontyOnTheRun
New member
Posts: 4
Joined: Fri Mar 15, 2024 9:15 am

Re: How to avoid bundling fonts

Post by MontyOnTheRun »

OMG! I went from 0 bytes free(!) to 1544 bytes free!
And I see no side-effect whatsoever.
Thank you very much! I hope to make the game less lame with that extra space :)
Post Reply