From 1efd8ef07e6f74b18965ece2fcddf804798d6e84 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Mon, 7 Oct 2019 19:32:55 +0800 Subject: [PATCH] Add MIT license and some help --- README.md | 7 +++++++ cfmtool.py | 21 +++++++++++++++++++++ ppcasm.py | 25 +++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 99ad375..e2706ed 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,10 @@ These patches depend on the `tbxi` library. Install and use it like this: git clone https://github.com/elliotnunn/tbxi-patches.git tbxi-patches/macmini.py /path/to/MacOSROM -o ~/mac-mini-rom.hqx + + +## Useful scripts + +Included are the simple PowerPC assembler `ppcasm.py` and the Preferred +Executable Format manipulator `cfmtool.py`. Feel free to include them in your +own projects. diff --git a/cfmtool.py b/cfmtool.py index 43b7233..7cc090c 100755 --- a/cfmtool.py +++ b/cfmtool.py @@ -1,5 +1,26 @@ #!/usr/bin/env python3 +# Copyright (c) 2019 Elliot Nunn + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + # This is a single-file library for manipulating Preferred Executable Format files # A command line-interface is available (just call cfmtool.py --help) diff --git a/ppcasm.py b/ppcasm.py index f8c31e9..5bcf72c 100755 --- a/ppcasm.py +++ b/ppcasm.py @@ -1,8 +1,29 @@ #!/usr/bin/env python3 +# Copyright (c) 2019 Elliot Nunn + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + # Dead-simple PowerPC assembler -# Supports instructions and labels, and nothing else! -# Requires Python 3, and nothing else! +# Usable as a library or an executable + import argparse import sys