Sprinter-Core/src/bios/BIOS.asm
2025-06-25 22:37:38 +10:00

168 lines
5.0 KiB
NASM
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;
;----------------[TO DO]----------------
; DEFINE path to rom, exp, build, etc.
; DEFINE path to including files for rom, exp, loader, etc...
; ...
;---------------------------------------
;=======================================
; DEFDEVICE SPRINTER, #4000, 256
DEVICE SPRINTER
; ENCODING "DOS"
;=======================================
;------------[LUA functions]------------;
includelua 'Shared_includes/lua/Functions.lua'
;---------------------------------------;
;-----------[Shared Includes]-----------
INCLUDE 'src/bios/shared/includes.inc' ; Includes
;---------------------------------------
LUA PASS1
local date, month, year = Get_date_RU(sj.get_define("__DATE__"))
BuildDate = "'" .. date .. "." .. month .. "." .. year .. "'"
BuildYear = "'" .. year .. "'"
sj.insert_define("BUILD_DATE", BuildDate)
sj.insert_define("BUILD_YEAR", BuildYear)
ENDLUA
LUA ALLPASS
sj.insert_define("BUILD_DATE", BuildDate)
sj.insert_define("BUILD_YEAR", BuildYear)
ENDLUA
IF PACKED_MAIN
;------------[MAIN prebuild]------------;
LUA PASS1
-- ­ áâà ¨¢ ¥¬ ¯ãâì ¤® 㯠ª®¢é¨ª 
detected_os = Detect_os()
print ("OS detected:", detected_os)
print ()
if detected_os == "Windows" then
pack_prog = "src\\bin\\hrust.exe Build\\Bin\\temp\\MAIN.PAK Build\\Bin\\temp\\MAIN.BIN"
elseif detected_os == "MacOS" then
pack_prog = "src/bin/mhmt -hst -zxh Build/Bin/temp/MAIN.BIN Build/Bin/temp/MAIN.PAK"
elseif detected_os == "Linux" then
pack_prog = "src/bin/mhmt -hst -zxh Build/Bin/temp/MAIN.BIN Build/Bin/temp/MAIN.PAK"
end
-- ª®¬¯¨«ïæ¨ï ¤«ï ¯®«ã祭¨ï ᦠ⮣® ä ©«  MAIN ¨ 宫®á⮩ ¯à®å®¤ Set_Pictures.asm
if (os.execute("sjasmplus -DPREBUILD=1 -Wall --msg=war --nologo --syntax=w --fullpath --lst=Build/Prebuilds.LST SRC/BIOS/ROM/SETUP/MAIN.ASM")) then
print("--[ MAIN.ASM Prebuild DONE ]--")
if (os.execute(pack_prog)) then
print("--[ Hrusting MAIN.BIN DONE ]--")
print(" ")
else
print("--[ Hrusting MAIN.BIN ERROR!!! ]--")
os.exit(1)
end
else
print("--[ MAIN.ASM Prebuild ERROR!!! ]--")
os.exit(1)
end
ENDLUA
;---------------------------------------;
ENDIF
IF PACKED_MAIN
;----------[MAIN's referenses]----------; Š®¬¯¨«ïæ¨ï ¤«ï ¯®«ã祭¨ï  ¤à¥á®¢ ¬¥â®ª ¨ ¯à®æ¥¤ãà
MMU 2 e, 18 ; áâà ­¨æ  18 ¢ ¡ ­ªã 2 ¨ ¯à®¢¥àª  ­  £à ­¨æë.
ORG COMPILE_ADDR.MAIN
INCLUDE 'src/bios/ROM/SETUP/MAIN.asm'
;---------------------------------------
ENDIF
; Building page 8 of Sprinter ROM
;-----------------[EXP]-----------------
MMU 0 e, 8 ; áâà ­¨æ  8 ¢ ¡ ­ªã 0 ¨ ¯à®¢¥àª  ­  £à ­¨æë
ORG COMPILE_ADDR.EXP
DEFINE+ IsInBIOS 1
OUTPUT 'Build/Bin/EXP.BIN'
ShowInfo 'EXP block Start', 0 ; !!!!! test
INCLUDE 'src/bios/EXP/EXP.asm'
ShowInfo 'EXP block End', 0 ; !!!!! test
OUTEND
;---------------------------------------
; Building page 0 of Sprinter ROM
;-----------------[ROM]-----------------
MMU 0 e, 0 ; áâà ­¨æ  0 ¢ ¡ ­ªã 0 ¨ ¯à®¢¥àª  ­  £à ­¨æë.
ORG ROM_MAP.ROM
DEFINE+ IsInBIOS 0
OUTPUT 'Build/Bin/ROM.BIN'
ShowInfo 'ROM block Start', 0 ; !!!!! test
INCLUDE 'src/bios/ROM/ROM.asm'
ShowInfo 'ROM block End', 0 ; !!!!! test
OUTEND
UNDEFINE IsInBIOS
;---------------------------------------
;
; Building page 12 of Sprinter ROM
;------[Loader with bitstream K30]------
MMU 0 3, 12 ; áâà ­¨æë 12-15 ¢ ¡ ­ª¨ 0-3.
ORG ROM_MAP.LOADER
OUTPUT 'Build/Bin/LOADER_K30.BIN'
Conf_loader K30
BLOCK #10000-$,#FF
OUTEND
;---------------------------------------
; Building page 22 of Sprinter ROM
;------[Loader with bitstream K50]------
MMU 0 3, 22 ; áâà ­¨æë 22-25 ¢ ¡ ­ª¨ 0-3.
ORG ROM_MAP.LOADER
OUTPUT 'Build/Bin/LOADER_K50.BIN'
;!TODO ᤥ« âì 㯠ª®¢é¨ª ¡¨âáâਬ  âãâ ­  LUA
Conf_loader K50
BLOCK #10000-$,#FF
OUTEND
;---------------------------------------
;
; Building page 1 of Sprinter ROM
;-----------------[LOGO]-----------------
MMU 1 e, 1 ; áâà ­¨æ  1 ¢ ¡ ­ªã 1 ¨ ¯à®¢¥àª  ­  £à ­¨æë.
ORG ROM_MAP.LOGO
OUTPUT 'Build/Bin/LOGO.BIN'
INCLUDE 'src/bios/logo/Set_Pictures.asm'
OUTEND
;---------------------------------------
;
;EXPORT ROM_NUMBER ; !FIXIT part1, part2 ¤«ï Flasher
EXPORT BOARD_INFO.number
EXPORT BOARD_INFO.type
EXPORT BoardID.start
EXPORT BoardID.end
EXPORT FN_CRIPT.cnf
EXPORT ID_SPRINTER.bitstream_ver
EXPORT bitstream_ver_hex
;EXPORT ID_Version
;EXPORT ID_SPRINTER.BIOS_ver
;EXPORT BIOS_ver_hex
;EXPORT Disk_subsystem_ver_hex
EXPORT EXP_ID.VER ; ‚¥àá¨ï ¡¨®á 
EXPORT EXP_ID.MOD
;EXPORT ROM_ID.VER ; ‚¥àá¨ï ¤¨áª®¢®© ¯®¤á¨á⥬ë
;EXPORT ROM_ID.MOD
EXPORT CNF_ID.VER ; ‚¥àá¨ï ª®­äë
EXPORT CNF_ID.MOD
EXPORT msgStrings.str_ACEX_MODEL
EXPORT msgRusStrings.str_ACEX_MODEL
EXPORT BETA_BUILD
EXPORT BETA_RC
EXPORT RELEASEhotFIX
; LUA ALLPASS
; print ("DEPACKER", sj.get_label("DEPACKER.PackedMAIN"))
; print ("UnPacker", sj.get_label("UnPacker.PackedMAIN"))
; ENDLUA