Jump to content
IGNORED

Plot & Drawto in assembly


peteym5

Recommended Posts

I have requested to work on a game that is going to require alot of line drawing. I have tested some stuff with calling the CIO to draw lines, but does not seem to be going much faster than Basic. I am aware Basic just called an OS routine for the plot and drawto statements. I would be looking for a faster routine or ways to speed things along. I believe someone did make some faster routines, but been having trouble tracking it down.

Link to comment
Share on other sites

The OS screen routines are slow because of the CIO overhead, and that they're not optimised and are also generalised and table driven so that they work in all of the supported graphics modes.

 

Also, I believe the line draw routine calls the put character routine for each pixel, which is slower than just having a routine with the plot point embedded inline with the code.

 

A much quicker way is of course having your own routine which is optimised to whatever graphics mode you're dealing with, and having the plot point routine inline.

 

I think I might have a couple of things on disk images which can help. The OS manual actually has the algorithm for the draw line routine, and I believe it is the fastest method - it's just that all the overhead and generallity of the Atari supplied stuff makes it slow.

 

I'll have a look, and see if I can upload something a little later.

Link to comment
Share on other sites

128_colour_painter_B.zip

 

There's some stuff - LOAD it with MAC/65.

 

Sorry it's pretty poorly documented, but there is source code in there for PLOT and DRAW. I wrote it over 20 years ago, so it's not so fresh in my mind.

There is also a fill routine which I adapted from one in an Analog magazine, although it uses the diamond method which is kind of slow.

 

It likely won't work with GR. 8 since it needs 2 bytes to represent the X position (another reason for the OS routine being slow).

 

You could modify it to your needs. I can't remember whether I made it work with tables or not.

 

Having tables with the address of each screen row can speed things up a lot - although it then costs you about another 400 bytes.

Link to comment
Share on other sites

Thankyou very much. I primarily need it for a graphics 15 screen so one byte for screen position would keep it working. I intend to use it for a ML executable and probably use alot of zero page variables. I use MAC/65 as my primary assembly editor because it has good syntax checking and best geared to work on the Atari.

Edited by peteym5
Link to comment
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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...