diff --git a/vaporlock/doubledouble/Makefile b/vaporlock/doubledouble/Makefile index f8ba05fa..f6b4faa9 100644 --- a/vaporlock/doubledouble/Makefile +++ b/vaporlock/doubledouble/Makefile @@ -34,8 +34,7 @@ double.o: double.s \ music/fighting.zx02 \ setup_graphics.s \ effect_static.s \ - effect_dhgr_dgr.s \ - effect_dhgr_hgr.s \ + effect_sin_window.s \ effect_midline.s \ table/sin.table \ graphics/sworg_hgr.hgr.zx02 \ diff --git a/vaporlock/doubledouble/double.s b/vaporlock/doubledouble/double.s index 71a73b20..c0a5a6fa 100644 --- a/vaporlock/doubledouble/double.s +++ b/vaporlock/doubledouble/double.s @@ -294,6 +294,11 @@ effect_smc: .align $100 +sin_table: +.incbin "table/sin.table" + +; sin_table is 256 bytes so this should still be aligned + .include "vblank.s" ; actually want 1524-12 = 1512 (6 each for jsr/rts) @@ -330,7 +335,7 @@ delay_12: rts -.include "effect_dhgr_dgr.s" +.include "effect_sin_window.s" .include "effect_static.s" @@ -397,8 +402,6 @@ config_string: .include "gr_offsets.s" ;.include "load_music.s" -sin_table: -.incbin "table/sin.table" fighting_zx02: .incbin "music/fighting.zx02" diff --git a/vaporlock/doubledouble/effect_dhgr_dgr.s b/vaporlock/doubledouble/effect_sin_window.s similarity index 80% rename from vaporlock/doubledouble/effect_dhgr_dgr.s rename to vaporlock/doubledouble/effect_sin_window.s index 9b4a1511..f54d99e2 100644 --- a/vaporlock/doubledouble/effect_dhgr_dgr.s +++ b/vaporlock/doubledouble/effect_sin_window.s @@ -25,9 +25,11 @@ aloop_24: jsr delay_12 ; 12 jsr delay_12 ; 12 jsr delay_12 ; 12 +; 60 dex ; 2 +; 62 bne aloop ; 2/3 - +; 65 ;========================== ; middle (Switch mode) @@ -45,26 +47,26 @@ middle_smc4: ; 17 - nop - nop - jmp bloop_24 + nop ; 2 + nop ; 2 + jmp bloop_24 ; 3 +; 24 bloop: ; update the movement mid-way ldy FRAME ; 3 - lda sin_table,Y ; 4+ - sta effect_top_smc+1 ; 4 + lda sin_table,Y ; 4 (aligned) + sta effect_top_smc+1 ; 4 +; 11 + clc ; 2 + adc #32 ; should this be 31? ; 2 + sta effect_bottom_smc+1 ; 4 - clc ; 2 - adc #32 ; should this be 31? ; 2 - sta effect_bottom_smc+1 ; 4 - ;================ - ; 19 ; 19 - nop - lda $00 ; nop3 + nop ; 2 + lda $00 ; nop3 ; 3 bloop_24: @@ -100,9 +102,16 @@ cloop: cloop_plus_24: jsr delay_12 ; 12 jsr delay_12 ; 12 - jsr delay_12 ; 12 +; 48 + nop ; 2 + nop ; 2 + nop ; 2 + nop ; 2 + nop ; 2 +; 58 inx ; 2 - cpx #192 + cpx #192 ; 2 +; 62 bcs cloop ; 2/3 rts diff --git a/vaporlock/doubledouble/table/table.c b/vaporlock/doubledouble/table/table.c index a82074b3..24199193 100644 --- a/vaporlock/doubledouble/table/table.c +++ b/vaporlock/doubledouble/table/table.c @@ -8,7 +8,9 @@ int main(int argc, char **argv) { for(i=0;i<256;i++) { value=80.0+(sin(i*(2*3.141592653589)/256.0)*78.0); - //printf("%d %d\n",i,value); + /* HACK to avoid jitter */ + if (value>157) value=157; +// fprintf(stderr,"%d %d\n",i,value); putchar(value); }