From 5ef86baf365b9c7e80fdc1df1283937698db37a5 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 4 Apr 2021 03:35:22 -0400 Subject: Inline some array code, 8128 bytes free --- arrayutils.s | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 arrayutils.s (limited to 'arrayutils.s') diff --git a/arrayutils.s b/arrayutils.s new file mode 100644 index 0000000..188ace4 --- /dev/null +++ b/arrayutils.s @@ -0,0 +1,60 @@ +; extern void clear_ships_on_screen(void); + +; optimized bzero() replacement. +; the real bzero() in cc65-2.19 is 129 bytes long. +; it's optimized for speed (has an unrolled loop) and shares +; code with memset(). we can do it in a lot less code here, +; especially since we only need to clear exactly 20 bytes +; located at a known absolute address. + +; in C, we could write: for(i=0; i