tower
This commit is contained in:
parent
f2dc36f5a4
commit
5b6ee97644
|
|
@ -167,6 +167,7 @@ $(DISKIMAGE): $(ASSEMBLE) $(CC1541)
|
||||||
-f "font" -w font.bin \
|
-f "font" -w font.bin \
|
||||||
-f "scrmap" -w tilemap.bin.lz \
|
-f "scrmap" -w tilemap.bin.lz \
|
||||||
-f "intrbmp" -w title_320-prepared.zx0.prg \
|
-f "intrbmp" -w title_320-prepared.zx0.prg \
|
||||||
|
-f "tower" -w tower.zx0.prg \
|
||||||
$@
|
$@
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,6 @@ python3 aart_lz.py tilemap.bin tilemap.bin.lz
|
||||||
zx02/zx02 title_320-prepared.bin title_320-prepared.zx0
|
zx02/zx02 title_320-prepared.bin title_320-prepared.zx0
|
||||||
printf "\x00\x80" > title_320-prepared.zx0.prg
|
printf "\x00\x80" > title_320-prepared.zx0.prg
|
||||||
cat title_320-prepared.zx0 >> title_320-prepared.zx0.prg
|
cat title_320-prepared.zx0 >> title_320-prepared.zx0.prg
|
||||||
|
zx02/zx02 tower.bin tower.zx0
|
||||||
|
printf "\x00\x80" > tower.zx0.prg
|
||||||
|
cat tower.zx0 >> tower.zx0.prg
|
||||||
|
|
@ -16,6 +16,10 @@ cur_frame: .res 1
|
||||||
frame_delay: .res 1
|
frame_delay: .res 1
|
||||||
frame_until: .res 1
|
frame_until: .res 1
|
||||||
text_ptr: .res 2
|
text_ptr: .res 2
|
||||||
|
timer: .res 2
|
||||||
|
timer_limit: .res 2
|
||||||
|
timer_reached: .res 2
|
||||||
|
timer_mode: .res 1
|
||||||
|
|
||||||
aart_lz_buffer := $fd00
|
aart_lz_buffer := $fd00
|
||||||
.include "lz_zp.asm"
|
.include "lz_zp.asm"
|
||||||
|
|
@ -83,39 +87,6 @@ copy_start:
|
||||||
sta $01
|
sta $01
|
||||||
jmp CODE_START_ADDR
|
jmp CODE_START_ADDR
|
||||||
|
|
||||||
run_nufli_bmp:
|
|
||||||
lda #$01
|
|
||||||
sta $81
|
|
||||||
lda #$29
|
|
||||||
sta $80
|
|
||||||
lda #0
|
|
||||||
sta $d01a
|
|
||||||
jsr $a000
|
|
||||||
cli
|
|
||||||
jsr $3000
|
|
||||||
@loop:
|
|
||||||
bit $d011
|
|
||||||
bpl @loop
|
|
||||||
jsr $a003
|
|
||||||
@loop2:
|
|
||||||
bit $d011
|
|
||||||
bmi @loop2
|
|
||||||
lda #0
|
|
||||||
sta $d020
|
|
||||||
sta $d021
|
|
||||||
jsr $a003
|
|
||||||
lda $80
|
|
||||||
bne :+
|
|
||||||
dec $81
|
|
||||||
:
|
|
||||||
dec $80
|
|
||||||
lda $81
|
|
||||||
cmp #$ff
|
|
||||||
beq :+
|
|
||||||
jmp @loop
|
|
||||||
:
|
|
||||||
rts
|
|
||||||
|
|
||||||
.res loadraw - *
|
.res loadraw - *
|
||||||
.incbin "../../build/loader-c64.prg", 2
|
.incbin "../../build/loader-c64.prg", 2
|
||||||
|
|
||||||
|
|
@ -138,8 +109,12 @@ code_start:
|
||||||
:
|
:
|
||||||
lda $8000, x
|
lda $8000, x
|
||||||
sta $d800, x
|
sta $d800, x
|
||||||
|
eor #$ff
|
||||||
|
sta $c00, x
|
||||||
lda $8100, x
|
lda $8100, x
|
||||||
sta $d900, x
|
sta $d900, x
|
||||||
|
eor #$ff
|
||||||
|
sta $d00, x
|
||||||
inx
|
inx
|
||||||
bne :-
|
bne :-
|
||||||
|
|
||||||
|
|
@ -205,6 +180,7 @@ code_start:
|
||||||
;sta frame_delay
|
;sta frame_delay
|
||||||
;jsr wait_loop
|
;jsr wait_loop
|
||||||
|
|
||||||
|
/*
|
||||||
lda #0
|
lda #0
|
||||||
jsr sfx_init
|
jsr sfx_init
|
||||||
|
|
||||||
|
|
@ -269,6 +245,7 @@ code_start:
|
||||||
lda #120
|
lda #120
|
||||||
sta frame_delay
|
sta frame_delay
|
||||||
jsr wait_loop
|
jsr wait_loop
|
||||||
|
*/
|
||||||
|
|
||||||
lda #$0b
|
lda #$0b
|
||||||
sta $d011
|
sta $d011
|
||||||
|
|
@ -291,6 +268,10 @@ code_start:
|
||||||
ldy #>sidname
|
ldy #>sidname
|
||||||
jsr loadraw
|
jsr loadraw
|
||||||
|
|
||||||
|
ldx #<towername
|
||||||
|
ldy #>towername
|
||||||
|
jsr loadraw
|
||||||
|
|
||||||
lda #<fake_kernal_irq
|
lda #<fake_kernal_irq
|
||||||
sta $fffe
|
sta $fffe
|
||||||
lda #>fake_kernal_irq
|
lda #>fake_kernal_irq
|
||||||
|
|
@ -302,8 +283,114 @@ code_start:
|
||||||
jsr run_nufli_bmp
|
jsr run_nufli_bmp
|
||||||
sei
|
sei
|
||||||
jsr init_2x
|
jsr init_2x
|
||||||
|
lda #$0b
|
||||||
|
sta $d011
|
||||||
|
;ldx #3
|
||||||
|
;:
|
||||||
|
;jsr wait_frame
|
||||||
|
;dex
|
||||||
|
;bpl :-
|
||||||
|
jsr clr_txt
|
||||||
|
ldx #<story_writ
|
||||||
|
ldy #>story_writ
|
||||||
|
jsr write_txt3
|
||||||
|
ldx #$30
|
||||||
|
ldy #$01
|
||||||
|
jsr init_timer
|
||||||
|
lda #1
|
||||||
|
sta timer_mode
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta ZX0_src
|
||||||
|
lda #$80
|
||||||
|
sta ZX0_src+1
|
||||||
|
lda #0
|
||||||
|
sta ZX0_dst
|
||||||
|
lda #$20
|
||||||
|
jsr zx02
|
||||||
|
|
||||||
|
:
|
||||||
|
lda timer_reached
|
||||||
|
beq :-
|
||||||
|
|
||||||
|
ldx #$b8
|
||||||
|
ldy #$01
|
||||||
|
jsr init_timer
|
||||||
|
lda #2
|
||||||
|
sta timer_mode
|
||||||
|
:
|
||||||
|
lda timer_reached
|
||||||
|
beq :-
|
||||||
|
|
||||||
|
jsr init_bmp
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta vbl
|
||||||
|
|
||||||
|
lda #$11
|
||||||
|
sta frame_until
|
||||||
|
jsr wait_frame_until_2x
|
||||||
|
|
||||||
|
ldx #$6c
|
||||||
|
:
|
||||||
|
jsr wait_frame
|
||||||
|
jsr wait_frame
|
||||||
|
dex
|
||||||
|
bpl :-
|
||||||
|
|
||||||
|
lda #$0b
|
||||||
|
sta $d011
|
||||||
jmp *
|
jmp *
|
||||||
|
|
||||||
|
|
||||||
|
wait_frame:
|
||||||
|
@loop:
|
||||||
|
bit $d011
|
||||||
|
bpl @loop
|
||||||
|
@loop2:
|
||||||
|
bit $d011
|
||||||
|
bmi @loop2
|
||||||
|
rts
|
||||||
|
|
||||||
|
story_writ:
|
||||||
|
.res 11, ' '
|
||||||
|
.byte "story written by"
|
||||||
|
.res 40-(16+11), ' '
|
||||||
|
.res 11, ' '
|
||||||
|
.res 5, ' '
|
||||||
|
.byte "takahiro ohura"
|
||||||
|
.res 40-(14+11+5), ' '
|
||||||
|
.res 11, ' '
|
||||||
|
.res 5, ' '
|
||||||
|
.byte "tomoo yamane"
|
||||||
|
.res 40-(12+11+5), ' '
|
||||||
|
|
||||||
|
|
||||||
|
clr_txt:
|
||||||
|
lda #$80
|
||||||
|
ldx #0
|
||||||
|
:
|
||||||
|
.repeat 4, I
|
||||||
|
sta $400+(I*250), x
|
||||||
|
.endrepeat
|
||||||
|
inx
|
||||||
|
cpx #250
|
||||||
|
bne :-
|
||||||
|
lda #0
|
||||||
|
ldx #0
|
||||||
|
:
|
||||||
|
.repeat 4, I
|
||||||
|
sta $d800+(I*250), x
|
||||||
|
.endrepeat
|
||||||
|
inx
|
||||||
|
cpx #250
|
||||||
|
bne :-
|
||||||
|
lda #$13
|
||||||
|
sta $d018
|
||||||
|
lda #$1b
|
||||||
|
sta $d011
|
||||||
|
rts
|
||||||
|
|
||||||
init_2x:
|
init_2x:
|
||||||
lda #127
|
lda #127
|
||||||
sta $dc0d
|
sta $dc0d
|
||||||
|
|
@ -351,6 +438,21 @@ init_2x:
|
||||||
cli
|
cli
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
init_timer:
|
||||||
|
lda #0
|
||||||
|
sta timer_reached
|
||||||
|
sta timer_mode
|
||||||
|
sta timer
|
||||||
|
sta timer+1
|
||||||
|
stx timer_limit
|
||||||
|
sty timer_limit+1
|
||||||
|
rts
|
||||||
|
|
||||||
|
fade_cols:
|
||||||
|
.byte 0, 0
|
||||||
|
.byte $0, $0, $0, $0, $b, $c, $f, $1
|
||||||
|
.res 32-10, $1
|
||||||
|
|
||||||
irq_music:
|
irq_music:
|
||||||
pha
|
pha
|
||||||
txa
|
txa
|
||||||
|
|
@ -358,9 +460,63 @@ irq_music:
|
||||||
tya
|
tya
|
||||||
pha
|
pha
|
||||||
|
|
||||||
inc $d020
|
lda $dd00
|
||||||
|
and #3
|
||||||
|
sta @dd00_arc+1
|
||||||
|
lda #3
|
||||||
|
sta $dd00
|
||||||
|
|
||||||
|
inc vbl
|
||||||
|
|
||||||
|
;inc $d020
|
||||||
jsr $a003
|
jsr $a003
|
||||||
dec $d020
|
;dec $d020
|
||||||
|
|
||||||
|
lda timer_mode
|
||||||
|
cmp #1
|
||||||
|
bne :+
|
||||||
|
lda timer+1
|
||||||
|
bne :+
|
||||||
|
lda timer
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
tax
|
||||||
|
lda fade_cols, x
|
||||||
|
sta $d021
|
||||||
|
:
|
||||||
|
lda timer_mode
|
||||||
|
cmp #2
|
||||||
|
bne :+
|
||||||
|
lda timer+1
|
||||||
|
bne :+
|
||||||
|
lda timer
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
eor #31
|
||||||
|
tax
|
||||||
|
lda fade_cols, x
|
||||||
|
sta $d021
|
||||||
|
:
|
||||||
|
|
||||||
|
inc timer
|
||||||
|
bne :+
|
||||||
|
inc timer+1
|
||||||
|
:
|
||||||
|
lda timer
|
||||||
|
cmp timer_limit
|
||||||
|
bne :+
|
||||||
|
lda timer+1
|
||||||
|
cmp timer_limit+1
|
||||||
|
bne :+
|
||||||
|
lda #1
|
||||||
|
sta timer_reached
|
||||||
|
:
|
||||||
|
|
||||||
|
@dd00_arc:
|
||||||
|
lda #0
|
||||||
|
sta $dd00
|
||||||
|
|
||||||
pla
|
pla
|
||||||
tay
|
tay
|
||||||
|
|
@ -385,9 +541,9 @@ fake_kernal_irq:
|
||||||
jmp ($0314) ; fuck you
|
jmp ($0314) ; fuck you
|
||||||
|
|
||||||
wait_loop:
|
wait_loop:
|
||||||
loop2:
|
@loop2:
|
||||||
lda vbl
|
lda vbl
|
||||||
beq loop2
|
beq @loop2
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta vbl
|
sta vbl
|
||||||
|
|
@ -397,14 +553,14 @@ loop2:
|
||||||
dec frame_delay
|
dec frame_delay
|
||||||
lda frame_delay
|
lda frame_delay
|
||||||
beq :+
|
beq :+
|
||||||
jmp loop2
|
jmp @loop2
|
||||||
:
|
:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
wait_frame_until:
|
wait_frame_until:
|
||||||
loop:
|
@loop:
|
||||||
lda vbl
|
lda vbl
|
||||||
beq loop
|
beq @loop
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
sta vbl
|
sta vbl
|
||||||
|
|
@ -424,12 +580,51 @@ loop:
|
||||||
cmp frame_until
|
cmp frame_until
|
||||||
beq :+
|
beq :+
|
||||||
|
|
||||||
jmp loop
|
jmp @loop
|
||||||
:
|
:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
wait_loop_2x:
|
||||||
|
@loop:
|
||||||
|
lda vbl
|
||||||
|
cmp #2
|
||||||
|
bcc @loop
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta vbl
|
||||||
|
|
||||||
|
dec frame_delay
|
||||||
|
lda frame_delay
|
||||||
|
beq :+
|
||||||
|
jmp @loop
|
||||||
|
:
|
||||||
|
rts
|
||||||
|
|
||||||
|
wait_frame_until_2x:
|
||||||
|
@loop:
|
||||||
|
lda vbl
|
||||||
|
cmp #2
|
||||||
|
bcc @loop
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta vbl
|
||||||
|
|
||||||
|
dec bmp_delay
|
||||||
|
bpl :+
|
||||||
|
jsr update_bmp
|
||||||
|
:
|
||||||
|
|
||||||
|
lda cur_frame
|
||||||
|
cmp frame_until
|
||||||
|
beq :+
|
||||||
|
jmp @loop
|
||||||
|
:
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
init_bmp:
|
init_bmp:
|
||||||
lda #$3b
|
lda #$0b
|
||||||
sta $d011
|
sta $d011
|
||||||
lda #$19
|
lda #$19
|
||||||
sta $d018
|
sta $d018
|
||||||
|
|
@ -467,6 +662,9 @@ init_bmp:
|
||||||
inx
|
inx
|
||||||
cpx #250
|
cpx #250
|
||||||
bne :-
|
bne :-
|
||||||
|
|
||||||
|
lda #$3b
|
||||||
|
sta $d011
|
||||||
rts
|
rts
|
||||||
|
|
||||||
inc_bmp_addr:
|
inc_bmp_addr:
|
||||||
|
|
@ -647,6 +845,7 @@ badguy: .byte "badguy",0
|
||||||
fontname: .byte "font",0
|
fontname: .byte "font",0
|
||||||
sidname: .byte "sid", 0
|
sidname: .byte "sid", 0
|
||||||
introname: .byte "intrbmp", 0
|
introname: .byte "intrbmp", 0
|
||||||
|
towername: .byte "tower", 0
|
||||||
|
|
||||||
darmtower_txt:
|
darmtower_txt:
|
||||||
.res (40-26)/2, ' '
|
.res (40-26)/2, ' '
|
||||||
|
|
@ -663,6 +862,48 @@ too_bad_txt:
|
||||||
.byte "too bad..."
|
.byte "too bad..."
|
||||||
.res (40-10)/2, ' '
|
.res (40-10)/2, ' '
|
||||||
|
|
||||||
|
write_txt3:
|
||||||
|
stx text_ptr
|
||||||
|
sty text_ptr+1
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
ldy #0
|
||||||
|
:
|
||||||
|
lda (text_ptr), y
|
||||||
|
sec
|
||||||
|
sbc #$20
|
||||||
|
ora #$80
|
||||||
|
sta $400+10*40, x
|
||||||
|
iny
|
||||||
|
inx
|
||||||
|
cpx #40
|
||||||
|
bne :-
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
:
|
||||||
|
lda (text_ptr), y
|
||||||
|
sec
|
||||||
|
sbc #$20
|
||||||
|
ora #$80
|
||||||
|
sta $400+12*40, x
|
||||||
|
iny
|
||||||
|
inx
|
||||||
|
cpx #40
|
||||||
|
bne :-
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
:
|
||||||
|
lda (text_ptr), y
|
||||||
|
sec
|
||||||
|
sbc #$20
|
||||||
|
ora #$80
|
||||||
|
sta $400+14*40, x
|
||||||
|
iny
|
||||||
|
inx
|
||||||
|
cpx #40
|
||||||
|
bne :-
|
||||||
|
rts
|
||||||
|
|
||||||
upload_text:
|
upload_text:
|
||||||
lda #$34
|
lda #$34
|
||||||
sta $01
|
sta $01
|
||||||
|
|
@ -690,9 +931,40 @@ upload_text:
|
||||||
bne :-
|
bne :-
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.include "sfx.asm"
|
|
||||||
.include "zx02.asm"
|
run_nufli_bmp:
|
||||||
.include "thcmod_lz.asm"
|
lda #$01
|
||||||
|
sta $81
|
||||||
|
lda #$29
|
||||||
|
sta $80
|
||||||
|
lda #0
|
||||||
|
sta $d01a
|
||||||
|
jsr $a000
|
||||||
|
cli
|
||||||
|
jsr $3000
|
||||||
|
@loop:
|
||||||
|
bit $d011
|
||||||
|
bpl @loop
|
||||||
|
jsr $a003
|
||||||
|
@loop2:
|
||||||
|
bit $d011
|
||||||
|
bmi @loop2
|
||||||
|
lda #0
|
||||||
|
sta $d020
|
||||||
|
sta $d021
|
||||||
|
jsr $a003
|
||||||
|
lda $80
|
||||||
|
bne :+
|
||||||
|
dec $81
|
||||||
|
:
|
||||||
|
dec $80
|
||||||
|
lda $81
|
||||||
|
cmp #$ff
|
||||||
|
beq :+
|
||||||
|
jmp @loop
|
||||||
|
:
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
.res $ea31-*, $ff
|
.res $ea31-*, $ff
|
||||||
;asl $d019
|
;asl $d019
|
||||||
|
|
@ -712,4 +984,8 @@ upload_text:
|
||||||
pla
|
pla
|
||||||
rti
|
rti
|
||||||
|
|
||||||
|
.include "sfx.asm"
|
||||||
|
.include "zx02.asm"
|
||||||
|
.include "thcmod_lz.asm"
|
||||||
|
|
||||||
code_end:
|
code_end:
|
||||||
|
|
|
||||||
BIN
loader/samples/minexample/tower.bin
Normal file
BIN
loader/samples/minexample/tower.bin
Normal file
Binary file not shown.
BIN
loader/samples/minexample/tower.zx0
Normal file
BIN
loader/samples/minexample/tower.zx0
Normal file
Binary file not shown.
BIN
loader/samples/minexample/tower.zx0.prg
Normal file
BIN
loader/samples/minexample/tower.zx0.prg
Normal file
Binary file not shown.
Loading…
Reference in a new issue