tfv: back to where we were before we started messing with page flipping

This commit is contained in:
Vince Weaver 2017-08-16 23:09:49 -04:00
parent 2b9a86f35a
commit 05ba5f99eb
3 changed files with 25 additions and 42 deletions

View File

@ -48,7 +48,7 @@ backgrounds.inc: $(PNG2RLE) \
TFV: tfv.o
ld65 -o TFV tfv.o -C ./apple2_1000.inc
tfv.o: tfv.s opener.s utils.s backgrounds.inc zp.inc
tfv.o: tfv.s opener.s title.s utils.s backgrounds.inc zp.inc
ca65 -o tfv.o tfv.s -l tfv.lst

View File

@ -1,31 +1,34 @@
.include "zp.inc"
;================================
; Clear screen and setup graphics
;================================
jsr HOME
jsr set_gr_page0
;===================================
; zero out the zero page that we use
;===================================
; memset()
; Clear page0 to 00
;===================================
; Clear top/bottom of page 0
;===================================
lda #$0
sta DRAW_PAGE
jsr clear_top
; Clear bottom page0 to ' '
jsr clear_bottom
; clc
;infinite:
; bcc infinite
; Clear page1 to 00
;===================================
; Clear top/bottom of page 1
;===================================
lda #$4
sta DRAW_PAGE
jsr clear_top
; Clear bottom page1 to ' '
jsr clear_bottom
;==========================
@ -38,32 +41,7 @@
; show the title screen
;======================
title_screen:
jsr CLRTOP
lda #$c
sta BASH
lda #$0
sta BASL ; load image off-screen 0xc00
lda #>(title_rle)
sta GBASH
lda #<(title_rle)
sta GBASL
jsr load_rle_gr
jsr gr_copy
lda #20
sta YPOS
lda #20
sta XPOS
jsr gr_copy
jsr wait_until_keypressed
jsr title_screen
enter_name:
@ -165,7 +143,7 @@ flying_start:
jsr set_gr_page0
flying_loop:
jsr gr_copy
jsr gr_copy_to_current
jsr put_sprite
@ -228,6 +206,7 @@ exit:
.include "opener.s"
.include "utils.s"
.include "title.s"
;===============================================
; Variables

View File

@ -57,6 +57,8 @@ load_rle_gr:
iny ; (we should check if we had
; bad luck and overflows page)
iny ; skip ysize
rle_loop:
lda (GBASL),y ; load run value
cmp #$ff ; if 0xff
@ -159,12 +161,12 @@ set_gr_page0:
rts
;=========================================================
; gr_copy
; gr_copy_to_current
;=========================================================
; for now copy 0xc00 to 0x400
; copy 0xc00 to DRAW_PAGE
; 2 + 8*38 + 4*80*23 + 4*120*26 + 13 = 20,159 = 20ms = 50Hz
;
gr_copy:
;
gr_copy_to_current:
ldx #0 ; set y to zero ; 2
gr_copy_loop:
@ -176,7 +178,9 @@ gr_copy_loop:
sta OUTL ; out and in are the same ; 3
sta INL ; 3
lda gr_offsets+1,Y ; lookup high byte for line addr ; 5
adc DRAW_PAGE
sta OUTH ; 3
lda gr_offsets+1,Y ; lookup high byte for line addr ; 5
adc #$8 ; for now, fixed 0xc ; 2
sta INH ; 3
ldx TEMP ; restore y ; 3