From ccd27ccbe3e201755b86c1b5f932b2e11ba74110 Mon Sep 17 00:00:00 2001 From: Damian Yerrick Date: Fri, 19 Oct 2018 19:35:25 -0400 Subject: [PATCH] update CHANGES.txt for 0.04 --- .gitignore | 1 + CHANGES.txt | 35 +++++++++++++-------- makefile | 5 +-- obj/nes/index.txt | 2 +- src/texts.txt | 4 +-- tools/zipup.py | 80 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 109 insertions(+), 18 deletions(-) create mode 100755 tools/zipup.py diff --git a/.gitignore b/.gitignore index f279b8d..1971b42 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ __pycache__/ /thwaite.nes /thwaite128.nes /zip.in +/thwaite-*.zip # this is NES homebrew, not DSiWare *.DS_Store diff --git a/CHANGES.txt b/CHANGES.txt index 0276758..a48f2c6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,29 +1,38 @@ -0.04 (2013) -* Expanded to 32 KiB PRG (with 8 KiB reserved for CHR RAM boards) -* Chained certain initialization functions -* Grouped functions into conceptual sections using a call graph -* Fixed failure to initialize missileType for player missiles +0.04 (2018-10-19) +* Chain certain initialization functions +* Group functions into conceptual sections using a call graph +* Use other libraries I've since made (ppuclear, Popslide) +* Pently audio: Rename subroutines to match the latest driver version +* Build a second ROM as NROM-256 (32 KiB PRG ROM + 8 KiB CHR ROM), + with libraries in the top half, in case I build a multicart +* Fix a bunch of uninitialized variables (#5; reported by jroatch) +* Port build tools to Python 3 +* i18n: Move dialogue, tips, copyright screen, and practice menu text + to separate UTF-8 text files +* Compress all text using DTE +* Cut scene draws all 12 buildings and pans across them +* Zipfile: No more zip bombing 0.03 (2011-12-08) -* Fixed crosshair braking failure +* Fix crosshair braking failure * Can play game with a Super NES Mouse in either controller port -* Switched to non-DPCM-safe controller reading code because the mouse +* Switch to non-DPCM-safe controller reading code because the mouse needs it * A button icon blinks after cut scenes dialogue finishes drawing * Practice mode to start on any level -* Draws much of 3x3-tile explosions with sprite flipping to save CHR -* CHR rearranged to allow for more distinct tiles in cut scenes +* Draw 3x3-tile explosions with sprite flipping to save CHR +* Rearrange CHR to allow for more distinct tiles in cut scenes * Music for 05:00 * Two ! alert sounds don't play at the same time * Some later levels are harder * I am within 256 bytes of filling PRG ROM 0.02 (2011-08-26) -* Includes source code, partly under GPLv3 and partly under an +* Publish source code, partly under GPLv3 and partly under an all-permissive license -* Added HTML5 manual -* Added music for 04:00 and daytime -* Dual channel drums for stronger kick and snare +* Add HTML manual +* Add music for 04:00 and daytime +* Audio: Add dual channel drums for stronger kick and snare * Villagers warp to houses after each hour, making it clearer that an hour has passed diff --git a/makefile b/makefile index 38af75b..29e4181 100644 --- a/makefile +++ b/makefile @@ -9,7 +9,7 @@ # This file is offered as-is, without any warranty. # title = thwaite -version = 0.04wip +version = 0.04 objlist = popslide16 \ main random levels smoke bg missiles explosion scurry \ title practice cutscene dtescripts \ @@ -67,12 +67,13 @@ clean: # to docs or tools. $(title)-$(version).zip: \ zip.in $(title).nes $(title)128.nes README.md USAGE.html $(objdir)/index.txt - zip -9 -u $@ -@ < $< + $(PY) tools/zipup.py $< $(title)-$(version) -o $@ # Build zip.in from the list of files in the Git tree zip.in: git ls-files | grep -e "^[^.]" > $@ echo $(title).nes >> $@ + echo $(title)128.nes >> $@ echo zip.in >> $@ # Some unzip tools won't create empty folders, so put a file there. diff --git a/obj/nes/index.txt b/obj/nes/index.txt index 109fef6..fdffb5c 100644 --- a/obj/nes/index.txt +++ b/obj/nes/index.txt @@ -1 +1 @@ -Files produced by build tools go here, but caulk goes where? +Files produced by build tools go here. diff --git a/src/texts.txt b/src/texts.txt index 5caf914..93d3b83 100644 --- a/src/texts.txt +++ b/src/texts.txt @@ -15,7 +15,7 @@ Side: Left Right (Cancel) (Play) == todo_txt == -Thwaite 0.04-wip +Thwaite 0.04 © 2011,2018 Damian YERRICK @@ -33,6 +33,6 @@ To do: * track missiles' spawn IDs for double-kill tracking * github.com/pinobatch - /thwaite.nes/issues + /thwaite-nes/issues Press Start Button diff --git a/tools/zipup.py b/tools/zipup.py new file mode 100755 index 0000000..245cdde --- /dev/null +++ b/tools/zipup.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 +import sys +import os +import argparse +import zipfile +import tarfile + +def make_zipfile(outname, filenames, prefix): + with zipfile.ZipFile(outname, "w", zipfile.ZIP_DEFLATED) as z: + for filename in filenames: + z.write(filename, prefix+filename) + +def make_tarfile(outname, filenames, prefix, mode="w"): + with tarfile.open(outname, "w", zipfile.ZIP_DEFLATED) as z: + for filename in filenames: + z.add(filename, prefix+filename) + +def make_tarfile_gz(outname, filenames, prefix): + return make_tarfile(outname, filenames, prefix, mode="w:gz") + +def make_tarfile_bz2(outname, filenames, foldername): + return make_tarfile(outname, filenames, prefix, mode="w:bz2") + +def make_tarfile_xz(outname, filenames, foldername): + return make_tarfile(outname, filenames, prefix, mode="w:xz") + +formathandlers = [ + (".zip", make_zipfile), + (".tar", make_tarfile), + (".tgz", make_tarfile_gz), + (".tar.gz", make_tarfile_gz), + (".tbz", make_tarfile_bz2), + (".tar.bz2", make_tarfile_bz2), + (".txz", make_tarfile_xz), + (".tar.xz", make_tarfile_xz), +] + +tophelptext = """ +Make a zip or tar archive containing specified files without a tar bomb. +""" +bottomhelptext = """ + +Supported output formats: """+", ".join(x[0] for x in formathandlers) + +def parse_argv(argv): + p = argparse.ArgumentParser( + description=tophelptext, epilog=bottomhelptext + ) + p.add_argument("filelist", + help="name of file containing newline-separated relative " + "paths to files to include, or - for standard input") + p.add_argument("foldername", + help="name of folder in archive (e.g. hello-1.2.5)") + p.add_argument("-o", "--output", + help="path of archive (default: foldername + .zip)") + return p.parse_args(argv[1:]) + +def get_writerfunc(outname): + outbaselower = os.path.basename(outname).lower() + for ext, writerfunc in formathandlers: + if outbaselower.endswith(ext): + return writerfunc + raise KeyError(os.path.splitext(outbaselower)[1]) + +def main(argv=None): + args = parse_argv(argv or sys.argv) + if args.filelist == '-': + filenames = set(sys.stdin) + else: + with open(args.filelist, "r") as infp: + filenames = set(infp) + filenames = set(x.strip() for x in filenames) + filenames = sorted(x for x in filenames if x) + + outname = args.output or args.foldername + ".zip" + writerfunc = get_writerfunc(outname) + writerfunc(outname, filenames, args.foldername+"/") + +if __name__=='__main__': + main()