Home | Forums | What's new | Resources | |
slPrint() Question |
slinga - Jan 22, 2004 |
1 | 2 | Next> |
slinga | Jan 22, 2004 | |||
Hey guys, Is there a way to print colored ASCII characters on the saturn? Like a function similar to slPrint(), but that will take a parameter for color? Thanks in advance. |
mrkotfw | Jan 22, 2004 | |||
my newest demo has colored text, if you need the source code just pm me. |
slinga | Jan 22, 2004 | |||
You guys rule :cheers I'm going to update my pong game to have different color paddles for each player. Since all I'm doing are slPrint()'s, this should be pretty easy. |
vreuzon | Jan 23, 2004 | |||
antime : I'm not sure I understand what you mean by "tile" ? Is it a bitmap defining the chars ? by the way, do you know where the default font (used for slprint) is stored ? piratero : I'd like to read your code: it could be interesting. You could make it public, too. V |
antime | Jan 23, 2004 | |||
Yes, a tile is the 8*8 pixel basic building block of backgrounds in non-bitmap modes. On the C64 they were called "characters". I don't know where the charset used in SGL is stored, but you could try loading both the BIOS ROM and SGL library into some graphics-ripping tool. |
vreuzon | Jan 23, 2004 | ||||
Thanks.
But... Isn't this 8x8 pixel block a bitmap ? So what do you call a non-bitmap mode ? Has it something to do with the block size and the screen size ? |
antime | Jan 23, 2004 | |||
In tiled modes you use tilemaps to get one (or more, in the case of the Saturn) level of indirections. The tiles are quite correctly bitmapped images, but the screen is constructed by going through the tilemap which directs which tile is displayed at what location. In bitmapped modes the whole screen is represented as one big bitmap which is directly transferred to the video output. EDIT: In case I didn't make myself clear, in tiled modes you generally manipulate the tilemaps while in bitmapped modes you draw individual pixels. |
mrkotfw | Jan 23, 2004 | |||
you copy the tiles in DMA, the map is where you would place a tile... why not just create a font and use that? |
vreuzon | Jan 24, 2004 | |||
Perfectly clear now, thanks. That was something I didn't knew. For info, i think the tilemap is called "pattern data" and character "character data". (chap 8-7 in sgl tut.). |
slinga | Jan 24, 2004 | |||
*bump* Can anybody get slCurColor to work? I tried with a number of values between 1-15, but I always get white text. One of the samples has it, but I can't compile it for some reason (something with my makefile, I'll check it again when I get back to school). |
antime | Jan 25, 2004 | |||
Looking through the akira3 sample you may have to load a palette to the start of VDP2 color-RAM. |
slinga | Jan 25, 2004 | |||
Yeah I saw that too, why can't Sega make anything simple for us I could compile that sample, but I couldn't get it to run on Satourne. Could you get it to work? |
antime | Jan 25, 2004 | |||
The sample works, it has the same Akira model walking in a circle as the other sample, but it has a fake "environment mapping" surface applied. |
slinga | Jan 25, 2004 | |||||||
Hey guys, I almost got it. From what I understand you need to define this before your main:
Code:
Then in your main do this:
Code:
Where slCurColor(some number) selects which color combination you want to use. Unfortunately, slPrint displays only the first color combination, no matter what number you use for slCurColor. In the above configuration I was always getting orange text with a black background no matter what number I used for slCurColor and even if I ommited slCurColor completely. I'll keep working on this, just thought I'd update anybody else who was interested. |
slinga | Jan 26, 2004 | |||
Nope I'm stuck again. It seems that even in the demos (chrome and akira3), changing slCurColor to a different value does nothing. Doh! |
vreuzon | Jan 27, 2004 | ||||
Searching in dev central threads, I found a one year old Piratero code calling slCurColor this way :
Code:
No palette. Still don't know if that works. |
mrkotfw | Jan 27, 2004 | ||||
Code:
Wild guess, horrible code, but i hope it at least gives you an idea.... |
slinga | Jan 27, 2004 | |||
Do you meaning changing the first entry in the palette? That changes all text on the screen at the next slSynch, so it's pretty worthless to me. I'm trying to display multiple colors at once. |
1 | 2 | Next> |