Skip to content

Commit a53d73f

Browse files
authored
Merge pull request #408 from boriel/feature/standardize-grammar
Add arch directory into src package
2 parents e07457f + d660186 commit a53d73f

504 files changed

Lines changed: 50813 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/arch/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
# vim:ts=4:et:sw=4:
4+
5+
import importlib
6+
7+
8+
__all__ = [
9+
'zx48k',
10+
'zxnext'
11+
]
12+
13+
AVAILABLE_ARCHITECTURES = __all__
14+
target = None
15+
16+
17+
def set_target_arch(target_arch: str):
18+
global target
19+
assert target_arch in AVAILABLE_ARCHITECTURES
20+
target = importlib.import_module(f'.{target_arch}', 'src.arch')
21+
22+
23+
set_target_arch(AVAILABLE_ARCHITECTURES[0])

src/arch/zx48k/__init__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
# vim:ts=4:et:sw=4:
4+
5+
from . import beep
6+
from .translator import * # noqa
7+
8+
import src.api.global_
9+
from src.api.constants import TYPE
10+
11+
12+
__all__ = [
13+
'beep',
14+
]
15+
16+
17+
# -----------------------------------------
18+
# Arch initialization setup
19+
# -----------------------------------------
20+
src.api.global_.PARAM_ALIGN = 2 # Z80 param align
21+
src.api.global_.BOUND_TYPE = TYPE.uinteger
22+
src.api.global_.SIZE_TYPE = TYPE.ubyte
23+
src.api.global_.PTR_TYPE = TYPE.uinteger
24+
src.api.global_.STR_INDEX_TYPE = TYPE.uinteger
25+
src.api.global_.MIN_STRSLICE_IDX = 0 # Min. string slicing position
26+
src.api.global_.MAX_STRSLICE_IDX = 65534 # Max. string slicing position

0 commit comments

Comments
 (0)