Beginnings of SHR support (just mode selection for now)

This commit is contained in:
Bobbi Webber-Manners 2022-12-22 13:44:40 -05:00
parent 336654560b
commit 79278f124d
6 changed files with 24 additions and 10 deletions

Binary file not shown.

View File

@ -95,6 +95,7 @@ RD80VID EQU $C01F
TBCOLOR EQU $C022 ; GS-specific, used but commented out TBCOLOR EQU $C022 ; GS-specific, used but commented out
KEYMOD EQU $C025 ; GS-specific KEYMOD EQU $C025 ; GS-specific
NEWVIDEO EQU $C029 ; GS-specific, new video register
SPKR EQU $C030 SPKR EQU $C030
CLOCKCTL EQU $C034 ; GS-specific, Clock control register CLOCKCTL EQU $C034 ; GS-specific, Clock control register

View File

@ -19,6 +19,8 @@ HGRVDU22 JSR VDU12 ; Clear text and HGR screen
STA GRON ; Enable Graphics STA GRON ; Enable Graphics
STA PAGE1 ; PAGE1 STA PAGE1 ; PAGE1
STA CLR80VID ; Select 40col text STA CLR80VID ; Select 40col text
LDA #$80 ; Most significant bit
TRB NEWVIDEO ; Turn off SHR
RTS RTS

View File

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

View File

@ -2,7 +2,12 @@
* (c) Bobbi 2022 GPLv3 * (c) Bobbi 2022 GPLv3
* *
* Routines for drawing bitmapped text and graphics in SHR mode * Routines for drawing bitmapped text and graphics in SHR mode
* on Apple IIGS (640x200 4 colour, or 320x200 16 colour. * on Apple IIGS (640x200 4 colour, or 320x200 16 colour.)
* *
* Enable SHR mode
SHRVDU22 JSR VDU12 ; Clear text and HGR screen
LDA #$80 ; Most significant bit
TSB NEWVIDEO ; Enable SHR mode
RTS

View File

@ -117,11 +117,11 @@ SCNTXTMAXX DB 79, 39, 39, 79, 39, 39, 39, 39 ; Max text column
SCNTXTMAXY DB 23, 23, 23, 23, 23, 23, 23, 23 ; Max text row SCNTXTMAXY DB 23, 23, 23, 23, 23, 23, 23, 23 ; Max text row
SCNBYTES DB 08, 08, 08, 01, 01, 01, 01, 01 ; Bytes per character SCNBYTES DB 08, 08, 08, 01, 01, 01, 01, 01 ; Bytes per character
SCNCOLOURS DB 03, 15, 07, 01, 01, 01, 01, 01 ; Colours-1 SCNCOLOURS DB 03, 15, 07, 01, 01, 01, 01, 01 ; Colours-1
SCNPIXELS DB 08, 08, 07, 00, 00, 00, 00, 00 ; Pixels per byte SCNPIXELS DB 04, 02, 07, 00, 00, 00, 00, 00 ; Pixels per byte
SCNTYPE DB 32, 32,128, 01, 00, 00, 00, 64 ; Screen type SCNTYPE DB 65, 64,128, 01, 00, 00, 00, 32 ; Screen type
* b7=FastDraw -> HGR mode * b7=FastDraw -> HGR mode
* b6=Teletext -> No-op * b6=SHR mode on Apple IIgs
* b5=SHR mode on Apple IIgs * b5=Teletext
* b0=40COL/80COL * b0=40COL/80COL
* Colour table * Colour table
@ -361,8 +361,9 @@ PUTCHRC PHA
BNE PRCHR4 BNE PRCHR4
CPX #$20 CPX #$20
BCS PRCHR3 ; Not $80-$9F BCS PRCHR3 ; Not $80-$9F
LDA #$20
BIT VDUSCREEN BIT VDUSCREEN
BVC PRCHR3 ; Not teletext BEQ PRCHR3 ; Not teletext
LDX #$E0 ; Convert $80-$9F to space LDX #$E0 ; Convert $80-$9F to space
PRCHR3 TXA PRCHR3 TXA
EOR #$40 EOR #$40
@ -593,15 +594,20 @@ VDU22 LDA VDUQ+8
JSR VDU20 ; Default colours JSR VDU20 ; Default colours
JSR VDU26 ; Default windows JSR VDU26 ; Default windows
STA FULLGR ; Clear MIXED mode STA FULLGR ; Clear MIXED mode
LDA VDUSCREEN BIT VDUSCREEN
BPL :NOTHGR BPL :NOTHGR
JMP HGRVDU22 ; b7=1, graphics mode JMP HGRVDU22 ; b7=1, HGR mode
:NOTHGR AND #$01 ; 40col/80col bit :NOTHGR BVC :NOTSHR
JMP SHRVDU22 ; b6=1, SHR mode
:NOTSHR LDA VDUSCREEN
AND #$01 ; 40col/80col bit
TAX TAX
STA CLR80VID,X ; Select 40col/80col STA CLR80VID,X ; Select 40col/80col
STA TEXTON ; Enable Text STA TEXTON ; Enable Text
STA PAGE2 ; PAGE2 STA PAGE2 ; PAGE2
STA SETALTCHAR ; Enable alt charset STA SETALTCHAR ; Enable alt charset
LDA #$80 ; Most significant bit
TRB NEWVIDEO ; Turn off SHR
* Fall through into CLS * Fall through into CLS