Skip to content

Commit 8568e1d

Browse files
committed
Fast text routine starting to work. Thanks jon!�
1 parent 4849244 commit 8568e1d

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

dist.atari/files/autorun.ar2

-2.26 KB
Binary file not shown.

src/atari/screen.c

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,25 @@
1616

1717
extern uint8_t pal[2];
1818
extern ConfigInfo config;
19-
2019
extern short FONT_SIZE_X;
2120
extern short FONT_SIZE_Y;
2221

22+
static short offset;
23+
24+
// referenced by fast_text routines.
25+
unsigned short cx;
26+
unsigned char cy;
27+
unsigned char CharCode;
28+
unsigned char Flags;
29+
unsigned char* GlyphData;
30+
31+
extern unsigned char font[];
32+
extern unsigned char fontm23[];
33+
extern uint16_t mul0625(uint16_t val);
34+
extern uint16_t mul0375(uint16_t val);
35+
36+
extern void RenderGlyph(void);
37+
2338
/**
2439
* screen_init_hook()
2540
* Called after tgi_init to set any special features, e.g. nmi trampolines.
@@ -125,4 +140,44 @@ void screen_beep(void)
125140
*/
126141
void screen_char_draw(padPt* Coord, unsigned char* ch, unsigned char count)
127142
{
143+
unsigned char i;
144+
Flags=0;
145+
146+
switch(CurMem)
147+
{
148+
case M0:
149+
GlyphData=font;
150+
offset=-32;
151+
break;
152+
case M1:
153+
GlyphData=font;
154+
offset=64;
155+
break;
156+
case M2:
157+
GlyphData=fontm23;
158+
offset=-32;
159+
break;
160+
case M3:
161+
GlyphData=fontm23;
162+
offset=32;
163+
break;
164+
}
165+
166+
if (CurMode==ModeInverse)
167+
Flags|=0x80;
168+
169+
if (ModeBold)
170+
Flags|=0x40;
171+
172+
cx=mul0625((Coord->x&0x1FF));
173+
cy=mul0375((Coord->y+14^0x1FF)&0x1FF);
174+
175+
176+
for (i=0;i<count;++i)
177+
{
178+
CharCode=ch[i]+offset;
179+
RenderGlyph();
180+
cx+=5;
181+
}
182+
128183
}

src/terminal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ void terminal_set_plato(void)
8888
{
8989
TTY=false;
9090
screen_clear();
91+
CharWide=8;
92+
CharHigh=16;
9193
}
9294

9395
/**

0 commit comments

Comments
 (0)