epiplon wrote:Hello.
I just got here a few days ago and the SGDK impressed me, because I thought that would take me weeks to set up and get the Megadrive to print just a color on the screen. Now, I achieved it with just some hours!
So, by looking at the tutorials and source codes, I thought if would be possible to:
1. change the colors of the PALs, and then making each letter with const u32 tile[8] = {...}
2. Actually change the color on the VDP_drawText function, somehow.
Is it possible just by using the devkit, without messing with ASM codes?
Really thanks!
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Hello Epiplon
Glad you get SGDK setup that quickly ! The next version of SGDK will provide a better font system so you can upload easily your own font from a bitmap file as well (the system font will also appears in .bmp format).
You can replace the system font by using the following method :
Code: Select all
/**
* \brief
* Load font tile data in VRAM.
*
* \param font
* Pointer to font tile data.
* \param use_dma
* Use DMA transfert (faster but can lock Z80 execution).
*
* This fonction permits to replace system font by user font.<br/>
* Font tile data are loaded to TILE_FONTINDEX and the font should contains FONT_LEN characters.
* See also VDP_loadTileData().
*/
void VDP_loadFont(const u32 *font, u8 use_dma);
Your font should be FONT_LEN character ideally but can be less.
You have to respect the default charset used in SGDK (based on default US charset starting a 32 ascii code)
So you define your font this way :
Code: Select all
const u32 font[8 * FONT_LEN] = {...};
VDP_loadFont(font, TRUE);
and you can change the font palette used to draw text with this method:
Hope that helps !