; LAST UPDATE: 19.07.2025 savelij include macros.a80 include macros_sp.a80 include define_sp.a80 include bios_sp.a80 include dss_sp.a80 include errors_sp.a80 include ports_sp.a80 include mouse_sp.a80 include accel_sp.a80 include fat_dir_sp.a80 include fn_version.a80 ENABLE ;.EDIT ;.VIEW ;.HELP PAGES_MEM := 4 IFDEF ENABLE.VIEW PAGES_MEM := PAGES_MEM + 1 ENDIF IFDEF ENABLE.EDIT PAGES_MEM := PAGES_MEM + 1 ENDIF INIT_VAR 0xC000 SETVAR FONT_RAW, 6888;IFFFONT_RAW_PACK - FONT_RAW_PACK SETVAR_ALIGN SETVAR IFFFONT_RAW, 8704;IFFFONT_RAW_END - IFFFONT_RAW_PACK SETVAR CLOCK_BMP, CLOCK_BMP_END - Clock_BMP SETVAR MOUSE_BMP, MOUSE_BMP_END - Mouse_BMP HDR_EXE 0x8100,1,EXEend-EntryExec,EntryExec,EntryExec,0x80FF,0 EntryExec: DI LD A,(IX-0x03) ; file handle LD (MAIN.hFile),A ; save LD HL,MAIN.copyright_str SPDSS DSSF.PCHARS ; print text SPDSS DSSF.VERSION LD A,D OR A JR NZ,.next1 LD HL,MAIN.incor_dos_str SPDSS DSSF.PCHARS ; print text SPDSS DSSF.EXIT,0x26 ; exit .next1 SPDSS DSSF.GETMEM,PAGES_MEM ; запрос страниц памяти JR NC,.next2 ; CY - not enough memory LD HL,MAIN.no_memory_str SPDSS DSSF.PCHARS ; print text SPDSS DSSF.EXIT,0x1E ; exit .next2 LD (MAIN.hMem),A ; memory handle LD HL,MAIN.FNMAIN SPBIOS BIOSF.GETMEMBLKPAGES ; get memory pages list ; загрузка керналя LD A,(MAIN.FNMAIN) ; set pages from 0xC000 SETPORT WINSP.CPU3,,0 LD HL,BASE_ADDR ; FNMAIN LD DE,END_BLOCK_1 - START_BLOCK_1 LD A,(MAIN.hFile) SPDSS DSSF.READ JP C,disk_error ; загрузка дополнительных функций LD A,(MAIN.FNREZ2) SETPORT WINSP.CPU3,,0 LD HL,0xC000 ; FNREZ2 LD DE,END_BLOCK_2 - START_BLOCK_2 LD A,(MAIN.hFile) SPDSS DSSF.READ JP C,disk_error ; загрузка фонта LD A,(MAIN.FNFONT) ; FNFONT SETPORT WINSP.CPU3,,0 LD HL,0xFFFF - (IFFFONT_RAW_END - FONT_RAW_PACK) LD DE,END_BLOCK_4 - START_BLOCK_4 LD A,(MAIN.hFile) SPDSS DSSF.READ JP C,disk_error ; распаковка шрифтов LD HL,0xFFFF - (IFFFONT_RAW_END - FONT_RAW_PACK) LD DE,0xC000 CALL UNPACK LD HL,0xFFFF - (IFFFONT_RAW_END - IFFFONT_RAW_PACK) LD DE,0xDB00 CALL UNPACK ; перенос иконок мыши на рабочее место LD HL,Clock_BMP LD DE,CLOCK_BMP LD BC,CLOCK_BMP_Size + MOUSE_BMP_Size LDIR ; загрузка хелпа LD A,(MAIN.FNREZ3) ; FNREZ3 SETPORT WINSP.CPU3,,0 ; SETPORT WINSP.CPU1,,0 ; ???? LD HL,0xC000 LD DE,END_BLOCK_3 - START_BLOCK_3 LD A,(MAIN.hFile) SPDSS DSSF.READ JP C,disk_error IFDEF ENABLE.VIEW ; загрузка вьювера LD A,(MAIN.FNVIEW) ; FNVIEW SETPORT WINSP.CPU3,,0 LD HL,0xC000 LD DE,END_BLOCK_VIEWER - START_BLOCK_VIEWER LD A,(MAIN.hFile) SPDSS DSSF.READ JP C,disk_error ENDIF IFDEF ENABLE.EDIT ; загрузка редактора LD A,(MAIN.FNEDIT) ; FNEDIT SETPORT WINSP.CPU3,,0 LD HL,0xC000 LD DE,END_BLOCK_EDITOR - START_BLOCK_EDITOR LD A,(MAIN.hFile) SPDSS DSSF.READ JP C,disk_error ENDIF LD A,(MAIN.hFile) SPDSS DSSF.CLOSE ; close file ;!TEST ; !HARDCODE SYS_PAGE SETPORT WINSP.CPU3,PAGE.SYSTEM LD HL,0x0124 + CPU3 ; !HARDCODE LD (HL),0x38 ; interrupt routine address Low byte INC HL XOR A LD (HL),A ; interrupt routine address High byte INC HL GETPORT WINSP.CPU0 LD (HL),A ; interrupt routine page LD A,(MAIN.FNMAIN) SETPORT WINSP.CPU3,,0 LD A,(MAIN.hMem) LD (RAMPAGES.FNPAGESID),A LD HL,MAIN.FNREZ2 LD DE,RAMPAGES.FNREZ2 LD BC,PAGES_MEM LDIR JP BASE_ADDR disk_error: PUSH AF LD A,(MAIN.hMem) ; free memory SPDSS DSSF.FREEMEM LD A,(MAIN.hFile) SPDSS DSSF.CLOSE ; close file LD HL,MAIN.load_err_str SPDSS DSSF.PCHARS ; print text POP BC SPDSS DSSF.EXIT ; exit UNPACK include dec40.a80 oo EQU COLORP.BLACK + COLORI.BLACK WW EQU COLORP.WHITE + COLORI.WHITE HH EQU COLORP.WHITE + COLORI.WHITE0E BB EQU COLORP.WHITE + COLORI.BLACK ; часики для мыши ; 9 x 14 = 126 00 01 02 03 04 05 06 07 08 Clock_BMP: DB oo,oo,oo,oo,oo,oo,oo,oo,oo ; 00 DB oo,HH,HH,HH,HH,HH,HH,HH,oo ; 01 DB oo,oo,oo,oo,oo,oo,oo,oo,oo ; 02 DB WW,oo,HH,HH,HH,HH,HH,oo,WW ; 03 DB WW,oo,HH,HH,HH,oo,HH,oo,WW ; 04 DB WW,WW,oo,HH,BB,HH,oo,WW,WW ; 05 DB WW,WW,WW,oo,HH,oo,WW,WW,WW ; 06 DB WW,WW,WW,oo,HH,oo,WW,WW,WW ; 07 DB WW,WW,oo,HH,BB,HH,oo,WW,WW ; 08 DB WW,oo,HH,HH,HH,oo,HH,oo,WW ; 09 DB WW,oo,HH,HH,HH,HH,HH,oo,WW ; 0A DB oo,oo,oo,oo,oo,oo,oo,oo,oo ; 0B DB oo,HH,HH,HH,HH,HH,HH,HH,oo ; 0C DB oo,oo,oo,oo,oo,oo,oo,oo,oo ; 0D CLOCK_BMP_END ; курсор для мыши ; 9 x 13 = 117 00 01 02 03 04 05 06 07 08 Mouse_BMP: DB oo,oo,WW,WW,WW,WW,WW,WW,WW ; 00 DB oo,HH,oo,WW,WW,WW,WW,WW,WW ; 01 DB oo,HH,HH,oo,WW,WW,WW,WW,WW ; 02 DB oo,HH,HH,HH,oo,WW,WW,WW,WW ; 03 DB oo,HH,HH,HH,HH,oo,WW,WW,WW ; 04 DB oo,HH,HH,HH,HH,HH,oo,WW,WW ; 05 DB oo,HH,HH,HH,HH,HH,HH,oo,WW ; 06 DB oo,HH,HH,HH,HH,oo,oo,oo,oo ; 07 DB oo,HH,HH,oo,HH,oo,WW,WW,WW ; 08 DB oo,HH,oo,oo,HH,HH,oo,WW,WW ; 09 DB oo,oo,WW,WW,oo,HH,oo,WW,WW ; 0A DB oo,WW,WW,WW,oo,HH,HH,oo,WW ; 0B DB WW,WW,WW,WW,WW,oo,oo,WW,WW ; 0C MOUSE_BMP_END MAIN .hFile db 0x00 .hMem db 0x00 .FNMAIN db 0x00 .FNREZ2 db 0x00 ; 00 .FNFONT db 0x00 ; 01 .FNREZ3 db 0x00 ; 02 IFDEF ENABLE.VIEW .FNVIEW db 0x00 ; 03 ENDIF IFDEF ENABLE.EDIT .FNEDIT db 0x00 ; 04 ENDIF DB 0xFF .copyright_str: DZ "\r\nThe Flex Navigator, ver.\{FLEX_VERS.NAVIGATOR}\r\n" .incor_dos_str: DZ "Incorrect DOS version, need DOS 1.00 or high.\r\n" .no_memory_str: DZ "Not enough memory to load program.\r\n" .load_err_str: DZ "Disk loading error.\r\n" EXEend: include fnmain.a80