mirror of
https://github.com/Tolik-Trek/MountIMA.git
synced 2026-06-17 18:30:22 +03:00
Более дружелюбные сообщения
This commit is contained in:
parent
6a20bca16c
commit
3c42528c73
102
mountima.asm
102
mountima.asm
@ -54,6 +54,7 @@ code_addr EQU BEGIN
|
||||
stack_point EQU #C000
|
||||
stack_buffer EQU 64
|
||||
program_start EQU BEGIN
|
||||
Loader_length EQU 0
|
||||
;-------------[]
|
||||
|
||||
|
||||
@ -76,27 +77,18 @@ program_start EQU BEGIN
|
||||
;[]-------------------------------------------------------------------[]
|
||||
include 'Shared_Includes/constants/EXE_Header.z80'
|
||||
ORG org_addr
|
||||
BEGIN:
|
||||
BEGIN: LD (dss_line),IX ; ‘®åà 塞 㪠§ ⥫ì áâப㠧 ¯ã᪠.
|
||||
|
||||
; LD C,BIOS.LP_GET_PLACE
|
||||
; RST ToBIOS
|
||||
; PUSH DE
|
||||
LD HL,EXIT.messages.start
|
||||
LD C,Dss.PChars
|
||||
RST ToDSS
|
||||
|
||||
; LD HL,EXIT.messages.test
|
||||
; LD C,Dss.PChars
|
||||
; RST ToDSS
|
||||
LD C,Dss.CurDisk
|
||||
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 ª« ¤ñâ ¤«¨ã ¯ à ¬¥â஢ ª®¬.áâப¨
|
||||
AND A ; ¯à®¢¥à塞 ®âáãâá⢨¥ ¯ à ¬¥â஢
|
||||
JP Z,EXIT.help ; § ¯ã᪠¢ ª®¬.áâப¥. …᫨ ¨å ¥â - ¢ë室 á ¨áâàãªæ¨¥©
|
||||
@ -294,7 +286,7 @@ RMD_MOUNT: LD A,(key_buff.FM)
|
||||
; RST ToBIOS ; NC -> ®à¬ «ì®¥ § ¢¥à襨¥
|
||||
; ; CF -> ®è¨¡ª : ¥¢¥àë© ®¬¥à RAM-Disk- ¨«¨
|
||||
; ; RAM-Disk § ïâ
|
||||
JR C,EXIT.error.wrongRAMdrv
|
||||
JP C,EXIT.error.wrongRAMdrv
|
||||
;-------------[]
|
||||
|
||||
;—⥨¥ ®¡à § ¢ ¯ ¬ïâì à ¬¤¨áª
|
||||
@ -332,7 +324,7 @@ RMD_MOUNT: LD A,(key_buff.FM)
|
||||
DJNZ .LOOP
|
||||
;;;;
|
||||
|
||||
.SavePage+*: LD A,0
|
||||
.SavePage+*: LD A,0
|
||||
OUT (SLOT3),A
|
||||
LD C,Dss.RescanDrives
|
||||
RST ToDSS
|
||||
@ -341,14 +333,14 @@ RMD_MOUNT: LD A,(key_buff.FM)
|
||||
LD C,Dss.Close
|
||||
RST ToDSS
|
||||
;!TODO check error?
|
||||
; JP EXIT.good
|
||||
JR EXIT.mounted
|
||||
;-------------[]
|
||||
|
||||
|
||||
;-------------[]
|
||||
MODULE EXIT
|
||||
good: LD B,DSS_Error.sys.NO_ERROR
|
||||
LD HL,messages.good
|
||||
good: LD HL,messages.good
|
||||
LD B,DSS_Error.sys.NO_ERROR
|
||||
printANDexit: PUSH BC
|
||||
LD C,Dss.PChars
|
||||
RST ToDSS
|
||||
@ -359,50 +351,65 @@ printANDexit: PUSH BC
|
||||
|
||||
help: LD HL,messages.help
|
||||
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:
|
||||
.writeFile: LD B,DSS_Error.sys.WRITE_ERROR
|
||||
LD HL,messages.writeFile
|
||||
JP printANDexit
|
||||
JR printANDexit
|
||||
|
||||
.WrongKeys: LD B,DSS_Error.sys.COMMON_ERROR
|
||||
LD HL,messages.WrongKeys
|
||||
JP printANDexit
|
||||
JR printANDexit
|
||||
|
||||
.UNDEFINED: LD B,DSS_Error.sys.COMMON_ERROR
|
||||
LD HL,messages.UNDEFINED
|
||||
JP printANDexit
|
||||
JR printANDexit
|
||||
|
||||
.noRAM: LD B,DSS_Error.sys.NOT_ENOUGH_MEMORY
|
||||
LD HL,messages.noRAM
|
||||
JP printANDexit
|
||||
JR printANDexit
|
||||
|
||||
.wrongMEMblkID: LD B,DSS_Error.sys.INVALID_MEMORY_HND
|
||||
LD HL,messages.wrongMEMblkID
|
||||
JP printANDexit
|
||||
JR printANDexit
|
||||
|
||||
.wrongRAMdrv: LD B,DSS_Error.sys.INVALID_DRIVE
|
||||
LD HL,messages.wrongRAMdrv
|
||||
JP printANDexit
|
||||
JR printANDexit
|
||||
|
||||
.readFile: LD B,DSS_Error.sys.READ_ERROR
|
||||
LD HL,messages.readFile
|
||||
JP printANDexit
|
||||
JR printANDexit
|
||||
|
||||
.noFreeRAMdsk: LD B,DSS_Error.sys.COMMON_ERROR
|
||||
LD HL,messages.noFreeRAMdsk
|
||||
JP printANDexit
|
||||
JR printANDexit
|
||||
;
|
||||
;
|
||||
messages:
|
||||
.good: DZ "\r\n",'Mountima:\> All Done. Good luck)))',"\r\n"
|
||||
.noRAM: DZ "\r\nERROR! No enough memory.\r\n"
|
||||
.wrongMEMblkID: DZ "\r\nERROR! Invalid Memory block ID.\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"
|
||||
.writeFile: DZ "\r\nERROR! Unable to write disk image to file.\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"
|
||||
.help: DB "\r\nMountima Help:\r\n"
|
||||
.start: DB "\r\nMountima v"
|
||||
.verNum: DB "0.25 beta. (c) Tolik_Trek@SprinterTeam, "
|
||||
.year: DZ "2026.\r\n"
|
||||
;
|
||||
.mounted: DB " mounted to RAM drive "
|
||||
.ramDrive: DZ "Z:\r\n"
|
||||
;
|
||||
.good: DZ "Done.\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 " /U - Unmounts RAM drive.\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 /U e:', "\r\n"
|
||||
DZ ' mountima.exe /S c:\images\image.img e:',"\r\n"
|
||||
.UNDEFINED: DZ "\r\nUndefined error: SET_KEYS\r\n" ;!TODO
|
||||
;.test DZ "1234567890-1234567890-1234567890-1234567890"
|
||||
;.help: DZ " HELP MESSAGE IN PROGRESS\r\n" ;!TODO
|
||||
.UNDEFINED: DZ "Undefined error: SET_KEYS\r\n" ;!TODO
|
||||
ENDMODULE
|
||||
;-------------[]
|
||||
dss_line: DW 0
|
||||
@ -590,6 +595,12 @@ Set_keys: LD HL,(dss_line)
|
||||
LD C,Dss.Open
|
||||
RST ToDSS ; ®âªàë⨥ ä ©«
|
||||
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
|
||||
;-----------------;
|
||||
.GetDRVnum: LD HL,Buffer+2
|
||||
@ -620,11 +631,12 @@ Set_keys: LD HL,(dss_line)
|
||||
;*******************************************************
|
||||
|
||||
|
||||
Loader_length EQU $-BEGIN
|
||||
;Loader_length EQU $-BEGIN
|
||||
;!FIXIT
|
||||
PagesBuffer EQU $
|
||||
Buffer EQU PagesBuffer+256
|
||||
SaveName EQU Buffer+256
|
||||
OpenName EQU SaveName+256
|
||||
|
||||
;----------------------------------------------[End Code section]
|
||||
STACK_CHECK_MACRO stack_point, (stack_buffer+256)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user