Более дружелюбные сообщения

This commit is contained in:
Tolik Trek 2026-05-14 03:39:51 +10:00
parent 6a20bca16c
commit 3c42528c73

View File

@ -54,6 +54,7 @@ code_addr EQU BEGIN
stack_point EQU #C000 stack_point EQU #C000
stack_buffer EQU 64 stack_buffer EQU 64
program_start EQU BEGIN program_start EQU BEGIN
Loader_length EQU 0
;-------------[] ;-------------[]
@ -76,27 +77,18 @@ program_start EQU BEGIN
;[]-------------------------------------------------------------------[] ;[]-------------------------------------------------------------------[]
include 'Shared_Includes/constants/EXE_Header.z80' include 'Shared_Includes/constants/EXE_Header.z80'
ORG org_addr ORG org_addr
BEGIN: BEGIN: LD (dss_line),IX ; ‘®å࠭塞 㪠§ â¥«ì ­  áâப㠧 ¯ã᪠.
; LD C,BIOS.LP_GET_PLACE LD HL,EXIT.messages.start
; RST ToBIOS LD C,Dss.PChars
; PUSH DE RST ToDSS
; LD HL,EXIT.messages.test LD C,Dss.CurDisk
; LD C,Dss.PChars RST ToDSS
; RST ToDSS LD A,'A'
ADD A,C
LD (EXIT.messages.ramDrive),A
; POP DE
; LD E,0
; LD C,BIOS.LP_SET_PLACE
; RST ToBIOS
; LD HL,EXIT.messages.help
; LD C,Dss.PChars
; RST ToDSS
; di : halt
LD (dss_line),IX ; ‘®å࠭塞 㪠§ â¥«ì ­  áâப㠧 ¯ã᪠.
LD A,(IX) ; âãâ DSS ª« ¤ñâ ¤«¨­ã ¯ à ¬¥â஢ ª®¬.áâப¨ LD A,(IX) ; âãâ DSS ª« ¤ñâ ¤«¨­ã ¯ à ¬¥â஢ ª®¬.áâப¨
AND A ; ¯à®¢¥à塞 ­  ®âáãâá⢨¥ ¯ à ¬¥â஢ AND A ; ¯à®¢¥à塞 ­  ®âáãâá⢨¥ ¯ à ¬¥â஢
JP Z,EXIT.help ; § ¯ã᪠ ¢ ª®¬.áâப¥. …᫨ ¨å ­¥â - ¢ë室 á ¨­áâàãªæ¨¥© JP Z,EXIT.help ; § ¯ã᪠ ¢ ª®¬.áâப¥. …᫨ ¨å ­¥â - ¢ë室 á ¨­áâàãªæ¨¥©
@ -294,7 +286,7 @@ RMD_MOUNT: LD A,(key_buff.FM)
; RST ToBIOS ; NC -> ­®à¬ «ì­®¥ § ¢¥à襭¨¥ ; RST ToBIOS ; NC -> ­®à¬ «ì­®¥ § ¢¥à襭¨¥
; ; CF -> ®è¨¡ª : ­¥¢¥à­ë© ­®¬¥à RAM-Disk-  ¨«¨ ; ; CF -> ®è¨¡ª : ­¥¢¥à­ë© ­®¬¥à RAM-Disk-  ¨«¨
; ; RAM-Disk § ­ïâ ; ; RAM-Disk § ­ïâ
JR C,EXIT.error.wrongRAMdrv JP C,EXIT.error.wrongRAMdrv
;-------------[] ;-------------[]
;—⥭¨¥ ®¡à §  ¢ ¯ ¬ïâì à ¬¤¨áª  ;—⥭¨¥ ®¡à §  ¢ ¯ ¬ïâì à ¬¤¨áª 
@ -341,14 +333,14 @@ RMD_MOUNT: LD A,(key_buff.FM)
LD C,Dss.Close LD C,Dss.Close
RST ToDSS RST ToDSS
;!TODO check error? ;!TODO check error?
; JP EXIT.good JR EXIT.mounted
;-------------[] ;-------------[]
;-------------[] ;-------------[]
MODULE EXIT MODULE EXIT
good: LD B,DSS_Error.sys.NO_ERROR good: LD HL,messages.good
LD HL,messages.good LD B,DSS_Error.sys.NO_ERROR
printANDexit: PUSH BC printANDexit: PUSH BC
LD C,Dss.PChars LD C,Dss.PChars
RST ToDSS RST ToDSS
@ -359,50 +351,65 @@ printANDexit: PUSH BC
help: LD HL,messages.help help: LD HL,messages.help
LD B,DSS_Error.sys.NO_ERROR LD B,DSS_Error.sys.NO_ERROR
JP printANDexit JR printANDexit
mounted: LD HL,OpenName
LD C,Dss.PChars
RST ToDSS
LD HL,messages.mounted
LD B,DSS_Error.sys.NO_ERROR
JR printANDexit
error: error:
.writeFile: LD B,DSS_Error.sys.WRITE_ERROR .writeFile: LD B,DSS_Error.sys.WRITE_ERROR
LD HL,messages.writeFile LD HL,messages.writeFile
JP printANDexit JR printANDexit
.WrongKeys: LD B,DSS_Error.sys.COMMON_ERROR .WrongKeys: LD B,DSS_Error.sys.COMMON_ERROR
LD HL,messages.WrongKeys LD HL,messages.WrongKeys
JP printANDexit JR printANDexit
.UNDEFINED: LD B,DSS_Error.sys.COMMON_ERROR .UNDEFINED: LD B,DSS_Error.sys.COMMON_ERROR
LD HL,messages.UNDEFINED LD HL,messages.UNDEFINED
JP printANDexit JR printANDexit
.noRAM: LD B,DSS_Error.sys.NOT_ENOUGH_MEMORY .noRAM: LD B,DSS_Error.sys.NOT_ENOUGH_MEMORY
LD HL,messages.noRAM LD HL,messages.noRAM
JP printANDexit JR printANDexit
.wrongMEMblkID: LD B,DSS_Error.sys.INVALID_MEMORY_HND .wrongMEMblkID: LD B,DSS_Error.sys.INVALID_MEMORY_HND
LD HL,messages.wrongMEMblkID LD HL,messages.wrongMEMblkID
JP printANDexit JR printANDexit
.wrongRAMdrv: LD B,DSS_Error.sys.INVALID_DRIVE .wrongRAMdrv: LD B,DSS_Error.sys.INVALID_DRIVE
LD HL,messages.wrongRAMdrv LD HL,messages.wrongRAMdrv
JP printANDexit JR printANDexit
.readFile: LD B,DSS_Error.sys.READ_ERROR .readFile: LD B,DSS_Error.sys.READ_ERROR
LD HL,messages.readFile LD HL,messages.readFile
JP printANDexit JR printANDexit
.noFreeRAMdsk: LD B,DSS_Error.sys.COMMON_ERROR .noFreeRAMdsk: LD B,DSS_Error.sys.COMMON_ERROR
LD HL,messages.noFreeRAMdsk LD HL,messages.noFreeRAMdsk
JP printANDexit JR printANDexit
;
; ;
messages: messages:
.good: DZ "\r\n",'Mountima:\> All Done. Good luck)))',"\r\n" .start: DB "\r\nMountima v"
.noRAM: DZ "\r\nERROR! No enough memory.\r\n" .verNum: DB "0.25 beta. (c) Tolik_Trek@SprinterTeam, "
.wrongMEMblkID: DZ "\r\nERROR! Invalid Memory block ID.\r\n" .year: DZ "2026.\r\n"
.wrongRAMdrv: DZ "\r\nERROR! Invalid RAM disk ID or RAM disk busy.\r\n" ;
.readFile: DZ "\r\nERROR! Unable to read disk image file.\r\n" .mounted: DB " mounted to RAM drive "
.writeFile: DZ "\r\nERROR! Unable to write disk image to file.\r\n" .ramDrive: DZ "Z:\r\n"
.noFreeRAMdsk: DZ "\r\nERROR! The number of RAM disks in use has reached its maximum.\r\n" ;
.WrongKeys: DZ "\r\nERROR! Wrong key combination.\r\n" .good: DZ "Done.\r\n"
.help: DB "\r\nMountima Help:\r\n" .noRAM: DZ "ERROR! No enough memory.\r\n"
.wrongMEMblkID: DZ "ERROR! Invalid Memory block ID.\r\n"
.wrongRAMdrv: DZ "ERROR! Invalid RAM disk ID or RAM disk busy.\r\n"
.readFile: DZ "ERROR! Unable to read disk image file.\r\n"
.writeFile: DZ "ERROR! Unable to write disk image to file.\r\n"
.noFreeRAMdsk: DZ "ERROR! The number of RAM disks in use has reached its maximum.\r\n"
.WrongKeys: DZ "ERROR! Wrong key combination.\r\n"
.help: DB "Mountima Help:\r\n"
DB " /M - Mounts IMG file to RAM drive.\r\n" DB " /M - Mounts IMG file to RAM drive.\r\n"
DB " /U - Unmounts RAM drive.\r\n" DB " /U - Unmounts RAM drive.\r\n"
DB " /S - Saves RAM drive to IMG file.\r\n" DB " /S - Saves RAM drive to IMG file.\r\n"
@ -410,9 +417,7 @@ messages:
DB ' mountima.exe /M c:\images\image.img', "\r\n" DB ' mountima.exe /M c:\images\image.img', "\r\n"
DB ' mountima.exe /U e:', "\r\n" DB ' mountima.exe /U e:', "\r\n"
DZ ' mountima.exe /S c:\images\image.img e:',"\r\n" DZ ' mountima.exe /S c:\images\image.img e:',"\r\n"
.UNDEFINED: DZ "\r\nUndefined error: SET_KEYS\r\n" ;!TODO .UNDEFINED: DZ "Undefined error: SET_KEYS\r\n" ;!TODO
;.test DZ "1234567890-1234567890-1234567890-1234567890"
;.help: DZ " HELP MESSAGE IN PROGRESS\r\n" ;!TODO
ENDMODULE ENDMODULE
;-------------[] ;-------------[]
dss_line: DW 0 dss_line: DW 0
@ -590,6 +595,12 @@ Set_keys: LD HL,(dss_line)
LD C,Dss.Open LD C,Dss.Open
RST ToDSS ; ®âªàë⨥ ä ©«  RST ToDSS ; ®âªàë⨥ ä ©« 
LD (key_buff.FM),A ; á®å࠭塞 ä ©«®¢ë© ¬ ­¨¯ã«ïâ®à LD (key_buff.FM),A ; á®å࠭塞 ä ©«®¢ë© ¬ ­¨¯ã«ïâ®à
RET C
;
LD HL,Buffer
LD DE,OpenName ; ¡ãä¥à (13 ¡ ©â)
LD BC,Dss.EX_Path.GET_NAME ; B=3, C=#45
RST ToDSS ; CF=0: A - १ã«ìâ â, ¡ãä¥à - "FILE.EXT",0
RET RET
;-----------------; ;-----------------;
.GetDRVnum: LD HL,Buffer+2 .GetDRVnum: LD HL,Buffer+2
@ -620,11 +631,12 @@ Set_keys: LD HL,(dss_line)
;******************************************************* ;*******************************************************
Loader_length EQU $-BEGIN ;Loader_length EQU $-BEGIN
;!FIXIT ;!FIXIT
PagesBuffer EQU $ PagesBuffer EQU $
Buffer EQU PagesBuffer+256 Buffer EQU PagesBuffer+256
SaveName EQU Buffer+256 SaveName EQU Buffer+256
OpenName EQU SaveName+256
;----------------------------------------------[End Code section] ;----------------------------------------------[End Code section]
STACK_CHECK_MACRO stack_point, (stack_buffer+256) STACK_CHECK_MACRO stack_point, (stack_buffer+256)