Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Just add dummy code for Vectrex
- Loading branch information
Showing
12 changed files
with
579 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# encoding:utf8 | ||
|
||
""" | ||
DragonPy | ||
======== | ||
: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. | ||
""" | ||
|
||
|
||
from dragonlib.utils.logging_utils import log | ||
|
||
|
||
class MOS6522VIA(object): | ||
""" | ||
MOS Technology 6522 Versatile Interface Adapter (VIA) | ||
https://en.wikipedia.org/wiki/MOS_Technology_6522 | ||
$D000 - $D7FF 6522 interface adapter | ||
$D800 - $DFFF 6522 / RAM ?!? | ||
""" | ||
def __init__(self, cfg, memory): | ||
self.cfg = cfg | ||
self.memory = memory | ||
|
||
self.memory.add_read_byte_callback( | ||
callback_func=self.read_byte, | ||
start_addr=0xd000, | ||
end_addr=0xdfff | ||
) | ||
|
||
self.memory.add_write_byte_callback( | ||
callback_func=self.write_byte, | ||
start_addr=0xd000, | ||
end_addr=0xdfff | ||
) | ||
|
||
def read_byte(self, cpu_cycles, op_address, address): | ||
log.error("%04x| TODO: 6522 read byte from $%04x - Send 0x00 back", op_address, address) | ||
return 0x00 | ||
|
||
def write_byte(self, cpu_cycles, op_address, address, value): | ||
log.error("%04x| TODO: 6522 write $%02x to $%04x", op_address, value, address) |
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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() |
Oops, something went wrong.