mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2024-09-24 11:56:47 +00:00
Compare commits
No commits in common. "24669a7ce0be043d4aaf51f8e5d63ee94af1166a" and "b32903a7e0c13e15759710e68c28797e139747d1" have entirely different histories.
24669a7ce0
...
b32903a7e0
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
74
auxmem.shr.s
74
auxmem.shr.s
@ -119,25 +119,70 @@ SHRPRCHAR LDX VDUPIXELS ; Pixels per byte
|
||||
* VS read cursor / VC write cursor
|
||||
* The read and write cursors have separate save-unders in :SAVEBYTES
|
||||
SHRCURSOR PHP ; Preserve flags
|
||||
PHA ; Preserve A
|
||||
PHA ; Preserve character
|
||||
LDA VDUSTATUS ; If VDU5 mode, bail
|
||||
AND #$20
|
||||
BNE SHRCURSBAIL
|
||||
BNE :BAIL
|
||||
LDA VDUPIXELS ; Pixels per byte
|
||||
CMP #$02 ; 2 is 320-mode (MODE 1)
|
||||
BNE :MODE0
|
||||
LDA #$04 ; 4 bytes in 320 mode
|
||||
LDX #$71 ; White/red
|
||||
BRA :S1
|
||||
:MODE0 LDA #$02 ; 2 bytes in 640 mode
|
||||
LDX #%11011101 ; White/red/white/red
|
||||
:S1 STA :BYTES ; Bytes per char
|
||||
STX :CURSBYTE
|
||||
LDA #$E1
|
||||
STA VDUBANK2
|
||||
JSR SHRCHARADDR ; Screen addr in VDUADDR
|
||||
>>> WRTMAIN
|
||||
LDA VDUADDR+0 ; Copy addr to SHRVDUQ
|
||||
STA SHRVDUQ+0
|
||||
LDA VDUADDR+1
|
||||
STA SHRVDUQ+1
|
||||
>>> WRTAUX
|
||||
PLA ; Recover A
|
||||
PLY ; Flags -> Y
|
||||
>>> XF2MAIN,SHRCURSM
|
||||
SHRCURSRET >>> ENTAUX
|
||||
LDA VDUADDR+0 ; LSB
|
||||
CLC
|
||||
ADC #<$460 ; $460 is seven rows
|
||||
STA VDUADDR+0
|
||||
LDA VDUADDR+1 ; MSB
|
||||
ADC #>$460 ; $460 is seven rows
|
||||
STA VDUADDR+1
|
||||
LDY #$00
|
||||
LDX #$00
|
||||
PLA ; Recover character
|
||||
PLP ; Recover flags
|
||||
BVC :S2 ; VC: Write cursor
|
||||
INX ; Advance to 2nd half of :SAVEBYTES
|
||||
INX
|
||||
INX
|
||||
INX
|
||||
:S2 BCC :CURSOROFF ; CC: Remove cursor
|
||||
:CURSORON
|
||||
LDA [VDUADDR],Y ; See if cursor shown
|
||||
CMP :CURSBYTE
|
||||
BEQ :DONE ; Cursor shown already, skip
|
||||
:L1 LDAL [VDUADDR],Y
|
||||
STA :SAVEBYTES,X ; Preserve bytes under cursor
|
||||
LDA :CURSBYTE ; Byte of cursor data
|
||||
STAL [VDUADDR],Y
|
||||
INX
|
||||
INY
|
||||
CPY :BYTES
|
||||
BNE :L1
|
||||
RTS
|
||||
SHRCURSBAIL PLA
|
||||
PLP
|
||||
:CURSOROFF
|
||||
LDA [VDUADDR],Y ; See if cursor shown
|
||||
CMP :CURSBYTE
|
||||
BNE :DONE ; Cursor not shown, skip
|
||||
:L2 LDA :SAVEBYTES,X ; Restore bytes under cursor
|
||||
STAL [VDUADDR],Y
|
||||
INX
|
||||
INY
|
||||
CPY :BYTES
|
||||
BNE :L2
|
||||
:DONE RTS
|
||||
:BAIL PLA ; Fix stack
|
||||
PLA
|
||||
RTS
|
||||
:BYTES DB $00 ; 2 for 640-mode, 4 for 320-mode
|
||||
:CURSBYTE DB $00 ; Cursor byte for mode
|
||||
:SAVEBYTES DS 8 ; Bytes under cursors
|
||||
|
||||
|
||||
* Write character to SHR screen in 320 pixel mode
|
||||
@ -644,7 +689,6 @@ SHRSETGCOL PHA
|
||||
>>> WRTAUX
|
||||
RTS
|
||||
|
||||
|
||||
* Wrapper to call SHRDEFPALM (which sets up default palette)
|
||||
SHRDEFPAL >>> XF2MAIN,SHRDEFPALM
|
||||
SHRDEFPALRET >>> ENTAUX
|
||||
|
106
mainmem.shr.s
106
mainmem.shr.s
@ -90,7 +90,6 @@ SHRXPLDFONT >>> ENTMAIN
|
||||
INC A
|
||||
CMP #128 ; 96 chars in FONT8
|
||||
BNE :L1
|
||||
JSR SHRCLR24 ; Clear row 24
|
||||
>>> XF2AUX,SHRV22RET
|
||||
RTS
|
||||
|
||||
@ -199,24 +198,6 @@ SHRXPLDROW LDX SHRPIXELS ; Pixels per byte
|
||||
:S4 RTS
|
||||
|
||||
|
||||
* Clear text row 24 (0-based index)
|
||||
SHRCLR24 CLC ; 65816 native mode
|
||||
XCE
|
||||
REP #$30 ; 16 bit M & X
|
||||
MX %00 ; Tell Merlin
|
||||
LDX #$00
|
||||
LDA #$00
|
||||
:L1 STAL $E19800,X
|
||||
INX
|
||||
INX
|
||||
CPX #$0500
|
||||
BNE :L1
|
||||
SEC ; 65816 emulation mode
|
||||
XCE
|
||||
MX %11 ; Tell Merlin
|
||||
RTS
|
||||
|
||||
|
||||
* Explode one pixel row of font in 320 mode
|
||||
* 4 bytes per char, 4 bits per pixel
|
||||
* On entry: A contains row of font data
|
||||
@ -275,76 +256,10 @@ SHRCHAR640 PHY ; Preserve Y
|
||||
RTS
|
||||
|
||||
|
||||
* Handle plotting & unplotting cursors
|
||||
* On entry: character in A, flags in Y
|
||||
* pointer to screen address in SHRVDUQ+0..1
|
||||
SHRCURSM >>> ENTMAIN
|
||||
PHY ; Preserve flags
|
||||
PHA ; Preserve character
|
||||
LDA SHRVDUQ+0 ; Copy pointer to A3L/H
|
||||
STA A3L
|
||||
LDA SHRVDUQ+1
|
||||
STA A3H
|
||||
LDA #$E1 ; Bank $E1
|
||||
STA A4L
|
||||
LDA SHRPIXELS ; Pixels per byte
|
||||
CMP #$02 ; 2 is 320-mode (MODE 1)
|
||||
BNE :MODE0
|
||||
LDA #$04 ; 4 bytes in 320 mode
|
||||
LDX #$71 ; White/red
|
||||
BRA :S1
|
||||
:MODE0 LDA #$02 ; 2 bytes in 640 mode
|
||||
LDX #%11011101 ; White/red/white/red
|
||||
:S1 STA :BYTES ; Bytes per char
|
||||
STX :CURSBYTE
|
||||
LDA A3L ; LSB
|
||||
CLC
|
||||
ADC #<$460 ; $460 is seven rows
|
||||
STA A3L
|
||||
LDA A3H ; MSB
|
||||
ADC #>$460 ; $460 is seven rows
|
||||
STA A3H
|
||||
LDY #$00
|
||||
LDX #$00
|
||||
PLA ; Recover character
|
||||
PLP ; Recover flags
|
||||
BVC :S2 ; VC: Write cursor
|
||||
INX ; Advance to 2nd half of :SAVEBYTES
|
||||
INX
|
||||
INX
|
||||
INX
|
||||
:S2 BCC :CURSOROFF ; CC: Remove cursor
|
||||
:CURSORON
|
||||
LDAL [A3L],Y ; See if cursor shown
|
||||
CMP :CURSBYTE
|
||||
BEQ :DONE ; Cursor shown already, skip
|
||||
:L1 LDAL [A3L],Y
|
||||
STA :SAVEBYTES,X ; Preserve bytes under cursor
|
||||
LDA :CURSBYTE ; Byte of cursor data
|
||||
STAL [A3L],Y
|
||||
INX
|
||||
INY
|
||||
CPY :BYTES
|
||||
BNE :L1
|
||||
>>> XF2AUX,SHRCURSRET
|
||||
:CURSOROFF
|
||||
LDAL [A3L],Y ; See if cursor shown
|
||||
CMP :CURSBYTE
|
||||
BNE :DONE ; Cursor not shown, skip
|
||||
:L2 LDA :SAVEBYTES,X ; Restore bytes under cursor
|
||||
STAL [A3L],Y
|
||||
INX
|
||||
INY
|
||||
CPY :BYTES
|
||||
BNE :L2
|
||||
:DONE >>> XF2AUX,SHRCURSRET
|
||||
:BYTES DB $00 ; 2 for 640-mode, 4 for 320-mode
|
||||
:CURSBYTE DB $00 ; Cursor byte for mode
|
||||
:SAVEBYTES DS 8 ; Bytes under cursors
|
||||
|
||||
|
||||
* VDU5 plot char at graphics cursor position
|
||||
SHRVDU5CH >>> ENTMAIN
|
||||
* PHP ; Disable interrupts
|
||||
* SEI
|
||||
CLC ; 65816 native mode
|
||||
XCE
|
||||
REP #$30 ; 16 bit M & X
|
||||
@ -470,6 +385,7 @@ SHRVDU5CH >>> ENTMAIN
|
||||
:DONE SEC ; 65816 emulation mode
|
||||
XCE
|
||||
MX %11 ; Tell Merlin
|
||||
* PLP
|
||||
>>> XF2AUX,SHRPRCH320RET
|
||||
* Zero page
|
||||
:COLCTR EQU TMPZP+0
|
||||
@ -769,6 +685,8 @@ SHRPLOT >>> ENTMAIN
|
||||
:S1 CMP #$40 ; Plot point
|
||||
BNE :BAIL ; Other? Bail out
|
||||
|
||||
* PHP ; Disable interrupts
|
||||
* SEI
|
||||
CLC ; 65816 native mode
|
||||
XCE
|
||||
SEP #$30 ; 8 bit M & X
|
||||
@ -777,6 +695,7 @@ SHRPLOT >>> ENTMAIN
|
||||
SEC ; 65816 emulation mode
|
||||
XCE
|
||||
MX %11 ; Tell Merlin
|
||||
* PLP ; Resume normal service
|
||||
|
||||
BRA :S2
|
||||
:S2 PLA ; Store prev pt in screen coords
|
||||
@ -987,6 +906,8 @@ SHRLINE LDA A2L ; y1
|
||||
INC A
|
||||
:S1 STA TMPZP+0 ; abs(y1 - y0)
|
||||
STZ TMPZP+1 ; Pad to 16 bit
|
||||
* PHP ; Disable interrupts
|
||||
* SEI
|
||||
CLC ; 65816 native mode
|
||||
XCE
|
||||
REP #$30 ; 16 bit M & X
|
||||
@ -1098,6 +1019,7 @@ SHRLINELO MX %00 ; Tell merlin 16 bit M & X
|
||||
SEC ; 65816 emulation mode
|
||||
XCE
|
||||
MX %11 ; Tell Merlin
|
||||
* PLP ; Resume normal service
|
||||
RTS
|
||||
* Zero page
|
||||
:DX EQU TMPZP+0 ; dx initially, then (2 * (dy - dx))
|
||||
@ -1189,6 +1111,8 @@ SHRLINEHI MX %00 ; Tell Merlin 16 bit M & X
|
||||
* from 1280x1024 to 640x200 or 320x200
|
||||
* On return: X-coordinate in A1L/H, Y-coordinate in A2L (A2H=0)
|
||||
SHRCOORD MAC
|
||||
* PHP ; Disable interrupts
|
||||
* SEI
|
||||
CLC ; 65816 native mode
|
||||
XCE
|
||||
REP #$30 ; 16 bit M & X
|
||||
@ -1236,6 +1160,7 @@ SHRCOORDM0 LDA SHRVDUQ+5
|
||||
SEC ; Back to emulation mode
|
||||
XCE
|
||||
MX %11 ; Tell Merlin
|
||||
* PLP ; Normal service resumed
|
||||
BRA SHRCOORDEND
|
||||
|
||||
SHRCOORDNEG MX %00 ; Tell Merlin we are 16 bit
|
||||
@ -1310,6 +1235,8 @@ SHRCOORD2M0 LDA SHRVDUQ,X
|
||||
|
||||
* Clear the graphics window
|
||||
SHRVDU16 >>> ENTMAIN
|
||||
* PHP ; Disable interrupts
|
||||
* SEI
|
||||
CLC ; 816 native mode
|
||||
XCE
|
||||
REP #$30 ; 16 bit M & X
|
||||
@ -1406,6 +1333,7 @@ SHRVDU16 >>> ENTMAIN
|
||||
SEC ; Back to 6502 emu mode
|
||||
XCE
|
||||
MX %11 ; Tell Merlin
|
||||
* PLP ; Normal service resumed
|
||||
>>> XF2AUX,SHRCLRRET
|
||||
:LEFT320 DB %11111111
|
||||
DB %00001111
|
||||
@ -1458,6 +1386,8 @@ SHRVDU16V PHA
|
||||
* Validate graphics window parms & store if okay
|
||||
* First 8 bytes of SHRVDUQ: left, bottom, right, top
|
||||
SHRVDU24 >>> ENTMAIN
|
||||
* PHP ; Disable interrupts
|
||||
* SEI
|
||||
CLC ; 65816 native mode
|
||||
XCE
|
||||
REP #$30 ; 16 bit M & X
|
||||
@ -1488,9 +1418,11 @@ SHRVDU24 >>> ENTMAIN
|
||||
|
||||
SEC ; 65816 emulation mode
|
||||
XCE
|
||||
* PLP
|
||||
>>> XF2AUX,VDU24RET
|
||||
:BAD SEC ; 65816 emulation mode
|
||||
XCE
|
||||
* PLP
|
||||
>>> XF2AUX,VDUXXRET
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user