From a3493d5e72252bd23be965c643ede376c8db083b Mon Sep 17 00:00:00 2001 From: uz Date: Mon, 20 Dec 2010 07:20:49 +0000 Subject: [PATCH] New versions that match the current TGI API by Karri Kaksonen. git-svn-id: svn://svn.cc65.org/cc65/trunk@4888 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- include/lynx.h | 5 --- libsrc/lynx/lynx-160-102-16.s | 67 +---------------------------------- 2 files changed, 1 insertion(+), 71 deletions(-) diff --git a/include/lynx.h b/include/lynx.h index 3708b41ba..985c33fe9 100644 --- a/include/lynx.h +++ b/include/lynx.h @@ -78,11 +78,6 @@ -void __fastcall__ lynx_change_framerate (unsigned char rate); -/* Change the framerate, in Hz. Recognized values are 50, 60 and 75. */ - - - /*****************************************************************************/ /* Accessing the EEPROM */ /*****************************************************************************/ diff --git a/libsrc/lynx/lynx-160-102-16.s b/libsrc/lynx/lynx-160-102-16.s index 83e0c10af..5b315ae1d 100644 --- a/libsrc/lynx/lynx-160-102-16.s +++ b/libsrc/lynx/lynx-160-102-16.s @@ -4,11 +4,6 @@ ; All the drawing functions are simply done by sprites as the sprite ; engine is the only way to do fast graphics on a Lynx. ; -; So the code is not really based on any algorithms done by somebody. -; I have looked at other routines in the cc65 libs to see what kind of -; entry points we need. And I have looked at the old cc65 libs by -; Bastian Schick to see how things worked in the past. -; ; This code is written by Karri Kaksonen, 2004 for the cc65 compiler. ; @@ -39,7 +34,7 @@ .byte 2 ; Number of screens available .byte 8 ; System font X size .byte 8 ; System font Y size - .res 4, $00 ; Reserved for future extensions + .word $0100 ; Aspect ratio ; Next comes the jump table. Currently all entries must be valid and may point ; to an RTS for test versions (function not implemented). A future version may @@ -64,7 +59,6 @@ .addr GETPIXEL .addr LINE .addr BAR - .addr CIRCLE .addr TEXTSTYLE .addr OUTTEXT .addr IRQ @@ -790,65 +784,6 @@ BAR: lda X1 ldx #>bar_sprite jmp draw_sprite -; ------------------------------------------------------------------------ -; CIRCLE: Draw a circle around the center X1/Y1 (= ptr1/ptr2) with the -; radius in tmp1 and the current drawing color. -; -; Must set an error code: NO -; -; There is no sensible way of drawing a circle on a Lynx. As I would -; have to use line elements to do the circle I rather do it in C than -; create it here in the driver. - -; To do a circle please add this to your C program - -;int sintbl[9] = { -; 0, // 0 degrees -; 3196, // 11.25 degrees -; 6270, // 22.5 degrees -; 9102, // 33.75 degrees -; 11585, // 45 degrees -; 13623, // 56.25 degrees -; 15137, // 67.5 degrees -; 16069, // 78.75 degrees -; 16384 // 90 degrees -;}; - -;int sin(char d) -;{ -; char neg; -; d = d & 31; -; neg = d > 16; -; d = d & 15; -; if (d > 8) -; d = 16 - d; -; if (neg) -; return -sintbl[d]; -; else -; return sintbl[d]; -;} - -;void tgi_Circle(int x0, int y0, unsigned char r) -;{ -; char i; -; int x1, y1, x2, y2; -; -; x1 = ((long)sin(0) * r + 8192) / 16384 + x0; -; y1 = ((long)sin(8) * r + 8192) / 16384 + y0; -; for (i = 1; i <= 32; i++) { -; x2 = ((long)sin(i) * r + 8192) / 16384 + x0; -; y2 = ((long)sin(i+8) * r + 8192) / 16384 + y0; -; tgi_line(x1, y1, x2, y2); -; x1 = x2; -; y1 = y2; -; } -;} - -;#define tgi_circle tgi_Circle - -CIRCLE: - rts - ; ------------------------------------------------------------------------ ; TEXTSTYLE: Set the style used when calling OUTTEXT. Text scaling in X and Y ; direction is passend in X/Y, the text direction is passed in A. -- 2.39.5