Simple text mode on tms9928.

Other misc things
Post Reply
Jens
Member
Posts: 32
Joined: Sun Jul 07, 2024 11:02 am

Simple text mode on tms9928.

Post by Jens »

I was going through the Wiki, and I seem to be missing the info: I want to use the simple text mode (tms9928, mode 0, 40x25, 2 colour, svi/spectravideo). I'll only need gotoxy (or similar) and printf, so a fancy terminal emulation is overkill.
If I use conio it seems to emulate some kind of 80-column screen with a squashed custom font. Which pragma/header do I use if I want to use a hardware text mode with the built-in font instead? Is that not implemented for the SVI backend and I need to fill that in?
User avatar
dom
Well known member
Posts: 2280
Joined: Sun Jul 15, 2007 10:01 pm

Re: Simple text mode on tms9928.

Post by dom »

Simplest way: --generic-console as the arguments and then <video/tms99x8.h> and call vdp_set_mode(0)

And then remove the code for the other modes with:

; -pragma-define:CLIB_DISABLE_MODE1=1 (also disables mangled mode)
; -pragma-define:CLIB_DISABLE_MODE2=1
; -pragma-define:CLIB_DISABLE_MODE3=1
Jens
Member
Posts: 32
Joined: Sun Jul 07, 2024 11:02 am

Re: Simple text mode on tms9928.

Post by Jens »

While that seems to initialise the correct video mode it seems to install an 8x8 font. Is there a way to leave the current bios font untouched?
Jens
Member
Posts: 32
Joined: Sun Jul 07, 2024 11:02 am

Re: Simple text mode on tms9928.

Post by Jens »

I can't work out a simple way to do that so I cheated: I saved VRAM to a file from BlueMSX, trimmed it to just the font, then used:

Code: Select all

void font()
{
    #asm
    INCBIN "font.bin"
    #endasm
}

...
vdp_vwrite(font, 0x800 + 32*8, (256-32)*8);
...
User avatar
dom
Well known member
Posts: 2280
Joined: Sun Jul 15, 2007 10:01 pm

Re: Simple text mode on tms9928.

Post by dom »

Assuming that the ROM is paged in, then -pragma-export:CRT_FONT=nnnn will use the ROM version.
Post Reply