LX.NET Posted September 17, 2012 Share Posted September 17, 2012 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: whereas the previous snapshot I used (2.13.9.20110618) gives the following: 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. Quote Link to comment Share on other sites More sharing options...
+karri Posted September 17, 2012 Share Posted September 17, 2012 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 Quote Link to comment Share on other sites More sharing options...
LX.NET Posted September 17, 2012 Author Share Posted September 17, 2012 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? Quote Link to comment Share on other sites More sharing options...
+karri Posted September 17, 2012 Share Posted September 17, 2012 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.