duke: can walk around now

This commit is contained in:
Vince Weaver 2020-12-10 19:24:05 -05:00
parent c9b51e62af
commit 5b3f545264
6 changed files with 87 additions and 4 deletions

View File

@ -12,6 +12,7 @@ duke.dsk: HELLO DUKE
cp empty.dsk duke.dsk
$(DOS33) -y duke.dsk SAVE A HELLO
$(DOS33) -y duke.dsk BSAVE -a 0x2000 DUKE
$(DOS33) -y duke.dsk BSAVE -a 0x4000 ./title/NEW_TITLEC.BIN TITLE
###
@ -37,6 +38,9 @@ duke.o: duke.s zp.inc hardware.inc duke.s \
graphics/duke_graphics.inc:
cd graphics && make
title/new_title.lzsa:
cd title && make
maps/level1_map.lzsa:
cd maps && make
@ -46,5 +50,5 @@ clean:
rm -f *~ *.o *.lst HELLO DUKE
cd graphics && make clean
cd maps && make clean
cd title && make clean

View File

@ -1,9 +1,58 @@
;=========================
; move duke
;=========================
move_duke:
lda DUKE_WALKING
beq done_move_duke
lda DUKE_DIRECTION
bmi move_left
lda DUKE_X
cmp #22
bcc duke_walk_right
duke_scroll_right:
inc TILEMAP_X
jsr copy_tilemap_subset
jmp done_move_duke
duke_walk_right:
inc DUKE_X
jmp done_move_duke
move_left:
lda DUKE_X
cmp #14
bcs duke_walk_left
duke_scroll_left:
dec TILEMAP_X
jsr copy_tilemap_subset
jmp done_move_duke
duke_walk_left:
dec DUKE_X
jmp done_move_duke
done_move_duke:
rts
;=========================
; draw duke
;=========================
draw_duke:
lda DUKE_X

View File

@ -1,4 +1,4 @@
5 HOME
10 PRINT "LOADING DUKE V0.01"
10 PRINT "LOADING DUKE V0.02"
20 PRINT:PRINT
30 PRINT CHR$(4);"BRUN DUKE"

30
duke/title/Makefile Normal file
View File

@ -0,0 +1,30 @@
#include ../Makefile.inc
B2D = ../../bmp2dhr/b2d
PNG2GR = ../../gr-utils/png2gr
LZSA = ~/research/lzsa/lzsa/lzsa
all: new_title.lzsa
####
duke_title.lzsa: DUKE_TITLEC.BIN
$(LZSA) -r -f2 DUKE_TITLEC.BIN duke_title.lzsa
DUKE_TITLEC.BIN: duke_title.bmp
$(B2D) duke_title.bmp HGR -d
####
new_title.lzsa: NEW_TITLEC.BIN
$(LZSA) -r -f2 NEW_TITLEC.BIN new_title.lzsa
NEW_TITLEC.BIN: new_title.bmp
$(B2D) new_title.bmp HGR
####
clean:
rm -f *~ *.o *.lst

BIN
duke/title/new_title.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
duke/title/new_title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB