1
0
mirror of https://github.com/cc65/cc65.git synced 2025-06-01 20:41:14 +00:00
cc65/libsrc/apple2/videomode.s
Oliver Schmidt fd4c1e193d 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.
2025-03-13 22:22:28 +01:00

41 lines
1.0 KiB
ArmAsm

;
; Oliver Schmidt, 07.09.2009
;
; unsigned __fastcall__ videomode (unsigned mode);
;
.ifdef __APPLE2ENH__
.export _videomode
.include "apple2.inc"
.segment "LOWCODE"
_videomode:
; Get and save current videomode flag
bit RD80VID
php
; Initializing the 80 column firmware needs the ROM switched
; in, otherwise it would copy the F8 ROM to the LC (@ $CEF4)
bit $C082
; 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
lda #$15 ; Ctrl-char code for 40 cols
plp
bpl :+
lda #$00 ; Ctrl-char code for 80 cols
: rts ; X was preserved all the way
.endif ; __APPLE2ENH__