mirror of
https://github.com/romychs/OK240.2-Firmware.git
synced 2026-11-27 08:33:42 +03:00
MonR9 proto, Type disassm, Jack disassm.
This commit is contained in:
1 parent
1f7e4e3ac9
commit
ba98cd404b
59 files changed
+16793
-451
No files matched your search
@@ -21,7 +21,7 @@ To compile sources, use [sjasmplus Z80 assembler](https://github.com/z00m128/sja
|
||||
It is assumed that there is a USB-RS232 (USB-TTL) adapter on the /dev/ttyUSB0.
|
||||
|
||||
1) At Ocean's CP/M command line:
|
||||
|
||||
|
||||
A>READ
|
||||
|
||||
2) At Linux terminal, configure tty for 4800,8N2:
|
||||
@@ -32,7 +32,6 @@ It is assumed that there is a USB-RS232 (USB-TTL) adapter on the /dev/ttyUSB0.
|
||||
|
||||
cat okeah.hex > /dev/ttyUSB0
|
||||
|
||||
|
||||
srec_cat - Utility from **srecord** package - collection of tools for manipulating EPROM load files.
|
||||
|
||||
[Forum topic](https://zx-pk.ru/threads/35390-zagruzka-hex-fajlov-direktivoj-l-monitora.html)
|
||||
@@ -2604,6 +2604,7 @@ bdos_get_file_size:
|
||||
RET
|
||||
|
||||
; -------------------------------------------------------
|
||||
; (F_RANDREC) - Update random access pointer
|
||||
; Set the random record count bytes of the FCB to the number
|
||||
; of the last record read/written by the sequential I/O calls.
|
||||
; -------------------------------------------------------
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
INCLUDE "ram.inc"
|
||||
INCLUDE "mon_entries.inc"
|
||||
|
||||
DEFINE CHECK_INTEGRITY
|
||||
|
||||
IFNDEF BUILD_ROM
|
||||
OUTPUT bios.bin
|
||||
ENDIF
|
||||
@@ -118,11 +120,11 @@ tape_wait_f:
|
||||
|
||||
JP warm_boot ; r8
|
||||
|
||||
disk_a_size DW 0x00C0 ; 192k disk A size
|
||||
disk_b_size DW 0x02d0 ; 720 disk B size
|
||||
disk_c_size DW 0x02d0 ; 720 disk C size
|
||||
bios_var04 DB 0x50
|
||||
bios_var05 DB 0x50
|
||||
disk_a_size DW 192 ; 192k disk A size
|
||||
disk_b_size DW 720 ; 720 disk B size
|
||||
disk_c_size DW 720 ; 720 disk C size
|
||||
disk_b_tracks DB 80
|
||||
disk_c_tracks DB 80
|
||||
|
||||
; -------------------------------------------------------
|
||||
; cold start
|
||||
@@ -189,8 +191,8 @@ bios_init_ilv:
|
||||
LD DE, bios_ini_vals
|
||||
LD C, 13
|
||||
CALL mov_dlhe_c
|
||||
LD A, (bios_var05) ; 0x50
|
||||
LD (bios_var2), A
|
||||
LD A, (disk_c_tracks) ; 0x50
|
||||
LD (disk_c_tracks), A
|
||||
RET
|
||||
; <<
|
||||
|
||||
@@ -267,43 +269,51 @@ bios_wboot: ; r8
|
||||
LD HL, CCP_RAM.bdos_enter_jump
|
||||
LD (bdos_ent_addr), HL
|
||||
|
||||
; Disk A
|
||||
LD HL, CPM_VARS.DPB_A_RAM
|
||||
LD C, 0xf
|
||||
LD DE, dpb_ram
|
||||
LD A, (disk_a_size+1)
|
||||
OR A
|
||||
JP Z, set_curr_dpb
|
||||
JP Z, .drv_a_192
|
||||
LD DE, dpb_empty
|
||||
|
||||
set_curr_dpb:
|
||||
.drv_a_192:
|
||||
CALL mov_dlhe_c
|
||||
|
||||
; Disk B
|
||||
LD HL, CPM_VARS.DPB_B_RAM
|
||||
LD C, 0xf
|
||||
LD DE, dpb_flop_360k
|
||||
LD A, (disk_b_size+1)
|
||||
CP 0x1
|
||||
JP Z, .l1
|
||||
JP Z, .drv_b_360
|
||||
LD DE, dpb_flop_720k
|
||||
.l1
|
||||
.drv_b_360:
|
||||
CALL mov_dlhe_c
|
||||
|
||||
; Disk C
|
||||
LD HL, CPM_VARS.DPB_C_RAM
|
||||
LD C, 0xf
|
||||
LD A, (disk_c_size+1)
|
||||
CP 0x2
|
||||
JP Z, .l2
|
||||
CP 0x2 ; 720?
|
||||
JP Z, .drv_c_720
|
||||
LD DE, dpb_flop_360k
|
||||
LD A, (bios_var3)
|
||||
; bios_var3 != 0 -> move DPB 360k
|
||||
LD A, (disk_sw_trk)
|
||||
OR A
|
||||
JP NZ, .l3
|
||||
JP NZ, .drv_c_mov
|
||||
; bios_var3 == 0 -> move DPB 720k
|
||||
LD DE, dpb_flop_720k
|
||||
JP .l3
|
||||
.l2
|
||||
JP .drv_c_mov
|
||||
.drv_c_720:
|
||||
LD DE, dpb_flop_720k
|
||||
LD A, (bios_var3)
|
||||
; bios_var3 != 0 -> move DPB 720k
|
||||
LD A, (disk_sw_trk)
|
||||
OR A
|
||||
JP NZ, .l3
|
||||
JP NZ, .drv_c_mov
|
||||
; bios_var3 == 1 -> move DPB 360k
|
||||
LD DE, dpb_flop_360k
|
||||
.l3
|
||||
.drv_c_mov:
|
||||
CALL mov_dlhe_c
|
||||
XOR A
|
||||
LD (CPM_VARS.slicer_has_data),A
|
||||
@@ -576,7 +586,7 @@ calc_sec_addr_in_bfr:
|
||||
LD A, (CPM_VARS.curr_sec)
|
||||
AND 0x3
|
||||
LD L, A
|
||||
LD H, 0x0
|
||||
LD H, 0
|
||||
ADD HL, HL
|
||||
ADD HL, HL
|
||||
ADD HL, HL
|
||||
@@ -637,7 +647,7 @@ slicer_get_floppy_args:
|
||||
DEC A
|
||||
JP Z, .non_interleave
|
||||
LD HL, interleave_0
|
||||
.non_interleave
|
||||
.non_interleave:
|
||||
LD A, (CPM_VARS.slicer_real_sector)
|
||||
ADD A, L
|
||||
LD L, A
|
||||
@@ -665,16 +675,16 @@ print_strz:
|
||||
JP print_strz
|
||||
|
||||
msg_hello:
|
||||
DB ASCII_ESC, "60" ; Режим 32x18 <ESC>60
|
||||
DB ASCII_ESC, "83"
|
||||
DB ASCII_ESC, "5!%"
|
||||
DB ASCII_ESC, "41"
|
||||
DB ASCII_ESC, "1", 0x16, 0xe2, 0xe2, 0xfc, 0x01
|
||||
DB ASCII_ESC, "40"
|
||||
DB ASCII_ESC, "1", 0x1e, 0xe6, 0xdb, 0xf8, 0x01
|
||||
DB ASCII_ESC, "43"
|
||||
DB ASCII_ESC, "6", "0" ; 40x25 cursor on
|
||||
DB ASCII_ESC, "8", "3" ; set palette
|
||||
DB ASCII_ESC, "5", 33, 37 ; set cursor r,c
|
||||
DB ASCII_ESC, "4", "1" ; set color
|
||||
DB ASCII_ESC, "1", 22, 226, 226, 252, 1 ; draw fill rect x1,y1,x2,y2,m
|
||||
DB ASCII_ESC, "4", "0" ; set color
|
||||
DB ASCII_ESC, "1", 30, 230, 219, 248, 1 ; draw fill rect x1,y1,x2,y2,m
|
||||
DB ASCII_ESC, "4", "3" ; set color
|
||||
DB "OKEAH-240 CP/M (V2.2) REL.8'\r\n\n"
|
||||
DB ASCII_ESC, "42", 0
|
||||
DB ASCII_ESC, "4", "2", 0 ; set color
|
||||
|
||||
|
||||
; --------------------------------------------------
|
||||
@@ -704,47 +714,47 @@ msg_hello:
|
||||
; -------------------------------------
|
||||
; CKS - number of dir sectors to check before write, 0 for HDD
|
||||
|
||||
; For RAM-Disk 128k
|
||||
; For RAM-Disk 192k
|
||||
dpb_ram:
|
||||
DW 0010h ; SPT Sector (128b) per track (16d)
|
||||
DB 03h ; BSH 1k
|
||||
DB 07h ; BLM 1k; Allocation block size = (BLM + 1) * 128 = 1k
|
||||
DB 00h ; EXM extent mask
|
||||
DW 16 ; SPT Sector (128b) per track (16d)
|
||||
DB 3 ; BSH 1k
|
||||
DB 7 ; BLM 1k; Allocation block size = (BLM + 1) * 128 = 1k
|
||||
DB 0 ; EXM extent mask
|
||||
DW 191 ; DSM Disk size blocks - 1
|
||||
DW 31 ; DRM Dir elements - 1
|
||||
DB 10000000b ; AL0 Dir map byte 1
|
||||
DB 00000000b ; AL1 Dir map byte 2
|
||||
DW 0008h ; CKS checksum vector size (8 sectors=1k)
|
||||
DW 0000h ; OFF (tracks reserved for system)
|
||||
DW 0x0008 ; CKS checksum vector size (8 sectors=1k)
|
||||
DW 0x0000 ; OFF (tracks reserved for system)
|
||||
|
||||
dpb_empty:
|
||||
DS 15, 0xff
|
||||
|
||||
; For FLOPPY 720k
|
||||
dpb_flop_720k:
|
||||
DW 0024h ; SPT Sector (128b) per track 36 * 128 = 18KB
|
||||
DB 04h ; BSH 2k
|
||||
DB 0Fh ; BLM 2k; Allocation block size = (BLM + 1) * 128 = 2k
|
||||
DB 00h ; EXM extent mask
|
||||
DW 36 ; SPT Sector (128b) per track 36 * 128 = 18KB
|
||||
DB 4 ; BSH 2k
|
||||
DB 15 ; BLM 2k; Allocation block size = (BLM + 1) * 128 = 2k
|
||||
DB 0 ; EXM extent mask
|
||||
DW 359 ; DSM Disk size blocks - 1 (359d)
|
||||
DW 127 ; DRM Directory entries - 1 (127d)
|
||||
DB 11000000b ; AL0 Dir map byte 1 (2 dir blk)
|
||||
DB 00000000b ; AL1 Dir map byte 2
|
||||
DW 32 ; CKS checksum vector size (32 sectors = 2k)
|
||||
DW 0000h ; OFF (No of tracks reserved for system)
|
||||
DW 0x0000 ; OFF (No of tracks reserved for system)
|
||||
|
||||
; For FLOPPY 360k
|
||||
dpb_flop_360k:
|
||||
DW 0024h ; SPT Sector (128b) per track 36 * 128 = 18KB
|
||||
DB 04h ; BSH 2k
|
||||
DB 0Fh ; BLM 2k; Allocation block size = (BLM + 1) * 128 = 2k
|
||||
DB 01h ; EXM extent mask
|
||||
DW 36 ; SPT Sector (128b) per track 36 * 128 = 18KB
|
||||
DB 4 ; BSH 2k
|
||||
DB 15 ; BLM 2k; Allocation block size = (BLM + 1) * 128 = 2k
|
||||
DB 1 ; EXM extent mask
|
||||
DW 179 ; DSM Disk size blocks - 1 (179d)
|
||||
DW 127 ; DRM Directory entries - 1 (127d)
|
||||
DB 11000000b ; AL0 Dir map byte 1 (2 dir blk)
|
||||
DB 00000000b ; AL1 Dir map byte 2
|
||||
DW 32 ; CKS checksum vector size (32 sectors = 2k)
|
||||
DW 0000h ; OFF (No of tracks reserved for system)
|
||||
DW 0x0000 ; OFF (No of tracks reserved for system)
|
||||
|
||||
bios_ini_vals:
|
||||
DB 0xaa, 0xaa, 0, 0xff, 1, 8, 6, 4, 2, 9, 7, 5, 3
|
||||
@@ -754,9 +764,8 @@ bios_ini_vals:
|
||||
; --------------------------------------------------
|
||||
; Disk A RAM
|
||||
dph_disk_a:
|
||||
DW 00h ; Sector translate table pointer
|
||||
DW 00h, 00h, 00h ; Scratchpad area
|
||||
; 0xda00
|
||||
DW 0 ; Sector translate table pointer
|
||||
DW 0, 0, 0 ; Scratchpad area
|
||||
DW CPM_VARS.dir_buffer ; Directory buffer pointer
|
||||
DW CPM_VARS.DPB_A_RAM ; DPB Pointer
|
||||
DW CPM_VARS.CHK_VEC_A ; Check Vector pointer
|
||||
@@ -764,8 +773,8 @@ dph_disk_a:
|
||||
|
||||
; Disk B Floppy
|
||||
dph_disk_b:
|
||||
DW 00h ; Sector translate table pointer
|
||||
DW 00h, 00h, 00h ; Scratchpad area
|
||||
DW 0 ; Sector translate table pointer
|
||||
DW 0, 0, 0 ; Scratchpad area
|
||||
DW CPM_VARS.dir_buffer ; Directory buffer pointer
|
||||
DW CPM_VARS.DPB_B_RAM ; DPB Pointer
|
||||
DW CPM_VARS.CHK_VEC_B ; Check Vector pointer
|
||||
@@ -773,17 +782,16 @@ dph_disk_b:
|
||||
|
||||
; Disk C Floppy
|
||||
dph_disk_c:
|
||||
DW 00h ; Sector translate table pointer
|
||||
DW 00h, 00h, 00h ; Scratchpad area
|
||||
DW 0 ; Sector translate table pointer
|
||||
DW 0, 0, 0 ; Scratchpad area
|
||||
DW CPM_VARS.dir_buffer ; Directory buffer pointer
|
||||
DW CPM_VARS.DPB_C_RAM ; DPB Pointer
|
||||
DW CPM_VARS.CHK_VEC_C ; Check Vector pointer
|
||||
DW CPM_VARS.AL_MAP_C ; Allocation map pointer
|
||||
|
||||
res_data: ; offset 0xda28
|
||||
DB 1, 8, 6, 4, 2, 9, 7, 5, 3
|
||||
|
||||
|
||||
res_data: ; 0xda28
|
||||
DB 1,8,6,4,2,9,7,5,3
|
||||
DPB_END EQU $
|
||||
DB 0x0e, 3
|
||||
|
||||
@@ -797,9 +805,9 @@ FILL_SIZE EQU 0x500-CODE_SIZE
|
||||
|
||||
DISPLAY "| BIOS\t| ",/H,boot_f," | ",/H,CODE_SIZE," | ",/H,FILL_SIZE," |"
|
||||
|
||||
IFDEF CHECK_INTEGRITY
|
||||
; Check integrity
|
||||
ASSERT bios_wboot = 0xd6a8
|
||||
ASSERT set_curr_dpb = 0xd722
|
||||
ASSERT sel_disk = 0xd781
|
||||
ASSERT home = 0xd7a7
|
||||
ASSERT ram_disk_calc_addr = 0xd7eb
|
||||
@@ -812,6 +820,7 @@ FILL_SIZE EQU 0x500-CODE_SIZE
|
||||
ASSERT dpb_ram = 0xd9af
|
||||
ASSERT dph_disk_a = 0xd9f8
|
||||
ASSERT res_data = 0xda28
|
||||
ENDIF
|
||||
|
||||
FILLER:
|
||||
DS FILL_SIZE, 0xff
|
||||
|
||||
@@ -267,7 +267,7 @@ ccp_dir:
|
||||
JP Z, .calc_remanis_ds
|
||||
|
||||
LD HL, (BIOS.disk_c_size)
|
||||
LD A, (bios_var3)
|
||||
LD A, (disk_sw_trk)
|
||||
OR A
|
||||
JP NZ, .calc_remanis_ds
|
||||
|
||||
|
||||
@@ -111,6 +111,10 @@ KBD_IRQ EQU 0x02
|
||||
|
||||
KBD_ACK EQU 0x10
|
||||
|
||||
IRQ_KEYBOARD EQU 0x02
|
||||
IRQ_PRINTER EQU 0x08
|
||||
IRQ_TIMER EQU 0x10
|
||||
|
||||
KEY_ALF EQU 0x0D
|
||||
KEY_FIX EQU 0x15
|
||||
; ------------------------------------------------------
|
||||
|
||||
@@ -28,10 +28,11 @@
|
||||
;reserve1 EQU 0x003b
|
||||
@bios_var0 EQU 0x0040 ; 0xaa - bios init r8
|
||||
@bios_var1 EQU 0x0041 ; 0xaa - bios init r8
|
||||
@bios_var2 EQU 0x0042 ; 0x00 - bios init r8
|
||||
@disk_sw_trk EQU 0x0042 ; 0x00 - bios init r8
|
||||
@bios_var3 EQU 0x0043 ; 0xff - bios init r8
|
||||
@interleave_0 EQU 0x0044
|
||||
;reserve2 EQU 0x0050
|
||||
@interleave_0 EQU 0x0044 ; 1, 8, 6, 4, 2, 9, 7, 5, 3 [44..4C]
|
||||
|
||||
;reserve2 EQU 0x0050
|
||||
@fcb1 EQU 0x005c ; Default FCB, 16 bytes
|
||||
@fcb2 EQU 0x006c
|
||||
;NMI_ISR EQU 0x0066
|
||||
|
||||
Reference in new issue
Block a user