dos33fsprogs/graphics/gr/plasmagoria
2023-09-12 01:21:37 -04:00
..
ca65 plasmag: still trying to find a good plasma 2023-08-31 00:18:30 -04:00
sines plasmag: more sine reversing 2023-09-03 23:32:26 -04:00
gr_gbascalc.s plasmag: more size opt 2023-09-05 00:40:33 -04:00
hardware.inc plasmag: optimize size down some more 2023-09-04 22:47:04 -04:00
hello.bas plasmag: try some hgr 2023-09-09 13:38:23 -04:00
LICENSE plasmag: still trying to find a good plasma 2023-08-31 00:18:30 -04:00
make_tables.s plasmag: more optimization 2023-09-08 00:29:22 -04:00
Makefile plasmag: try some hgr 2023-09-09 13:38:23 -04:00
plasmag_full.s plasma: split off so can work on minimal version 2023-08-31 00:59:07 -04:00
plasmag_hgr_full.s plsmag_hgr: draw every other scanline 2023-09-10 00:13:30 -04:00
plasmag_hgr.s plasmag: cycle counting 2023-09-12 01:21:37 -04:00
plasmag_outline.s star_horiz: quick attempt at some BASIC 2023-09-09 13:37:38 -04:00
plasmag_tiny.s plasmag: more optimization 2023-09-08 00:29:22 -04:00
plasmag.s plasmag: more size opt 2023-09-05 00:40:33 -04:00
README plasmag: cycle counting 2023-09-12 01:21:37 -04:00

Apple II display is 65 cycles per row
	65*192=12480(screen)+ 4550 more for vblank = 17030 cycles

	17030/1023000 = 60fps

Theory maximum screen update
	completely unrolled 192*40*4 cycles = 30720  cycles

	30720 / 1023000 = 33 fps





17030 cycles

   ;       Total of 12480 cycles to draw screen
        ; Vertical blank = 4550 cycles (70 scan lines)
        ; Total of 17030 cycles to get back to where was

to fill the hi-res screen with a single color you need to update 7680 
bytes.  If you completely unroll the loop this takes 30720 cycles, or 
roughly 33fps.

This plasma algorithm if drawing the whole screen (192 lines) manages 
only 3fps.  The video here I am skipping half the lines which gives 
5.5fps.  I have a version drawing every 4th line which still looks OK 
that can do 9fps.

The code is already heavily optimized with lots of self modifying code 
and table lookups.  I'm losing some cycles to doing page flipping, and 
part of the problem is the Apple II's bizzarre framebuffer layout.  I 
also waste cycles because I'm doing table lookups to get the dithered 
patterns, and again due to Apple II oddness (3.5 colored pixels per 
byte) I need separate lookups for odd/even columns