diff --git a/gr-sim/bounce.c b/gr-sim/bounce.c new file mode 100644 index 00000000..64639a5f --- /dev/null +++ b/gr-sim/bounce.c @@ -0,0 +1,28 @@ +#include + +int main(int argc, char **argv) { + + double x,v0,g,t,d; + + x=10.0; + d=0.0; + v0=0; + g=-9.8; + +#define T 0.01 + + for(t=0;t<10;t+=T) { + + x+=v0*T; + v0+=g*T; + + if (x<0) v0=-v0; + + printf("%.2f %.2f\n",t,x); + + + + } + + return 0; +} diff --git a/mode7_demo/mode7.s b/mode7_demo/mode7.s index 540075d4..d7db1361 100644 --- a/mode7_demo/mode7.s +++ b/mode7_demo/mode7.s @@ -19,8 +19,23 @@ CONST_LOWRES_HALF_F EQU $00 ; pre-programmed directions -flying_directions: - .byte $20,$00, $1,'Z', $10,'D', $1,' ', $40,$00, $1,'Q' +checkerboard_flying_directions: + .byte $18,$00 ; 24 frames, do nothing + .byte $10,'D' ; 16 frames, turn right + .byte $10,$00 ; 16 frames, do nothing + .byte $f,'A' ; 15 frames, turn left + .byte $10,$00 ; 16 frames, do nothing + .byte $1,'Z' ; start moving forward + .byte $20,$00 ; 32 frames, do nothing + .byte $1,'Q' ; quit + +island_flying_directions: + .byte $20,$00 ; 32 frames, do nothing + .byte $1,'Z' ; start moving forward + .byte $10,'D' ; 16 frames, turn right + .byte $1,' ' ; stop + .byte $40,$00 ; 64 frames, do nothing + .byte $1,'Q' ; quit ;===================== ; Flying @@ -55,6 +70,7 @@ mode7_flying: sta DISP_PAGE sta KEY_COUNT sta KEY_OFFSET + sta FRAME_COUNT lda #2 ; initialize sky both pages sta DRAW_SKY @@ -80,10 +96,12 @@ flying_keyboard: bne done_key ldy KEY_OFFSET - lda flying_directions,Y +direction_smc_1: + lda island_flying_directions,Y sta KEY_COUNT iny - lda flying_directions,Y +direction_smc_2: + lda island_flying_directions,Y sta LASTKEY inc KEY_OFFSET inc KEY_OFFSET @@ -313,9 +331,30 @@ draw_sphere: lda #match sta nomatch+5 + lda #checkerboard_flying_directions + sta direction_smc_1+2 + sta direction_smc_2+2 + + jsr mode7_flying ; call generic mode7 code rts @@ -81,6 +89,13 @@ island_demo: lda #$29 sta nomatch+5 + lda #island_flying_directions + sta direction_smc_1+2 + sta direction_smc_2+2 + jsr mode7_flying rts diff --git a/mode7_demo/zp.inc b/mode7_demo/zp.inc index 6a18ff21..33e0233c 100644 --- a/mode7_demo/zp.inc +++ b/mode7_demo/zp.inc @@ -99,6 +99,7 @@ KEY_COUNT EQU $8C KEY_OFFSET EQU $8D DRAW_BLUE_SKY EQU $8E RANDOM_POINTER EQU $8F +FRAME_COUNT EQU $90 SHIPY EQU $E4 @@ -109,6 +110,7 @@ KEYRESET EQU $C010 CLR80COL EQU $C000 ; PAGE0/PAGE1 normal SET80COL EQU $C001 ; PAGE0/PAGE1 switches PAGE0 in Aux instead EIGHTYCOL EQU $C00D +SPEAKER EQU $C030 SET_GR EQU $C050 SET_TEXT EQU $C051 FULLGR EQU $C052 diff --git a/tfv/sprites.png b/tfv/sprites.png index 66f91284..8c12d3b5 100644 Binary files a/tfv/sprites.png and b/tfv/sprites.png differ