diff --git a/mode7_demo/mode7.s b/mode7_demo/mode7.s index 0b9be779..cd9fa560 100644 --- a/mode7_demo/mode7.s +++ b/mode7_demo/mode7.s @@ -56,9 +56,6 @@ mode7_flying: sta KEY_COUNT sta KEY_OFFSET - lda #1 ; slightly off North for better view of island - sta ANGLE - lda #2 ; initialize sky both pages sta DRAW_SKY @@ -163,6 +160,9 @@ turn_left: dec ANGLE + inc DRAW_SKY + inc DRAW_SKY + check_right: cmp #('D') bne check_speedup @@ -183,6 +183,8 @@ turn_right: sta TURNING inc ANGLE + inc DRAW_SKY + inc DRAW_SKY check_speedup: cmp #('Z') @@ -552,17 +554,23 @@ draw_background_mode7: ;============== ; 6 -.if .def(CHECKERBOARD_MAP) - lda #0 + dec DRAW_SKY ; usually 2 as we redraw both pages ; 5 + + + lda DRAW_BLUE_SKY + bne draw_blue_sky + +draw_black_sky: sta CV jsr scroll_background + jmp no_draw_sky -.else +draw_blue_sky: ; Draw Sky ; not performance critical as this happens rarely - dec DRAW_SKY ; usually 2 as we redraw both pages ; 5 + lda #COLOR_BOTH_MEDIUMBLUE ; MEDIUMBLUE color ; 2 sta COLOR ; 3 lda #0 ; 2 @@ -594,7 +602,7 @@ sky_loop: ; draw line across screen ;=========== ; 63+(X*16)+14 -.endif + no_draw_sky: @@ -913,9 +921,11 @@ screenx_loop: nomatch: +; This is self modified a few times +; jsr lookup_checkerboard_map +; jmp match ; Get color to draw in A .include "island_lookup.s" -; .include "checkerboard_lookup.s" match: diff --git a/mode7_demo/mode7_demo.dsk b/mode7_demo/mode7_demo.dsk index 9fb4c016..a76be7a5 100644 Binary files a/mode7_demo/mode7_demo.dsk and b/mode7_demo/mode7_demo.dsk differ diff --git a/mode7_demo/mode7_demo.s b/mode7_demo/mode7_demo.s index 2c1912cf..03b79877 100644 --- a/mode7_demo/mode7_demo.s +++ b/mode7_demo/mode7_demo.s @@ -37,6 +37,23 @@ checkerboard_demo: sta INL jsr decompress_scroll + lda #0 + sta DRAW_BLUE_SKY + + + lda #$20 + sta nomatch + lda #lookup_checkerboard_map + sta nomatch+2 + lda #$4c + sta nomatch+3 + lda #match + sta nomatch+5 + jsr mode7_flying rts @@ -48,6 +65,22 @@ checkerboard_demo: island_demo: ; initialize + lda #1 + sta DRAW_BLUE_SKY + + lda #$A5 ; fix the code that was self-modified + sta nomatch ; away in checkerboard code + lda #$6A + sta nomatch+1 + lda #$8D + sta nomatch+2 + lda #<(spacex_label+1) + sta nomatch+3 + lda #>(spacex_label+1) + sta nomatch+4 + lda #$29 + sta nomatch+5 + jsr mode7_flying rts diff --git a/mode7_demo/zp.inc b/mode7_demo/zp.inc index d82038e4..0ef1742f 100644 --- a/mode7_demo/zp.inc +++ b/mode7_demo/zp.inc @@ -97,6 +97,7 @@ DRAW_SKY EQU $8A COLOR_MASK EQU $8B KEY_COUNT EQU $8C KEY_OFFSET EQU $8D +DRAW_BLUE_SKY EQU $8E SHIPY EQU $E4