Pure C examples

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

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

Willsy
Atari User
Atari User
Posts: 30
Joined: Tue Oct 20, 2009 4:07 pm

Pure C examples

Postby Willsy » Sun Oct 31, 2010 10:43 am

Good morning

Well, I have my Pure C environment set up, and I have managed to convert the Pure C German help files to English with the help of a program I found here on Atari-Forum!

I've got my "hello world" program working, so I think the environment and .PRJ file is ok (though I may trim the linked libraries, as it seems to just include everything).

Wonkck mentioned an 'examples folder' that is presumably distributed with legitimate copies of Pure C. However, the version I found on the internet somewhere does not have an examples folder. Does anybody have this folder that they could make available? I would appreciate it very much.

In particular, I am interested in developing applications in GEM, so I am interested in learning how a C programmer interfaces with the GEM system. Also, I would be interested to know what C libraries are available to make interfacing with GEM easier. Perhaps Pure C has it's own abstraction layer/library, or perhaps there are C compatible libraries that others have developed that I can leverage to make interfacing with GEM easier. Any reading material suggestions very gratefully received!

I spent some time last night with Hisoft C. It is a very nice system. The GEM functions that come with HiSoft C look quite easy to use. I ran the event.c example which shows opening a GEM window, and trapping events. Worked perfectly. However, the thing that puts me off Hisoft C is that it is interpreted . Thus any application developed with Hisoft C will run at a fraction of the speed of a natively compiled application. Still, interpreted C does have tangible benefits during the debugging stage.

Regards

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

Re: Pure C examples

Postby wongck » Sun Oct 31, 2010 11:26 am

Huh? No demo source?
Where did you get the Pure C from ... ?
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12496
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Pure C examples

Postby wongck » Sun Oct 31, 2010 11:37 am

Just unZIp it into a folder.
Load the pcframe.prj and load any pcgemX C source into the editor.
Notice the PRJ file does not specify any source except for a * - this means whatever in your editor.
Do a ALT-M to make it. Alt-R to run it.

Have fun!
You do not have the required permissions to view the files attached to this post.
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12496
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Pure C examples

Postby wongck » Sun Oct 31, 2010 11:47 am

For understanding the basic GEM system... look no further than our very own Wiki Pages here
The Professional Gem :mrgreen:

Good to know these before using a Windows Library... and there are plenty :thumbs:
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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

Willsy
Atari User
Atari User
Posts: 30
Joined: Tue Oct 20, 2009 4:07 pm

Re: Pure C examples

Postby Willsy » Sun Oct 31, 2010 4:04 pm

Thanks very much for the zip file and the link! Going to try the demo now, then I will have a rad of the article.

Regards

Willsy
Atari User
Atari User
Posts: 30
Joined: Tue Oct 20, 2009 4:07 pm

Re: Pure C examples

Postby Willsy » Sun Oct 31, 2010 4:21 pm

Unfortunately the demo doesn't run. It does seem to compile, however when I run it I can just about see an error message on the screen:

Error device driver file not found - I tried the demo in both mono and colour (medium) modes.

Makes me wonder if there are some file(s) missing from this version of Pure C that I have.

Anyone know where I can download a 'good' version of this software, preferably the original floppy images.

Thanks

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2367
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Pure C examples

Postby lp » Sun Oct 31, 2010 5:03 pm

If you didn't already get it here, try this page:
http://rg.atari.org/source.htm

Willsy
Atari User
Atari User
Posts: 30
Joined: Tue Oct 20, 2009 4:07 pm

Re: Pure C examples

Postby Willsy » Sun Oct 31, 2010 7:44 pm

lp wrote:If you didn't already get it here, try this page:
http://rg.atari.org/source.htm


Hi lp,

Just tried it. It's incomplete (IMHO):

* No demo folder
* As soon as you launch PC.PRG you get an error message: Can't find C:\TEST.C ((implying it is a copy of someone's installation)
* The compiler/linker settings etc target a folder on D: drive (again, implying it is a copy of someone's installation)
* The assemblers' include option targets a sub-directory of Pure_C that doesn't exist.

I'm starting to think I'm wasting my time. Unless I can get (buy) a proper development environment then I'm not going to get anywhere!

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2367
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Pure C examples

Postby lp » Sun Oct 31, 2010 8:12 pm

Well it was worth a shot. I've noticed it seems to be easier to get games properly archived but not most dev tools. Had the same problem with devpac, until I finally snagged an original off ebay with the manual.

Even when "C" is installed correctly I find the whole compile/link 'make file' business overly complex. However, that's just me. :wink:

Best of luck finding a full copy.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5031
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Pure C examples

Postby simonsunnyboy » Mon Nov 01, 2010 9:33 am

Pure C as distributed by the RG works 100%. All you need is to configure the paths to your setup.

If you are looking for a free replacmeent, try AHCC by Henk Robbers. He will also reply to emails and improve on his package.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

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

Re: Pure C examples

Postby wongck » Mon Nov 01, 2010 11:18 am

Willsy wrote:Unfortunately the demo doesn't run. It does seem to compile, however when I run it I can just about see an error message on the screen:
Error device driver file not found - I tried the demo in both mono and colour (medium) modes.


never saw this error before :roll:
Which demo did you try?
The BGI demo may need a device driver, but the normal GEM demo sure don't.
I mean GEM is inside your TOS !!!
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12496
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Pure C examples

Postby wongck » Mon Nov 01, 2010 11:22 am

Willsy wrote:I'm starting to think I'm wasting my time. Unless I can get (buy) a proper development environment then I'm not going to get anywhere!


Well.... mine was not lifted off any website... I got mine like 15 years ago from the local Atari reseller here when they are still around then.
It came in 4-5 floppies... can't really remember but a whole bunch of them. I had installed them on my HDD since then.
The floppies are .... well I can't really find them in my cupboard otherwise I can pass them to you..... :roll:
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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
AtariSince1989
Atari Super Hero
Atari Super Hero
Posts: 778
Joined: Sun Jan 11, 2009 1:14 pm
Location: Edinburgh, Scotland
Contact:

Re: Pure C examples

Postby AtariSince1989 » Mon Nov 01, 2010 11:36 am

I use the Pure C downloaded from here.

Once in Pure C, you need to create a Project file (.PRJ). For testing, you can use the DEFAULT.PRJ that comes with the ZIP file. Open it from Pure C and delete the line that says E_GEM.LIB. Save it. Then just create a .C file with a simple Hello World, and do Make from the Project menu. Then Run from the same menu. You should see the Hello World in the top of the screen.

As simonsunnyboy mentioned. Be sure your paths are correct. It can be configured from the Option menu.

Hope it helps.
- Atari 520 STe 4MB RAM + TOS 2.06 + UltraSatan
- Atari Falcon030 14MB RAM + TOS 4.04 + IDE-SD card HDD + NVRAM mod + SCSI buffer clock mod + EtherNEC
- Amstrad CPC 6128 + HxC USB Floppy Emulator
- Acorn A3010 4MB RAM + 40MB IDE HDD

Atari ST Essential software (The List)
My FTP Server: http://www.datavase.info/FTPserver (only from Midnight to 8am UK Time)
My music at http://soundcloud.com/datavase/

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

Re: Pure C examples

Postby wongck » Mon Nov 01, 2010 12:00 pm

Willsy wrote:Unfortunately the demo doesn't run. It does seem to compile, however when I run it I can just about see an error message on the screen:
Error device driver file not found - I tried the demo in both mono and colour (medium) modes.


Yeap.... suspected you tried to use BGIDEMO... I saw that the Initialisation routines loads a driver and print out an error if none found.
Also I just tried that and it's the same error on my system.

That's not your standard run of the mill device driver on everyone's Atari system.
I recommend that you do NOT use that.... but if you must, then do this:

On your PURE C folder there is a VDI.BGI file. Just copy it into the BGIDEMO folder.
That's it... just run it.
Of course, there will be another error later.... the fonts are missing :mrgreen:
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12496
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Pure C examples

Postby wongck » Mon Nov 01, 2010 12:13 pm

I would recommend you try PCGEM4.C as it draws a window and some patterns in it.
You can move the window and resize it etc.
The code shows how it's easily done.

Just select your project to PCFRAME.PRJ and load PCGEM4.C into the editor.
Compile and run it.
You don't need any VDI.BGI for this to work :lol: .. you TOS contains all the standard GEM Windowing routines needed. :mrgreen:

For the other demos, you ought to read the code and understand what's it's doing.
(I know, it's in German so it's a bit difficult for me... may be ok for you. :wink: )
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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

Willsy
Atari User
Atari User
Posts: 30
Joined: Tue Oct 20, 2009 4:07 pm

Re: Pure C examples

Postby Willsy » Mon Nov 01, 2010 9:23 pm

Ha! It worked, thank you very much! :D

I can now start to study the code and see if I can learn how it works.

Can I post any questions here, or is there a more appropriate forum/web site?

Many thanks once again for your help. Much appreciated!

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

Re: Pure C examples

Postby wongck » Tue Nov 02, 2010 11:37 am

Willsy wrote:Can I post any questions here, or is there a more appropriate forum/web site?


This is the C section of the forum after all... :mrgreen:
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12496
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Pure C examples

Postby wongck » Tue Nov 02, 2010 11:42 am

lp wrote:Well it was worth a shot. I've noticed it seems to be easier to get games properly archived but not most dev tools. Had the same problem with devpac, until I finally snagged an original off ebay with the manual.
Even when "C" is installed correctly I find the whole compile/link 'make file' business overly complex. However, that's just me. :wink:
Best of luck finding a full copy.


No, it was actually not the distribution diskettes but an archive of someone's development environment. That's the problem.
Like my own development environment, it started as a exact copy of the diskette but over time became contaminated by other libraries & removal of some files (like the fonts folder that came with Pure C - I run into some errors with the demo because the lack of these fonts).
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12496
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Pure C examples

Postby wongck » Tue Nov 02, 2010 11:46 am

lp wrote:Even when "C" is installed correctly I find the whole compile/link 'make file' business overly complex. However, that's just me. :wink:


NO it's not you.... it is overly complex.... or rather those people who created it sure knows how to mess you up.
A single typo can generate 20-30 errors lines from the compiler all quite easily..... :lol: :lol:
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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

rabindranath72
Captain Atari
Captain Atari
Posts: 244
Joined: Tue Feb 15, 2011 3:59 pm

Re: Pure C examples

Postby rabindranath72 » Tue Feb 15, 2011 4:34 pm

AtariSince1989 wrote:I use the Pure C downloaded from here.

Once in Pure C, you need to create a Project file (.PRJ). For testing, you can use the DEFAULT.PRJ that comes with the ZIP file. Open it from Pure C and delete the line that says E_GEM.LIB. Save it. Then just create a .C file with a simple Hello World, and do Make from the Project menu. Then Run from the same menu. You should see the Hello World in the top of the screen.

As simonsunnyboy mentioned. Be sure your paths are correct. It can be configured from the Option menu.

Hope it helps.

Hi,
I tried that link, but it asks for a password. Any other download link?

Thanks,
Antonio

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

Re: Pure C examples

Postby wongck » Tue Feb 15, 2011 11:58 pm

rabindranath72 wrote:I tried that link, but it asks for a password. Any other download link?


His site is only on anonymous FTP mode after midnight UK time till dawn.
This is to stop you competing against himself while using the network :lol: :lol:

But I think he has moved his stuff to Google sites....
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12496
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Pure C examples

Postby wongck » Wed Feb 16, 2011 12:04 am

Ahh yes.... just click on the link on his signature will bring you there. :mrgreen:

https://sites.google.com/site/stessential/development
I see that Pure C is https://sites.google.com/site/stessenti ... edirects=0 which looks like also on Google.
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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

rabindranath72
Captain Atari
Captain Atari
Posts: 244
Joined: Tue Feb 15, 2011 3:59 pm

Re: Pure C examples

Postby rabindranath72 » Wed Feb 16, 2011 9:15 am

Thank you! But apparently, it's the same distribution I have seen before, which lacks the DEMO_PC and SOURCES folders I have seen in another distribution. Oh well!

Antonio

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

Re: Pure C examples

Postby wongck » Wed Feb 16, 2011 1:29 pm

I have them somewhere in my cupboard..... been trying to get at them since the start of OP. :roll:
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 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

rabindranath72
Captain Atari
Captain Atari
Posts: 244
Joined: Tue Feb 15, 2011 3:59 pm

Re: Pure C examples

Postby rabindranath72 » Wed Feb 16, 2011 2:05 pm

I found this version, which include also the demos:

http://markwills.co.uk/purec/


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 3 guests