-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.py
88 lines (67 loc) · 2.2 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# coding: utf-8
"""
DragonPy - Vectrex
==================
https://en.wikipedia.org/wiki/Vectrex
:created: 2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2014 by the DragonPy team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""
import logging
import os
# from dragonlib.api import VectrexAPI
from dragonlib.utils.logging_utils import log
from dragonpy.core.configs import BaseConfig, VECTREX
from dragonpy.components.rom import ROMFile
from dragonpy.vectrex.mem_info import VectrexMemInfo
class VectrexCfg(BaseConfig):
"""
http://www.playvectrex.com/designit/chrissalo/toc.htm
$0000 - $7FFF Cartridge ROM
$8000 - $C7FF Unmapped space
$C800 - $CFFF RAM
$D000 - $D7FF 6522 interface adapter
$D800 - $DFFF 6522 / RAM ?!?
$E000 - $EFFF ROM - builtin Mine storm game
$F000 - $FFFF ROM - vectrex BIOS Executive
"""
CONFIG_NAME = VECTREX
MACHINE_NAME = "Vectrex"
RAM_START = 0xC800
RAM_END = 0xCFFF
ROM_START = 0xE000
ROM_END = 0xFFFF
ROM_SIZE = 0x2000
DEFAULT_ROMS = (
ROMFile(address=0xE000, # max_size=0x4000,
filepath=os.path.join(os.path.abspath(os.path.dirname(__file__)),
"SYSTEM.IMG"
)
),
)
# for unittests init:
# STARTUP_END_ADDR = 0xbbe5 # scan keyboard
def __init__(self, cmd_args):
self.ROM_SIZE = (self.ROM_END - self.ROM_START) + 1
self.RAM_SIZE = (self.RAM_END - self.RAM_START) + 1
super(VectrexCfg, self).__init__(cmd_args)
self.machine_api = None# VectrexAPI()
self.periphery_class = None# VectrexPeriphery
# TODO:
# http://www.playvectrex.com/designit/chrissalo/appendixa.htm#Other
if self.verbosity <= logging.ERROR:
self.mem_info = VectrexMemInfo(log.debug)
config = VectrexCfg
def test_run():
import sys
import os
import subprocess
cmd_args = [
sys.executable,
os.path.join("..", "DragonPy_CLI.py"),
"--machine", "Vectrex", "run",
]
print "Startup CLI with: %s" % " ".join(cmd_args[1:])
subprocess.Popen(cmd_args, cwd="..").wait()
if __name__ == "__main__":
test_run()