diff --git a/src/basic/engine_variables/array_create.s b/src/basic/engine_variables/array_create.s index 46026364..d40c1148 100644 --- a/src/basic/engine_variables/array_create.s +++ b/src/basic/engine_variables/array_create.s @@ -46,7 +46,9 @@ array_create_fetch_dims_loop: // Check if the stack has reasonable space free + phx_trash_a jsr check_stack_space + plx_trash_a // Fetch the dimension, increment it by 1, and put it on the stack; // confirmed with original ROM, that it also stores dimensions in the reverse order @@ -172,8 +174,8 @@ array_create_store_loop: array_create_store_dims_done: // Restore FOUR6, calculate number of bytes needed for storage - - pha +.break + pla sta FOUR6 // XXX do we need to store this value in FOUR6? is it still needed? sta __FAC1+3 stx __FAC1+4 // .X is 0 at this point diff --git a/src/basic/math/mul_FAC2_FAC1_8x8.s b/src/basic/math/mul_FAC2_FAC1_8x8.s index aa903e0d..bfc0730c 100644 --- a/src/basic/math/mul_FAC2_FAC1_8x8.s +++ b/src/basic/math/mul_FAC2_FAC1_8x8.s @@ -12,10 +12,16 @@ mul_FAC2_FAC1_8x8: - // Special case (optimization) - handle 0 in INDEX+2 + // Special cases - handle multiplication by 0 + + beq mul_FAC2_FAC1_8x8_zero + sta INDEX+2 + + lda INDEX+3 beq mul_FAC2_FAC1_8x8_zero - sta INDEX+2 + // Multiply INDEX+2 * INDEX+3 + lda #$00 dec INDEX+3 // decrement because we will be adding with carry set for speed (an extra one)