[Coco] Setting graphics modes with Assembly
Fedor Steeman
petrander at gmail.com
Sat Dec 20 03:44:15 EST 2008
Hi all,
I have been studying Chris Lomont's reference guide and, combined with your
help, I am starting to come to grips with it. One thing I don't get yet,
though, is how to switch from one graphics mode to another. I tried simply
appending the following to the already written code, but that doesn't do
anything noticeable:
LDA #$E8 * load 1110 1000
STA VDGSET * set pmode 3
Also: how to set the equivalent of SCREEN 1,0 / 1,1 commands?
This is my complete code so far:
TXTSCR EQU $0400 *Start of text screen
HIRES1 EQU $E00 *Start of hi-res graphics screen
VDGSET EQU $FF22 *PIA1 data port B: VDG Control output
V0CLR EQU $FFC0 *Clear bit for Sam Chip (Graphics mode)
V1SET EQU $FFC3 *Set V1 bit in Sam Chip (Graphics mode)
V2SET EQU $FFC5 *set V2 bit in Sam Chip (Graphics mode)
F0CLR EQU $FFC6 *Display Offset Binary, This is the CLR Bit
(Video page offset)
F0SET EQU $FFC7
F1SET EQU $FFC9
F2SET EQU $FFCB
POLCAT EQU $A000 *Color Basic rom poll keyboard routine
ORG $7000
START LDX #HIRES1
LDD #$AAAA
LOOP1 STD ,X++
CMPX #HIRES1+$1800
BCS LOOP1
GMODE STA V0CLR * set graphics mode
STA V1SET * set graphics mode
STA V2SET * set graphics mode
LDA #$F8 * load 1111 1000
STA F0SET * set graphics mode
STA F1SET * set graphics mode
STA F2SET * set graphics mode
STA VDGSET * set pmode 4 equivalent
JMP $ADFB * wait for keypress
LDA #$E8 * load 1110 1000
STA VDGSET * set pmode 3 equivalent?
JMP $ADFB
END START
Thanks for any input!
Cheers,
Fedor
More information about the Coco
mailing list