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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions src/arch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:ts=4:et:sw=4:

import importlib


__all__ = [
'zx48k',
'zxnext'
]

AVAILABLE_ARCHITECTURES = __all__
target = None


def set_target_arch(target_arch: str):
global target
assert target_arch in AVAILABLE_ARCHITECTURES
target = importlib.import_module(f'.{target_arch}', 'src.arch')


set_target_arch(AVAILABLE_ARCHITECTURES[0])
26 changes: 26 additions & 0 deletions src/arch/zx48k/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:et:sw=4:

from . import beep
from .translator import * # noqa

import src.api.global_
from src.api.constants import TYPE


__all__ = [
'beep',
]


# -----------------------------------------
# Arch initialization setup
# -----------------------------------------
src.api.global_.PARAM_ALIGN = 2 # Z80 param align
src.api.global_.BOUND_TYPE = TYPE.uinteger
src.api.global_.SIZE_TYPE = TYPE.ubyte
src.api.global_.PTR_TYPE = TYPE.uinteger
src.api.global_.STR_INDEX_TYPE = TYPE.uinteger
src.api.global_.MIN_STRSLICE_IDX = 0 # Min. string slicing position
src.api.global_.MAX_STRSLICE_IDX = 65534 # Max. string slicing position
Loading