Re: [stella] Poor man's cart dumper

Subject: Re: [stella] Poor man's cart dumper
From: Glenn Saunders <mos6507@xxxxxxxxx>
Date: Sun, 14 Aug 2005 18:27:49 -0400
I downloaded activePerl but that example didn't work
for me.  It just copied the file contents over witout
altering it.  So I wrote this VBScript program that
can run in windows scripting host like this:

CScript cartmaker.vbs [filename input] [filename
output (optional)]

Pass in filenames, no path.  You have to run this in
the same working directory as your hex file.

I tried dumping Oystron to hex and then converting it
over with this and the BIN works fine.  Very cool that
this can be done with just a stock 2600 and a hacked
up cable!


'NAME this cartmaker.vbs

'must have at least one parameter
if WScript.Arguments.Count = 0 then
   WScript.Echo "Usage: CScript cartmaker.vbs
[filename input] [filename output (optional)]"
   WScript.Quit 1
elseif WScript.Arguments.Count < 2 then
	'autogenerate output filename based on base filename
of input
	parsed_filename = split(WScript.Arguments(0),".")
	out_filename = parsed_filename(0) & ".bin"
	'just use the parameter
	out_filename = WScript.Arguments(1)
END if

Dim fso, infile, outfile

Set fso = CreateObject("Scripting.FileSystemObject")

'get current directory
With CreateObject("WScript.Shell") 
  .CurrentDirectory = WScript.ScriptFullName & "\.." 
  currDir = .CurrentDirectory 
End With

Set infile = fso.OpenTextFile(currDir &
WScript.Arguments(0), 1)
hex_string = trim(infile.ReadAll())

'convert each hex byte-pair to binary byte
for each this_hex_byte in split(hex_string," ")
   bin_string = bin_string &

Set outfile = fso.OpenTextFile(currDir & out_filename,
2, True)

Function HexToDec(ByVal sHex)
HexToDec = CINT("&H" & sHex)
End Function

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
Archives (includes files) at
Unsub & more at

Current Thread