Jump to content
damosan

ST High Res GFX

Recommended Posts

I've been searching for a short tutorial on doing high res graphics via 68k assembly. I've found a few good writeups on low/medium res and I've tried to tweak them to work in high res but things keep exploding. I've written a few linea hacks but the performance is, well, pretty bad for basic line drawing.

 

Anyone have any links to this topic? Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

I guess you know about the line a commands? There you have a command that does exactly this. I dont think hires is any problem.

 

Skickat från min ANE-LX1 via Tapatalk

Share this post


Link to post
Share on other sites

I guess you know about the line a commands? There you have a command that does exactly this. I dont think hires is any problem.

 

Skickat från min ANE-LX1 via Tapatalk

 

Yeah I looked into those - they're pretty slow, at least for pixel / line drawing.

 

I played around further and managed to figure out how to plot points directly and got about a x5 performance boost (each pixel was two pointer lookups and an eor). Someone knowing what they're doing could probably get it going faster but I was pretty happy. From there I went on to implement Horizontal and Vertical line routines which calculated the first pointer and then simply incremented by $80 for each row, etc. That was pretty quick. Color will be next once I get a flatscreen capable of 15khz.

 

It was a fun experiment - now I'm looking at playing with the trace flag to implement a form of threading though I suspect that'll be somewhat slow. Who knows. I've run into a few example co-op multi-tasking examples that I may start with -- implementing a lightweight scheduler and removing the co-op aspects. Who knows.

 

At the end of the day 68k assembly is a fun way to program on the ST.

 

D.

Share this post


Link to post
Share on other sites

It was a fun experiment - now I'm looking at playing with the trace flag to implement a form of threading though I suspect that'll be somewhat slow. Who knows. I've run into a few example co-op multi-tasking examples that I may start with -- implementing a lightweight scheduler and removing the co-op aspects. Who knows.

Threading using the trace flag sounds a bit odd but I'd be interested to see the results! In any case let me suggest a couple of ideas:

 

a) You can use interrupts to simulate threading. There are quite a few of them on the 68000 but the useful ones for your case are the ones that are tied to timers, of which the ST has 4 (A, B, C, D). By programming the clocks you can do timeslicing easily. A fifth timer you can use is the Vertical Blank interrupt which occurs 50 or 60 times per second (depending on your monitor refresh rate). During those interrupts you can save the CPU state, run your code and then restore it back. Then the other "threads" won't even know anything happened (unless you might want to for some reason)

b) If you require more than the 4 (or 5) timed interrupts then you could program a timer to run an interrupt that "simply" switches to the next thread's cpu state and then exit. That way you can have an arbitrary amount of threads that again will run in a time sliced manner.

 

Hope this gives you some food for thought!

 

 

P.S. Before anyone mentions it - yes there are some other timed interrupts one can employ such as the HBL interrupt but I didn't want to bog the answer down with a complete reply.

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.

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...