From 7a6d5a869417ded6479e51ddda51af4e21a48ede Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Sat, 14 Jun 2025 11:31:32 +0200 Subject: [PATCH 1/2] feat: add hMirror lib --- src/lib/arch/zx48k/stdlib/hmirror.bas | 22 ++++++++++++++++++++++ src/lib/arch/zxnext/stdlib/hmirror.bas | 6 ++++++ 2 files changed, 28 insertions(+) create mode 100644 src/lib/arch/zx48k/stdlib/hmirror.bas create mode 100644 src/lib/arch/zxnext/stdlib/hmirror.bas diff --git a/src/lib/arch/zx48k/stdlib/hmirror.bas b/src/lib/arch/zx48k/stdlib/hmirror.bas new file mode 100644 index 000000000..e4683f643 --- /dev/null +++ b/src/lib/arch/zx48k/stdlib/hmirror.bas @@ -0,0 +1,22 @@ +#pragma once + +Function fastcall hMirror(number as uByte) as uByte + Asm + ;17 bytes and 66 clock cycles + ld b,a ;b=ABCDEFGH + rrca ;a=HABCDEFG + rrca ;a=GHABCDEF + xor b + and %10101010 + xor b ;a=GBADCFEH + ld b,a ;b=GBADCFEH + rrca ;a=HGBADCFE + rrca ;a=EHGBADCF + rrca ;a=FEHGBADC + rrca ;a=CFEHGBAD + xor b + and %01100110 + xor b ;a=GFEDCBAH + rrca ;a=HGFEDCBA + End Asm +End Function diff --git a/src/lib/arch/zxnext/stdlib/hmirror.bas b/src/lib/arch/zxnext/stdlib/hmirror.bas new file mode 100644 index 000000000..6162a6846 --- /dev/null +++ b/src/lib/arch/zxnext/stdlib/hmirror.bas @@ -0,0 +1,6 @@ +#pragma once + +#define hMirror(x) \ + Asm \ + mirror a \ + End Asm From d322fde35a8ad39e0ea1fe2bd9367852269cdea5 Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Sun, 20 Jul 2025 12:07:13 +0200 Subject: [PATCH 2/2] test: increase default TIMEOUT to 10 secs --- src/api/utils.py | 1 + tests/functional/test.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/api/utils.py b/src/api/utils.py index 8fdedfc0a..0a9561cb8 100644 --- a/src/api/utils.py +++ b/src/api/utils.py @@ -22,6 +22,7 @@ __doc__ = """Utils module contains many helpers for several task, like reading files or path management""" + SHELVE_PATH = os.path.join(constants.ZXBASIC_ROOT, "parsetab", "tabs.dbm") SHELVE = shelve.open(SHELVE_PATH) diff --git a/tests/functional/test.py b/tests/functional/test.py index 5c0c89250..086a2ff0b 100755 --- a/tests/functional/test.py +++ b/tests/functional/test.py @@ -41,19 +41,19 @@ from src.zxbc.args_parser import FileType # noqa from src.api.utils import open_file # noqa -DEFAULT_TIMEOUT: Final[int] = 3 # Default test timeout in seconds +DEFAULT_TIMEOUT: Final[int] = 10 # Default test timeout in seconds # global FLAGS CLOSE_STDERR = False # Whether to show compiler error or not (usually not when doing tests) PRINT_DIFF = False # Will show diff on test failure VIM_DIFF = False # Will show visual diff using (g?)vimdiff on test failure UPDATE: bool = False # True and test will be updated on failure -FOUT = sys.stdout # Output file. By default stdout but can be captured changing this +FOUT = sys.stdout # Output file. By default, stdout but can be captured changing this TEMP_DIR: str = "" -QUIET = False # True so suppress output (useful for testing) +QUIET = False # True to suppress output (useful for testing) DEFAULT_STDERR = "/dev/stderr" STDERR: str = "" -INLINE: bool = True # Set to false to use system Shell +INLINE: bool = True # Set to False to use system Shell RAISE_EXCEPTIONS = False # True if we want the testing to abort on compiler crashes TIMEOUT = DEFAULT_TIMEOUT # Max number of seconds a test should last