raster_sound: got the mb routine cycle counted

1000 cycles?
This commit is contained in:
Vince Weaver 2019-06-18 22:48:00 -04:00
parent 0a7e5547a4
commit 9e880eef92
3 changed files with 37 additions and 16 deletions

View File

@ -45,7 +45,7 @@ RASTERBARS_SOUND: rasterbars_sound.o
rasterbars_sound.o: rasterbars_sound.s gr_copy.s \
rasterbars_screen.s rasterbars_table.s movement_table.s rb_bg.inc \
pt3_lib_ci.s interrupt_handler.s
pt3_lib_ci.s interrupt_handler.s mockingboard_a.s
ca65 -o rasterbars_sound.o rasterbars_sound.s -l rasterbars_sound.lst

View File

@ -252,7 +252,7 @@ mb4_not_in_this_slot:
;====================================
; cycle counted
; 2 + 13*(28+28+7) + 5
; 2 + 13*(70) + 74 + 5 = 991
mb_write_frame:
@ -267,9 +267,9 @@ mb_write_frame:
mb_write_loop:
;=============================
; not r13 -- 4+5+[ ]+28+28+7
; r13, not ff -- 4+5+ 3 +28+28+7
; r13 is ff -- 4+5+ 4
; not r13 -- 4+5+28+26+7 = 70
; r13, not ff -- 4+5+ 4 +28+26+7 = 74
; r13 is ff -- 4+5+3+1=[61] = 74
lda AY_REGISTERS,X ; load register value ; 4
@ -282,9 +282,25 @@ mb_write_loop:
; -1
cmp #$ff ; 2
beq mb_skip_13 ; 3
bne mb_not_13 ; 3
; -1
; delay 61
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
inc TEMP ; 5
lda TEMP ; 3
jmp mb_skip_13 ; 3
mb_not_13:
@ -308,7 +324,7 @@ mb_not_13:
sty MOCK_6522_ORB1 ; 4
sty MOCK_6522_ORB2 ; 4
;===========
; 28
; 26
mb_no_write:
inx ; point to next register ; 2
cpx #14 ; if 14 we're done ; 2

View File

@ -288,8 +288,9 @@ display_loop:
; -582 -- erase 22+4*(8+6+126) = 582
; -696 -- move+draw 4*(16+26+6+126) = 696
; -10 -- keypress
; -997 -- mockingboard out
;=======
; 3262
; 2265
pad_time:
@ -462,21 +463,19 @@ pad_time:
;============================
jsr pt3_make_frame
jsr mb_write_frame
; jsr pt3_make_frame
jsr mb_write_frame ; 6+921
;============================
; WAIT for VBLANK to finish
;============================
; Try X=5 Y=105 cycles=3256 R6
nop
nop
nop
; Try X=112 Y=4 cycles=2265
ldy #105 ; 2
loop1: ldx #5 ; 2
ldy #4 ; 2
loop1: ldx #112 ; 2
loop2: dex ; 2
bne loop2 ; 2nt/3
dey ; 2
@ -491,6 +490,12 @@ no_keypress:
jmp display_loop ; 3
;========================
; Draw a rasterbar
; unroll as memory is free! haha