Created a target and a library for the Commander X16 prototype computer.
This commit is contained in:
30
libsrc/cx16/videomode.s
Normal file
30
libsrc/cx16/videomode.s
Normal file
@@ -0,0 +1,30 @@
|
||||
;
|
||||
; 2009-09-07, Ullrich von Bassewitz
|
||||
; 2019-09-23, Greg King
|
||||
;
|
||||
; unsigned __fastcall__ videomode (unsigned Mode);
|
||||
; /* Set the video mode, return the old mode. */
|
||||
;
|
||||
|
||||
.export _videomode
|
||||
.import SWAPPER
|
||||
|
||||
.include "cx16.inc"
|
||||
|
||||
|
||||
.proc _videomode
|
||||
cmp LLEN ; Do we have this mode already?
|
||||
beq @L9
|
||||
|
||||
lda LLEN ; Get current mode ...
|
||||
pha ; ... and save it
|
||||
|
||||
jsr SWAPPER ; Toggle the mode
|
||||
|
||||
pla ; Get old mode into A
|
||||
|
||||
; Done, old mode is in .A
|
||||
|
||||
@L9: ldx #>$0000 ; Clear high byte
|
||||
rts
|
||||
.endproc
|
||||
Reference in New Issue
Block a user