mirror of
https://github.com/cc65/cc65.git
synced 2025-04-08 19:38:55 +00:00
Completely disable/enable 80 column firmware.
The //e 80 column firmware allows to switch between 80 and 40 clumns without clearing the screen. So far, I made that feature available via videomode(). However thinking about it once more, I don't see a C program making use of it. A C program rather benefits from the consistent behavior of videomode() always clearing the screen. Apart from that, the (default) 40 column display and the 40 column display with 80 column firmware active, behave differently (CH vs. OURCH) which causes subtile issues. Those issues can be avoid altogether by simply always deactivating the 80 column firmware when switching from 80 column display to 40 column display. Of course, those issues are also relevant, if the 40 column display with 80 column firmware is already active when the C program starts. However, I have reasons to believe that running the Apple II in that mode was/is very unpopular.
This commit is contained in:
parent
c8eb6e2dd5
commit
fd4c1e193d
@ -82,8 +82,8 @@
|
||||
#define CH_F10 0xB0
|
||||
|
||||
/* Video modes */
|
||||
#define VIDEOMODE_40x24 0x0011
|
||||
#define VIDEOMODE_80x24 0x0012
|
||||
#define VIDEOMODE_40x24 0x15
|
||||
#define VIDEOMODE_80x24 0x00
|
||||
#define VIDEOMODE_40COL VIDEOMODE_40x24
|
||||
#define VIDEOMODE_80COL VIDEOMODE_80x24
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
.ifdef __APPLE2ENH__
|
||||
|
||||
.export _videomode
|
||||
.import COUT
|
||||
|
||||
.include "apple2.inc"
|
||||
|
||||
@ -17,52 +16,25 @@ _videomode:
|
||||
bit RD80VID
|
||||
php
|
||||
|
||||
; If we are in 80 column mode then the 80 column firmware is
|
||||
; known to be active so we can just print the ctrl-char code
|
||||
; (even if this only means staying in the current videomode)
|
||||
bpl :+
|
||||
jsr COUT
|
||||
bra done
|
||||
|
||||
; If we are in 40 column mode and want to set 40 column mode
|
||||
; then we explicitly do nothing as we neither know about the
|
||||
; current state of the 80 column firmware nor want to fix it
|
||||
: cmp #$11 ; Ctrl-char code for 40 cols
|
||||
beq done
|
||||
|
||||
; If we are in 40 column mode and want to set 80 column mode
|
||||
; then we first presume the 80 column firmware being already
|
||||
; active and print the ctrl-char code (this causes a garbage
|
||||
; char to be printed on the screen if isn't already active)
|
||||
jsr COUT
|
||||
|
||||
; If we successfully switched to 80 column mode then the 80
|
||||
; column firmware was in fact already active and we're done
|
||||
bit RD80VID
|
||||
bmi done
|
||||
|
||||
; The 80 column firmware isn't already active so we need to
|
||||
; initialize it - causing the screen to be cleared and thus
|
||||
; the garbage char printed above to be erased (but for some
|
||||
; reason the cursor horizontal position not to be zeroed)
|
||||
stz CH
|
||||
|
||||
; Initializing the 80 column firmware needs the ROM switched
|
||||
; in, otherwise it would copy the F8 ROM to the LC (@ $CEF4)
|
||||
bit $C082
|
||||
|
||||
; Initialize 80 column firmware
|
||||
jsr $C300 ; PR#3
|
||||
; Call 80 column firmware with ctrl-char code
|
||||
jsr $C300
|
||||
|
||||
; Switch in LC bank 2 for R/O
|
||||
bit $C080
|
||||
|
||||
; Switch in alternate charset again
|
||||
sta SETALTCHAR
|
||||
|
||||
; Return ctrl-char code for setting previous
|
||||
; videomode using the saved videomode flag
|
||||
done: lda #$11 ; Ctrl-char code for 40 cols
|
||||
lda #$15 ; Ctrl-char code for 40 cols
|
||||
plp
|
||||
bpl :+
|
||||
inc a ; Ctrl-char code for 80 cols
|
||||
lda #$00 ; Ctrl-char code for 80 cols
|
||||
: rts ; X was preserved all the way
|
||||
|
||||
.endif ; __APPLE2ENH__
|
||||
|
Loading…
x
Reference in New Issue
Block a user