Jump to content
IGNORED

Tiles and fonts in different gfx blocks


mksmith

Recommended Posts

Hi,

 

I'm using 7800basic with a 48kRam romsize and I currently have a tile image containing 115 tiles (4x8) at 12+1 colors plus 2 font images (one a-z0-9 then other 0-9a-f).

 

My issue is that the tiles are being put into GFX Block #0 and the fonts into GFX Block #1. Now when it comes time to render the screen obviously depending on which characterset I choose it will only display that characterset and the other is gibberish (attempting to have a background with the tile set and scores etc with the font set).

 

Is there anyway to fix this? Would using banking make a difference?

 

Thanks!

  • Like 1
Link to comment
Share on other sites

When you change character set it tells the 7800 where the start of your first tile is, then when it draws the tilemap it takes that location and skips ahead a number of bytes to get the tile you want drawn to the screen. As the index of each tile is stored in a single byte you can only have 256 bytes of tiles in use at a time.

 

If your text is always vertically separated from the main tiles then you can look into changing the character set partway down the screen. In the 7800BASIC samples folder there should be a split mode demo that shows how to set up a topscreen routine to wait a number of lines using WSYNC and then change the screen.

 

Also look into how you're using your tiles. Do you really need 2 sets of fonts or can you make do with just 1? If you're using 160B mode then each byte covers 2 (wide) pixels which means if you've cut up your graphics into 4*8 tiles you might have a lot of empty space you can work with, or you could shrink your tiles by 2 pixels and free up some space that way.

  • Like 2
Link to comment
Share on other sites

SmittyB,

 

Thanks will take a look in the samples!

 

ATM I can only fit the tiles into GFX Block #0 nothing else will go in - they are already 4x8 but I might need to simplify what I intend to display instead. I need to see about the fonts - It appears that using plotvalue requires a specific 0-9a-f font order? Maybe I can just re-order the other base font instead.

Edited by mksmith
Link to comment
Share on other sites

You can change which characters represent which tiles using alphachars. Starting at 0 each character will represent a tile from the start of the character set.

Personally I like to start with 0-9 A-Z so that the first 16 represent their own value in hex.

 

If you're not writing a lot of text you can probably get away with a limited number of text characters. There aren't many q's and z's in 'new high score' or 'extra life'.

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...