; Platform : Commodore VIC-20
; Script for : VICE emulator (xvic.exe) (tested with v2.1)
; Script version : v2.0.0.0
; Last changed : 2009.02.05
;
;
; Author : Sebastiaan Ebeltjes (aka Phoenix)
;
; NOTES:
;
;
;
;
; ==============================================================================
; You need to implent this block in every script, this changes the workfolder to
; the folder where this script is executed, and loads the 'eccScriptSystem' script.
FileChangeDir(@ScriptDir)
#include "..\eccScriptSystem.au3"
; ==============================================================================
; ------------------------------------------------------------------------------
; BEGIN OF SCRIPT
; ------------------------------------------------------------------------------
; SET additional variables for script
Global $VicIni = $eccEmuEmulatorPath & "vice.ini"
Global $VicCommandline = " "
; Check if the 'Meta-Info ID' field is filled in.
If $eccMetaInfoId = "" Then
; META INFO ID is not present
; Check if 'PrgInfo.exe' exists in the script folder
If FileExists($eccSystemEccFolder & "\ecc-script\vic20\PrgInfo.exe") <> 1 Then
MsgBox(0, $eccSystemName, "PRG Info '" & $eccSystemEccFolder & "\vic20\PrgInfo.exe' not found!")
Exit
EndIf
;First we need to 'catch' the right setting from 'PRGInfo'
; start 'PRGInfo' (using chr34 to put rom in quotes)
Run(@ScriptDir & "\PrgInfo.exe " & chr(34) & $eccFileRomPath & $eccFileRomFile & chr(34))
; wait until 'PRGInfo' is loaded
WinWait("PRGInfo 1.0.2", "", 10)
; Get the text from the PRG info windows and put it in a variable
$prg_info = WinGetText("PRGInfo 1.0.2", "")
; close 'PRGinfo'
WinClose("PRGInfo 1.0.2", "")
; Get the 'cpu settings' string from 'PRGinfo'
For $search_cpu = 1 to StringLen($prg_info)
; Check if string is found
If StringMid($prg_info, $search_cpu, 14) = "--------------" Then
; go 2 bytes further to get the good 'cpu string'
$search_cpu_found = $search_cpu + 16
EndIf
Next
; ROM files
If StringMid($prg_info, $search_cpu_found, 8) = "Vic20 4K" Then $VicCommandline = $VicCommandline & "-memory 3k "
If StringMid($prg_info, $search_cpu_found, 8) = "Vic20 8K" Then $VicCommandline = $VicCommandline & "-memory 8k "
; BASIC files
If StringMid($prg_info, $search_cpu_found, 16) = "Unexpanded Vic20" Then $VicCommandline = $VicCommandline & "-memory none "
If StringMid($prg_info, $search_cpu_found, 13) = "Vic20 with 3K" Then $VicCommandline = $VicCommandline & "-memory 3k "
If StringMid($prg_info, $search_cpu_found, 13) = "Vic20 with 8K" Then $VicCommandline = $VicCommandline & "-memory 8k "
If StringMid($prg_info, $search_cpu_found, 14) = "Vic20 with 16K" Then $VicCommandline = $VicCommandline & "-memory 16k "
If StringMid($prg_info, $search_cpu_found, 14) = "Vic20 with 24K" Then $VicCommandline = $VicCommandline & "-memory 24k "
; Other
If StringMid($prg_info, $search_cpu_found, 26) = "Vic20 With Super Expander" Then $VicCommandline = $VicCommandline & "-memory 8k "
If StringMid($prg_info, $search_cpu_found, 46) = "Vic20 graphics memory (standard 5K) or C64/128" Then $VicCommandline = $VicCommandline & "-memory 8k "
If StringMid($prg_info, $search_cpu_found, 42) = "Commodore64/128 or Vic20 with 3K expansion" Then $VicCommandline = $VicCommandline & "-memory 3k "
; Not supported
If StringMid($prg_info, $search_cpu_found, 13) = "Commodore 128" Then
MsgBox(0, $eccSystemName, "No setting found for 'Commodore 128 (Or expanded Vic20 with altered basic memory address)'")
Exit
EndIf
If StringMid($prg_info, $search_cpu_found, 64) = "Expanded Vic20, saved from manually altered basic memory address" Then
MsgBox(0, $eccSystemName, "No setting found for 'Expanded Vic20, saved from manually altered basic memory address'")
Exit
EndIf
If StringMid($prg_info, $search_cpu_found, 12) = "Commodore 64" Then
MsgBox(0, $eccSystemName, "No setting found for 'Commodore 64 (Or Expanded Vic20, saved from manually altered basic memory address)'")
Exit
Endif
If StringMid($prg_info, $search_cpu_found, 30) = "Cassette buffer or sprite data" Then
MsgBox(0, $eccSystemName, "No setting found for 'Cassette buffer or sprite data'")
Exit
EndIf
If StringMid($prg_info, $search_cpu_found, 16) = "Commodore 64/128" Then
MsgBox(0, $eccSystemName, "No setting found for 'Commodore 64/128'")
Exit
EndIf
Else
; META INFO ID is present
; Get information to run in NTSC or PAL.
If StringInStr($eccMetaInfoId, "[ntsc]") Then $VicCommandline = $VicCommandline & "-ntsc "
If StringInStr($eccMetaInfoId, "[pal]") Then $VicCommandline = $VicCommandline & "-pal "
; Set memorybanks for VIC-20
If StringInStr($eccMetaInfoId, "[unexp]") Then $VicCommandline = $VicCommandline & "-memory none "
If StringInStr($eccMetaInfoId, "[all]") Then $VicCommandline = $VicCommandline & "-memory all "
If StringInStr($eccMetaInfoId, "[3k]") Then $VicCommandline = $VicCommandline & "-memory 3k "
If StringInStr($eccMetaInfoId, "[8k]") Then $VicCommandline = $VicCommandline & "-memory 8k "
If StringInStr($eccMetaInfoId, "[16k]") Then $VicCommandline = $VicCommandline & "-memory 16k "
If StringInStr($eccMetaInfoId, "[24k]") Then $VicCommandline = $VicCommandline & "-memory 24k "
If StringInStr($eccMetaInfoId, "[Custom 3,5]") Then $VicCommandline = $VicCommandline & "-memory 3,5 "
; Settings for catridges (no memory settings needed...?)
If StringInStr($eccMetaInfoId, "[a0]") Then $VicCommandline = $VicCommandline & "-cartA -cart6 "
If StringInStr($eccMetaInfoId, "[b0]") Then $VicCommandline = $VicCommandline & "-cartB "
If StringInStr($eccMetaInfoId, "[20]") Then $VicCommandline = $VicCommandline & "-cart2 "
If StringInStr($eccMetaInfoId, "[40]") Then $VicCommandline = $VicCommandline & "-cart4 "
If StringInStr($eccMetaInfoId, "[60]") Then $VicCommandline = $VicCommandline & "-cart6 "
If StringInStr($eccMetaInfoId, "[test]") Then $VicCommandline = $VicCommandline & "-cart6 E:/eCC/ecc-user/#_AUTO_UNPACKED/vic20/arachnoid.crt "
If StringInStr($eccMetaInfoId, "[neu]") Then $VicCommandline = $VicCommandline & "-cart6 $RomFile "
If StringInStr($eccMetaInfoId, "[cart]") Then $VicCommandline = $VicCommandline & "-cartA -cart6"
; If StringInStr($eccMetaInfoId, "[test2]") Then $VicCommandline = $VicCommandline & "-cartA "
EndIf
; Run the rom
Run($Emulator & " " & $VicCommandline & $RomFile)
; ------------------------------------------------------------------------------
; END OF SCRIPT
; ------------------------------------------------------------------------------
Exit