Circle

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: https://technical.swissmicros.com/decoders/dm42/

You can then copy/paste the listing and post it in "code" tags.
Post Reply
User avatar
charger73@gmx.ch
Posts: 14
Joined: Mon Nov 06, 2017 8:41 am
Location: Trimbach

Circle

Post by charger73@gmx.ch »

Simple prog. draws a circle..

Z= X Pos (Pixel)
Y= Y Pos
X= Radius
XEQ "CIRCLE"

faster and shorter versions, welcome

regards
tobie

Code: Select all

00 { 71-Byte Prgm }
01▸LBL "CIRCLE"
02 STO "R"
03 R↓
04 STO "Y"
05 R↓
06 STO "X"
07 RAD
08 0.36
09 STO "L"
10▸LBL 00
11 RCL "L"
12 COS
13 RCL "R"
14 ×
15 RCL "X"
16 +
17 RCL "L"
18 SIN
19 RCL "R"
20 ×
21 RCL "Y"
22 +
23 PIXEL
24 ISG "L"
25 GTO 00
26 RCL "X"
27 RCL "Y"
28 RCL "R"
29 END
User avatar
Guenter
Posts: 168
Joined: Wed May 24, 2017 6:26 pm
Location: Germany

Re: Circle

Post by Guenter »

What's the reason for "07 RAD"? the program seems to work in each mode. You have to ensure the circle does not go outside the screen, otherwise .... well see yourself.
Günter
Günter
DM42 SN:00004 and SN:00184 -- DM41X SN:00013 and SN:00955
User avatar
charger73@gmx.ch
Posts: 14
Joined: Mon Nov 06, 2017 8:41 am
Location: Trimbach

Re: Circle

Post by charger73@gmx.ch »

Hi Günter
Thank you for your feedback. It is just a demo program. A start, perhaps a kick for others... :D
Where are other programs??? Demos, Apps, Games etc..

Have fun with the DM42!!

Best regards
Tobie
Vitasam

Re: Circle

Post by Vitasam »

charger73@gmx.ch wrote:
Tue Dec 19, 2017 8:37 am
Hi Günter
Thank you for your feedback. It is just a demo program. A start, perhaps a kick for others... :D
Where are other programs??? Demos, Apps, Games etc..

Have fun with the DM42!!

Best regards
Tobie
It will be nice to have similar sub-routines for drawing LINE, RECT etc.
Post Reply