Sprinter-Core/src/bios/logo/Set_Pictures.asm
2024-07-06 04:33:08 +10:00

200 lines
5.1 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.

;
;------------[LUA functions]------------;
includelua 'Shared_Includes/LUA/Functions.lua'
;---------------------------------------;
LUA PASS1
-- <EFBFBD>஢¥à塞 BMP, ¤®áâ ñ¬ ¨§ ­¥£® ¯ à ¬¥âàë, ०¥¬ ­  ªã᪨
bmp_width, bmp_height, bmp_image_size, bmp_image_offset, bmp_colors = Get_bmp8bit_values (sj.get_define("PICTURE_FILE"))
if bmp_width ~= 128 then sj.error("Invalid BMP width", bmp_width) end
if bmp_height ~= 72 then sj.error("Invalid BMP height", bmp_height) end
if bmp_colors ~= 256 then sj.error("Invalid BMP number of colors", bmp_colors) end
if not File_save(sj.get_define("PICTURE_FILE"), "./Build/Bin/LOGO_PAL.BIN", bmp_image_offset-1024, 1024) then sj.error("Palete save error!") end
if not File_save(sj.get_define("PICTURE_FILE"), "./Build/Bin/LOGO_DAT.BIN", bmp_image_offset, bmp_image_size) then sj.error("Image data save error!") end
ENDLUA
LUA ALLPASS
function make_pic_files (fileName, needPal, needPic)
local fileNameBMP = "'" .. fileName .. ".bmp" .. "'"
local fileNamePAL = fileName .. "_PAL.BIN"
local fileNameDAT = fileName .. "_DAT.BIN"
local bmp_width, bmp_height, bmp_image_size, bmp_image_offset, bmp_colors = Get_bmp8bit_values (fileNameBMP)
if needPal == 1 then
if bmp_width ~= 128 then sj.error(fileNameBMP .. "Invalid BMP width", bmp_width) end
if bmp_height ~= 72 then sj.error(fileNameBMP .. "Invalid BMP height", bmp_height) end
if bmp_colors ~= 256 then sj.error(fileNameBMP .. "Invalid BMP number of colors", bmp_colors) end
if not File_save(fileNameBMP, fileNamePAL, bmp_image_offset-1024, 1024) then
sj.error(fileNameBMP .. "Palete save error!")
end
end
if needPic == 1 then
local correctWidth = ((bmp_width*3)%4)+bmp_width
if correctWidth > bmp_width then
File_save(fileNameBMP, fileNameDAT, bmp_image_offset, bmp_image_size, bmp_width, correctWidth-bmp_width)
else
File_save(fileNameBMP, fileNameDAT, bmp_image_offset, bmp_image_size)
end
end
print("Resolution: " .. bmp_width .. "x" .. bmp_height, fileNameDAT)
end
ENDLUA
MODULE MAIN_LOGO
Pallete:
INCBIN 'Build/Bin/LOGO_PAL.BIN'
.length EQU $-Pallete
Raster:
INCBIN 'Build/Bin/LOGO_DAT.BIN'
.length EQU $-Raster
IF Pashalki
; !TODO ᤥ« âì âãâ â ¡«¨çªã-áá뫪¨ ­  ­ã¦­ãî â ¡«¨æã á¯à ©â®¢ ¨ § ¢ï§ âì íâ® ­  ¤ âë
MACRO _PASHALKI_CODE
IN A,(SLOT3)
EX AF,AF'
LD A,SYS_PAGE
OUT (SLOT3),A
ld e,(RebootDate.month)
SLA e
xor a
ld
EX AF,AF'
OUT (SLOT3),A
ENDM
months_table:
WORD days_table.January
WORD days_table.February
WORD days_table.March
WORD days_table.April
WORD days_table.May
WORD days_table.June
WORD days_table.July
WORD days_table.August
WORD days_table.September
WORD days_table.October
WORD days_table.November
WORD days_table.December
days_table:
.January: DZ 1,2,3,4,5,6,7
.February EQU 0
.March EQU 0
.April EQU 0
.May EQU 0
.June EQU 0
.July EQU 0
.August EQU 0
.September EQU 0
.October EQU 0
.November EQU 0
.December: DZ 31
NewYear: INCLUDE './src/bios/logo/use/New_Year.inc'
;.March8: INCLUDE './src/bios/logo/use/March_8.inc'
ENDIF
/*
and a
ld b,0
ld hl,months_table
ld de,months_table+1
ld a,month
call FIND_NEXT
ld hl,days_table
adc hl,de
ld ix,hl
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
ld de,days_table+1
ld a,day
call FIND_NEXT
ld hl,sprites_table
adc hl,de
call Sprites ; ¢ hl  ¤à¥á ¢ â ¡«¨æ¥  ¤à¥á®¢ â ¡«¨æ á¯à ©â®¢ (SP_Table)
FIND_NEXT:
ld c,(hl) ; ¡¥àñ¬ ¤«¨­ã â ¡«¨æë BYTE
inc hl
CPIR
jr nz,.nothing
sbc hl,de
sla l
ex de,hl
ret
days_table:
WORD december_days_table
WORD january_days_table
WORD march_days_table
WORD december_days_table
;----------------[Months table]----------------[v]
months_table:
BYTE months_table.length-1
.months:
BYTE 01 ; Ÿ­¢ àì
BYTE 03 ; Œ àâ
BYTE 12 ; „¥ª ¡àì
.length equ $-months_table
ASSERT months_table.length < 14, ERROR!!! "months_table" should be less than 14 bytes!
;----------------------------------------------[^]
;-------------[December days table]------------[v]
december_days_table:
BYTE december_days_table.length-1
.months:
BYTE 31 ; <20>®¢ë© £®¤
.length equ $-december_days_table
ASSERT december_days_table.length < 33, ERROR!!! "december_days_table" should be less than 33 bytes!
;----------------------------------------------[^]
;-------------[January days table]-------------[v]
january_days_table:
BYTE january_days_table.length-1
.months:
BYTE 01 ; <20>®¢ë© £®¤
BYTE 02 ; <20>®¢ë© £®¤
BYTE 03 ; <20>®¢ë© £®¤
BYTE 04 ; <20>®¢ë© £®¤
BYTE 05 ; <20>®¢ë© £®¤
BYTE 06 ; <20>®¢ë© £®¤
BYTE 07 ; <20>®¦¤¥á⢮
.length equ $-january_days_table
ASSERT january_days_table.length < 33, ERROR!!! "january_days_table" should be less than 33 bytes!
;----------------------------------------------[^]
;-------------[March days table]------------[v]
march_days_table:
BYTE december_days_table.length-1
.months:
BYTE 08 ; Š« à  –¥âª¨­ ¨ <20>®§  ‹îªá¥¬¡ãà£
.length equ $-december_days_table
ASSERT december_days_table.length < 33, ERROR!!! "december_days_table" should be less than 33 bytes!
;----------------------------------------------[^]
*/
ENDMODULE