chart library in C

C and PASCAL (or any other high-level languages) in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

chart library in C

Postby peterlane » Thu May 12, 2016 8:15 pm

I wrote a simple chart library to use from C programs. (It *should* be portable across Atari platforms, but currently is only tested on the Firebee.)

A snapshot of the example program illustrating all the chart types:
Image

Three types of chart are supported:

1. Bar Charts: A set of positive values is converted into a series of vertical bars. The title, x/y labels, colours and fill patterns of bars may be altered.
2. Line Charts: A set of lines added to a line chart. The title, x/y labels, and colour, line style and point style may all be altered.
3. Pie Charts: A set of positive values is converted into slices of a pie chart. The title, slice labels, colours and fill patterns may be altered.

There's more information at http://peterlane.info/chart.html and a download zip. The zip file contains a Firebee-compiled EXAMPLE.PRG.

[Note: I tried compiling this with the -2 switch in AHCC, which should produce 68020 code. However, the executable does not work for me in Hatari. If anyone tries this under AHCC on a Falcon, I would be interested to know if it compiles and runs, and what instructions to put in the PRJ.]
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1547
Joined: Sun Jul 31, 2011 1:11 pm

Re: chart library in C

Postby Eero Tamminen » Thu May 12, 2016 10:35 pm

If you use floating point, you likely need -8 switch also, and if you use Hatari's WinUAE CPU core, that doesn't enable FPU by default for Falcon, only for TT.

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: chart library in C

Postby peterlane » Fri May 13, 2016 12:19 am

Eero Tamminen wrote:If you use floating point, you likely need -8 switch also, and if you use Hatari's WinUAE CPU core, that doesn't enable FPU by default for Falcon, only for TT.


Thanks for the tip, though I'm still unsuccessful. I tried including -8 switch as well. In Hatari I have selected 68030+FPU as the System. I still get the crash, the message is "Panic: Line F Emulation".
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

User avatar
shoggoth
Nature
Nature
Posts: 853
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: chart library in C

Postby shoggoth » Fri May 13, 2016 7:47 am

Beautiful! Nice one, thx :)
Ain't no space like PeP-space.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11976
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: chart library in C

Postby wongck » Fri May 13, 2016 11:33 am

looks very nice. thks
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 654
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: chart library in C

Postby Anima » Fri May 13, 2016 3:32 pm

Cool stuff. :cheers:

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1547
Joined: Sun Jul 31, 2011 1:11 pm

Re: chart library in C

Postby Eero Tamminen » Sun May 22, 2016 7:40 pm

peterlane wrote:
Eero Tamminen wrote:If you use floating point, you likely need -8 switch also, and if you use Hatari's WinUAE CPU core, that doesn't enable FPU by default for Falcon, only for TT.


Thanks for the tip, though I'm still unsuccessful. I tried including -8 switch as well. In Hatari I have selected 68030+FPU as the System. I still get the crash, the message is "Panic: Line F Emulation".


Looking at your PRJ file, the problem is that you use ColdFire versions of the libraries. With the attach PRJ file, it compiles fine (build deps can be listed in parenthesis).
You do not have the required permissions to view the files attached to this post.

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: chart library in C

Postby peterlane » Mon May 23, 2016 11:43 am

Eero Tamminen wrote:Looking at your PRJ file, the problem is that you use ColdFire versions of the libraries. With the attach PRJ file, it compiles fine (build deps can be listed in parenthesis).


Thank you, that's very useful. (I had thought the difference of ahccstdi.lib and ahccstf.lib was to do with int/float rather than the coldfire versions. I've been using those libraries with AHCC on my STe, where float is not supported.)
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1547
Joined: Sun Jul 31, 2011 1:11 pm

Re: chart library in C

Postby Eero Tamminen » Mon May 23, 2016 8:52 pm

AHCC builds contain *4* versions of the standard library:
- ahccstdf.lib (Firebee/ColdFire)
- ahccstd.lib (680x0 + FPU)
- ahccstdi.lib (68000 with floating point support missing from printf/scanf)
- ahccstfi.lib (Firebee/ColdFire without FPU, may be compatible with Falcon)

(Hopefully Henk notices this and corrects me if I got something wrong, these were not explained in the AHCC manual.)
Last edited by Eero Tamminen on Thu May 26, 2016 8:47 pm, edited 1 time in total.

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: chart library in C

Postby peterlane » Thu May 26, 2016 8:26 am

Eero Tamminen wrote:AHCC builds contain *4* versions of the standard library:
- ahccstdf.lib (Firebee/ColdFire)
- ahccstd.lib (680x0 + FPU)
- ahccstdi.lib (68000 with floating point support missing from printf/scanf)
- ahccstfi.lib (Firebee/ColdFile without FPU, may be compatible with Falcon)

(Hopefully Henk notices this and corrects me if I got something wrong, these were not explained in the AHCC manual.)


Thanks Eero for your two comments. They have improved my understanding of PRJ files and target platforms. I seem to be having a bit more success now getting things to work for Hatari.
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html

peterlane
Atari maniac
Atari maniac
Posts: 94
Joined: Tue Mar 05, 2013 2:44 pm
Contact:

Re: chart library in C

Postby peterlane » Thu May 26, 2016 11:14 am

I removed all references to float and now the library should be more portable. I've tested the example program on a Hatari-emulated ST and Falcon.
Here it is in high resolution.
You do not have the required permissions to view the files attached to this post.
Peter Lane
Firebee | STE (4Mb, TOS 2.06)
http://peterlane.info/firebee.html


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 3 guests