Skip to content

Commit

Permalink
[Build Tool] Fixed the no new-line in 'version.h' for Linux. Fixed 'S…
Browse files Browse the repository at this point in the history
…ucceed' mistake.

[Game Pawn] Fixed some warning message.
[VDP] Fixed some R#25 value for MSX2/2+ hybrid hardware
[msxtar] Added new boot code for direct launch of disk application (--dos0) + Added build scripts
  • Loading branch information
aoineko-fr committed Jan 15, 2023
1 parent a44668a commit 344d62c
Show file tree
Hide file tree
Showing 20 changed files with 1,506 additions and 1,316 deletions.
14 changes: 7 additions & 7 deletions engine/script/js/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ if (DoCompile)
Version = data.slice(22).toString();
}
Version++;
fs.writeFileSync("./version.h", `#define BUILD_VERSION ${Version}`);
fs.writeFileSync("./version.h", `#define BUILD_VERSION ${Version}\r\n`);

util.print(`New build version: ${Version}`);
}
Expand Down Expand Up @@ -400,7 +400,7 @@ if (DoMake)
util.print(`Lib generation error! Code: ${err}`, PrintError);
process.exit(1);
}
util.print("Succeed", PrintSucced);
util.print("Success", PrintSuccess);
}

//=========================================================================
Expand All @@ -420,7 +420,7 @@ if (DoMake)
util.print(`Link error! Code: ${err}`, PrintError);
process.exit(1);
}
util.print("Succeed", PrintSucced);
util.print("Success", PrintSuccess);
}

//_____________________________________________________________________________
Expand Down Expand Up @@ -449,7 +449,7 @@ if (DoPackage)
util.print(`Package error! Code: ${err}`, PrintError);
process.exit(1);
}
util.print("Succeed", PrintSucced);
util.print("Success", PrintSuccess);
}

//_____________________________________________________________________________
Expand Down Expand Up @@ -568,7 +568,7 @@ if (DoDeploy)
util.print(basTxt, PrintDetail);
util.print("----------------------------------------", PrintDetail);
fs.writeFileSync(`${ProjDir}emul/bin/autoexec.bas`, basTxt);
util.print("Succeed", PrintSucced);
util.print("Success", PrintSuccess);

//---- Generate DSK file ----
if (fs.existsSync(DskTool))
Expand Down Expand Up @@ -645,7 +645,7 @@ if (DoDeploy)
util.print(dosTxt, PrintDetail);
util.print("----------------------------------------", PrintDetail);
fs.writeFileSync(`${ProjDir}emul/dos${DOS}/autoexec.bat`, dosTxt);
util.print("Succeed", PrintSucced);
util.print("Success", PrintSuccess);

//---- Generate DSK file ----
if (fs.existsSync(DskTool))
Expand Down Expand Up @@ -739,7 +739,7 @@ if (DoDeploy)
}
}

util.print("Succeed", PrintSucced);
util.print("Success", PrintSuccess);
}

//_____________________________________________________________________________
Expand Down
4 changes: 2 additions & 2 deletions engine/script/js/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports.compile = function (file, size, seg)
// Generate dependencies list
// err = util.execSync(`${Compiler} -M ${SDCCParam} > ${OutDir}${path.parse(file).name}.dep`);

util.print(`Succeed`, PrintSucced);
util.print(`Success`, PrintSuccess);
}
//*************************************************************************
//* COMPILE ASSEMBLER SOURCE
Expand All @@ -98,7 +98,7 @@ module.exports.compile = function (file, size, seg)
fs.renameSync(`${filePath}${fileName}.lst`, `${OutDir}${fileName}.lst`)
fs.renameSync(`${filePath}${fileName}.sym`, `${OutDir}${fileName}.sym`)

util.print(`Succeed`, PrintSucced);
util.print(`Success`, PrintSuccess);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion engine/script/js/setup_global.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ global.ColorBG = "";
//-- Print flag
global.PrintError = 0;
global.PrintWarning = 1;
global.PrintSucced = 2;
global.PrintSuccess = 2;
global.PrintHighlight = 3;
global.PrintNote = 4;
global.PrintDetail = 5;
Expand Down
2 changes: 1 addition & 1 deletion engine/script/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports.print = function (string, flag = PrintNote)
{
case PrintError: string = ColorRed + "Error: " + string + ColorReset; break;
case PrintWarning: string = ColorYellow + "Warning: " + string + ColorReset; break;
case PrintSucced: string = ColorGreen + string + ColorReset; break;
case PrintSuccess: string = ColorGreen + string + ColorReset; break;
case PrintHighlight: string = ColorBlue + string + ColorReset; break;
case PrintNote: break;
case PrintDetail: string = ColorGray + string + ColorReset; break;
Expand Down
4 changes: 2 additions & 2 deletions engine/src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

// Library version
#define VERSION_MAJOR (u16)0 // 4-bits (0-15)
#define VERSION_MINOR (u16)7 // 6-bits (0-63)
#define VERSION_PATCH (u16)8 // 6-bits (0-63)
#define VERSION_MINOR (u16)8 // 6-bits (0-63)
#define VERSION_PATCH (u16)0 // 6-bits (0-63)
#define VERSION(a, b, c) ((((a) & 0x0F) << 12) | (((b) & 0x3F) << 6) | ((c) & 0x3F))
#define VERSION_CURRENT VERSION(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)

Expand Down
132 changes: 132 additions & 0 deletions engine/src/crt0/bootsector.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
; ____________________________
; ██▀███▀██▀▀▀▀▀▀▀█▀▀█ │ ▄▄ ▄▄ ▄▄
; ██ ▀ █▄ ▀██▄ ▀ ▄█ ▄▀▀ █ │ ██ ▀ ██▄▀ ██▀ █ ██
; █ █ █ ▀▀ ▄█ █ █ ▀▄█ █▄ │ ▀█▄▀ ██ ▀█▄ ▀▄█▀
; ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀────────┘
; by Guillaume 'Aoineko' Blanchard under CC-BY-AS license
;──────────────────────────────────────────────────────────────────────────────
; boot sector for direct boot application
;──────────────────────────────────────────────────────────────────────────────
.module boot

BDOS = 0xF37D
_DIRIO = 0x06
_DIRIN = 0x07
_FOPEN = 0x0F
_SETDTA = 0x1A
_RDBLK = 0x27

.area _HEADER (ABS)
.org 0xC000

header: ; 0xC000
header_jump: ; Jump instruction in machine language 8088 (IBM)
.db 0xEB ; 00
.db 0xFE ; 01
.db 0x90 ; 02
header_label: ; Manufacturer's label and software version
.ascii "BOOTDISK"
; .db 0x4E ; 03 'N'
; .db 0x4D ; 04 'M'
; .db 0x53 ; 05 'S'
; .db 0x20 ; 06 ' '
; .db 0x32 ; 07 '2'
; .db 0x2E ; 08 '.'
; .db 0x30 ; 09 '0'
; .db 0x50 ; 0A 'P'
header_sectorsize: ; Number of bytes per sector
.db 0x00 ; 0B
.db 0x02 ; 0C
header_sectorpercluster: ; Number of sectors per cluster
.db 0x02 ; 0D
header_firstsector: ; Number of the first sector of the FAT
.db 0x01 ; 0E
.db 0x00 ; 0F
header_fatondisk: ; Number of FATs stored on the disk
.db 0x02 ; 10
header_maxdir: ; Maximum size of the Directory in files
.db 0x70 ; 11 'p'
.db 0x00 ; 12
header_totalsector: ; Total number of sectors on the disk
.db 0xA0 ; 13
.db 0x05 ; 14
header_typecode: ; Disc type code
.db 0xF9 ; 15
header_reservedsector: ; Number of sectors reserved for a FAT.
.db 0x03 ; 16
.db 0x00 ; 17
header_sectorpertrack: ; Number of sectors per track
.db 0x09 ; 18 ' '
.db 0x00 ; 19
header_headsnum: ; Number of read/write heads
.db 0x02 ; 1A
.db 0x00 ; 1B
header_logical: ; Logical disk shift in number of sectors
.db 0x00 ; 1C
.db 0x00 ; 1D

boot_start: ; 0xC01E
ret nc
ld sp, #0xF51F ; Set callstack address

ld de, #fcb
ld c, #_FOPEN ; Open file (FCB)
call BDOS ; Open MSXDOS.SYS

inc a
jp z, boot_start ; If open failed
ld de, #0x0100
ld c, #_SETDTA ; Set disk transfer address
call BDOS

ld hl, #0x0001
ld (fcb_record), hl ; Record size

ld hl, #0x3F00 ; Number of records to read (16128 bytes! Max size?)
ld de, #fcb ; Pointer to opened FCB
ld c, #_RDBLK ; Random block read (FCB)
call BDOS

jp 0x0100 ; Execute MSXDOS.SYS

fcb:
.db 0x00 ; 00 Drive number. 0=default drive
fcb_filename:
.ascii "BOOTDISKCOM"
; .db 0x4D ; 01 'M' Filename
; .db 0x53 ; 02 'S'
; .db 0x58 ; 03 'X'
; .db 0x44 ; 04 'D'
; .db 0x4F ; 05 'O'
; .db 0x53 ; 06 'S'
; .db 0x20 ; 07 ' '
; .db 0x20 ; 08 ' '
; .db 0x53 ; 09 'S' Extension
; .db 0x59 ; 0A 'Y'
; .db 0x53 ; 0B 'S'
.db 0x00 ; 0C Extent number (low byte)
.db 0x00 ; 0D File attributes
fcb_record:
.db 0x00 ; 0E Record size (low byte) / Extent number (high byte)
.db 0x00 ; 0F Record size (high byte)
.db 0x00 ; 10 File size (32 bits)
.db 0x00 ; 11
.db 0x00 ; 12
.db 0x00 ; 13
.db 0x00 ; 14 Volume-id (32 bits)
.db 0x00 ; 15
.db 0x00 ; 16
.db 0x00 ; 17
.db 0x00 ; 18 Internal information
.db 0x00 ; 19
.db 0x00 ; 1A
.db 0x00 ; 1B
.db 0x00 ; 1C
.db 0x00 ; 1D
.db 0x00 ; 1E
.db 0x00 ; 1F
.db 0x00 ; 20 Current record within extent
.db 0x00 ; 21 Random record number
.db 0x00 ; 22
.db 0x00 ; 23
.db 0x00 ; 24
Loading

0 comments on commit 344d62c

Please sign in to comment.