Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
joska wrote:My experience with the gcc debugger on TOS is very limited
Things have hopefully improved since then.
ThorstenOtto wrote:If you mean gdb: that does not even work on plain TOS, it requires MiNT.
joska wrote:Pure Debugger is my favourite debugger on TOS/MiNT. It works well with MiNT too,
Code: Select all
void screen_char_draw(padPt* Coord, unsigned char* ch, unsigned char count, bool queue)
Code: Select all
/**
* screen_char_draw(Coord, ch, count) - Output buffer from ch* of length count as PLATO characters
*/
void screen_char_draw(padPt* Coord, unsigned char* ch, unsigned char count, bool queue)
{
unsigned char* queued_ch;
short color_index[2]={1,0};
unsigned char* curfont;
char offset;
short x,y;
unsigned char i;
MFDB screen_mfdb = {0};
MFDB char_mfdb;
unsigned char current_char;
unsigned char* current_char_ptr;
short pxyarray[8];
if (queue==true)
{
queued_ch=screen_strndup(ch,count);
screen_queue_append(screen_queue,SCREEN_QUEUE_CHAR,Coord->x,Coord->y,0,0,queued_ch,count);
}
switch(CurMem)
{
case M0:
curfont=font;
offset=-32;
break;
case M1:
curfont=font;
offset=64;
break;
case M2:
curfont=fontm23;
offset=-32;
break;
case M3:
curfont=fontm23;
offset=32;
break;
}
// Flip color settings for inverse.
if (CurMode==ModeInverse)
{
color_index[0]=0;
color_index[1]=1;
}
x=scalex[(Coord->x&0x1FF)];
y=scaley[(Coord->y)+14&0x1FF];
for (i=0;i<count;++i)
{
current_char=*ch;
++ch;
current_char+=offset;
current_char_ptr=&curfont[fontptr[current_char]];
char_mfdb.fd_addr=current_char_ptr;
char_mfdb.fd_w=0;
char_mfdb.fd_h=0;
char_mfdb.fd_wdwidth=1;
char_mfdb.fd_stand=0;
char_mfdb.fd_nplanes=1;
char_mfdb.fd_r1=char_mfdb.fd_r2=char_mfdb.fd_r3=0;
pxyarray[0]=0;
pxyarray[1]=0;
pxyarray[2]=7;
pxyarray[3]=11;
pxyarray[4]=x;
pxyarray[5]=y;
pxyarray[6]=x+7;
pxyarray[7]=x+11;
x+=FONT_SIZE_X;
vrt_cpyfm(app.aeshdl,1,pxyarray,&char_mfdb,&screen_mfdb,color_index);
}
return;
}
Code: Select all
/**
* Font definitions for font memories M0 and M1
*/
#include <stdint.h>
uint8_t FONT_SIZE_X=8;
uint8_t FONT_SIZE_Y=12;
uint8_t font[]={
0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00, /* SPACE 0x20 */
0x00,0x00,0x10,0x10,0x10,0x10,
0x10,0x00,0x10,0x00,0x00,0x00, /* ! 0x21 */
0x00,0x00,0x00,0x28,0x28,0x00,
0x00,0x00,0x00,0x00,0x00,0x00, /* " 0x22 */
0x00,0x28,0x7C,0x28,0x7C,0x28,
0x00,0x00,0x00,0x00,0x00,0x00, /* # 0x23 */
0x00,0x00,0x10,0x7C,0x90,0x7C,
0x20,0x7C,0x10,0x00,0x00,0x00, /* $ 0x24 */
0x00,0x00,0x42,0xA4,0x48,0x10,
0x24,0x4A,0x84,0x00,0x00,0x00, /* % 0x25 */
0x00,0x00,0x20,0x50,0x20,0x62,
0x92,0x8C,0x72,0x00,0x00,0x00, /* & 0x26 */
0x00,0x00,0x10,0x10,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00, /* ' 0x27 */
...
Users browsing this forum: No registered users and 2 guests