Skip to content

Commit f34844f

Browse files
authored
Merge pull request #991 from boriel-basic/feat/hmirror_lib
Feat/hmirror lib
2 parents 670c12a + d322fde commit f34844f

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

src/api/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
__doc__ = """Utils module contains many helpers for several task,
2323
like reading files or path management"""
2424

25+
2526
SHELVE_PATH = os.path.join(constants.ZXBASIC_ROOT, "parsetab", "tabs.dbm")
2627
SHELVE = shelve.open(SHELVE_PATH)
2728

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#pragma once
2+
3+
Function fastcall hMirror(number as uByte) as uByte
4+
Asm
5+
;17 bytes and 66 clock cycles
6+
ld b,a ;b=ABCDEFGH
7+
rrca ;a=HABCDEFG
8+
rrca ;a=GHABCDEF
9+
xor b
10+
and %10101010
11+
xor b ;a=GBADCFEH
12+
ld b,a ;b=GBADCFEH
13+
rrca ;a=HGBADCFE
14+
rrca ;a=EHGBADCF
15+
rrca ;a=FEHGBADC
16+
rrca ;a=CFEHGBAD
17+
xor b
18+
and %01100110
19+
xor b ;a=GFEDCBAH
20+
rrca ;a=HGFEDCBA
21+
End Asm
22+
End Function
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#pragma once
2+
3+
#define hMirror(x) \
4+
Asm \
5+
mirror a \
6+
End Asm

tests/functional/test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@
4141
from src.zxbc.args_parser import FileType # noqa
4242
from src.api.utils import open_file # noqa
4343

44-
DEFAULT_TIMEOUT: Final[int] = 3 # Default test timeout in seconds
44+
DEFAULT_TIMEOUT: Final[int] = 10 # Default test timeout in seconds
4545

4646
# global FLAGS
4747
CLOSE_STDERR = False # Whether to show compiler error or not (usually not when doing tests)
4848
PRINT_DIFF = False # Will show diff on test failure
4949
VIM_DIFF = False # Will show visual diff using (g?)vimdiff on test failure
5050
UPDATE: bool = False # True and test will be updated on failure
51-
FOUT = sys.stdout # Output file. By default stdout but can be captured changing this
51+
FOUT = sys.stdout # Output file. By default, stdout but can be captured changing this
5252
TEMP_DIR: str = ""
53-
QUIET = False # True so suppress output (useful for testing)
53+
QUIET = False # True to suppress output (useful for testing)
5454
DEFAULT_STDERR = "/dev/stderr"
5555
STDERR: str = ""
56-
INLINE: bool = True # Set to false to use system Shell
56+
INLINE: bool = True # Set to False to use system Shell
5757
RAISE_EXCEPTIONS = False # True if we want the testing to abort on compiler crashes
5858
TIMEOUT = DEFAULT_TIMEOUT # Max number of seconds a test should last
5959

0 commit comments

Comments
 (0)