From f97f406272afed75f62af27ed0bd503f5850db7e Mon Sep 17 00:00:00 2001 From: chrisly42 Date: Tue, 5 Sep 2023 21:17:11 +0200 Subject: [PATCH] Optimized ping pong some more. --- binaries/raspberry_casket.bin | Bin 5716 -> 5690 bytes src/raspberry_casket.asm | 69 +++++++++++++++------------------- 2 files changed, 30 insertions(+), 39 deletions(-) diff --git a/binaries/raspberry_casket.bin b/binaries/raspberry_casket.bin index 66f9908e71b0f2d8767a8d55742b64f42fad5c2e..3e17934492c5e8524054cb7394d69d7173485275 100644 GIT binary patch delta 209 zcmcbjvrA{fW=5rnTmCa9ZQjB-nT^qIvImDEquk~!4hKdi?q8eNa27H%uGlQctIEWv zx7mf?o{@3K_|{IhFtb delta 235 zcmdm`b46#uW=5NdTmCcFY~I2+nT;`GvImDEqs8Vd4hKdi9+Ay!I18B>4{es?Rb^t- z+U&w_&&YUba*Kc? curr start? - add.w d2,d1 ; place offset at last possible place (loop_end - loop size) - - clr.b pcd_inst_ping_pong_dir_b(a5) ; mark going backwards - bra.s .wave_loop_dir_changed - -.loop_is_moving_backwards - sub.w d2,d1 ; decrement offset in backward direction one step - - move.w wi_loop_start_w(a3),d4 - - move.w d4,d2 - sub.w d1,d2 ; calc how many bytes we are past front - bmi.s .wave_new_loop_pos_fits - -.wave_hit_front_of_loop - move.w d4,d1 - st pcd_inst_ping_pong_dir_b(a5) - .wave_loop_dir_changed + add.w d2,d1 ; fix front of looip + not.b pcd_inst_ping_pong_dir_b(a5) + IFEQ PRETRACKER_FASTER_CODE ; this extra code doesn't seem to be justified tst.w d2 bne.s .wave_new_loop_pos_fits ; perfect fit for last loop - ; partial fit only - subq.w #1,pcd_inst_subloop_wait_w(a5) ; why, oh why? - + subq.w #1,d5 ; why, oh why? + ENDC .wave_new_loop_pos_fits move.w d1,pcd_inst_loop_offset_w(a5) .wave_subloop_wait + move.w d5,pcd_inst_subloop_wait_w(a5) move.w d1,pcd_out_lof_w(a5) moveq.l #0,d1 bra.s .wave_load_sample_offset .wave_has_no_subloop - moveq.l #0,d1 - move.b pcd_wave_offset_b(a5),d1 - beq.s .loop_handling_done - tst.b wi_allow_9xx_b(a3) - beq.s .loop_handling_done + tst.w d1 + beq.s .wave_loop_handling_done ; apply offset from pattern for sample without subloop lsl.w #7,d1 @@ -2049,8 +2041,7 @@ pre_PlayerTick: add.l pv_wave_sample_table(a4,d2.w),d1 move.l d1,pcd_out_ptr_l(a5) - ;move.w #$FFFF,pcd_out_lof_w(a5) ; this is already set to -1, no need to set it again -.loop_handling_done +.wave_loop_handling_done ; ---------------------------------------- ; pitch handling