[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DGR...
On Wednesday, November 14, 2012 6:34:50 PM UTC-6, gid...@sasktel.net wrote:
> > Do they? Do you have to flip 80STORE for odd/even columns? I remember using ampersand routines for double-lores graphics in the 90's. I might still have them somewhere.
>
> >
>
> > I can help with the asm if you can send me specs (though don't expect a fast turnaround -- I have a lot of fires going).
>
>
>
>
>
> Yes. But the math still had to be done before jumping to the plot routine. Something as simple as this was done.
>
>
>
> PLOT EQU $F800
>
>
>
> LDA #LORES COLOR*17
>
> STA $30
>
>
>
> LDX #VERTICAL LINE (0-47)
>
> LDA #(PIXEL 1-79)
>
> LSR
>
> PHA
>
> LSR
>
> PLA
>
> TAY
>
> TXA
>
> BCS PLOT
>
> STA $C055
>
> PLOT EQU *
>
> JSR PLOT
>
> STA $C054
>
> ...
The only thing of note is that you've defined plot in two places as a label so you'd want to use a different label for a local label vs. a firmware routine. Otherwise I see what you'd doing to use the carry bit to detect odd/even (but does your method work? Why is the stack used and why shift twice? It's less expensive to use a scratch zero-page location than to use the stack) Anyway, one thing which comes to mind is that if you draw the full screen it may be more efficient to make one pass for odd columns and another pass for even, that way you have less conditional branching and 80store accesses. It would double your code size (well... macro code can make it manageable at least) but it would yield a big performance gain.
I found the rom firmware routines to be useful for general purpose but they're mostly optimized for size and are somewhat a tradeoff of speed/efficiency compared to a bulkier routine using a lookup table to translate the y-coordinate to a memory offset. So if you're trying to do a really fast drawing routine (say, a full-screen plasma effect) you'll have to roll your own or look @ other sources for examples to get the most speed.