From c1f32e8cb34471aab2a6e3b3926bb31e76d6e956 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Sat, 1 Jun 2019 01:45:48 -0400 Subject: [PATCH] optimize the volume table generation code --- pt3_player/pt3_lib.s | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/pt3_player/pt3_lib.s b/pt3_player/pt3_lib.s index 77625158..e3f707f2 100644 --- a/pt3_player/pt3_lib.s +++ b/pt3_player/pt3_lib.s @@ -2282,34 +2282,19 @@ vol_outer: pha ; save HL clc ; add HL,DE - lda z80_l adc z80_e - sta z80_l + sta z80_e lda z80_h adc z80_d - sta z80_h ; carry is important - - lda z80_h ; ex de,hl ; swap - pha - lda z80_l - pha - lda z80_d - sta z80_h - lda z80_e - sta z80_l - pla - sta z80_e - pla - sta z80_d + sta z80_d ; carry is important ; sbc hl,hl + lda #$ff bcs vol_ffs vol_zeros: lda #0 - beq vol_write vol_ffs: - lda #$ff vol_write: sta z80_h sta z80_l