Skip to content

Commit

Permalink
refactory ROM downloads:
Browse files Browse the repository at this point in the history
Remove .sh scripts and download in python
so it's easier to startup under windows.

Explicit download is not needed. All ROMs will be downloaded if needed.

Add "download_roms" to cli to download all and check them.

Add a "boot_dragonpy.cmd" for easy install under windows.

Add unitests for download.
  • Loading branch information
jedie committed Aug 18, 2015
1 parent 5a773a4 commit a401214
Show file tree
Hide file tree
Showing 45 changed files with 755 additions and 461 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.py[cod]
*.rom
/roms/*

*.py[cod]
*~

# C extensions
Expand Down
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# Config file for automatic testing at travis-ci.org

language: python
sudo: false

python:
- "2.7"
- "3.4"
- "pypy"

install:
- "pip install ."
- "pip install coveralls"
- ./download_ROMs.sh
- pip install --upgrade pip
- pip install .
- pip install coveralls

script:
# - python -m unittest discover
- coverage run --source=dragonpy ./setup.py test

after_success:
coveralls
- coveralls

branches:
only:
- master
- stable
- refactory_rom_downloads

notifications:
irc: "irc.freenode.org#pylucid"
63 changes: 16 additions & 47 deletions README.creole
Original file line number Diff line number Diff line change
Expand Up @@ -115,63 +115,30 @@ There are several ways to install the project under windows.
The following is hopeful the easiest one:

* Install Python 3, e.g.: https://www.python.org/downloads/
* Download the {{{DWLOAD Server}}} git snapshot from Github: [[https://github.com/jedie/DragonPy/archive/master.zip|master.zip]]
* Download the {{{DragonPy}}} git snapshot from Github: [[https://github.com/jedie/DragonPy/archive/master.zip|master.zip]]
* Extract the Archive somewhere
* Maybe, adjust paths in {{{boot_dwload_server.cmd}}}
* Run {{{boot_dwload_server.cmd}}}
* Maybe, adjust paths in {{{boot_dragonpy.cmd}}}
* Run {{{boot_dragonpy.cmd}}}
The default {{{boot_dwload_server.cmd}}} will install via {{{Python Package Index}}} (PyPi) into {{{%APPDATA%\DragonPy_env}}}
The default {{{boot_dragonpy.cmd}}} will install via {{{Python Package Index}}} (PyPi) into {{{%APPDATA%\DragonPy_env}}}

There exist a batch file for easy startup the server under Windows:
* [[https://github.com/jedie/DragonPy/blob/master/scripts/start_dwload_server.cmd|/scripts/start_dwload_server.cmd]]
There exist some {{{.cmd}}} batch files for easy startup in {{{%APPDATA%\DragonPy_env\}}}

Copy it into {{{%APPDATA%\DragonPy_env\start_dwload_server.cmd}}} and edit it for your needs.

{{{
# clone the repro:
~$ git clone https://github.com/jedie/DragonPy.git
# Alternative download as .zip: https://github.com/jedie/DragonPy/archive/master.zip
~$ cd DragonPy
== ROMs

# Download all ROM files:
~/DragonPy$ ./download_ROMs.sh
All needed ROM files, will be downloaded automatically.

# Start Dragon 32
~/DragonPy$ python2 DragonPy_CLI.py --machine=Dragon32 run
}}}
The files will be downloaded from:

| Dragon 32 + 64 | http://archive.worldofdragon.org/archive/index.php?dir=Roms/Dragon/
| CoCo 2b | http://mess.oldos.net/
| Multicomp | http://searle.hostei.com/grant/Multicomp/
| Simple6809 | http://searle.hostei.com/grant/6809/Simple6809.html

== ROMs
sbc09 and vectrex ROMs are included.

The Dragon ROMs can be downloaded here:
* http://archive.worldofdragon.org/archive/index.php?dir=Roms/Dragon/
There is a simple shell script to automatic download and extract the Dragon ROMs:
{{{
/home/FooBar/DragonPy_env$ cd src/dragonpy/
/home/FooBar/DragonPy_env/src/dragonpy$ ./download_ROMs.sh
}}}
To verify existing ROMs, just call the script again:
{{{
/home/FooBar/DragonPy_env$ cd src/dragonpy/
/home/FooBar/DragonPy_env/src/dragonpy$ ./download_ROMs.sh
+ cd dragonpy/Dragon32/
+ source download_Dragon32_rom.sh
++ '[' '!' -f d32.rom ']'
++ set -x
++ sha1sum -c d32.rom.sha1
d32.rom: OK
========================================================================
...
d64_ic17.rom: OK
d64_ic18.rom: OK
bas13.rom: OK
extbas11.rom: OK
EXT_BASIC_NO_USING.bin: OK
ExBasROM.bin: OK
}}}
All ROM files and download will be checked by SHA1 value, before use.


== cli example
Expand Down Expand Up @@ -323,6 +290,7 @@ e.g. The Dragon 32 6809 machine with a 14.31818 MHz crystal runs with:

== TODO:

# implement a easy tkinter startup helper
# implement more Dragon 32 periphery
missing 6809 unittests after coverage run:
Expand Down Expand Up @@ -442,6 +410,7 @@ Six is a Python 2 and 3 compatibility library.
== History

* 18.08.2015 - v0.5.0 - ROM files will be downloaded on-the-fly ({{{.sh}}} scripts are removed. So it's easier to use under Windows)
* 26.05.2015 - v0.4.0 - The MC6809 code is out sourced to: https://github.com/6809/MC6809
* 15.12.2014 - v0.3.2 - Use [[http://pygments.org/|Pygments]] syntax highlighter in BASIC editor
* 08.10.2014 - Release as v0.3.1
Expand Down
30 changes: 30 additions & 0 deletions boot_dragonpy.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@echo off

title "%~0"

set python=C:\Python34\python.exe
if NOT exist %python% (
echo ERROR: '%python%' doesn't exists?!?
pause
exit 1
)

set boot_script=boot_dragonpy.py
if NOT exist %boot_script% (
echo ERROR: '%boot_script%' doesn't exists?!?
pause
exit 1
)

set destination=%APPDATA%\DragonPy_env
mkdir %destination%
if NOT exist %destination% (
echo ERROR: '%destination%' doesn't exists?!?
pause
exit 1
)

echo on
%python% %boot_script% --install_type=pypi %destination%
explorer.exe %destination%
@pause
37 changes: 0 additions & 37 deletions download_ROMs.sh

This file was deleted.

29 changes: 29 additions & 0 deletions dragonpy/CoCo/CoCo2b_rom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
DragonPy - 6809 emulator in Python
==================================
:created: 2015 by Jens Diemer - www.jensdiemer.de
:copyleft: 2015 by the DragonPy team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""

from __future__ import print_function, absolute_import

from dragonpy.components.rom import ROMFile, ARCHIVE_EXT_ZIP


class CoCo2b_Basic13_ROM(ROMFile):
ARCHIVE_EXT = ARCHIVE_EXT_ZIP
URL = "http://mess.oldos.net/coco2b.zip"
DOWNLOAD_SHA1 = "059a8461f09f267a3847980c497e61d6c3ce5d9b" # downloaded .zip archive
FILE_COUNT = 2 # How many files are in the archive?
SHA1 = "28b92bebe35fa4f026a084416d6ea3b1552b63d3" # extracted ROM
FILENAME = "bas13.rom"


class CoCo2b_ExtendedBasic11_ROM(CoCo2b_Basic13_ROM):
SHA1 = "ad927fb4f30746d820cb8b860ebb585e7f095dea" # extracted ROM
FILENAME = "extbas11.rom"



1 change: 0 additions & 1 deletion dragonpy/CoCo/bas13.rom.sha1

This file was deleted.

18 changes: 5 additions & 13 deletions dragonpy/CoCo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
================
:created: 2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2014 by the DragonPy team, see AUTHORS for more details.
:copyleft: 2014-2015 by the DragonPy team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""

from __future__ import absolute_import, division, print_function


import logging
import os

from dragonlib.api import CoCoAPI
from dragonpy.CoCo.CoCo2b_rom import CoCo2b_Basic13_ROM, \
CoCo2b_ExtendedBasic11_ROM

from dragonpy.CoCo.mem_info import get_coco_meminfo
from dragonpy.Dragon32.config import Dragon32Cfg
from dragonpy.Dragon32.keyboard_map import get_coco_keymatrix_pia_result
from dragonpy.components.rom import ROMFile
from dragonpy.core.configs import COCO2B


Expand Down Expand Up @@ -59,16 +59,8 @@ class CoCo2bCfg(Dragon32Cfg):
"""
ROM_START = 0x8000
DEFAULT_ROMS = (
ROMFile(address=0x8000, max_size=0x4000,
filepath=os.path.join(os.path.abspath(os.path.dirname(__file__)),
"extbas11.rom"
)
),
ROMFile(address=0xA000, max_size=0x4000,
filepath=os.path.join(os.path.abspath(os.path.dirname(__file__)),
"bas13.rom"
)
),
CoCo2b_ExtendedBasic11_ROM(address=0x8000, max_size=0x4000),
CoCo2b_Basic13_ROM(address=0xA000, max_size=0x4000),
)

def __init__(self, cmd_args):
Expand Down
15 changes: 0 additions & 15 deletions dragonpy/CoCo/download_CoCo2b_roms.sh

This file was deleted.

1 change: 0 additions & 1 deletion dragonpy/CoCo/extbas11.rom.sha1

This file was deleted.

23 changes: 23 additions & 0 deletions dragonpy/Dragon32/Dragon32_rom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
DragonPy - 6809 emulator in Python
==================================
:created: 2015 by Jens Diemer - www.jensdiemer.de
:copyleft: 2015 by the DragonPy team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""

from __future__ import print_function, absolute_import

from dragonpy.components.rom import ROMFile, ARCHIVE_EXT_ZIP


class Dragon32Rom(ROMFile):
ARCHIVE_EXT = ARCHIVE_EXT_ZIP
URL = "http://archive.worldofdragon.org/archive/index.php?dir=Roms/Dragon/\&file=Dragon%20Data%20Ltd%20-%20Dragon%2032%20-%20IC17.zip"
DOWNLOAD_SHA1 = "2cc4cbf81769746d261063eee20719899a001fed" # downloaded .zip archive
FILE_COUNT = 1 # How many files are in the archive?
RENAME_DATA = {"Dragon Data Ltd - Dragon 32 - IC17.ROM": "d32.rom"}
SHA1 = "f2dab125673e653995a83bf6b793e3390ec7f65a" # extracted ROM
FILENAME = "d32.rom"

26 changes: 11 additions & 15 deletions dragonpy/Dragon32/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@
DragonPy - Dragon 32 emulator in Python
=======================================
:created: 2013-2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2013-2014 by the DragonPy team, see AUTHORS for more details.
:created: 2013 by Jens Diemer - www.jensdiemer.de
:copyleft: 2013-2015 by the DragonPy team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""

from __future__ import absolute_import, division, print_function
from dragonlib.utils import six
xrange = six.moves.xrange

import logging
import os

from dragonlib.api import Dragon32API
import logging
from dragonlib.utils import six

log=logging.getLogger(__name__)
xrange = six.moves.xrange

from dragonlib.api import Dragon32API
from dragonpy.Dragon32.keyboard_map import get_dragon_keymatrix_pia_result
from dragonpy.Dragon32.mem_info import get_dragon_meminfo
from dragonpy.components.rom import ROMFile
from dragonpy.core.configs import BaseConfig, DRAGON32
from dragonpy.Dragon32.Dragon32_rom import Dragon32Rom


log=logging.getLogger(__name__)


class Dragon32Cfg(BaseConfig):
Expand Down Expand Up @@ -65,14 +66,9 @@ class Dragon32Cfg(BaseConfig):
FF00-FFFF I/O, machine configuration, reset vectors
"""
DEFAULT_ROMS = (
ROMFile(address=0x8000, max_size=0x4000,
filepath=os.path.join(os.path.abspath(os.path.dirname(__file__)),
"d32.rom"
)
),
Dragon32Rom(address=0x8000, max_size=0x4000),
)


# for unittests init:
STARTUP_END_ADDR = 0xbbe5 # scan keyboard

Expand Down
1 change: 0 additions & 1 deletion dragonpy/Dragon32/d32.rom.sha1

This file was deleted.

15 changes: 0 additions & 15 deletions dragonpy/Dragon32/download_Dragon32_rom.sh

This file was deleted.

Loading

0 comments on commit a401214

Please sign in to comment.