Jump to content
  • 1

vera: character sets


JohnGill
 Share

Question

Hi all,

I started developing a hex-based strategy/roleplay game last year but sadly it's been shelved for ages. That was back on r34 of the emulator. I know it's changed loads since then so I've been ploughing through v0.9 of the vera guide to get my code up to date on r37, and I can't find any reference to the character sets.

It used to be the case that the character set pixel data was copied into vram starting at $1F000 and so I could make custom characters by poking that area. Is this still the case?

thanks

John Gill

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  

Aww, Matt beat me to it. I'm too verbose.

Consider the following BASIC program which dumps the VERA's layer-related registers:

Quote

10 PRINT "L0 CONFIG:    "PEEK($9F2D)
20 PRINT "L0 MAPBASE:   "PEEK($9F2E)"
30 PRINT "L0 TILEBASE:  "PEEK($9F2F)"
40 PRINT "L0 HSCROLL L: "PEEK($9F30)
50 PRINT "L0 HSCROLL H: "PEEK($9F31)
60 PRINT "L0 VSCROLL L: "PEEK($9F32)
70 PRINT "L0 VSCROLL H: "PEEK($9F33)

80 PRINT "L1 CONFIG:    "PEEK($9F34)
90 PRINT "L1 MAPBASE:   "PEEK($9F35)"
100 PRINT "L1 TILEBASE:  "PEEK($9F36)"
110 PRINT "L1 HSCROLL L: "PEEK($9F37)
120 PRINT "L1 HSCROLL H: "PEEK($9F38)
130 PRINT "L1 VSCROLL L: "PEEK($9F39)
140 PRINT "L1 VSCROLL H: "PEEK($9F3A)

Run that, and you'll get the following output on r37:

Quote

L0 CONFIG: 0
L0 MAPBASE: 0
L0 TILEBASE: 0
L0 HSCROLL L: 0
L0 HSCROLL H: 0
L0 VSCROLL L: 0
L0 VSCROLL H: 0
L1 CONFIG: 96
L1 MAPBASE: 0
L1 TILEBASE: 124
L1 HSCROLL L: 0
L1 HSCROLL H: 0
L1 VSCROLL L: 0
L1 VSCROLL H: 0

Layer 1 is the only layer configured at boot, as you can see.

L1 CONFIG is 96, or $60, which breaks down as setting Map Height to %01, Map Width to %10, T256C to 0, Bitmap Mode to 0, and Color Depth to 0. This is a 128x64 tilemap at 1bpp, with 16-color background and 16-color foreground for each tile.

L1 MAPBASE is 0, so the tilemap data starts at VRAM address $00000.

L1 TILEBASE is 124, or $7C, which breaks down to a Tile Base Address of %011111 or $1F, Tile Height of 0, and Tile Width of 0. The Tile Base Address field only represents bits 11-16 (bits 0-10 are not represented at all, meaning the value has to be aligned to a 2048-byte increment). Multiply that out and you get the VRAM start address of $0F800. Per the other layer settings from this register and L1 Config, each tile is 8x8x1bpp.

  • Like 1
Link to comment
Share on other sites

  • 0
45 minutes ago, StephenHorn said:

  

Aww, Matt beat me to it. I'm too verbose.

Consider the following BASIC program which dumps the VERA's layer-related registers:

Run that, and you'll get the following output on r37:

Layer 1 is the only layer configured at boot, as you can see.

L1 CONFIG is 96, or $60, which breaks down as setting Map Height to %01, Map Width to %10, T256C to 0, Bitmap Mode to 0, and Color Depth to 0. This is a 128x64 tilemap at 1bpp, with 16-color background and 16-color foreground for each tile.

L1 MAPBASE is 0, so the tilemap data starts at VRAM address $00000.

L1 TILEBASE is 124, or $7C, which breaks down to a Tile Base Address of %011111 or $1F, Tile Height of 0, and Tile Width of 0. The Tile Base Address field only represents bits 11-16 (bits 0-10 are not represented at all, meaning the value has to be aligned to a 2048-byte increment). Multiply that out and you get the VRAM start address of $0F800. Per the other layer settings from this register and L1 Config, each tile is 8x8x1bpp.

That's all really helpful, thanks Stephen, getting to grips with where everything is in the new vera / r37 layout

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.

Guest
Answer this question...

×   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.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use