Author Topic: Text on the PCE  (Read 433 times)

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Text on the PCE
« on: May 15, 2012, 06:15:28 PM »
Is text display sprites, tiles, or its own thing?
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

nodtveidt

  • Guest
Re: Text on the PCE
« Reply #1 on: May 15, 2012, 06:17:53 PM »
It's normally tiles, but it can be either/or, sometimes even both.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Text on the PCE
« Reply #2 on: May 15, 2012, 06:22:02 PM »
But there is no separate text display function. OK, just checking to make sure. What does HuC use by default for the basic text routines? Tiles?
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

nodtveidt

  • Guest
Re: Text on the PCE
« Reply #3 on: May 16, 2012, 02:11:09 AM »
No, there is no separate text display function. HuC uses tiles stored in a dedicated area of VRAM. Text display is generally a user or library function. The CD BIOS may have some text functions... it has font storage, but that's all I know about, and you need assembly to access it.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Text on the PCE
« Reply #4 on: May 16, 2012, 02:48:42 AM »
The "text display" function, just puts background tiles where you tell them, and it knows where the system font (or font you tell it) is stored in VRAM.


It's your job to store the font properly so that the library function properly puts the text where you tell it.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

cabbage

  • Sr. Member
  • ****
  • Posts: 342
Re: Text on the PCE
« Reply #5 on: May 16, 2012, 08:09:47 AM »
Yeah, HuC's text-output functions (e.g. put_number, put_string, etc.) just update the background/tiles table with your font's tiles.

Don't forget that you can change a sprite's priority to make it appear underneath the background (and thus the HuC-libraries-outputted text), but you'll only be able to see through the color-0 part of your tiles... so, not really useful in most applications, but it can come in handy and is worth remembering. (Use spr_pri(0), if I recall correctly, to have a sprite appear underneath the background)

For truly sprite-based text, I suppose it's simple enough to just reload some font data into your sprite ram area and set up a few sprites--or something similar. I guess this mostly comes up on titles, credits, stuff like that, as well as your on-screen display for score/etc. Since this sprite text can usually be kept to a minimum, it's generally easy enough to manage with your own code. I don't think the overhead from a flexible sprite-based text output library would really be worthwhile on PCE... maybe for subtitling cut-scenes in games or something, heh.