Jump to content

Photo

ST High Res GFX


3 replies to this topic

#1 damosan OFFLINE  

damosan

    Space Invader

  • 22 posts

Posted Sat Feb 23, 2019 12:39 PM

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.



#2 Redreamer82 OFFLINE  

Redreamer82

    Combat Commando

  • 9 posts

Posted Thu Feb 28, 2019 5:41 AM

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

#3 damosan OFFLINE  

damosan

    Space Invader

  • Topic Starter
  • 22 posts

Posted Sat Mar 9, 2019 6:57 AM

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.



#4 ggn OFFLINE  

ggn

    Stargunner

  • 1,472 posts
  • Location:Athens, Greece

Posted Sat Mar 9, 2019 4:15 PM

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.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users