Sprinter-Core/src/bios/BIOS.asm
2023-06-20 01:27:50 +10:00

144 lines
4.3 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
;---------------------------------------
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 ID_Version
EXPORT ID_SPRINTER.bitstream_ver
EXPORT bitstream_ver_hex
EXPORT Disk_subsystem_ver_hex
EXPORT EXP_ID.VER
EXPORT EXP_ID.MOD
EXPORT ROM_ID.VER
EXPORT ROM_ID.MOD
EXPORT BoardID.start
EXPORT BoardID.end
EXPORT ROM_NUMBER ; !FIXIT part1, part2 ¤«ï Flasher
; LUA ALLPASS
; print ("DEPACKER", sj.get_label("DEPACKER.PackedMAIN"))
; print ("UnPacker", sj.get_label("UnPacker.PackedMAIN"))
; ENDLUA