Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
22 changes: 22 additions & 0 deletions src/lib/arch/zx48k/stdlib/hmirror.bas
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions src/lib/arch/zxnext/stdlib/hmirror.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

#define hMirror(x) \
Asm \
mirror a \
End Asm
8 changes: 4 additions & 4 deletions tests/functional/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down