How to draw a circle (the hard way)
- Hello all,
I posted this in the AtariAge forum and I wanted to share it here too. It is an adaptation of Bresenham's Algorithm to drawing circles, translated to CP-1610 Assembly Language to draw a circle on the BACKTAB.
I implemented it to draw sequentially concentric circles and create a "fade-in" transition for Christmas Carol, which resulted in a rather effective effect. I'm posting it freely here for anybody to use if they find value in it.
There are two routines, DRAW_CIRCLE() and GET_BTAB_ADDRS(). The second one converts column and row coordinates into a pointer to the corresponding BACKTAB cell (and was provided by Arnauld in the past). It also checks for boundaries and returns an error in the Carry flag if the coordinates are out of bounds. This is useful to "clip" circles larger than the screen or positioned off center.
I plan to include the fade-in effect transition in the next P-machinery version, as part of a set of general use, stock screen transitions. I can also post it here if anybody is interested.
I know this code will not win any awards for efficiency and style, but it does work. Suggestions to improve it are welcomed!
I've attached a copy of the source in the file "draw_circle.asm."
- Does anyone have jzIntv working with 4 joysticks? I can get it to
recognize the 2 master controllers but not the 2 ECS controllers.
If you do have it working, would you please share your hackfile?