Difference between revisions of "Batch to JS conversion guide"

From MSX Game Library

Line 22: Line 22:
  
 
=== Example ===
 
=== Example ===
{|
 
|-
 
  
 +
<table><tr style="vertical-align:top;"><td>
 +
Batch version:
 
‎<syntaxhighlight lang="batch">
 
‎<syntaxhighlight lang="batch">
 
:: ____________________________
 
:: ____________________________
:: ██▀▀█▀▀██▀▀▀▀▀▀▀█▀▀█        │  ▄▄▄                ▄▄    
+
:: ██▀▀█▀▀██▀▀▀▀▀▀▀█▀▀█        │  ▄▄▄                ▄▄
 
:: ██  ▀  █▄  ▀██▄ ▀ ▄█ ▄▀▀ █  │  ▀█▄  ▄▀██ ▄█▄█ ██▀▄ ██  ▄███
 
:: ██  ▀  █▄  ▀██▄ ▀ ▄█ ▄▀▀ █  │  ▀█▄  ▄▀██ ▄█▄█ ██▀▄ ██  ▄███
 
:: █  █ █  ▀▀  ▄█  █  █ ▀▄█ █▄ │  ▄▄█▀ ▀▄██ ██ █ ██▀  ▀█▄ ▀█▄▄
 
:: █  █ █  ▀▀  ▄█  █  █ ▀▄█ █▄ │  ▄▄█▀ ▀▄██ ██ █ ██▀  ▀█▄ ▀█▄▄
Line 39: Line 39:
 
::─────────────────────────────────────────────────────────────────────────────
 
::─────────────────────────────────────────────────────────────────────────────
 
call ..\default_config.cmd %0
 
call ..\default_config.cmd %0
 +
 +
::*****************************************************************************
 +
:: TOOLS SETTINGS
 +
::*****************************************************************************
 +
 +
set Emulator=%ToolsDir%\OpenMSX\openmsx.exe
 +
REM set Emulator=%ToolsDir%\Emulicious\Emulicious.exe
 +
REM set Emulator=%ToolsDir%\BlueMSX\blueMSX.exe
 +
REM set Emulator=%ToolsDir%\MEISEI\meisei.exe
 +
REM set Emulator=%ToolsDir%\fMSX\fMSX.exe
 +
REM set Emulator=%ToolsDir%\RuMSX\MSX.exe
 +
REM set Debugger=%ToolsDir%\OpenMSX\Debugger\openmsx-debugger.exe
  
 
::*****************************************************************************
 
::*****************************************************************************
Line 45: Line 57:
  
 
:: Project name (will be use for output filename)
 
:: Project name (will be use for output filename)
set ProjName=template
+
set ProjName=example
 +
 
 
:: Project modules to build (use ProjName if not defined)
 
:: Project modules to build (use ProjName if not defined)
 
set ProjModules=%ProjName%
 
set ProjModules=%ProjName%
 +
 
:: List of modules to link
 
:: List of modules to link
SET LibModules=system,bios,vdp,print,input,memory
+
set LibModules=system,bios,vdp,print,input,memory,game,game_pawn,math,string
  
 
:: MSX machine version:
 
:: MSX machine version:
Line 60: Line 74:
 
:: - 3 MSX 3 (reserved)
 
:: - 3 MSX 3 (reserved)
 
set Machine=1
 
set Machine=1
 +
 
:: Program media target:
 
:: Program media target:
 
:: - BIN .bin BASIC binary program (8000h~)
 
:: - BIN .bin BASIC binary program (8000h~)
Line 79: Line 94:
 
:: - DOS2_ARG .com [WIP] MSX-DOS 2 program (using command line arguments ; 0100h~) No direct acces to Main-ROM.  
 
:: - DOS2_ARG .com [WIP] MSX-DOS 2 program (using command line arguments ; 0100h~) No direct acces to Main-ROM.  
 
set Target=ROM_32K
 
set Target=ROM_32K
 +
 
:: ROM mapper size (from 64 to 4096). Must be a multiple of 8 or 16 depending on the mapper type
 
:: ROM mapper size (from 64 to 4096). Must be a multiple of 8 or 16 depending on the mapper type
 
set ROMSize=
 
set ROMSize=
  
:: Install BDOS driver for ROM program? (0=false, 1=true)
+
:: Postpone the ROM startup to let the other ROMs initialize (BDOS for example) (0=false, 1=true)
 
REM set ROMDelayBoot=0
 
REM set ROMDelayBoot=0
 +
 
:: Set RAM in slot 0 and install ISR there (0=false, 1=true)
 
:: Set RAM in slot 0 and install ISR there (0=false, 1=true)
 
REM set InstallRAMISR=0
 
REM set InstallRAMISR=0
:: Type of custom ISR (for RAM or ROM)
+
 
:: - VBLANK V-blank handler
 
:: - VHBLANK V-blank and h-blank handler (V9938 or V9958)
 
:: - V9990 v-blank, h-blank and command end handler (V9990)
 
REM set CustomISR=VBLANK
 
 
:: Use banked call and trampoline functions (0=false, 1=true)
 
:: Use banked call and trampoline functions (0=false, 1=true)
 
REM set BankedCall=0
 
REM set BankedCall=0
 +
 
:: Overwrite RAM starting address (e.g. 0xE0000 for 8K RAM machine)
 
:: Overwrite RAM starting address (e.g. 0xE0000 for 8K RAM machine)
 
REM set ForceRamAddr=
 
REM set ForceRamAddr=
 +
 
:: Data to copy to disk (comma separated list)
 
:: Data to copy to disk (comma separated list)
 
REM set DiskFiles=
 
REM set DiskFiles=
 +
 +
:: Add application signature to binary data (0=false, 1=true)
 +
set AppSignature=1
 +
 +
:: Application company
 +
set AppCompany="PP"
 +
 +
:: Application ID (0~65535)
 +
set AppID="EX"
  
 
::*******************************************************************************
 
::*******************************************************************************
Line 104: Line 128:
 
:: Use static MSXgl library (0=false, 1=true)
 
:: Use static MSXgl library (0=false, 1=true)
 
REM set BuildLibrary=0
 
REM set BuildLibrary=0
 +
 
:: Set debug flag (0=false, 1=true)
 
:: Set debug flag (0=false, 1=true)
REM set Debug=0
+
set Debug=1
 +
 
 
:: Assembler code optimizer
 
:: Assembler code optimizer
 
:: - None
 
:: - None
Line 111: Line 137:
 
:: - MDL MDL z80 otpimizer
 
:: - MDL MDL z80 otpimizer
 
REM set AsmOptim=None
 
REM set AsmOptim=None
 +
 
:: Optim:
 
:: Optim:
 
:: - Default
 
:: - Default
Line 116: Line 143:
 
:: - Size
 
:: - Size
 
REM set Optim=Speed
 
REM set Optim=Speed
 +
 
:: Additionnal compilation flag
 
:: Additionnal compilation flag
 
REM set CompileOpt=
 
REM set CompileOpt=
 +
 
:: Skip file if compile data is newer than the (0=false, 1=true)
 
:: Skip file if compile data is newer than the (0=false, 1=true)
REM set CompileSkipOld=0
+
set CompileSkipOld=0
 +
 
 
:: Compile verbose mode (0=false, 1=true)
 
:: Compile verbose mode (0=false, 1=true)
 
REM set Verbose=0
 
REM set Verbose=0
 +
 +
:: Update build version header file
 +
set BuildVersion=1
  
 
::*******************************************************************************
 
::*******************************************************************************
Line 128: Line 161:
  
 
:: Emulator options: 0 or 1
 
:: Emulator options: 0 or 1
REM set EmulMachine=1
+
set EmulMachine=0
 
REM set Emul60Hz=0
 
REM set Emul60Hz=0
 
REM set EmulFullScreen=0
 
REM set EmulFullScreen=0
 
REM set EmulMute=0
 
REM set EmulMute=0
REM set EmulDebug=0
+
set EmulDebug=1
 +
:: Emulator extensions: 0 or 1
 
REM set EmulSCC=0
 
REM set EmulSCC=0
 
REM set EmulMSXMusic=0
 
REM set EmulMSXMusic=0
 
REM set EmulMSXAudio=0
 
REM set EmulMSXAudio=0
 +
REM set EmulPSG2=0
 +
REM set EmulV9990=0
 +
:: Emulator port: joystick, mouse, keyboard (fake joystick)
 +
REM set EmulPortA=
 +
REM set EmulPortB=
 
:: Emulator extra parameters to be add to command-line (emulator sotfware specific)
 
:: Emulator extra parameters to be add to command-line (emulator sotfware specific)
 
REM set EmulExtraParam=
 
REM set EmulExtraParam=
Line 148: Line 187:
 
set DoPackage=1
 
set DoPackage=1
 
set DoDeploy=1
 
set DoDeploy=1
set DoRun=0
+
set DoRun=1
  
 
::*****************************************************************************
 
::*****************************************************************************
Line 155: Line 194:
 
call %LibDir%\script\build.cmd
 
call %LibDir%\script\build.cmd
 
‎</syntaxhighlight>
 
‎</syntaxhighlight>
 +
</td><td>
 +
JS version:
 +
‎<syntaxhighlight lang="js">
 +
// ____________________________
 +
// ██▀▀█▀▀██▀▀▀▀▀▀▀█▀▀█        │  ▄▄▄                ▄▄
 +
// ██  ▀  █▄  ▀██▄ ▀ ▄█ ▄▀▀ █  │  ▀█▄  ▄▀██ ▄█▄█ ██▀▄ ██  ▄███
 +
// █  █ █  ▀▀  ▄█  █  █ ▀▄█ █▄ │  ▄▄█▀ ▀▄██ ██ █ ██▀  ▀█▄ ▀█▄▄
 +
// ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀────────┘                ▀▀
 +
//  by Guillaume 'Aoineko' Blanchard under CC BY-SA license
 +
//─────────────────────────────────────────────────────────────────────────────
 +
 +
//*****************************************************************************
 +
// TOOLS SETTINGS
 +
//*****************************************************************************
 +
 +
Emulator = `${ToolsDir}OpenMSX/openmsx.exe`;
 +
// Emulator = `${ToolsDir}Emulicious/Emulicious.exe`;
 +
// Emulator = `${ToolsDir}BlueMSX/blueMSX.exe`;
 +
// Emulator = `${ToolsDir}MEISEI/meisei.exe`;
 +
// Emulator = `${ToolsDir}fMSX/fMSX.exe`;
 +
// Emulator = `${ToolsDir}RuMSX/MSX.exe`;
 +
// Debugger = `${ToolsDir}OpenMSX/Debugger/openmsx-debugger.exe`;
 +
 +
//*****************************************************************************
 +
// PROJECT SETTINGS
 +
//*****************************************************************************
 +
 +
// Project name (will be use for output filename)
 +
ProjName = "example";
 +
 +
// Project modules to build (use ProjName if not defined)
 +
ProjModules = [ ProjName ];
 +
 +
// List of modules to link
 +
LibModules = [ "system", "bios", "vdp", "print" ,"input" ,"memory" ,"game" ,"game_pawn" ,"math" ,"string" ];
 +
 +
// MSX machine version:
 +
// - 1 MSX 1
 +
// - 2 MSX 2
 +
// - 12 MSX 1 or 2 (dual support)
 +
// - 2K Korean MSX 2 (SC9 support)
 +
// - 2P MSX 2+
 +
// - TR MSX Turbo-R
 +
// - 3 MSX 3 (reserved)
 +
Machine = "1";
 +
 +
// Program media target:
 +
// - BIN .bin BASIC binary program (8000h~)
 +
// - ROM_8K .rom 8KB ROM in page 1 (4000h ~ 5FFFh)
 +
// - ROM_8K_P2 .rom 8KB ROM in page 2 (8000h ~ 9FFFh)
 +
// - ROM_16K .rom 16KB ROM in page 1 (4000h ~ 7FFFh)
 +
// - ROM_16K_P2 .rom 16KB ROM in page 2 (8000h ~ BFFFh)
 +
// - ROM_32K .rom 32KB ROM in page 1-2 (4000h ~ BFFFh)
 +
// - ROM_48K .rom 48KB ROM in page 0-2 (0000h ~ BFFFh). Pages 1-2 visible at start
 +
// - ROM_48K_ISR .rom 48KB ROM in page 0-2 (0000h ~ BFFFh). Pages 0-2 visible at start
 +
// - ROM_64K .rom 64KB ROM in page 0-3 (0000h ~ FFFFh). Pages 1-2 visible at start
 +
// - ROM_64K_ISR .rom 64KB ROM in page 0-3 (0000h ~ FFFFh). Pages 0-2 visible at start
 +
// - ROM_ASCII8 .rom 128KB ROM using ASCII-8 mapper
 +
// - ROM_ASCII16 .rom 128KB ROM using ASCII-16 mapper
 +
// - ROM_KONAMI .rom 128KB ROM using Konami mapper (8KB segments)
 +
// - ROM_KONAMI_SCC .rom 128KB ROM using Konami SCC mapper (8KB segments)
 +
// - DOS1 .com MSX-DOS 1 program (0100h~) No direct acces to Main-ROM
 +
// - DOS2 .com MSX-DOS 2 program (0100h~) No direct acces to Main-ROM
 +
// - DOS2_ARG .com [WIP] MSX-DOS 2 program (using command line arguments ; 0100h~) No direct acces to Main-ROM.
 +
Target = "ROM_32K";
 +
 +
// ROM mapper size (from 64 to 4096). Must be a multiple of 8 or 16 depending on the mapper type
 +
// ROMSize =
 +
 +
// Postpone the ROM startup to let the other ROMs initialize (BDOS for example) (0 = false, 1 = true)
 +
// ROMDelayBoot = 0
 +
 +
// RAM in slot 0 and install ISR there (0 = false, 1 = true)
 +
// InstallRAMISR = 0
 +
 +
// Use banked call and trampoline functions (0 = false, 1 = true)
 +
// BankedCall = 0
 +
 +
// Overwrite RAM starting address (e.g. 0xE0000 for 8K RAM machine)
 +
// ForceRamAddr =
 +
 +
// Data to copy to disk (comma separated list)
 +
// DiskFiles =
 +
 +
// Add application signature to binary data (0 = false, 1 = true)
 +
AppSignature = true;
 +
 +
// Application company
 +
AppCompany = "PP";
 +
 +
// Application ID (0~65535)
 +
AppID = "EX";
 +
 +
//*******************************************************************************
 +
// MAKE SETTINGS
 +
//*******************************************************************************
 +
 +
// Use static MSXgl library (0 = false, 1 = true)
 +
// BuildLibrary = false;
  
||
+
// debug flag (0 = false, 1 = true)
 +
// Debug = false;
  
‎<syntaxhighlight lang="js">
+
// Assembler code optimizer
 +
// - None
 +
// - PeepHole SDCC otpimizer
 +
// - MDL MDL z80 otpimizer
 +
// AsmOptim = None
 +
 
 +
// Optim:
 +
// - Default
 +
// - Speed
 +
// - Size
 +
// Optim = Speed
 +
 
 +
// Additionnal compilation flag
 +
// CompileOpt =
 +
 
 +
// Skip file if compile data is newer than the (0 = false, 1 = true)
 +
CompileSkipOld = false;
 +
 
 +
// Compile verbose mode (0 = false, 1 = true)
 +
Verbose = 1
 +
 
 +
// Update build version header file
 +
BuildVersion = true;
 +
 
 +
//*******************************************************************************
 +
// EMULATOR SETINGS
 +
//*******************************************************************************
 +
 
 +
// Emulator options: 0 or 1
 +
EmulMachine = false;
 +
// Emul60Hz = 0
 +
// EmulFullScreen = 0
 +
// EmulMute = 0
 +
EmulDebug = true;
 +
// Emulator extensions: 0 or 1
 +
// EmulSCC = 0
 +
// EmulMSXMusic = 0
 +
// EmulMSXAudio = 0
 +
// EmulPSG2 = 0
 +
// EmulV9990 = 0
 +
// Emulator port: joystick, mouse, keyboard (fake joystick)
 +
// EmulPortA =
 +
// EmulPortB =
 +
// Emulator extra parameters to be add to command-line (emulator sotfware specific)
 +
// EmulExtraParam =
 +
 
 +
//*******************************************************************************
 +
// BUILD STEPS
 +
//*******************************************************************************
 +
 
 +
DoClean  = false;
 +
DoCompile = true;
 +
DoMake    = true;
 +
DoPackage = true;
 +
DoDeploy  = true;
 +
DoRun    = true;
 
‎</syntaxhighlight>
 
‎</syntaxhighlight>
  
|}
+
</td></tr></table>

Revision as of 19:02, 22 December 2022

Historically, MSXGL was designed on Windows PC, for users of this platform. The Build tool was therefore written in Batch language (.bat).

To open the library to users of other platforms (Linux and macOS) and overcome the limitations of the Batch language, the Build tool has been entirely rewritten in Java Script and executed via Node.js. Everything necessary for the execution of these new scripts being packaged with MSXgl on Windows, the user has no other software to install. For Linux, SDCC and Node.js must be installed separately.

This guide is intended for users who have already created an MSXgl project and who would like to convert their project configuration to benefit from the new version of the Build tool (which I strongly recommend).

Convert Batch project to JS

  1. Rename your build.bat to project_config.js (You can duplicate the file if you want to keep the batch file as a backup)
  2. Open project_config.js an start the Batch to JS converion:
    • Convert comment:
      • Replace any '::' by '//'.
      • Replace any 'REM' by '//'.
    • Remove '@echo off', 'call ..\default_config.cmd %0' and the final 'call %LibDir%\script\build.cmd'.
    • Remove all the 'set ' before the parameter name.
    • Convert parameter value depends on the value type:
      • Number: Nothing to do.
      • Boolean: You can keep '0' and '1' value but for a better readability, it is recommended to use the values 'true' and 'false' instead.
      • String: Enclose the value in parenthesis. For example, 'ProjName=template' become 'ProjName = "template"' (space are not mandatory).
      • Array: The array values must be converted according to their type (number, string, ...) but the array itself must be encapsulated with the '[]' characters. For example, 'LibModules=system,bios,vdp' become 'LibModules = [ "system", "bios", "vdp" ]' (space are not mandatory).

Example

Batch version:

:: ____________________________
:: ██▀▀█▀▀██▀▀▀▀▀▀▀█▀▀█        │   ▄▄▄                ▄▄
:: ██  ▀  █▄  ▀██▄ ▀ ▄█ ▄▀▀ █  │  ▀█▄  ▄▀██ ▄█▄█ ██▀▄ ██  ▄███
:: █  █ █  ▀▀  ▄█  █  █ ▀▄█ █▄ │  ▄▄█▀ ▀▄██ ██ █ ██▀  ▀█▄ ▀█▄▄
:: ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀────────┘                 ▀▀
::  by Guillaume 'Aoineko' Blanchard under CC BY-SA license
::─────────────────────────────────────────────────────────────────────────────
@echo off

::─────────────────────────────────────────────────────────────────────────────
:: Build Tool configuration
::─────────────────────────────────────────────────────────────────────────────
call ..\default_config.cmd %0

::*****************************************************************************
:: TOOLS SETTINGS
::*****************************************************************************

set Emulator=%ToolsDir%\OpenMSX\openmsx.exe
REM set Emulator=%ToolsDir%\Emulicious\Emulicious.exe
REM set Emulator=%ToolsDir%\BlueMSX\blueMSX.exe
REM set Emulator=%ToolsDir%\MEISEI\meisei.exe
REM set Emulator=%ToolsDir%\fMSX\fMSX.exe
REM set Emulator=%ToolsDir%\RuMSX\MSX.exe
REM set Debugger=%ToolsDir%\OpenMSX\Debugger\openmsx-debugger.exe

::*****************************************************************************
:: PROJECT SETTINGS
::*****************************************************************************

:: Project name (will be use for output filename)
set ProjName=example

:: Project modules to build (use ProjName if not defined)
set ProjModules=%ProjName%

:: List of modules to link
set LibModules=system,bios,vdp,print,input,memory,game,game_pawn,math,string

:: MSX machine version:
:: - 1		MSX 1
:: - 2		MSX 2
:: - 12		MSX 1 or 2 (dual support)
:: - 2K		Korean MSX 2 (SC9 support)
:: - 2P		MSX 2+
:: - TR		MSX Turbo-R
:: - 3		MSX 3 (reserved)
set Machine=1

:: Program media target:
:: - BIN			.bin	BASIC binary program (8000h~)
:: - ROM_8K			.rom	8KB ROM in page 1 (4000h ~ 5FFFh)
:: - ROM_8K_P2		.rom	8KB ROM in page 2 (8000h ~ 9FFFh)
:: - ROM_16K		.rom	16KB ROM in page 1 (4000h ~ 7FFFh)
:: - ROM_16K_P2		.rom	16KB ROM in page 2 (8000h ~ BFFFh)
:: - ROM_32K		.rom	32KB ROM in page 1-2 (4000h ~ BFFFh)
:: - ROM_48K		.rom	48KB ROM in page 0-2 (0000h ~ BFFFh). Pages 1-2 visible at start
:: - ROM_48K_ISR	.rom	48KB ROM in page 0-2 (0000h ~ BFFFh). Pages 0-2 visible at start
:: - ROM_64K		.rom	64KB ROM in page 0-3 (0000h ~ FFFFh). Pages 1-2 visible at start
:: - ROM_64K_ISR	.rom	64KB ROM in page 0-3 (0000h ~ FFFFh). Pages 0-2 visible at start
:: - ROM_ASCII8		.rom	128KB ROM using ASCII-8 mapper
:: - ROM_ASCII16	.rom	128KB ROM using ASCII-16 mapper
:: - ROM_KONAMI		.rom	128KB ROM using Konami mapper (8KB segments)
:: - ROM_KONAMI_SCC	.rom	128KB ROM using Konami SCC mapper (8KB segments)
:: - DOS1			.com	MSX-DOS 1 program (0100h~) No direct acces to Main-ROM
:: - DOS2			.com	MSX-DOS 2 program (0100h~) No direct acces to Main-ROM
:: - DOS2_ARG		.com	[WIP] MSX-DOS 2 program (using command line arguments ; 0100h~) No direct acces to Main-ROM. 
set Target=ROM_32K

:: ROM mapper size (from 64 to 4096). Must be a multiple of 8 or 16 depending on the mapper type
set ROMSize=

:: Postpone the ROM startup to let the other ROMs initialize (BDOS for example) (0=false, 1=true)
REM set ROMDelayBoot=0

:: Set RAM in slot 0 and install ISR there (0=false, 1=true)
REM set InstallRAMISR=0

:: Use banked call and trampoline functions (0=false, 1=true)
REM set BankedCall=0

:: Overwrite RAM starting address (e.g. 0xE0000 for 8K RAM machine)
REM set ForceRamAddr=

:: Data to copy to disk (comma separated list)
REM set DiskFiles=

:: Add application signature to binary data (0=false, 1=true)
set AppSignature=1

:: Application company
set AppCompany="PP"

:: Application ID (0~65535)
set AppID="EX"

::*******************************************************************************
:: MAKE SETTINGS
::*******************************************************************************

:: Use static MSXgl library (0=false, 1=true)
REM set BuildLibrary=0

:: Set debug flag (0=false, 1=true)
set Debug=1

:: Assembler code optimizer
:: - None
:: - PeepHole	SDCC otpimizer
:: - MDL		MDL z80 otpimizer
REM set AsmOptim=None

:: Optim:
:: - Default
:: - Speed
:: - Size
REM set Optim=Speed

:: Additionnal compilation flag
REM set CompileOpt=

:: Skip file if compile data is newer than the (0=false, 1=true)
set CompileSkipOld=0

:: Compile verbose mode (0=false, 1=true)
REM set Verbose=0

:: Update build version header file
set BuildVersion=1

::*******************************************************************************
:: EMULATOR SETINGS
::*******************************************************************************

:: Emulator options: 0 or 1
set EmulMachine=0
REM set Emul60Hz=0
REM set EmulFullScreen=0
REM set EmulMute=0
set EmulDebug=1
:: Emulator extensions: 0 or 1
REM set EmulSCC=0
REM set EmulMSXMusic=0
REM set EmulMSXAudio=0
REM set EmulPSG2=0
REM set EmulV9990=0
:: Emulator port: joystick, mouse, keyboard (fake joystick)
REM set EmulPortA=
REM set EmulPortB=
:: Emulator extra parameters to be add to command-line (emulator sotfware specific)
REM set EmulExtraParam=

::*******************************************************************************
:: BUILD STEPS
::*******************************************************************************

set DoClean=0
set DoCompile=1
set DoMake=1
set DoPackage=1
set DoDeploy=1
set DoRun=1

::*****************************************************************************
:: START BUILD
::*****************************************************************************
call %LibDir%\script\build.cmd
‎

JS version:

// ____________________________
// ██▀▀█▀▀██▀▀▀▀▀▀▀█▀▀█        │   ▄▄▄                ▄▄
// ██  ▀  █▄  ▀██▄ ▀ ▄█ ▄▀▀ █  │  ▀█▄  ▄▀██ ▄█▄█ ██▀▄ ██  ▄███
// █  █ █  ▀▀  ▄█  █  █ ▀▄█ █▄ │  ▄▄█▀ ▀▄██ ██ █ ██▀  ▀█▄ ▀█▄▄
// ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀────────┘                 ▀▀
//  by Guillaume 'Aoineko' Blanchard under CC BY-SA license
//─────────────────────────────────────────────────────────────────────────────

//*****************************************************************************
// TOOLS SETTINGS
//*****************************************************************************

Emulator = `${ToolsDir}OpenMSX/openmsx.exe`;
// Emulator = `${ToolsDir}Emulicious/Emulicious.exe`;
// Emulator = `${ToolsDir}BlueMSX/blueMSX.exe`;
// Emulator = `${ToolsDir}MEISEI/meisei.exe`;
// Emulator = `${ToolsDir}fMSX/fMSX.exe`;
// Emulator = `${ToolsDir}RuMSX/MSX.exe`;
// Debugger = `${ToolsDir}OpenMSX/Debugger/openmsx-debugger.exe`;

//*****************************************************************************
// PROJECT SETTINGS
//*****************************************************************************

// Project name (will be use for output filename)
ProjName = "example";

// Project modules to build (use ProjName if not defined)
ProjModules = [ ProjName ];

// List of modules to link
LibModules = [ "system", "bios", "vdp", "print" ,"input" ,"memory" ,"game" ,"game_pawn" ,"math" ,"string" ];

// MSX machine version:
// - 1		MSX 1
// - 2		MSX 2
// - 12		MSX 1 or 2 (dual support)
// - 2K		Korean MSX 2 (SC9 support)
// - 2P		MSX 2+
// - TR		MSX Turbo-R
// - 3		MSX 3 (reserved)
Machine = "1";

// Program media target:
// - BIN			.bin	BASIC binary program (8000h~)
// - ROM_8K			.rom	8KB ROM in page 1 (4000h ~ 5FFFh)
// - ROM_8K_P2		.rom	8KB ROM in page 2 (8000h ~ 9FFFh)
// - ROM_16K		.rom	16KB ROM in page 1 (4000h ~ 7FFFh)
// - ROM_16K_P2		.rom	16KB ROM in page 2 (8000h ~ BFFFh)
// - ROM_32K		.rom	32KB ROM in page 1-2 (4000h ~ BFFFh)
// - ROM_48K		.rom	48KB ROM in page 0-2 (0000h ~ BFFFh). Pages 1-2 visible at start
// - ROM_48K_ISR	.rom	48KB ROM in page 0-2 (0000h ~ BFFFh). Pages 0-2 visible at start
// - ROM_64K		.rom	64KB ROM in page 0-3 (0000h ~ FFFFh). Pages 1-2 visible at start
// - ROM_64K_ISR	.rom	64KB ROM in page 0-3 (0000h ~ FFFFh). Pages 0-2 visible at start
// - ROM_ASCII8		.rom	128KB ROM using ASCII-8 mapper
// - ROM_ASCII16	.rom	128KB ROM using ASCII-16 mapper
// - ROM_KONAMI		.rom	128KB ROM using Konami mapper (8KB segments)
// - ROM_KONAMI_SCC	.rom	128KB ROM using Konami SCC mapper (8KB segments)
// - DOS1			.com	MSX-DOS 1 program (0100h~) No direct acces to Main-ROM
// - DOS2			.com	MSX-DOS 2 program (0100h~) No direct acces to Main-ROM
// - DOS2_ARG		.com	[WIP] MSX-DOS 2 program (using command line arguments ; 0100h~) No direct acces to Main-ROM. 
Target = "ROM_32K";

// ROM mapper size (from 64 to 4096). Must be a multiple of 8 or 16 depending on the mapper type
// ROMSize = 

// Postpone the ROM startup to let the other ROMs initialize (BDOS for example) (0 = false, 1 = true)
// ROMDelayBoot = 0

// RAM in slot 0 and install ISR there (0 = false, 1 = true)
// InstallRAMISR = 0

// Use banked call and trampoline functions (0 = false, 1 = true)
// BankedCall = 0

// Overwrite RAM starting address (e.g. 0xE0000 for 8K RAM machine)
// ForceRamAddr = 

// Data to copy to disk (comma separated list)
// DiskFiles = 

// Add application signature to binary data (0 = false, 1 = true)
AppSignature = true;

// Application company
AppCompany = "PP";

// Application ID (0~65535)
AppID = "EX";

//*******************************************************************************
// MAKE SETTINGS
//*******************************************************************************

// Use static MSXgl library (0 = false, 1 = true)
// BuildLibrary = false;

// debug flag (0 = false, 1 = true)
// Debug = false;

// Assembler code optimizer
// - None
// - PeepHole	SDCC otpimizer
// - MDL		MDL z80 otpimizer
// AsmOptim = None

// Optim:
// - Default
// - Speed
// - Size
// Optim = Speed

// Additionnal compilation flag
// CompileOpt = 

// Skip file if compile data is newer than the (0 = false, 1 = true)
CompileSkipOld = false;

// Compile verbose mode (0 = false, 1 = true)
Verbose = 1

// Update build version header file
BuildVersion = true;

//*******************************************************************************
// EMULATOR SETINGS
//*******************************************************************************

// Emulator options: 0 or 1
EmulMachine = false;
// Emul60Hz = 0
// EmulFullScreen = 0
// EmulMute = 0
EmulDebug = true;
// Emulator extensions: 0 or 1
// EmulSCC = 0
// EmulMSXMusic = 0
// EmulMSXAudio = 0
// EmulPSG2 = 0
// EmulV9990 = 0
// Emulator port: joystick, mouse, keyboard (fake joystick)
// EmulPortA = 
// EmulPortB = 
// Emulator extra parameters to be add to command-line (emulator sotfware specific)
// EmulExtraParam = 

//*******************************************************************************
// BUILD STEPS
//*******************************************************************************

DoClean   = false;
DoCompile = true;
DoMake    = true;
DoPackage = true;
DoDeploy  = true;
DoRun     = true;
‎