/[projet1]/public/oric/routines/rasterization/CircleBench/Main.c
Defence Force logotype

Contents of /public/oric/routines/rasterization/CircleBench/Main.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 225 - (show annotations)
Tue Feb 2 20:25:29 2010 UTC (9 years, 7 months ago) by Chema
File MIME type: text/plain
File size: 2095 byte(s)
Circle routine. Performs clipping and handles 16-bit coordinates for center and radius.
1
2 #include <lib.h>
3
4 // --------------------------------------
5 // CircleBench
6 // --------------------------------------
7 // (c) 2003-2008 Mickael Pointier.
8 // This code is provided as-is.
9 // I do not assume any responsability
10 // concerning the fact this is a bug-free
11 // software !!!
12 // Except that, you can use this example
13 // without any limitation !
14 // If you manage to do something with that
15 // please, contact me :)
16 // --------------------------------------
17 // --------------------------------------
18 // For more information, please contact me
19 // on internet:
20 // e-mail: enguita@gmail.com
21 // URL: http://www.defence-force.org
22 // --------------------------------------
23 // Note: This text was typed with a Win32
24 // editor. So perhaps the text will not be
25 // displayed correctly with other OS.
26
27
28 // ============================================================================
29 //
30 // Externals
31 //
32 // ============================================================================
33
34 #include "params.h"
35
36 //
37 // ===== circle.s =====
38 //
39 extern unsigned int CentreX; // Coordinate X of the circle centre
40 extern unsigned int CentreY; // Coordinate Y of the circle centre
41 extern unsigned int Radius; // Circle radius
42
43 void circleMidpoint();
44
45
46
47 void circle_Chema()
48 {
49 CentreX=10;
50 CentreY=160;
51 for (Radius=1;Radius<200;Radius++)
52 {
53 circleMidpoint();
54 }
55 }
56
57
58 void circle_basic()
59 {
60 unsigned int i;
61 curset(120,100,0);
62 for (i=1;i<99;i++)
63 circle(i,1);
64 }
65
66
67 void test()
68 {
69 unsigned int delay;
70
71 while (1)
72 {
73 // Chema routine first
74 printf("\nChema test: ");
75 *(unsigned int*)0x276=0;
76 circle_Chema();
77 delay=65536-(*(unsigned int*)0x276);
78 printf(" duration (in 100th of second): %d",delay);
79
80 // Basic routine second
81 /*
82 printf("\nBasic: ");
83 *(unsigned int*)0x276=0;
84 circle_basic();
85 delay=65536-(*(unsigned int*)0x276);
86 printf(" duration (in 100th of second): %d",delay);
87 */
88
89 }
90 }
91
92 int x,y;
93
94 void main()
95 {
96
97 GenerateTables();
98 hires();
99 paper(4);
100 test();
101 }
102
103

  ViewVC Help
Powered by ViewVC 1.1.26