double: got rid of bottom line jitter

was trouble in the sine table
This commit is contained in:
Vince Weaver 2023-05-15 16:39:07 -04:00
parent cb4cec284f
commit a9a053b295
4 changed files with 34 additions and 21 deletions

View File

@ -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 \

View File

@ -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"

View File

@ -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

View File

@ -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);
}