Jump to content
IGNORED

Broken tgi_outtext?


LX.NET

Recommended Posts

Hi everyone,

 

When working on my tutorial source code I noticed that the screen output of the roms on the Lynx emulator (probably also hardware) has changed to faulty behavior.

I have recompiled using the latest 2.13.9.20120912 snapshot, which gives this result:

post-27403-0-41365900-1347870383_thumb.jpg

whereas the previous snapshot I used (2.13.9.20110618) gives the following:

post-27403-0-38441700-1347870393_thumb.jpg

It seems related to the use of tgi_outtext, which doesn't advance the current position anymore.

I haven't looked into this yet, but was wondering whether other people experience the same thing.

Thanks.

Link to comment
Share on other sites

I can verify that there is a bug here. This code produces Hello and World on to of each other.

 

#include <lynx.h>
#include <tgi.h>
#include <unistd.h>
#include <6502.h>
extern char lynxtgi[];

void main(void) {
 tgi_install(&lynxtgi);
 tgi_init();
 CLI();
 while (tgi_busy())
   ;
 tgi_clear();
 tgi_setcolor(COLOR_GREEN);
 tgi_outtextxy(0, 0, "Hello ");
 tgi_outtext("World");
 tgi_updatedisplay();
 while (1)
   ;
}

 

Uz added graphics fonts to tgi and changed the way it works. Obviously it is now broken.

--

Karri

Link to comment
Share on other sites

Thanks for confirming this. I am sure it will get fixed. I can work around this for now and do not rely on the new things (changed loader etc).

 

Interesting though that you have been working on the fonts. I was wondering how you can create your own custom font and hook it up for use with TGI. Any hints, Karri?

Link to comment
Share on other sites

The font is built in to the lynx-160-102-12.tgi driver. The easiest way is not to link in this driver but replace it with your own driver.

 

Just copy cc65/libsrc/lynx/lynx-160-102-16.s and change the font to whatever you like. You can also change the width and height of the characters.

 

Then you just compile it and add some label to the jump table that is at the start of the driver.

 

A command like tgi_initialize(&yourowndriver) is all you need.

 

If your driver is really cool you can share it to cc65 and give it a new name like lynxfutura-160-102-16.s if it happens to use Futura typefont.

 

--

Karri

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...