Last active
September 28, 2018 03:14
-
-
Save pfiscarelli/8cb6f044a251c3cf60bbc261a1bed2f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off & setlocal EnableExtensions EnableDelayedExpansion | |
cls | |
:: Set tool paths here | |
set LWTOOLS_PATH="%USERPROFILE%\Desktop\lwtools" | |
set TOOLSHED_PATH="%USERPROFILE%\Desktop\toolshed" | |
set MAME_PATH="%USERPROFILE%\Desktop\MESS" | |
set VCC_PATH="%USERPROFILE%\Desktop\VCC\VCC.exe" | |
set XROAR_PATH="%USERPROFILE%\Desktop\xroar" | |
set XROAR_COMMAND="%USERPROFILE%\Desktop\xroar\xroar.exe" | |
:: Set environment paths here | |
set DISKETTE_NAME=assembly.dsk | |
set "DISKETTE_PATH=%USERPROFILE%\Desktop\CoCo Disks\" | |
set "CODE_PATH=%USERPROFILE%\Desktop\6809 Assembly Code\" | |
:: Set filename to uppercase - beneficial with Toolshed | |
:: Set line below equal to FALSE if not worried about uppercase only files | |
set uppercase=TRUE | |
:: /// | |
:: /// NO NEED TO EDIT BELOW THIS LINE /// | |
:: /// | |
set filename=%1 | |
if "%uppercase%" NEQ "TRUE" goto :start | |
:toupper | |
for %%L in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do set filename=!filename:%%L=%%L! | |
:: Build paths for scripting | |
:start | |
set assembly_path="%CODE_PATH%%filename%.asm" | |
set binary_path="%CODE_PATH%%filename%.BIN" | |
set disk_path="%DISKETTE_PATH%%DISKETTE_NAME%" | |
:: Echo paths to console | |
echo. | |
echo Compiling: %assembly_path% | |
echo. | |
:: Compile the source code to binary | |
cd %LWTOOLS_PATH% | |
lwasm %assembly_path% --6809 --list --symbols --6800compat --output=%binary_path% --format=decb | |
if %ERRORLEVEL% neq 0 goto:done | |
:: Emulator left blank - exit script | |
if "%2" == "" goto:done | |
:: Copy binary file to disk image | |
echo. | |
echo Writing: %disk_path% | |
cd %TOOLSHED_PATH% | |
decb copy -2 -b %binary_path% -r %disk_path%,%filename%.BIN | |
if %ERRORLEVEL% == 248 (echo The target disk %disk_path% is full) | |
if %ERRORLEVEL% neq 0 goto:done | |
:: Check which platform to test on | |
echo Launching: %binary_path% | |
if "%2" == "vcc" goto:vcc | |
if "%2" == "xroar" goto:xroar | |
:: MAME/MESS executes here as default emulator | |
:: Use: coco,coco2,coco2b,coco3 on command line to select target platform | |
:mess | |
cd %MAME_PATH% | |
messui64.exe %2 %3 -menu -skip_gameinfo -window -flop1 %disk_path% -autoboot_delay 1 -autoboot_command "\nLOADM\"%filename%\":EXEC\n" | |
cd %CODE_PATH% | |
goto:done | |
:: VCC executes here | |
:vcc | |
cd %CODE_PATH% | |
%VCC_PATH% %filename%.bin | |
goto:done | |
:: XRoar executes here | |
:xroar | |
rem cd %XROAR_PATH% | |
rem %XROAR_COMMAND% %CODE_PATH% %filename%.bin | |
:: Change directory back to source path and exit | |
:done | |
cd %CODE_PATH% | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment