megademo: load some graphics

This commit is contained in:
Vince Weaver 2018-08-29 11:57:54 -04:00
parent e2900d6fd7
commit 69a34222aa
3 changed files with 108 additions and 2 deletions

View File

@ -17,14 +17,20 @@ megademo.dsk: MEGADEMO
MEGADEMO: megademo.o
ld65 -o MEGADEMO megademo.o -C ../linker_scripts/apple2_1000.inc
megademo.o: megademo.s
megademo.o: megademo.s \
c64.img
ca65 -o megademo.o megademo.s -l megademo.lst
####
c64.img: c64_updated.png
../hgr-utils/png2hgr c64_updated.png > c64.img
####
C64C.BIN: c64.bmp
$(B2D) c64.bmp HGR
clean:
rm -f *~ *.o *.lst *.inc MEGADEMO
rm -f *~ *.o *.lst *.inc MEGADEMO c64.img

84
megademo/hardware.inc Normal file
View File

@ -0,0 +1,84 @@
;; HARDWARE LOCATIONS
KEYPRESS = $C000
KEYRESET = $C010
;; SOFT SWITCHES
CLR80COL = $C000 ; PAGE0/PAGE1 normal
SET80COL = $C001 ; PAGE0/PAGE1 switches PAGE0 in Aux instead
EIGHTYCOLOFF = $C00C
EIGHTYCOLON = $C00D
SPEAKER = $C030
SET_GR = $C050
SET_TEXT = $C051
FULLGR = $C052
TEXTGR = $C053
PAGE0 = $C054
PAGE1 = $C055
LORES = $C056 ; Enable LORES graphics
HIRES = $C057 ; Enable HIRES graphics
AN3 = $C05E ; Annunciator 3
PADDLE_BUTTON0 = $C061
PADDL0 = $C064
PTRIG = $C070
;; BASIC ROUTINES
NORMAL = $F273
;; MONITOR ROUTINES
HLINE = $F819 ;; HLINE Y,$2C at A
VLINE = $F828 ;; VLINE A,$2D at Y
CLRSCR = $F832 ;; Clear low-res screen
CLRTOP = $F836 ;; clear only top of low-res screen
SETCOL = $F864 ;; COLOR=A
TEXT = $FB36
TABV = $FB5B ;; VTAB to A
BASCALC = $FBC1 ;;
VTAB = $FC22 ;; VTAB to CV
HOME = $FC58 ;; Clear the text screen
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
SETINV = $FE80 ;; INVERSE
SETNORM = $FE84 ;; NORMAL
COUT = $FDED ;; output A to screen
COUT1 = $FDF0 ;; output A to screen
COLOR_BLACK = 0
COLOR_RED = 1
COLOR_DARKBLUE = 2
COLOR_PURPLE = 3
COLOR_DARKGREEN = 4
COLOR_GREY = 5
COLOR_MEDIUMBLUE = 6
COLOR_LIGHTBLUE = 7
COLOR_BROWN = 8
COLOR_ORANGE = 9
COLOR_GREY2 = 10
COLOR_PINK = 11
COLOR_LIGHTGREEN = 12
COLOR_YELLOW = 13
COLOR_AQUA = 14
COLOR_WHITE = 15
COLOR_BOTH_BLACK = $00
COLOR_BOTH_RED = $11
COLOR_BOTH_DARKBLUE = $22
COLOR_BOTH_DARKGREEN = $44
COLOR_BOTH_GREY = $55
COLOR_BOTH_MEDIUMBLUE = $66
COLOR_BOTH_LIGHTBLUE = $77
COLOR_BOTH_BROWN = $88
COLOR_BOTH_ORANGE = $99
COLOR_BOTH_PINK = $BB
COLOR_BOTH_LIGHTGREEN = $CC
COLOR_BOTH_YELLOW = $DD
COLOR_BOTH_AQUA = $EE
COLOR_BOTH_WHITE = $FF

View File

@ -3,6 +3,19 @@
; by deater (Vince Weaver) <vince@deater.net>
.include "hardware.inc"
;===================
; set graphics mode
;===================
jsr HOME
bit PAGE0 ; first graphics page
bit FULLGR ; full screen graphics
bit HIRES ; hires mode !!!
bit SET_GR ; graphics mode
;===================
; do nothing
@ -11,3 +24,6 @@ do_nothing:
jmp do_nothing
.align $1000
.incbin "c64.img"