#13481 - RaBBi - Sun Dec 14, 2003 9:24 pm
Hi all ^^
Studying Golden Sun with VBA, I saw that text engine was based on bg tiles which are used as sprites.
I think it's "just" a question of copying the right tiles memory entries to the tiles sprite memory.
If anyone has another view of the method, I take it ^^
(For know all I didn't figured out is for the color indexes cause the both 16 colors palettes, one for initial tiles, and other for sprites are not similarly arranged)
But, additionally, the sprites letters have an "italic" aspect.
So I wanted to know if this effect is possible with tricks or just by register values? (I inspect the oam entries and they're not rotated for example).
Plus, letters have black shadow under but the sprites use black as transparent color.
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^
#13482 - sajiimori - Sun Dec 14, 2003 9:40 pm
Quote: |
I think it's "just" a question of copying the right tiles memory entries to the tiles sprite memory.
|
The letters are actually rendered directly into character RAM, which is how the font is not monospace.
Quote: |
But, additionally, the sprites letters have an "italic" aspect.
|
They were drawn that way.
Quote: |
Plus, letters have black shadow under but the sprites use black as transparent color.
|
Sprites do not use "black" as the transparent color. They use palette index 0. (This comes up so often that it should be in the FAQ.) Edit: Nevermind, I see what you mean. I don't know how that's done, actually. Edit: Wait, yes I do. There are two blacks in the palette: color 0 and color 1. Color 1 is the shadow.
#13483 - RaBBi - Sun Dec 14, 2003 10:01 pm
Ok so you think the sprites aren't generated from bg tiles?
That's could be such an easier way in that case.
Even for the palette indexes that's more understandable.
But why are letters loaded as bg tiles if they'ren't used... ^^
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^
#13484 - sajiimori - Sun Dec 14, 2003 10:20 pm
Remember, the same character RAM is used for both sprites and tiles.
#13485 - tepples - Sun Dec 14, 2003 10:25 pm
sajiimori wrote: |
Sprites do not use "black" as the transparent color. They use palette index 0. (This comes up so often that it should be in the FAQ.) |
It's answered now. I just finished adding subsections on transparency and priority to the Graphics section of the Beginners' FAQ.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#13486 - RaBBi - Sun Dec 14, 2003 11:15 pm
sajiimori wrote: |
Remember, the same character RAM is used for both sprites and tiles. |
I must say that I need some explanations about this...
For many days, I try to master the architecture of the GBA, reading cowbyte and GBAtek technical info, but even after that I don't about what RAM you're talk about :/
"character" means the same memory area of Character Base Bloc?
I don't mind, cause it ends before 0x6010000, adress of the sprite tile data.
So I think I'm too confused by term of "character RAM", since there's still a lot of things about GBA I must learn ^^
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^
#13487 - sajiimori - Sun Dec 14, 2003 11:30 pm
Sorry, I think I was just confusing myself :-P
Anyway, there seems to be a monospace font in the tile area, along with a few bits of static text like "Time" and "Isaac", apparently used for menus. The text used in conversations seems to be rendered straight into sprite RAM.
#13488 - RaBBi - Sun Dec 14, 2003 11:36 pm
character Ram doesn't exists? ^^
Yep, I agree with the way dialog text is rendered ^^
And for tiles used for static text.
That's OK :)
The next thing I'm searching for is how they can place letters near (or straight, I don't know what english term to use) each other with a initially monospace font.
Is there a simple way to overlap tiles?
I use Ham, and the function SetMapTile accept x and y as a tile coordonates, not pixels...
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^
#13489 - sgeos - Mon Dec 15, 2003 12:18 am
RaBBi wrote: |
character Ram doesn't exists? ^^ |
A character is a single 8 by 8 pixel block.
RaBBi wrote: |
The next thing I'm searching for is how they can place letters near (or straight, I don't know what english term to use) each other with a initially monospace font. |
I think you are looking for the english phrase "right next to".
"I'm searching for how they place letters right next to each other with an initially monospace font."
RaBBi wrote: |
Is there a simple way to overlap tiles? |
You can shift and OR things. If you start with two characters:
Code: |
0 ........ ........
1 .#...... ........
2 .#...... .#......
3 .#...... ........
4 .###.... .#......
5 .#..#... .#......
6 .#..#... .#......
7 ........ ........
|
You need to shove the second character onto the first one. If we want to combine line 5, we need to shift the data in the second character over before we OR the lines together:
Code: |
.#..#...
-> .#......
.#..#...
------> .#......
.#..#.#.
|
Note: Each dot represents a transparnet pixel, and each # a non-transparent pixel. The dots and # do not represent bits!
Each line needs to be combined to complete the character. Five pixels get pushed off the edge in the diagram above. One will want to shift (some of) those pixels onto the next character if overlapping multiple tiles.
-Brendan
#13490 - RaBBi - Mon Dec 15, 2003 12:43 am
Thanks a lot Brendan!
I don't know yet how exactly I'm going to do that but it's a great highlight ^^
In fact, as I use Ham, and the memory settings are managed (user don't know exactly at which adresses are loaded tiles and sprites), do you think I have to do this way? :
Code: |
(example for 2 letters)
- search the two letters in a tile source array,
- made 2 arrays from them,
- do SHIFT lines of the second,
- OR the 2 ones,
- finally load the result array to sprites
|
It could work for sprites that are directly rendered...but my letters tiles are already loaded.
So I need to manage bits in tiles memory, need I?...
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^
Last edited by RaBBi on Mon Dec 15, 2003 12:54 am; edited 1 time in total
#13491 - sajiimori - Mon Dec 15, 2003 12:44 am
Quote: |
The next thing I'm searching for is how they can place letters near (or straight, I don't know what english term to use) each other with a initially monospace font.
|
The conversation text in Golden Sun does not use the monospace font. It uses a variable-width font that is apparently not stored in VRAM, but is instead rendered into VRAM dynamically.
Use VBA to look at the sprite characters with "automatic update" turned on, then talk to an NPC.
#13492 - RaBBi - Mon Dec 15, 2003 12:50 am
sajiimori wrote: |
Quote: |
The next thing I'm searching for is how they can place letters near (or straight, I don't know what english term to use) each other with a initially monospace font.
|
The conversation text in Golden Sun does not use the monospace font. It uses a variable-width font that is apparently not stored in VRAM, but is instead rendered into VRAM dynamically.
Use VBA to look at the sprite characters with "automatic update" turned on, then talk to an NPC. |
Yeah ^^
I think you have a delay post ^^
This is for sprites letters only.
But if you look at fixed hero's name , or "Psy", you'll see that is on a BG, so bg tiles with monospaced font are used, but tiles are closed to each other.
That's what I discuss with Brendan ^^
Note: I said "load in sprite mem" but Brendan's trick can work for bg tiles too!
I'm a fool :P
_________________
Sorry for my poor english, but it would be worst for you to understand me if I speak in my native language, French ^^