Jump to content
Sign in to follow this  
bpj1138

A8 Graphics Library (CC65)

Recommended Posts

I posted this some time ago in the regular A8 forum. This is my graphics library in C/assembler. Here's the features thus far:

 

* ANTIC mode E init code (single or double buffer)

* front/back buffer flipping

* horizontal/vertical line draw

* symmetric bresenham's line draw

* rectangle fill

* polygon fill

* text draw

 

If anybody wants to add to any of this, you're welcome to it.

Fake_Rotation.zip

Edited by bpj1138
  • Like 3

Share this post


Link to post
Share on other sites

I posted this some time ago in the regular A8 forum. This is my graphics library in C/assembler. Here's the features thus far:

 

* ANTIC mode E init code (single or double buffer)

* front/back buffer flipping

* horizontal/vertical line draw

* symmetric bresenham's line draw

* rectangle fill

* polygon fill

* text draw

 

If anybody wants to add to any of this, you're welcome to it.

Sounds interesting, will try it out... Thank you!

Share this post


Link to post
Share on other sites

The latest cc65 snapshots have a full set of Atari TGI (Tiny Graphics Interface) drivers now. They support the newest TGI features like the ability to use converted old Borland CHR fonts. Maybe you should check that out too, it's fun to write graphics programs that are more or less portable between different 6502 machines :)

Share this post


Link to post
Share on other sites

The latest cc65 snapshots have a full set of Atari TGI (Tiny Graphics Interface) drivers now. They support the newest TGI features like the ability to use converted old Borland CHR fonts. Maybe you should check that out too, it's fun to write graphics programs that are more or less portable between different 6502 machines icon_smile.gif

Now that's exciting for me. I've long been looking for source code in order to use Borland fonts in my GUI project. I'm presently trying to decypher the CC65 libraries...

Share this post


Link to post
Share on other sites

Now that's exciting for me. I've long been looking for source code in order to use Borland fonts in my GUI project. I'm presently trying to decypher the CC65 libraries...

 

May be this can help. Inside the zip file there is Uz's tgi-preview.c program that demonstrates the latest features of the TGI.

 

There is also a readme.txt with compile instructions and a ready to go atr file with the necessary TGI drivers and TCH fonts. Just boot and load TGIPREV.XEX.

 

Good luck!

Share this post


Link to post
Share on other sites

May be this can help. Inside the zip file there is Uz's tgi-preview.c program that demonstrates the latest features of the TGI.

Thank you VERY much. Really impressive stuff. I'd like to do some work in CC65. Can you recommend a good Eclipse-like IDE that the CC65 compiler can be plumbed into?

Share this post


Link to post
Share on other sites

Can you recommend a good Eclipse-like IDE that the CC65 compiler can be plumbed into?

 

Sorry, I just use ConTEXT on Windows which isn't exactly an IDE. I use command line and makefiles when working with cc65. Maybe you should ask this at the cc65 mailing list. There are people with infinite knowledge on everything 8-bit :)

 

BTW, I was going to send you another TGI example, my own test program that demonstrated ALL the TGI features (except vector fonts that are already covered on the previous example), I used it when I wrote the Atari TGI drivers. But apparently some things have changed and it doesn't work anymore. I should be checking if it's a bug in the drivers and fix it if it is so but I don't have time right now :( I'll let you know if I find something.

 

@bpj1138:

Sorry, I didn't want to hijack your thread :) Maybe we should continue in a different thread or with PMs...

Share this post


Link to post
Share on other sites

Thank you VERY much. Really impressive stuff. I'd like to do some work in CC65. Can you recommend a good Eclipse-like IDE that the CC65 compiler can be plumbed into?

 

MS Visual Studio integrates very well with the CC65.

Set the path to the include directory and even the code completion should work (at least with Visual Assist ) :)

Share this post


Link to post
Share on other sites

Sorry, I just use ConTEXT on Windows which isn't exactly an IDE. I use command line and makefiles when working with cc65. Maybe you should ask this at the cc65 mailing list. There are people with infinite knowledge on everything 8-bit icon_smile.gif

 

BTW, I was going to send you another TGI example, my own test program that demonstrated ALL the TGI features (except vector fonts that are already covered on the previous example), I used it when I wrote the Atari TGI drivers. But apparently some things have changed and it doesn't work anymore. I should be checking if it's a bug in the drivers and fix it if it is so but I don't have time right now icon_sad.gif I'll let you know if I find something.

 

Thanks. I looked at ConTEXT the other day but I did indeed get the impression I was going to have to mess around with the command line to invoke the compiler. I've gotten used to the convenience of WUDSN.

 

The penny just dropped that you wrote the Atari TGI drivers. The demo is very impressive, and I'd be interested to see the other one. I'd really love to know what's going on behind the scenes with those vector fonts, but in reality I'm leaning towards bitmap rendering, at least for stuff like the word processor. That would require a set of bitmapped fonts in different point sizes: something I'm still trying to source (in a form I can easily convert for the Atari). There are plenty of CHR font converters out there, though, which still makes the vector fonts an enticing proposition. I'm looking forward to writing a CC65 library for whatever GUI API I end up designing: it should look pretty impressive.

 

MS Visual Studio integrates very well with the CC65.

Set the path to the include directory and even the code completion should work (at least with Visual Assist ) icon_smile.gif

That's what I just downloaded, and I'm going to have a go at setting it up with CC65 next week.

Share this post


Link to post
Share on other sites

cyco130:

 

Don't mind you using this thread one bit (or 8 bits even). I'm glad people are interested in this at all. If you want to use any of my code, you're welcome to, or not... My routines are optimized for mode E. This is mainly so that coordinates can be kept in one byte per component. I use a lot of zero page space too. For example, my rectangle filler uses 16 zp pointers, so it fills 16 scanlines per interation. My text draw uses the same scheme.. fills the entire character at once. I also keep a complete list of scanline addresses in higher memory. The polygon filler is pretty cool too.. it uses the line algorithm to fill scanline spans for the polygon. This works with any number of edges. This also takes up some higher mem.. like 192x2 bytes..

 

I gotta say programming the 6502 is a lot of fun. More fun than playing video games.

 

--Bart

Share this post


Link to post
Share on other sites

I gotta say programming the 6502 is a lot of fun. More fun than playing video games.

Hear, hear. I could never get into games much myself. Kids at school used to say "What - you've got an Atari and you don't play games on it?" I spent all my time programming.

 

I looked through your mode E routines the other day and they're extremely efficient. I'll certainly learn a lot from studying them further when it comes to building my library for mono hi-res mode.

Share this post


Link to post
Share on other sites

I remember reading "Assembly Language Programming for the Atari Computers" back in junior high school (I should have gotten an award for that, but nobody had any idea of what I was doing). I didn't have an assembler, so I would assemble my code on paper, then encode it into BASIC strings.. you know the drill.. Needless to say, I never got very far coding this way, but the experience taught me a lot and stayed with me. My only regret was that I never met people like me, and that kept me back all these years. Now I can't get people to help me if their life depended on it.

  • Like 2

Share this post


Link to post
Share on other sites

I remember reading "Assembly Language Programming for the Atari Computers" back in junior high school (I should have gotten an award for that, but nobody had any idea of what I was doing). I didn't have an assembler, so I would assemble my code on paper, then encode it into BASIC strings.. you know the drill.. Needless to say, I never got very far coding this way, but the experience taught me a lot and stayed with me. My only regret was that I never met people like me, and that kept me back all these years. Now I can't get people to help me if their life depended on it.

Well, it took me twenty years to finally "meet" people like me - here at AtariAge. I didn't get into Assembler until after sixth-form, and my solution to the no-assembler problem (or at least, one which suited my needs) was to write my own... in assembly language. It's called MA65 and is available on my website. :)

 

It's a real shame Windows apps aren't coded in 6502. I could make some money then!

  • Like 1

Share this post


Link to post
Share on other sites

@flashjazzcat:

 

tgitest.zip

 

It seems to be an optimizer problem. The program runs fine without optimizations. There are some non-officialy available drivers in the package (the ones named atrXp2.tgi), they support double buffering. This program and the previous one covers almost all of the TGI API. There isn't much functionality but the idea with the TGI is portability: The programs you write for atari will run in c64 and apple 2 for example. You can take a look at the sources, they are pretty generic so maybe you can find something for your own use.

 

BTW: Just hit a key before the circles go out of the screen, otherwise the program will lock up, because the clipping code in the TGI kernel is buggy.

 

I don't kow what's going on with the vector fonts either. They are implemented in the TGI kernel not the driver. But I know that there is a CHR -> TCH converter named chrcvt in the sources.

 

@bpj1138:

 

I took a quick look at your library. It's impressive I must say. I will try to convert it to a special TGI driver when I got more time, I think it would be fun :)

 

By the way, I did have Assembler Editor but it was on cassette (I didn't have a disk drive and the cartridges were hard to find in here). It loaded the old 800 ROMs before the assembler, and no turbo. Go figure how much time it would take :) So I used pen and paper too. I even remember typing my memory move routine as a string without even looking at the paper. Heh, those were the days :)

 

I did write my own crappy assembler in BASIC but the memory usage was too high and I never thought of separating the editor from the assembler proper. The idea was to use that assembler to write another one in assembly but it didn't work out... (Maybe I should try this again :)) Luckily we now have the insane cross assemblers (even compilers) that have every feature imaginable :)

Share this post


Link to post
Share on other sites

That's what I just downloaded, and I'm going to have a go at setting it up with CC65 next week.

 

I attach a little project for Visual Studio configured to compile for the Atari.

 

regards,

Jakub

Viper.zip

  • Like 1

Share this post


Link to post
Share on other sites

You should have seen the Donkey Kong thread a while back. Turns out a lot of the commerical games were cross assembled on mainframes.

 

This stuff I wrote was really a calling card for you guys. I'm trying to get some people together to work on PC games. C++/OpenGL. If anybody's interested, leave a message after the beep..

 

--Bart

Share this post


Link to post
Share on other sites

Thanks everyone for these great downloads. The C project worked well on my VS 2010 setup. It's amazing to be able to code for the A8 with a full-strength C compiler using the MS IDE. Just incredible. I can't wait to write a WIMP API for the A8 and interface it with CC65 functions. The source code for apps will look like an ST program full of GEM VDI calls! :)

 

 

 

Share this post


Link to post
Share on other sites

Thanks everyone for these great downloads. The C project worked well on my VS 2010 setup.

 

I wrote a little tool to merge CC65 and other assembler. Check out the attachment.

The build.bat compiles C code with CC65 and merges it with Raster Music Tracker MADS engine for music and sound effects.

All you have to do is to place MADS generated code low in the memory, and above that CC65 generated code (STARTADDRESS in cfg file).

Really simple :)

ViperSFX.zip

Edited by ilmenit

Share this post


Link to post
Share on other sites

everyone was late to the party, they forgot what time it was after the holiday... you know how that can be

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...