; File: Create Description ; Author: Neil Cafferkey ; ======================== ; A script to translate an Atari 2600 game. ; ; $VER: "Create Description" 2.1 (6.9.2001) ; Set constants (set #wrong-rom-msg (cat "This ROM image is the wrong size. Only 2kb and 4kb ROMs are " "supported currently." ) ) (set #askrom-prompt "Please select the game's ROM image:") (set #ask-name-prompt "Please enter the name of the game:" ) (set #ask-name-help @askstring-help) (set #exit-msg "The description files for %s have been created.") ; Ask for the location of the ROM image (set #rom-file (askfile (default "") (prompt #askrom-prompt) (help @askfile-help) ) ) ; Get the size of the ROM image (set #rom-size (getsize #rom-file) ) ; Ask for the name of the game (set #app-name (askstring (prompt #ask-name-prompt) (help #ask-name-help))) (set @app-name #app-name) (set @default-dest (tackon "games" @app-name)) ; Create a directory for the game (makedir @default-dest) ; Check if rom image is wrong size (if (> #rom-size 4096) (abort #wrong-rom-msg) ) ; Copy the ROM image (if (= #rom-size 2048) (run ("Join \"%s\" \"%s\" AS \"%s\"" #rom-file #rom-file (tackon @default-dest "rom") ) ) (copyfiles (source #rom-file) (dest @default-dest) (newname "rom") (help @copyfiles-help) ) ) ; Create the program file (textfile (dest (tackon @default-dest "program")) (append ("\nName:\n\t%s\nMachine:\n\tmachines/Atari2600\nSegments:\n\t%s/segment\nInstructions:\n\n" @app-name @default-dest)) ) ; Create the segment file (textfile (dest (tackon @default-dest "segment")) (append ("\nBase Address:\n\t$1000\nLength:\n\t$1000\nBanks:\n\t%s/bank\n\n" @default-dest)) ) ; Create the bank file (textfile (dest (tackon @default-dest "bank")) (append ("\nMemory Type:\n\t0\nBase Address:\n\t$1000\nLength:\n\t$1000\nData File:\n\t%s/rom\nBank Number:\n\t0\n\n" @default-dest)) ) ; Exit the script (exit (#exit-msg @app-name @default-dest) (quiet)) ; Make sure the standard welcome screen never appears (welcome)