Faster point plotting courtesy Kent Dickey :)

This commit is contained in:
Bobbi Webber-Manners 2022-12-30 15:27:35 -05:00
parent 6a0c91c1e2
commit 6d48d2650c
4 changed files with 22 additions and 21 deletions

Binary file not shown.

View File

@ -218,6 +218,6 @@ BYTE00 BEQ BYTE00A ; OSBYTE 0,0 - generate error
RTS ; %000x1xxx host type, 'A'pple
BYTE00A BRK
DB $F7
HELLO ASC 'Applecorn MOS 2022-12-28'
HELLO ASC 'Applecorn MOS 2022-12-30'
DB $00 ; Unify MOS messages

View File

@ -558,6 +558,7 @@ SHRCLREOL JSR SHRCHARADDR
* VDU16 (CLG) clears the whole SHR screen right now
* TODO: Should clear to background colour
SHRCLEAR PHP ; Disable interrupts
SEI
CLC ; 816 native mode

View File

@ -248,7 +248,7 @@ SHRPLOT >>> ENTMAIN
AND SHRGFXMASK ; Mask to set colour
ORA A1L ; OR into existing byte
* TODO: Apple SHRGFXACTION GCOL action
* TODO: Apply SHRGFXACTION GCOL action
STA [A3L],Y ; Write to screen
>>> XF2AUX,GFXPLOTRET
@ -286,27 +286,25 @@ SHRCOORD PHP ; Disable interrupts
* Y-coordinate in SHRVDUQ+7,+8 1024*25/128=200
:Y LDA SHRVDUQ+7
ASL ; *2
ASL ; *4
ASL ; *8
ASL ; *16
STA A2L ; (A2L and A2H)
LDA SHRVDUQ+7
ASL ; *2
ASL ; *4
ASL ; *8
CLC
ADC A2L ; *16 + *8 -> *24
; CLC ; We know it is clear
ADC SHRVDUQ+7 ; *3
ASL ; *6
ASL ; *12
ASL ; *24
ADC SHRVDUQ+7 ; *25
LSR ; *25/2
LSR ; *25/4
LSR ; *25/8
LSR ; *25/16
LSR ; *25/32
LSR ; *25/64
LSR ; *25/128
STA A2L ; Into A2L/H
* Clever speedup trick thanks to Kent Dickey @ A2Infinitum
* now we have valid data in acc[15:7], and we want to shift right 7 bits to
* get acc[8:0] as the valid bits. If we left shift one bit and xba,
* we get acc[7:0] in the proper bits, so we just have to bring the bit we
* just shifted out back
* See: https://apple2infinitum.slack.com/archives/CA8AT5886/p1628877444215300
* for code on how to shift left 7 bits
ASL ;
AND #$FF00 ; Mask bits
XBA ; Clever trick: fewer shifts
STA A2L ; Into A2L/H
SEC ; Back to emulation mode
XCE
MX %11 ; Tell Merlin
@ -716,3 +714,5 @@ SHRROWSH DB >$9c60
DB >$2140
DB >$20a0
DB >$2000