From 36be00122997abd26d6ac18a47e03b5c3609532e Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Mon, 27 Jul 2020 21:47:28 -0400 Subject: [PATCH] Improve the randN function. Show a different colour on the border when drawing versus updating the game state. --- BuGS/game.s | 6 ++++++ BuGS/random.s | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/BuGS/game.s b/BuGS/game.s index 152b988..294c3c2 100644 --- a/BuGS/game.s +++ b/BuGS/game.s @@ -36,6 +36,12 @@ gameLoop anop jsl drawFlea jsl drawDirtyNonGameTiles + short i,m + lda >BORDER_COLOUR_REGISTER + and #$f1 + sta >BORDER_COLOUR_REGISTER + long i,m + jsl updateScorpion jsl updateSpider jsl updateFlea diff --git a/BuGS/random.s b/BuGS/random.s index 144d063..c8cb5b6 100644 --- a/BuGS/random.s +++ b/BuGS/random.s @@ -88,10 +88,14 @@ randN_ret0 anop randN_doit anop sta upperLimit -randN_retry anop jsl rand0_to_14 +randN_loop anop cmp upperLimit - bge randN_retry + blt randN_done + sec + sbc upperLimit + bra randN_loop +randN_done anop rtl