MonR9 proto, Type disassm, Jack disassm.

This commit is contained in:
Роман Бойков 2026-03-25 17:18:26 +03:00
parent 1f7e4e3ac9
commit ba98cd404b
59 changed files with 16793 additions and 451 deletions

View File

@ -557,10 +557,10 @@ print_strz:
JP print_strz
msg_hello:
DB ASCII_ESC, "60" ; Режим 32x18 <ESC>60
DB ASCII_ESC, "6", 0x30 ; Режим 32x18 <ESC>60
DB ASCII_ESC, "8", 2 ; Выбор палтитры <ESC>82
DB ASCII_ESC, "42" ; Выбор цвета <ESC>42
DB "48K CP/M (V2.2) REL.7/2D\r\n64K RAM DISK (A:)\r\n180K FD (B:)\r\n", 0
DB ASCII_ESC, "4", 0x32 ; Выбор цвета <ESC>42
DB "48K CP/M (V2.2) REL.7/2D\r\n64K RAM DISK (A:)\r\n720K FD (B:)\r\n", 0
; --------------------------------------------------
; Disk parameters headers in ROM
@ -632,18 +632,33 @@ DPB_64K:
DW 0008h ; CKS checksum vector size (8 sectors=1k)
DW 0000h ; OFF (tracks reserved for system)
; For FLOPPY 360k
DPB_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 00B3h ; DSM Disk size blocks - 1 (179d)
DW 003Fh ; DRM Directory entries - 1 (63d)
DB 10000000b ; AL0 Dir map byte 1
DB 00000000b ; AL1 Dir map byte 2
DW 0010h ; CKS checksum vector size (16 sectors = 2k)
DW 0000h ; OFF (No of tracks reserved for system)
; ; For FLOPPY 360k
; DPB_360K:
; 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 63 ; DRM Directory entries - 1 (63d)
; DB 10000000b ; AL0 Dir map byte 1
; DB 00000000b ; AL1 Dir map byte 2
; DW 0010h ; CKS checksum vector size (16 sectors = 2k)
; DW 0000h ; OFF (No of tracks reserved for system)
; For FLOPPY 720k
dpb_flop_720k:
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 0x0000 ; OFF (No of tracks reserved for system)
DPB_END:
DB 4h ; reserved

View File

@ -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)

View File

@ -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.
; -------------------------------------------------------

View File

@ -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

View File

@ -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

View File

@ -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
; ------------------------------------------------------

View File

@ -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

22
JumpingJack/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,22 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "make (sjasmplus)",
"type": "shell",
"command": "sjasmplus",
"args": [
"--i8080",
"--sld=jack.sld",
"--raw=jack.obj",
"--fullpath",
"jack.asm"
],
"problemMatcher": "$problem-matcher-sjasmplus",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

10
JumpingJack/README.md Normal file
View File

@ -0,0 +1,10 @@
# Океан 240.2
## Игра Jumping Jack
Дизасемблирована мной и исправлена для работы под монитором версии 8.
Исходный код для ассемблера [sjasmplus](https://github.com/z00m128/sjasmplus) в нотации Z80 (ограничен инструкциями i8080).
Игра использует прямые обращения к переменным монитора для установки цвета и позиции курсора.
Так же использовала точку входа в монитор, которой нет в мониторе r8. Точка заменена на выход в CP/M.

3650
JumpingJack/jack.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,111 @@
; ======================================================
; Ocean-240.2
; Equates for all assembly sources
;
; By Romych 2026-03-10
; ======================================================
IFNDEF _EQUATES
DEFINE _EQUATES
ASCII_BELL EQU 0x07 ; Make Beep
ASCII_BS EQU 0x08 ; Move cursor left (Back Space)
ASCII_TAB EQU 0x09 ; Move cursor right +8 pos
ASCII_LF EQU 0x0A ; Move cursor down (Line Feed)
ASCII_FF EQU 0x0C ; Move cursor to home (Form Feed)
ASCII_CR EQU 0x0D ; Move gursor to 1st pos (Cariage Return)
ASCII_CAN EQU 0x18 ; Move cursor right
ASCII_EM EQU 0x19 ; Move cursor up
ASCII_SUB EQU 0x1A ; CTRL-Z - end of text file marker
ASCII_ESC EQU 0x1B ;
ASCII_US EQU 0x1F ; Clear screen
ASCII_SP EQU 0x20
ASCII_DEL EQU 0x7F
; ------------------------------------------------------
BELL_PIN EQU 0x08 ; DD67 Pin PC3 - "BELL"
; ------------------------------------------------------
CTRL_A EQU 0x01
CTRL_B EQU 0x02
CTRL_C EQU 0x03 ; Warm boot
CTRL_D EQU 0x04
CTRL_E EQU 0x05 ; Move to beginning of new line (Physical EOL)
CTRL_F EQU 0x06
CTRL_G EQU 0x07
CTRL_H EQU 0x08 ; Backspace
CTRL_I EQU 0x09
CTRL_J EQU 0x0A ; LF - Line Feed
CTRL_K EQU 0x0B
CTRL_L EQU 0x0C
CTRL_M EQU 0x0D ; CR - Carriage Return
CTRL_N EQU 0x0E
CTRL_O EQU 0x0F
CTRL_P EQU 0x10 ; turn on/off printer
CTRL_Q EQU 0x11
CTRL_R EQU 0x12 ; Repeat current cmd line
CTRL_S EQU 0x13 ; Temporary stop display data to console (aka DC3)
CTRL_T EQU 0x14
CTRL_U EQU 0x15 ; Cancel (erase) current cmd line
CTRL_V EQU 0x16
CTRL_W EQU 0x17
CTRL_X EQU 0x18 ; Cancel (erase) current cmd line
CTRL_Y EQU 0x19
CTRL_Z EQU 0x1A ; CTRL-Z - end of text file marker
; ------------------------------------------------------
TRUE EQU 0xFF
FALSE EQU 0x00
; ---------------------------------------------------
; FCB Offsets
; ---------------------------------------------------
FCB_LEN EQU 32 ; length of FCB
FCB_SHF EQU 5
FN_LEN EQU 12 ; Length of filename in FCB
FCB_DR EQU 0 ; Drive. 0 for default, 1-16 for A-P
FCB_FN EQU 1 ; Fn - Filename, 7-bit ASCII. The top bits - attributes
FCB_FT EQU 9 ; Filetype, 7-bit ASCII.
; T1' to T3' have the following
; T1' - Read-Only
; T2' - System (hidden)
; T3' - Archive
FCB_EXT EQU 12 ; EX - Set this to 0 when opening a file and then leave it to
; CP/M. You can rewind a file by setting EX, RC, S2 and CR to 0.
FCB_S1 EQU 13 ; S1 - Reserved.
FCB_S2 EQU 14 ; S2 - Reserved. Bit 7 - wile write flag, [6:0] module number (Extent hi bits)
FCB_RC EQU 15 ; RC - Set this to 0 when opening a file and then leave it to CP/M.
FCB_AL EQU 16 ; AL - Image of the second half of the directory entry,
; containing the file's allocation (which disc blocks it owns).
FCB_CR EQU 32 ; CR - Current record within extent. It is usually best to set
; this to 0 immediately after a file has been opened and
; then ignore it.
FCB_RN EQU 33 ; Rn - Random access record number. A 16-bit (with R2 used for overflow)
; ------------------------------------------------------
IRQ_0 EQU 0x01
IRQ_1 EQU 0x02
IRQ_2 EQU 0x04
IRQ_KEYBOARD EQU 0x02
IRQ_PRINTER EQU 0x08
IRQ_TIMER EQU 0x10
KBD_ACK EQU 0x80
PRINTER_ACK EQU 0x10
KEY_LEFT EQU 0x93
KEY_RIGHT EQU 0x84
KEY_UP EQU 0x85
TX_READY EQU 0x01
RX_READY EQU 0x02
TMR0_SQWAVE EQU 0x36
; ------------------------------------------------------
ENDIF

View File

@ -3413,7 +3413,7 @@ m_rst1_handler:
DI
LD (TM_VARS.rst_hl_save), HL
LD HL, 0x2
ADD HL,SP
ADD HL, SP
LD (TM_VARS.rst_sp_save), HL
POP HL
LD SP, TM_VARS.rst_hl_save
@ -3440,7 +3440,7 @@ m_cold_start:
LD (TM_VARS.tm_hrg), HL
tm_main:
LD SP, TM_VARS.tm_stsp
LD DE,esc_64x23_cursor ; FORM61
LD DE, esc_64x23_cursor ; FORM61
CALL tm_print
LD DE, msg_turbo_mon ;= '\f'
CALL tm_out_strz

File diff suppressed because it is too large Load Diff

View File

@ -41,7 +41,7 @@ FDC_SECT EQU 0x22
FDC_DATA EQU 0x23
;
FDC_WAIT EQU 0x24
FDC_DRQ EQU 0x24
; Controller port
FLOPPY EQU 0x25
@ -85,8 +85,8 @@ TMR_DD70C3 EQU 0x62
TMR_DD70CTR EQU 0x63
; Programable Interrupt controller PIC KR580VV59
PIC_DD75RS EQU 0x80
PIC_DD75RM EQU 0x81
PIC_DD75A EQU 0x80
PIC_DD75B EQU 0x81
; -------------------------------------------------------
; КР580ВВ51 DD72

View File

@ -59,6 +59,7 @@ esc_param:
DS 10 ; bfe2
screen_mode:
DS 1 ; bfec
cursor_pos: ; as word
cursor_row:
DS 1 ; bfed
cursor_col:
@ -81,7 +82,7 @@ strobe_state:
DS 1 ; bff9
ul_var0:
DS 1 ; bffa
ul_var1:
head_loaded:
DS 1 ; bffb
ul_var2:
DS 1 ; bffc

View File

@ -15,6 +15,8 @@
OUTPUT mon_E000.bin
DEFINE CHECK_INTEGRITY
MODULE MONITOR
ORG 0xe000
@ -121,17 +123,27 @@ conf_uart:
XOR A
OUT (TMR_DD70C2), A
conf_pic:
; ----------------------------------------------
; Config PIC
LD A,00010010b ; ICW1 edge trigger, interval 8, sin...
OUT (PIC_DD75RS), A
; ----------------------------------------------
; Send Init Control Words
; ICW1 0x12 - Low ISR address A7:A5 = 000b,
; ISR Interval 8 byte, Single controller
LD A,00010010b
OUT (PIC_DD75A), A
; ICW2 = 0x00 Hi ISR address
XOR A
OUT (PIC_DD75RM), A ; ICW2
OUT (PIC_DD75B), A
// No ICW3 in single mode
// OCW1 = 0xff , bits [7:0] - Mask 1-Set, 0-Reset
CPL
OUT (PIC_DD75RM), A ; ICW3 no slave
OUT (PIC_DD75B), A
// OCWZ = 0x20 Non-specific EOI command - reset highest ISR bit
LD A,00100000b
OUT (PIC_DD75RS), A ; Non-specific EOI command, End of I...
LD A, PIC_POLL_MODE
OUT (PIC_DD75RS), A ; Poll mode, poll on next RD
OUT (PIC_DD75A), A
// OCW3 Polled mode read IRR
LD A, PIC_POLL_MODE ; 0000-1010 P=1 - poll mode, RR=1+RIS=0 -> read IRR on next RD
OUT (PIC_DD75A), A ; Poll mode, poll on next RD
; Config KBD
LD A, 0x80
OUT (KBD_DD78PC), A ; TODO: - Check using this 7th bit
@ -187,7 +199,7 @@ msg_hw_mon:
; ---------------------------------------------------
reset_m_stack:
LD HL, M_VARS.stor_e
LD HL, M_VARS.stor_de
LD SP, HL
CALL get_cmd_letter
INC HL
@ -196,13 +208,13 @@ reset_m_stack:
; Monitor entry point
; ---------------------------------------------------
m_cold_start:
LD HL, M_VARS.stor_e
LD HL, M_VARS.stor_de
LD SP, HL
DI
CALL get_a_ref_sp
CALL get_cmd_letter
LD L, 205
DB 0xdd
DB 0xdd ; 0x13 INC DE in previous r5 version
PUSH AF
CP ASCII_CR
JP Z, m_cold_start
@ -484,7 +496,7 @@ registers_tab:
; A = 0xFF - ready (key pressed)
; ------------------------------------------------------
m_con_status:
IN A, (PIC_DD75RS) ; Read PIC status
IN A, (PIC_DD75A) ; Read PIC status
NOP
AND KBD_IRQ ; Check keyboard request RST1
LD A, 0
@ -572,7 +584,7 @@ get_cmd_letter:
; ------------------------------------------------------
m_char_print:
; wait printer ready
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND PRINTER_IRQ
JP Z, m_char_print
@ -585,7 +597,7 @@ m_char_print:
.wait_lp:
; wait printer ack
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND PRINTER_IRQ
JP NZ, .wait_lp
; remove LP strobe
@ -1471,41 +1483,42 @@ m2_lf:
; Access to VRAM
LD A, 0x1
OUT (SYS_DD17PB), A
.cas_l5:
; Scroll one line 8 px
scroll_nxt_y:
LD B, 0x40
LD H, 0x40 ; TODO: LD H, B save 1b 3t
LD D, H
.cas_l6:
scroll_nxt_x:
LD A, (DE)
LD (HL), A
INC H
INC D
DEC B
JP NZ, .cas_l6
JP NZ, scroll_nxt_x
INC L
INC E
DEC C
JP NZ, .cas_l5
JP NZ, scroll_nxt_y
; correct row shift value
LD C, 11
LD A, (M_VARS.row_shift)
ADD A, 8
LD E, A
.cas_l7:
; clear new line
clr_nxt_y:
LD B, 0x40
LD D, 0x40 ; TODO: LD D, B save 1b 3t
XOR A
.cas_l8:
clr_nxt_x:
LD (DE), A
INC D
DEC B
JP NZ, .cas_l8
JP NZ, clr_nxt_x
INC E
DEC C
JP NZ, .cas_l7
JP NZ, clr_nxt_y
LD A, 0
OUT (SYS_DD17PB), A
RET
@ -1998,6 +2011,7 @@ m_clear_screen:
LD A, 0x0
JP NZ, .mono_mode
LD A, 01000000b
.mono_mode:
OR B
; Restore mode and palette
@ -2538,7 +2552,7 @@ m_bell_cont:
LD B, A
OUT (DD67PC), A ; Invert bell pin
m_bell_wait_tmr1:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND TIMER_IRQ ; 0x10
JP NZ, m_bell_wait_tmr1
LD A, B
@ -2546,7 +2560,7 @@ m_bell_wait_tmr1:
LD B, A
OUT (DD67PC), A
m_bell_wait_tmr2:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND TIMER_IRQ
JP Z,m_bell_wait_tmr2
JP m_bell_cont
@ -4167,7 +4181,7 @@ m_tape_write:
PUSH DE
LD BC, 2550
LD A, PIC_POLL_MODE ; pool mode
OUT (PIC_DD75RS), A
OUT (PIC_DD75A), A
LD A,TMR0_SQWAVE ; tmr0, load lsb+msb, sq wave, bin
OUT (TMR_DD70CTR), A
LD A, C
@ -4177,7 +4191,7 @@ m_tape_write:
; Write Hi+Lo, Hi+Lo
LD DE, 4 ; repeat next 4 times
.l1:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND TIMER_IRQ ; check rst4 from timer#0
JP NZ, .l1
LD A, D
@ -4200,7 +4214,7 @@ m_tape_write:
JP NZ, .l1
.l2:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND TIMER_IRQ
JP NZ, .l2
@ -4232,7 +4246,7 @@ m_tape_write:
LD A, 0x0
CALL m_tape_wr_byte
.wait_end:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND TIMER_IRQ
JP NZ, .wait_end
LD A, TL_MID ; tape level middle
@ -4262,7 +4276,7 @@ m_tape_wr_byte:
LD B, A
JP C, .bit_hi
.wait_t:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND TIMER_IRQ
JP NZ, .wait_t
LD A, TMR0_SQWAVE
@ -4287,7 +4301,7 @@ m_tape_wr_byte:
POP BC
RET
.bit_hi:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND TIMER_IRQ
JP NZ, .bit_hi
; program for 660 cycles
@ -4324,7 +4338,7 @@ m_tape_read:
PUSH HL
PUSH DE
LD A, PIC_POLL_MODE ; pool mode
OUT (PIC_DD75RS), A
OUT (PIC_DD75A), A
LD A, TMR0_SQWAVE
OUT (TMR_DD70CTR), A ; tmr0, load lsb+msb, sq wave
LD A, 0x0
@ -4478,7 +4492,7 @@ read_tape_bit_kbd:
LD B, A ; save tape bit state
; wait change with keyboard check
.wait_change:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND KBD_IRQ
JP NZ, .key_pressed
IN A, (KBD_DD78PB)
@ -4530,10 +4544,10 @@ m_tape_wait:
LD A, 0xc
OUT (TMR_DD70C1), A
.wait_tmr_key:
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND KBD_IRQ ; RST1 flag (keyboard)
JP NZ, .key_pressed
IN A, (PIC_DD75RS)
IN A, (PIC_DD75A)
AND TIMER_IRQ ; RST4 flag (timer out)
JP Z, .wait_no_rst4
IN A, (KBD_DD78PB)
@ -4570,26 +4584,26 @@ m_tape_blk_detect:
; ======================================================
; FDC DRIVER
; ======================================================
fdc_unload_head:
fdc_load_head:
LD A,0x0
OUT (FDC_DATA),A
LD A,0x3
OUT (FDC_CMD),A
NOP
NOP
fuh.wait_no_busy:
.wait_no_busy:
IN A,(FDC_CMD)
AND 0x5 ; TR0. BYSY
CP 0x4 ;
JP Z,fuh.tr0_ok
JP Z, .tr0_ok
IN A,(FLOPPY)
RLCA ; MOT_ST -> CF
JP NC,fuh.wait_no_busy
LD A,0x20
JP NC, .wait_no_busy
LD A, 0x20
RET
fuh.tr0_ok:
LD A,0x1
LD (M_VARS.ul_var1),A
.tr0_ok:
LD A, 1
LD (M_VARS.head_loaded), A
XOR A
RET
@ -4746,36 +4760,39 @@ fdc_init:
; Inp: DE - track/sector
; ---------------------------------------------------
m_fdc_seek_trk:
LD A, (M_VARS.ul_var1)
; check and load head
LD A, (M_VARS.head_loaded)
AND 0x1
CALL Z, fdc_unload_head
CALL Z, fdc_load_head
; send track no to data register
LD A, D
OUT (FDC_DATA), A
; send seek track command
LD A, 0x1f
OUT (FDC_CMD), A
NOP
NOP
IN A, (FDC_WAIT)
IN A, (FDC_DRQ)
IN A, (FDC_CMD)
AND ASCII_EM
CP 0x0
JP NZ, .l1
JP .l2
.l1:
AND 00011001b ; Seek Error, CRC Error, Busy
CP 0
JP NZ, .seek_sec_err
JP .seek_sec_ok
.seek_sec_err:
LD A, D
OUT (FDC_DATA), A
LD A, 0x2f
OUT (FDC_CMD), A
NOP
NOP
IN A, (FDC_WAIT)
IN A, (FDC_DRQ)
IN A, (FDC_CMD)
AND ASCII_EM
AND 00011001b
CP 0x0
JP Z, .l2
JP Z, .seek_sec_ok
SCF
LD A, 0x40
.l2:
.seek_sec_ok:
PUSH AF
LD A, E
OUT (FDC_SECT), A
@ -4789,7 +4806,7 @@ m_fdc_write_bytes:
LD A, C
OUT (FDC_CMD), A
.w_next:
IN A, (FDC_WAIT)
IN A, (FDC_DRQ)
RRCA
LD A, (HL)
OUT (FDC_DATA), A
@ -4799,7 +4816,11 @@ m_fdc_write_bytes:
RET
; ---------------------------------------------------
;
; Read byte(s) to [HL] until DRQ is set
; Inp: C - FDC read command
; HL -> to buffer
; Out: CF set if error
; A - error code if CF set
; ---------------------------------------------------
m_fdc_read_c_bytes:
LD A, C
@ -4809,8 +4830,8 @@ m_fdc_read_c_bytes:
LD (HL), A
INC HL
.l2:
IN A, (FDC_WAIT)
RRCA
IN A, (FDC_DRQ)
RRCA ; CF = DRQ state
IN A, (FDC_DATA)
JP C, .l1
CALL fdc_check_status ; TODO: replace call+ret to jp
@ -4821,27 +4842,27 @@ m_fdc_read_c_bytes:
; Out: CF set if errors
; ---------------------------------------------------
fdc_check_status:
IN A,(FDC_CMD)
AND 11011111b
IN A, (FDC_CMD)
AND 11011111b ; check status of
CP 0x0
JP Z,fdc_ret
IN A,(FDC_CMD)
JP Z, fdc_ret
IN A, (FDC_CMD)
CP 0x80
LD C,0x80
JP Z,fcs_error
LD C, 0x80
JP Z, fcs_error
CP 0x40
LD C,0x3
JP Z,fcs_error
LD C, 0x3
JP Z, fcs_error
CP 0x10
LD C,0x4
JP Z,fcs_error
LD C, 0x4
JP Z, fcs_error
CP 0x8
LD C,0x9
JP Z,fcs_error
LD C,0x10
LD C, 0x9
JP Z, fcs_error
LD C, 0x10
fcs_error:
SCF
LD A,C
LD A, C
fdc_ret:
RET
@ -4853,71 +4874,71 @@ LAST EQU $
CODE_SIZE EQU LAST-0xe000
FILL_SIZE EQU ROM_CHIP_SIZE-CODE_SIZE
IFDEF CHECK_INTEGRITY
ASSERT m_start = 0xe036
ASSERT conf_uart = 0xe08c
ASSERT conf_pic = 0xe09f
ASSERT jump_bios = 0xe0d6
ASSERT m_out_strz = 0xe0e7
ASSERT m_cold_start = 0xe10c
ASSERT registers_tab = 0xe27e
ASSERT m_char_print = 0xe2e8
ASSERT m_con_out = 0xe307
ASSERT m_con_out_int = 0xe311
ASSERT get_esc_param = 0xe32b
ASSERT esc_params_tab = 0xe3ae
ASSERT esc_set_beep = 0xe3dd
ASSERT esc_print_screen = 0xe3fb
ASSERT m_print_hor_line = 0xe424
ASSERT m_get_7vpix = 0xe49e
ASSERT esc_set_palette = 0xe4e8
ASSERT m_get_glyph = 0xe50a
ASSERT m_print_no_esc = 0xe533
ASSERT calc_addr_40 = 0xe6b2
ASSERT mp_mode_64 = 0xe72e
ASSERT scroll_up = 0xe777
ASSERT mp_mode_80 = 0xe7c2
ASSERT m80_rt = 0xe85d
ASSERT calc_addr_80 = 0xe8a0
ASSERT m_clear_screen = 0xe900
ASSERT m_cursor_home = 0xe933
ASSERT m_draw_cursor = 0xe961
ASSERT m_handle_esc_code = 0xeb04
ASSERT handle_cc_common = 0xeb4c
ASSERT handle_cc_mono = 0xeb87
ASSERT handle_cc_80x25 = 0xebce
ASSERT m_beep = 0xebf5
ASSERT esc_set_cursor = 0xec2b
ASSERT esc_set_vmode = 0xec8b
ASSERT esc_set_color = 0xecbc
ASSERT m_print_at_xy = 0xecd0
ASSERT calc_px_addr = 0xed4b
ASSERT esc_draw_fill_rect = 0xed5e
ASSERT esc_draw_line = 0xedf7
ASSERT esc_draw_dot = 0xef3e
ASSERT esc_draw_circle = 0xef62
ASSERT dc_put_pixel = 0xf0a8
ASSERT get_key_with_check = 0xf5ce
ASSERT m_tape_write_ram = 0xf654
ASSERT m_tape_read_ram = 0xf6a4
ASSERT m_ramdisk_read = 0xf76a
ASSERT m_ramdisk_write = 0xf794
ASSERT m_tape_write = 0xf7be
ASSERT m_tape_wr_byte = 0xf835
ASSERT m_tape_read = 0xf88e
ASSERT m_read_tape_bit = 0xf92f
ASSERT m_tape_wait = 0xf97f
ASSERT m_select_drive = 0xf9e8
ASSERT m_start = 0xe036
ASSERT conf_uart = 0xe08c
ASSERT conf_pic = 0xe09f
ASSERT jump_bios = 0xe0d6
ASSERT m_out_strz = 0xe0e7
ASSERT m_cold_start = 0xe10c
ASSERT registers_tab = 0xe27e
ASSERT m_char_print = 0xe2e8
ASSERT m_con_out = 0xe307
ASSERT m_con_out_int = 0xe311
ASSERT get_esc_param = 0xe32b
ASSERT esc_params_tab = 0xe3ae
ASSERT esc_set_beep = 0xe3dd
ASSERT esc_print_screen = 0xe3fb
ASSERT m_print_hor_line = 0xe424
ASSERT m_get_7vpix = 0xe49e
ASSERT esc_set_palette = 0xe4e8
ASSERT m_get_glyph = 0xe50a
ASSERT m_print_no_esc = 0xe533
ASSERT calc_addr_40 = 0xe6b2
ASSERT mp_mode_64 = 0xe72e
ASSERT scroll_up = 0xe777
ASSERT mp_mode_80 = 0xe7c2
ASSERT m80_rt = 0xe85d
ASSERT calc_addr_80 = 0xe8a0
ASSERT m_clear_screen = 0xe900
ASSERT m_cursor_home = 0xe933
ASSERT m_draw_cursor = 0xe961
ASSERT m_handle_esc_code = 0xeb04
ASSERT handle_cc_common = 0xeb4c
ASSERT handle_cc_mono = 0xeb87
ASSERT handle_cc_80x25 = 0xebce
ASSERT m_beep = 0xebf5
ASSERT esc_set_cursor = 0xec2b
ASSERT esc_set_vmode = 0xec8b
ASSERT esc_set_color = 0xecbc
ASSERT m_print_at_xy = 0xecd0
ASSERT calc_px_addr = 0xed4b
ASSERT esc_draw_fill_rect = 0xed5e
ASSERT esc_draw_line = 0xedf7
ASSERT esc_draw_dot = 0xef3e
ASSERT esc_draw_circle = 0xef62
ASSERT dc_put_pixel = 0xf0a8
ASSERT get_key_with_check = 0xf5ce
ASSERT m_tape_write_ram = 0xf654
ASSERT m_tape_read_ram = 0xf6a4
ASSERT m_ramdisk_read = 0xf76a
ASSERT m_ramdisk_write = 0xf794
ASSERT m_tape_write = 0xf7be
ASSERT m_tape_wr_byte = 0xf835
ASSERT m_tape_read = 0xf88e
ASSERT m_read_tape_bit = 0xf92f
ASSERT m_tape_wait = 0xf97f
ASSERT m_select_drive = 0xf9e8
ASSERT m_read_floppy = 0xfa36
ASSERT m_write_floppy = 0xfa47
ASSERT m_start_floppy = 0xfa61
ASSERT fdc_init = 0xfa90
ASSERT m_fdc_seek_trk = 0xfa9c
ASSERT m_fdc_write_bytes = 0xfad8
ASSERT m_fdc_read_c_bytes = 0xfae9
ASSERT fdc_check_status = 0xfafd
ASSERT m_read_floppy = 0xfa36
ASSERT m_write_floppy = 0xfa47
ASSERT m_start_floppy = 0xfa61
ASSERT fdc_init = 0xfa90
ASSERT m_fdc_seek_trk = 0xfa9c
ASSERT m_fdc_write_bytes = 0xfad8
ASSERT m_fdc_read_c_bytes = 0xfae9
ASSERT fdc_check_status = 0xfafd
ENDIF
;DISPLAY "m_handle_esc_code: ", /H, m_handle_esc_code

View File

@ -13,17 +13,7 @@
"--fullpath",
"monitor.asm"
],
"problemMatcher": {
"owner": "sjasmplus",
"fileLocation": "autoDetect",
"pattern": {
"regexp": "^(.*)\\((\\d+)\\):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
},
"problemMatcher": "$problem-matcher-sjasmplus",
"group": {
"kind": "build",
"isDefault": true

View File

@ -15,6 +15,8 @@
OUTPUT mon_E000.bin
; Check original labels position
DEFINE CHECK_INTEGRITY
MODULE MONITOR
@ -5173,56 +5175,59 @@ LAST EQU $
CODE_SIZE EQU LAST-0xe000
FILL_SIZE EQU ROM_CHIP_SIZE-CODE_SIZE
IFDEF CHECK_INTEGRITY
ASSERT m_hot_start = 0xe039
ASSERT m_out_strz = 0xe0d9
ASSERT m_char_print = 0xe130
ASSERT m_con_out = 0xe14a
ASSERT m_con_out_int = 0xe154
ASSERT get_esc_param = 0xe16e
ASSERT esc_params_tab = 0xe1b2
ASSERT esc_handler_tab = 0xe1c2
ASSERT esc_set_beep = 0xe1e0
ASSERT esc_print_screen = 0xe1f8
ASSERT m_print_hor_line = 0xe221
ASSERT m_get_7vpix = 0xe29b
ASSERT esc_set_palette = 0xe2e5
ASSERT m_get_glyph = 0xe307
ASSERT m_print_no_esc = 0xe330
ASSERT calc_addr_40 = 0xe420
ASSERT mp_mode_64 = 0xe49f
ASSERT calc_addr_80 = 0xe5f9
ASSERT m_clear_screen = 0xe620
ASSERT m_cursor_home = 0xe653
ASSERT m_draw_cursor = 0xe681
ASSERT m_handle_esc_code = 0xe763
ASSERT handle_cc_common = 0xe7ab
ASSERT handle_cc_80x25 = 0xe81a
ASSERT m_beep = 0xe841
ASSERT esc_set_cursor = 0xe877
ASSERT esc_set_vmode = 0xe8d6
ASSERT esc_set_color = 0xe91c
ASSERT m_print_at_xy = 0xe930
ASSERT game_sprite_tab = 0xea26
ASSERT calc_px_addr = 0xeb46
ASSERT esc_draw_fill_rect = 0xeb59
ASSERT esc_paint = 0xebd4
ASSERT draw_line_h = 0xee8d
ASSERT esc_draw_line = 0xeec7
ASSERT esc_draw_dot = 0xf00e
ASSERT esc_picture = 0xf121
ASSERT esc_draw_circle = 0xf2e1
ASSERT dc_put_pixel = 0xf427
ASSERT esc_get_put_image = 0xf0b5
ASSERT me_out_strz = 0xf9cb
ASSERT m_ramdisk_read = 0xf9d8
ASSERT m_ramdisk_write = 0xfa02
ASSERT m_tape_write = 0xfa2c
ASSERT m_tape_wr_byte = 0xfaa3
ASSERT m_tape_read = 0xfafc
ASSERT m_read_tape_bit = 0xfb9d
ASSERT m_tape_wait = 0xfbed
ASSERT m_select_drive = 0xfc66
ASSERT m_hot_start = 0xe039
ASSERT m_out_strz = 0xe0d9
ASSERT m_char_print = 0xe130
ASSERT m_con_out = 0xe14a
ASSERT m_con_out_int = 0xe154
ASSERT get_esc_param = 0xe16e
ASSERT esc_params_tab = 0xe1b2
ASSERT esc_handler_tab = 0xe1c2
ASSERT esc_set_beep = 0xe1e0
ASSERT esc_print_screen = 0xe1f8
ASSERT m_print_hor_line = 0xe221
ASSERT m_get_7vpix = 0xe29b
ASSERT esc_set_palette = 0xe2e5
ASSERT m_get_glyph = 0xe307
ASSERT m_print_no_esc = 0xe330
ASSERT calc_addr_40 = 0xe420
ASSERT mp_mode_64 = 0xe49f
ASSERT calc_addr_80 = 0xe5f9
ASSERT m_clear_screen = 0xe620
ASSERT m_cursor_home = 0xe653
ASSERT m_draw_cursor = 0xe681
ASSERT m_handle_esc_code = 0xe763
ASSERT handle_cc_common = 0xe7ab
ASSERT handle_cc_80x25 = 0xe81a
ASSERT m_beep = 0xe841
ASSERT esc_set_cursor = 0xe877
ASSERT esc_set_vmode = 0xe8d6
ASSERT esc_set_color = 0xe91c
ASSERT m_print_at_xy = 0xe930
ASSERT game_sprite_tab = 0xea26
ASSERT calc_px_addr = 0xeb46
ASSERT esc_draw_fill_rect = 0xeb59
ASSERT esc_paint = 0xebd4
ASSERT draw_line_h = 0xee8d
ASSERT esc_draw_line = 0xeec7
ASSERT esc_draw_dot = 0xf00e
ASSERT esc_picture = 0xf121
ASSERT esc_draw_circle = 0xf2e1
ASSERT dc_put_pixel = 0xf427
ASSERT esc_get_put_image = 0xf0b5
ASSERT me_out_strz = 0xf9cb
ASSERT m_ramdisk_read = 0xf9d8
ASSERT m_ramdisk_write = 0xfa02
ASSERT m_tape_write = 0xfa2c
ASSERT m_tape_wr_byte = 0xfaa3
ASSERT m_tape_read = 0xfafc
ASSERT m_read_tape_bit = 0xfb9d
ASSERT m_tape_wait = 0xfbed
ASSERT m_select_drive = 0xfc66
ENDIF
; DISPLAY "esc_paint: ", /H, esc_paint

View File

@ -33,7 +33,8 @@ tape_read_f EQU 0xD639
tape_write_f EQU 0xD63C
tape_wait_f EQU 0xD63F
bios_var04 EQU 0xD64B
drive_B_tracks EQU 0xD64B
drive_C_tracks EQU 0xD64C
ENDMODULE

View File

@ -39,16 +39,32 @@ CCP_SIZE EQU 0x809
CPM_VERSION EQU 0x22 ; Version of CP/M as byte nibbles '2.2'
CTRL EQU 0x5E ; ^
CTRL_A EQU 0x01
CTRL_B EQU 0x02
CTRL_C EQU 0x03 ; Warm boot
CTRL_H EQU 0x08 ; Backspace
CTRL_D EQU 0x04
CTRL_E EQU 0x05 ; Move to beginning of new line (Physical EOL)
CTRL_F EQU 0x06
CTRL_G EQU 0x07
CTRL_H EQU 0x08 ; Backspace
CTRL_I EQU 0x09
CTRL_J EQU 0x0A ; LF - Line Feed
CTRL_K EQU 0x0B
CTRL_L EQU 0x0C
CTRL_M EQU 0x0D ; CR - Carriage Return
CTRL_N EQU 0x0E
CTRL_O EQU 0x0F
CTRL_P EQU 0x10 ; turn on/off printer
CTRL_Q EQU 0x11
CTRL_R EQU 0x12 ; Repeat current cmd line
CTRL_S EQU 0x13 ; Temporary stop display data to console (aka DC3)
CTRL_T EQU 0x14
CTRL_U EQU 0x15 ; Cancel (erase) current cmd line
CTRL_V EQU 0x16
CTRL_W EQU 0x17
CTRL_X EQU 0x18 ; Cancel (erase) current cmd line
CTRL_Y EQU 0x19
CTRL_Z EQU 0x1A ; CTRL-Z - end of text file marker
; ------------------------------------------------------
DBPLIST EQU 0x0F
@ -69,9 +85,10 @@ FDC_DD80RB EQU 0x21
FDC_NOT_READY EQU 0x80
FDC_RESTORE_L EQU 0x08
FDC_SEEK_LV EQU 0x1C
FDC_RESTORE_UH_NV EQU 0x03 ; Restore Unload Head, No Verify, 15ms Rate
FDC_RESTORE EQU 0x03 ; Restore Unload Head, No Verify, 15ms Rate
FILE_DELETED EQU 0xE5
FWF_MASK EQU 0x80 ; File Write Flag mask
FLOPPY_SSEL EQU 0x20
; ---------------------------------------------------
; FCB Offsets
@ -109,7 +126,11 @@ IRQ_2 EQU 0x04
;LP_IRQ EQU 0x08
KBD_IRQ EQU 0x02
KBD_ACK EQU 0x10
KBD_ACK EQU 0x80
IRQ_KEYBOARD EQU 0x02
IRQ_PRINTER EQU 0x08
IRQ_TIMER EQU 0x10
KEY_ALF EQU 0x0D
KEY_FIX EQU 0x15

View File

@ -28,22 +28,26 @@ USR_DD79CTR EQU 0x03
; -------------------------------------------------------
; КР1818ВГ93
; -------------------------------------------------------
; CMD
; WR: FDC CMD
; RD: STATUS
FDC_CMD EQU 0x20
; TRACK
; FDC TRACK
FDC_TRACK EQU 0x21
; SECTOR
; FDC SECTOR
FDC_SECT EQU 0x22
; DATA
; FDC DATA
FDC_DATA EQU 0x23
;
; RD: Bit 0 - DRQ
FDC_WAIT EQU 0x24
; Controller port
; RD: [MOTST,SSEL,x,x,DRSEL,MOT1,MOT0,INTRQ]
; WR: [x,x,SSEL,#DDEN,INIT,DRSEL,MOT1,MOT0]
FLOPPY EQU 0x25

496
MON_r8_9c6c6546/m8_all.map Normal file
View File

@ -0,0 +1,496 @@
MONITOR.mon_start 0xe000 f
MONITOR.mon_hexb 0xe003 f
MONITOR.non_con_status 0xe006 f
MONITOR.mon_con_in 0xe009 f
MONITOR.mon_con_out 0xe00c f
MONITOR.mon_serial_in 0xe00f f
MONITOR.mon_serial_out 0xe012 f
MONITOR.mon_char_print 0xe015 f
MONITOR.mon_tape_read 0xe018 f
MONITOR.mon_tape_write 0xe01b f
MONITOR.mon_ram_disk_read 0xe01e f
MONITOR.mon_ram_disk_write 0xe021 f
MONITOR.mon_tape_read_ram 0xe024 f
MONITOR.mon_tape_write_ram 0xe027 f
MONITOR.mon_tape_wait 0xe02a f
MONITOR.mon_tape_detect 0xe02d f
MONITOR.mon_read_floppy 0xe030 f
MONITOR.mon_write_floppy 0xe033 f
MONITOR.mon_out_str_z 0xe036 f
MONITOR.m_start 0xe051 f
MONITOR.m_start.fill_video 0xe06c f
MONITOR.m_start.conf_uart 0xe0a7 f
MONITOR.m_start.conf_pic 0xe0ba f
MONITOR.m_out_strz 0xe0f1 f
MONITOR.mgs_system_nf 0xe0fc f
MONITOR.m_sys_halt 0xe111 f
MONITOR.m_con_status 0xe112 f
MONITOR.m_serial_in 0xe11c f
MONITOR.m_con_in 0xe128 f
MONITOR.m_serial_out 0xe13d f
MONITOR.m_char_print 0xe148 f
MONITOR.m_char_print.wait_lp 0xe157 f
MONITOR.m_con_out 0xe163 f
MONITOR.m_con_out_int 0xe16d f
MONITOR.get_esc_param 0xe187 f
MONITOR.esc_no_draw_fn 0xe1c1 f
MONITOR.esc_exit 0xe1c6 f
MONITOR.esc_params_tab 0xe1cb f
MONITOR.esc_handler_tab 0xe1db f
MONITOR.esc_set_beep 0xe1f9 f
MONITOR.esc_set_cursor2 0xe20e f
MONITOR.esc_print_screen 0xe211 f
MONITOR.esc_print_screen.chk_keys 0xe220 f
MONITOR.esc_print_screen.no_keys 0xe22d f
MONITOR.m_print_hor_line 0xe23a f
MONITOR.m_print_hor_line.print_next_col 0xe248 f
MONITOR.m_print_cmd 0xe276 f
MONITOR.m_print_cmd.print_nxt 0xe277 f
MONITOR.m_print_cmd.cmd_end 0xe285 f
MONITOR.m_print_vert_7pix 0xe287 f
MONITOR.cmd_esc_inc_Y2 0xe2a5 f
MONITOR.cmd_esc_set_X0 0xe2a9 f
MONITOR.cmd_esc_set_X 0xe2ae f
MONITOR.cmd_esc_print_col 0xe2b1 f
MONITOR.m_get_7vpix 0xe2b4 f
MONITOR.m_get_7vpix.calc_pix_no 0xe2be f
MONITOR.m_get_7vpix.for_all_pix 0xe2dc f
MONITOR.m_get_7vpix.all_shifted 0xe2e9 f
MONITOR.m_get_7vpix.not_1_1 0xe2f2 f
MONITOR.m_get_7vpix.not_1_2 0xe2fa f
MONITOR.esc_set_palette 0xe2fe f
MONITOR.esp_no_colr 0xe313 f
MONITOR.esc_set_charset 0xe317 f
MONITOR.m_get_glyph 0xe320 f
MONITOR.m_get_glyph.cp_rus 0xe340 f
MONITOR.m_get_glyph.cp_common 0xe344 f
MONITOR.m_print_no_esc 0xe349 f
MONITOR.m_print_no_esc.l1 0xe377 f
MONITOR.m_print_no_esc.l2 0xe381 f
MONITOR.m_print_no_esc.l3 0xe389 f
MONITOR.m_print_no_esc.l4 0xe391 f
MONITOR.m_print_no_esc.l5 0xe396 f
MONITOR.m_print_no_esc.sym_draw 0xe39a f
MONITOR.m_print_no_esc.pne_l7 0xe3a5 f
MONITOR.m_print_no_esc.pne_l8 0xe3aa f
MONITOR.m40_rt 0xe3ee f
MONITOR.m40_wrap_rt 0xe3f9 f
MONITOR.m40_lf 0xe405 f
MONITOR.m40_bksp 0xe40f f
MONITOR.m40_bksp.wrap 0xe41d f
MONITOR.m40_up 0xe421 f
MONITOR.m40_up.up_no_minus 0xe429 f
MONITOR.m20_tab 0xe42b f
MONITOR.calc_addr_40 0xe439 f
MONITOR.calc_addr_40.l1 0xe454 f
MONITOR.calc_addr_40.l2 0xe45a f
MONITOR.m2_lf 0xe464 f
MONITOR.m2_lf.lf_nowr 0xe46e f
MONITOR.m2_lf.cas_l5 0xe47b f
MONITOR.m2_lf.cas_l6 0xe480 f
MONITOR.m2_lf.cas_l7 0xe496 f
MONITOR.m2_lf.cas_l8 0xe49b f
MONITOR.m20_bksp 0xe4ab f
MONITOR.mp_mode_64 0xe4b8 f
MONITOR.mp_mode_64.next_row 0xe4d3 f
MONITOR.m64_rt 0xe4e7 f
MONITOR.m64_lf 0xe4f0 f
MONITOR.scroll_up 0xe4fa f
MONITOR.scroll_up.next_row 0xe512 f
MONITOR.scroll_up.next_col 0xe514 f
MONITOR.m64_bs 0xe524 f
MONITOR.m64_up 0xe52f f
MONITOR.m64_up.no_wrap 0xe537 f
MONITOR.m64_tab 0xe539 f
MONITOR.mp_mode_80 0xe545 f
MONITOR.mp_mode_80.l1 0xe55e f
MONITOR.mp_mode_80.l2 0xe56d f
MONITOR.mp_mode_80.l3 0xe58e f
MONITOR.mp_mode_80.l4 0xe5b3 f
MONITOR.mp_mode_80.l5 0xe5b4 f
MONITOR.mp_mode_80.l6 0xe5c4 f
MONITOR.m80_rt 0xe5cf f
MONITOR.m80_col_wrap 0xe5da f
MONITOR.m80_lf 0xe5de f
MONITOR.m80_bs 0xe5e8 f
MONITOR.m80_bs.wrap 0xe5f6 f
MONITOR.m80_up 0xe5fa f
MONITOR.m80_up.no_wrap 0xe602 f
MONITOR.m80_tab 0xe604 f
MONITOR.calc_addr_80 0xe612 f
MONITOR.mns_l1 0xe62d f
MONITOR.mns_ep_fm_0 0xe633 f
MONITOR.m_clear_screen 0xe639 f
MONITOR.m_clear_screen.fill_scrn 0xe652 f
MONITOR.m_clear_screen.mono_mode 0xe669 f
MONITOR.m_cursor_home 0xe66c f
MONITOR.m_clear_20_rows 0xe679 f
MONITOR.m_clear_20_rows.next_row 0xe683 f
MONITOR.m_clear_20_rows.next_col 0xe688 f
MONITOR.m_draw_cursor 0xe69a f
MONITOR.m_draw_cursor.dc_rt2 0xe6cf f
MONITOR.m_draw_cursor.dc_mid 0xe6d7 f
MONITOR.m_draw_cursor.dc_lt 0xe6dd f
MONITOR.m_draw_cursor.dc_rt1 0xe6e3 f
MONITOR.m_draw_cursor.dc_put 0xe6e6 f
MONITOR.m_draw_cursor.dc_mode_64 0xe703 f
MONITOR.m_draw_cursor.cur_64_next 0xe721 f
MONITOR.m_draw_cursor.dc_mode_80 0xe72f f
MONITOR.m_draw_cursor.dc_1_byte 0xe75e f
MONITOR.m_draw_cursor.dc_2_byte 0xe769 f
MONITOR.m_draw_cursor.dc_80_end 0xe776 f
MONITOR.m_handle_esc_code 0xe77c f
MONITOR.m_handle_control_code 0xe78a f
MONITOR.handle_cc_common 0xe7c4 f
MONITOR.handle_cc_common.handle_cc_mono 0xe7ff f
MONITOR.handle_cc_80x25 0xe833 f
MONITOR.m_beep 0xe85a f
MONITOR.m_bell_cont 0xe86f f
MONITOR.m_bell_wait_tmr1 0xe879 f
MONITOR.m_bell_wait_tmr2 0xe886 f
MONITOR.esc_set_cursor 0xe890 f
MONITOR.esc_set_cursor.mode_40 0xe8bf f
MONITOR.esc_set_cursor.mode_80 0xe8ca f
MONITOR.esc_set_cursor.common 0xe8d2 f
MONITOR.esc_le_24 0xe8df f
MONITOR.esc_set_vmode 0xe8e9 f
MONITOR.esc_set_vmode.set_color_mode 0xe90f f
MONITOR.esc_set_vmode.skip_for_mono_mode 0xe911 f
MONITOR.esc_set_vmode.draw_cursor 0xe91a f
MONITOR.esc_set_vmode.cursor_hide 0xe91e f
MONITOR.esc_set_vmode.cursor_show 0xe928 f
MONITOR.esc_set_color 0xe92f f
MONITOR.m_set_color 0xe932 f
MONITOR.m_print_at_xy 0xe943 f
MONITOR.m_print_at_xy.mode_sp 0xe986 f
MONITOR.m_print_at_xy.out_sp 0xe99b f
MONITOR.m_print_at_xy.next_line 0xe9a2 f
MONITOR.m_print_at_xy.l04 0xe9af f
MONITOR.m_print_at_xy.l05 0xe9b4 f
MONITOR.m_print_at_xy.sprites_en 0xe9e2 f
MONITOR.mode2_exit 0xe9e6 f
MONITOR.co_ex_l08 0xe9ed f
MONITOR.out_no_xor 0xe9f1 f
MONITOR.out_no_xor.l10 0xe9fe f
MONITOR.out_no_xor.l11 0xea03 f
MONITOR.game_sprite_tab 0xea39 f
MONITOR.calc_px_addr 0xeb51 f
MONITOR.esc_draw_fill_rect 0xeb64 f
MONITOR.esc_draw_fill_rect.non_zero_h 0xeb73 f
MONITOR.esc_draw_fill_rect.shift_mask_l 0xeb78 f
MONITOR.esc_draw_fill_rect.shift_mask_r 0xeb8d f
MONITOR.esc_draw_fill_rect.next_line 0xebb7 f
MONITOR.esc_draw_fill_rect.rectangle_xor 0xebc6 f
MONITOR.esc_draw_fill_rect.edf_l6 0xebd5 f
MONITOR.esc_draw_fill_rect.next_8px 0xebdf f
MONITOR.esc_draw_fill_rect.w_ne_0 0xebe0 f
MONITOR.esc_draw_fill_rect.r_mask 0xebf6 f
MONITOR.esc_draw_fill_rect.next_full 0xebfc f
MONITOR.esc_draw_fill_rect.complete 0xec0b f
MONITOR.esc_paint 0xec18 f
MONITOR.esc_paint.l1 0xec57 f
MONITOR.ep_fm_0 0xec8b f
MONITOR.ep_task_end 0xec9a f
MONITOR.ep_l4 0xecb5 f
MONITOR.ep_l5 0xecbd f
MONITOR.ep_l6 0xecc5 f
MONITOR.ep_f_fast 0xecd7 f
MONITOR.ep_l8 0xece5 f
MONITOR.ep_l9 0xed1d f
MONITOR.ep_l10 0xed2c f
MONITOR.ep_l11 0xed3d f
MONITOR.paint_find_next_right 0xed77 f
MONITOR.paint_find_next_right.l1 0xed84 f
MONITOR.paint_find_next_right.l2 0xed90 f
MONITOR.paint_find_next_left 0xed9a f
MONITOR.paint_find_next_left.l1 0xeda7 f
MONITOR.paint_find_next_left.l2 0xedb3 f
MONITOR.ep_l12 0xedbd f
MONITOR.ep_l13 0xedd6 f
MONITOR.ep_l14 0xede8 f
MONITOR.ep_l15 0xedf1 f
MONITOR.ep_l16 0xedfa f
MONITOR.paint_find_right 0xedfd f
MONITOR.paint_find_right.in_byte 0xee0a f
MONITOR.paint_find_left 0xee18 f
MONITOR.paint_find_left.in_byte 0xee24 f
MONITOR.get_pixel 0xee32 f
MONITOR.get_pixel.bit1_set 0xee48 f
MONITOR.get_pixel.bit2_set 0xee57 f
MONITOR.get_pixel.bit12_set 0xee5f f
MONITOR.paint_task 0xee67 f
MONITOR.paint_task.lmp_mask 0xee7e f
MONITOR.paint_task.rmp_mask 0xee97 f
MONITOR.paint_task.lmi_mask 0xeea3 f
MONITOR.paint_task.rmi_mask 0xeeac f
MONITOR.paint_exit 0xeec6 f
MONITOR.draw_line_h 0xeed1 f
MONITOR.draw_line_h.next_byte 0xeedc f
MONITOR.draw_line_h.width_ne0 0xeedd f
MONITOR.draw_line_h.r_mask 0xeef5 f
MONITOR.draw_line_h.full_8 0xeefb f
MONITOR.draw_line_h.complete 0xef06 f
MONITOR.esc_draw_line 0xef0b f
MONITOR.esc_draw_line.x1_le_x2 0xef1b f
MONITOR.esc_draw_line.pos_height 0xef2b f
MONITOR.esc_draw_line.next_16 0xef45 f
MONITOR.esc_draw_line.edl_l4 0xef51 f
MONITOR.esc_draw_line.edl_l5 0xef54 f
MONITOR.esc_draw_line.roll_l 0xef67 f
MONITOR.esc_draw_line.edl_l7 0xef6e f
MONITOR.esc_draw_line.next_up 0xef89 f
MONITOR.esc_draw_line.next_down 0xef9f f
MONITOR.esc_draw_line.is_last 0xefb5 f
MONITOR.esc_draw_line.edl_l11 0xefc3 f
MONITOR.esc_draw_line.width0 0xefcb f
MONITOR.esc_draw_line.edl_l13 0xefd1 f
MONITOR.esc_draw_line.next_row_up 0xefe5 f
MONITOR.esc_draw_line.next_row_down 0xeffb f
MONITOR.close_vram_ret 0xf011 f
MONITOR.height0 0xf016 f
MONITOR.height0.len_ne0 0xf01e f
MONITOR.height0.edl_l19 0xf023 f
MONITOR.height0.next_col 0xf033 f
MONITOR.height0.edl_l21 0xf048 f
MONITOR.esc_draw_dot 0xf052 f
MONITOR.edd_l1 0xf05b f
MONITOR.edd_ep_fm_0 0xf084 f
MONITOR.edd_ep_task_end 0xf09d f
MONITOR.esc_picture 0xf0a4 f
MONITOR.pict_sub1 0xf0d6 f
MONITOR.pict_clr 0xf0f3 f
MONITOR.ehd_l1 0xf104 f
MONITOR.m_fn_39 0xf10f f
MONITOR.m_fn_39.l1 0xf12e f
MONITOR.m_fn_39.l2 0xf148 f
MONITOR.m_fn_39.l3 0xf15f f
MONITOR.get_image_hdr 0xf177 f
MONITOR.esc_get_put_image 0xf1b5 f
MONITOR.get_image 0xf1e1 f
MONITOR.get_image.next_row 0xf1e3 f
MONITOR.get_image.l2 0xf1f2 f
MONITOR.put_image 0xf201 f
MONITOR.put_image.next_row 0xf203 f
MONITOR.put_image.l2 0xf213 f
MONITOR.img_task_end 0xf21e f
MONITOR.fn39_sub2 0xf223 f
MONITOR.fn39_sub2.l1 0xf224 f
MONITOR.fn39_sub2.l2 0xf225 f
MONITOR.fn39_sub2.l3 0xf233 f
MONITOR.fn39_sub2.l4 0xf238 f
MONITOR.fn39_sub2.l5 0xf245 f
MONITOR.fn39_sub2.l6 0xf24a f
MONITOR.gih_rt 0xf266 f
MONITOR.gih_rt.l1 0xf289 f
MONITOR.gih_rt.l2 0xf28d f
MONITOR.gih_rt.l3 0xf291 f
MONITOR.gih_bs 0xf2bd f
MONITOR.gih_bs.l1 0xf2dd f
MONITOR.gih_bs.l2 0xf2e9 f
MONITOR.gih_bs.l3 0xf2ed f
MONITOR.gih_ctrl_z 0xf319 f
MONITOR.gih_ctrl_z.l1 0xf32e f
MONITOR.gih_ctrl_z.l2 0xf332 f
MONITOR.gih_ctrl_z.l3 0xf345 f
MONITOR.gih_ctrl_z.l4 0xf34a f
MONITOR.gih_ctrl_z.l5 0xf35a f
MONITOR.gih_up 0xf368 f
MONITOR.gih_up.l1 0xf378 f
MONITOR.gih_up.l2 0xf390 f
MONITOR.gih_up.l3 0xf394 f
MONITOR.gih_up.l4 0xf3a7 f
MONITOR.gih_up.l5 0xf3ac f
MONITOR.gih_up.l6 0xf3bc f
MONITOR.pict_sub2 0xf3ca f
MONITOR.pict_sub2.l1 0xf3f2 f
MONITOR.pict_sub2.l2 0xf3f7 f
MONITOR.pict_sub2.l3 0xf3fb f
MONITOR.pict_sub2.l4 0xf426 f
MONITOR.mov_hl_bc 0xf43b f
MONITOR.mov_hl_bc.next 0xf442 f
MONITOR.esc_draw_circle 0xf44c f
MONITOR.esc_draw_circle.l1 0xf469 f
MONITOR.esc_draw_circle.l2 0xf480 f
MONITOR.esc_draw_circle.l3 0xf4a2 f
MONITOR.dc_draw_8px 0xf4ab f
MONITOR.dc_aspect_ratio_1 0xf4c7 f
MONITOR.dc_aspect_ratio_1.dc_ax_ne0 0xf4d7 f
MONITOR.dc_aspect_ratio_1.dc_ay_ne0 0xf4e0 f
MONITOR.dc_aspect_ratio2 0xf4e7 f
MONITOR.dc_aspect_ratio2.dc_ax_ne0 0xf4f7 f
MONITOR.dc_aspect_ratio2.dc_ay_ne0 0xf500 f
MONITOR.dc_mul_e_h 0xf507 f
MONITOR.dc_mul_e_h.l1 0xf50f f
MONITOR.dc_mul_e_h.l2 0xf514 f
MONITOR.dc_mul_e_h.l3 0xf519 f
MONITOR.dc_mul_e_h.l4 0xf51e f
MONITOR.dc_mul_e_h.l5 0xf523 f
MONITOR.dc_mul_e_h.l6 0xf528 f
MONITOR.dc_mul_e_h.l7 0xf52d f
MONITOR.dc_mul_e_h.l8 0xf532 f
MONITOR.dc_draw_4px_bc 0xf534 f
MONITOR.dc_draw_4px_bc.l1 0xf540 f
MONITOR.dc_draw_4px_bc.l2 0xf54c f
MONITOR.dc_draw_4px_bc.l3 0xf558 f
MONITOR.dc_draw_4px_cb 0xf563 f
MONITOR.dc_draw_4px_cb.l1 0xf56f f
MONITOR.dc_draw_4px_cb.l2 0xf57b f
MONITOR.l3 0xf587 f
MONITOR.dc_put_pixel 0xf592 f
MONITOR.dc_put_pixel.roll 0xf59a f
MONITOR.m_font_cp0 0xf5bc f
MONITOR.m_font_cp1 0xf85c f
MONITOR.conv_nibble 0xfa1c f
MONITOR.m_hexb 0xfa26 f
MONITOR.out_hex 0xfa2f f
MONITOR.m_tape_write_ram2 0xfa36 f
MONITOR.m_tape_write_ram2.cl_stack 0xfa3b f
MONITOR.m_tape_write_ram2.nxt_blk 0xfa5d f
MONITOR.twr2_delay 0xfa73 f
MONITOR.twr2_delay.delay 0xfa76 f
MONITOR.m_tape_read_ram2 0xfa7d f
MONITOR.m_tape_read_ram2.srch_first 0xfa88 f
MONITOR.m_tape_read_ram2.rd_next 0xfaa6 f
MONITOR.m_tape_read_ram2.not_found 0xfac5 f
MONITOR.m_tape_read_ram2.rd_error 0xfacc f
MONITOR.m_tape_read_ram2.inv_id 0xfae1 f
MONITOR.m_tape_read_ram2.err_ubi 0xfaed f
MONITOR.m_tape_read_ram2.err_ibu 0xfaf5 f
MONITOR.m_tape_read_ram2.end 0xfaf6 f
MONITOR.out_hexw 0xfafd f
MONITOR.msg_no_start_rec 0xfb08 f
MONITOR.msg_checksum 0xfb18 f
MONITOR.msg_sequence 0xfb22 f
MONITOR.msg_ibg 0xfb2c f
MONITOR.msg_break 0xfb30 f
MONITOR.me_out_strz 0xfb36 f
MONITOR.m_ramdisk_read 0xfb43 f
MONITOR.m_ramdisk_read.read 0xfb55 f
MONITOR.m_ramdisk_write 0xfb6d f
MONITOR.m_ramdisk_write.wr_byte 0xfb7f f
MONITOR.m_tape_write 0xfb97 f
MONITOR.m_tape_write.l1 0xfbae f
MONITOR.m_tape_write.set_lvl 0xfbc0 f
MONITOR.m_tape_write.l2 0xfbd0 f
MONITOR.m_tape_write.next_byte 0xfbee f
MONITOR.m_tape_write.wait_end 0xfc00 f
MONITOR.m_tape_wr_byte 0xfc0e f
MONITOR.m_tape_wr_byte.get_bit 0xfc15 f
MONITOR.m_tape_wr_byte.wait_t 0xfc1b f
MONITOR.m_tape_wr_byte.out_bit 0xfc39 f
MONITOR.m_tape_wr_byte.bit_hi 0xfc41 f
MONITOR.m_tape_wr_byte.out_bit_hi 0xfc5f f
MONITOR.m_tape_read 0xfc67 f
MONITOR.m_tape_read.wait_3_changes 0xfc79 f
MONITOR.m_tape_read.wait_4th_change 0xfc8a f
MONITOR.m_tape_read.wait_f5_marker 0xfc99 f
MONITOR.m_tape_read.read_next_b 0xfcbd f
MONITOR.m_tape_read.checksum_ok 0xfcd6 f
MONITOR.m_tape_read.return 0xfcd7 f
MONITOR.m_tape_read.err_read_blk 0xfcda f
MONITOR.m_tape_read.err_read_id 0xfcde f
MONITOR.m_tape_read.key_pressed 0xfce3 f
MONITOR.m_tape_read_byte 0xfcee f
MONITOR.m_tape_read_byte.next_bit 0xfcf1 f
MONITOR.m_tape_read_byte.ret_err 0xfd06 f
MONITOR.m_read_tape_bit 0xfd08 f
MONITOR.m_read_tape_bit.wait_change 0xfd0d f
MONITOR.read_tape_bit_kbd 0xfd2b f
MONITOR.read_tape_bit_kbd.wait_change 0xfd30 f
MONITOR.read_tape_bit_kbd.key_pressed 0xfd55 f
MONITOR.m_tape_wait 0xfd58 f
MONITOR.m_tape_wait.wait_t4 0xfd5c f
MONITOR.m_tape_wait.wait_next_2ms 0xfd62 f
MONITOR.m_tape_wait.wait_tmr_key 0xfd6d f
MONITOR.m_tape_wait.wait_no_rst4 0xfd86 f
MONITOR.m_tape_wait.key_pressed 0xfd8d f
MONITOR.m_tape_blk_detect 0xfd95 f
MONITOR.floppy_reset 0xfd9e f
MONITOR.floppy_reset.wait_no_busy 0xfda8 f
MONITOR.floppy_reset.tr0_ok 0xfdba f
MONITOR.floppy_reset.b1 0xfdc9 f
MONITOR.m_select_drive 0xfdd1 f
MONITOR.m_select_drive.sel_A 0xfddf f
MONITOR.m_select_drive.sel_B 0xfde1 f
MONITOR.m_select_drive.dpar_a 0xfdf6 f
MONITOR.m_select_drive.dpar_b 0xfdf9 f
MONITOR.m_select_drive.l_le 0xfe15 f
MONITOR.delay_136uS 0xfe24 f
MONITOR.delay_b 0xfe26 f
MONITOR.delay_1.4mS 0xfe2b f
MONITOR.m_read_floppy 0xfe30 f
MONITOR.m_write_floppy 0xfe43 f
MONITOR.m_start_seek_track 0xfe56 f
MONITOR.m_start_floppy 0xfe5f f
MONITOR.m_start_floppy.need_m_start 0xfe6b f
MONITOR.m_start_floppy.wait_motor 0xfe76 f
MONITOR.m_start_floppy.wait_rdy1 0xfe7d f
MONITOR.m_start_floppy.long_delay 0xfe8f f
MONITOR.m_start_floppy.mst_exi 0xfe95 f
MONITOR.fdc_init 0xfe97 f
MONITOR.m_fdc_seek_trk 0xfea3 f
MONITOR.m_fdc_seek_trk.drv_b 0xfebc f
MONITOR.m_fdc_seek_trk.cmn 0xfecd f
MONITOR.m_fdc_seek_trk.l1 0xfef5 f
MONITOR.m_fdc_seek_trk.l2 0xff06 f
MONITOR.m_fdc_seek_trk.l3 0xff1d f
MONITOR.m_fdc_seek_trk.l4 0xff20 f
MONITOR.m_fdc_write_bytes 0xff26 f
MONITOR.m_fdc_write_bytes.w_next 0xff29 f
MONITOR.m_fdc_read_c_bytes 0xff37 f
MONITOR.m_fdc_read_c_bytes.l1 0xff3d f
MONITOR.m_fdc_read_c_bytes.l2 0xff3f f
MONITOR.fdc_check_status 0xff4b f
MONITOR.fdc_ret 0xff55 f
MONITOR.filler1 0xff56 f
MONITOR.LAST 0xff57 l
MONITOR.CODE_SIZE 0x1f57 l
MONITOR.FILL_SIZE 0xa9 l
MONITOR.FILLER 0xff57 f
M_VARS.buffer 0xbf00 f
M_VARS.paint_stack 0xbfa4 l
M_VARS.stack1 0xbfc4 l
M_VARS.paint_var1 0xbfc5 f
M_VARS.paint_var2 0xbfc6 f
M_VARS.paint_var3 0xbfc7 f
M_VARS.paint_var4 0xbfc8 f
M_VARS.paint_var5 0xbfc9 f
M_VARS.paint_y 0xbfca f
M_VARS.paint_var7 0xbfcb f
M_VARS.cmp_color 0xbfcc f
M_VARS.paint_sp_save 0xbfcd f
M_VARS.pixel_mask_r 0xbfcf f
M_VARS.tmp_color 0xbfd0 f
M_VARS.rect_var2 0xbfd1 f
M_VARS.stack_0 0xbfd2 l
M_VARS.rect_var3 0xbfd2 f
M_VARS.esc_mode 0xbfd3 f
M_VARS.esc_cmd 0xbfd4 f
M_VARS.esc_param_cnt 0xbfd5 f
M_VARS.esc_param 0xbfd6 f
M_VARS.pixel_mask_l_i 0xbfdd f
M_VARS.pixel_mask_r_i 0xbfde f
M_VARS.pixel_mask_l 0xbfdf f
M_VARS.screen_mode 0xbfe0 f
M_VARS.cursor_row 0xbfe1 f
M_VARS.cursor_col 0xbfe2 f
M_VARS.curr_color 0xbfe3 f
M_VARS.esc_hex_cmd 0xbfe5 f
M_VARS.row_shift 0xbfe5 f
M_VARS.codepage 0xbfe6 f
M_VARS.cur_palette 0xbfe7 f
M_VARS.beep_period 0xbfe8 f
M_VARS.beep_duration 0xbfea f
M_VARS.pix_shift 0xbfec f
M_VARS.strobe_state 0xbfed f
M_VARS.prn_start_x 0xbfee f
M_VARS.drv_B_inited 0xbfef f
M_VARS.drv_C_inited 0xbff0 f
M_VARS.drv_current 0xbff1 f
M_VARS.drv_B_track 0xbff2 f
M_VARS.drv_C_track 0xbff3 f
M_VARS.drv_dir_inout 0xbff4 f
M_VARS.esc_var0 0xbff5 f
M_VARS.esc_var1 0xbff6 f
M_VARS.esc_var2 0xbff7 f
M_VARS.esc_var3 0xbff8 f

View File

@ -0,0 +1,47 @@
buffer 0xbf00 l
paint_stack 0xbfa4 l
stack1 0xbfc4 l
paint_var1 0xbfc5 l
paint_var2 0xbfc6 l
paint_var3 0xbfc7 l
paint_var4 0xbfc8 l
paint_var5 0xbfc9 l
paint_y 0xbfca l
paint_var7 0xbfcb l
cmp_color 0xbfcc l
paint_sp_save 0xbfcd l
pixel_mask_r 0xbfcf l
tmp_color 0xbfd0 l
rect_var2 0xbfd1 l
stack_0 0xbfd2 l
rect_var3 0xbfd2 l
esc_mode 0xbfd3 l
esc_cmd 0xbfd4 l
esc_param_cnt 0xbfd5 l
esc_param 0xbfd6 l
pixel_mask_l_i 0xbfdd l
pixel_mask_r_i 0xbfde l
pixel_mask_l 0xbfdf l
screen_mode 0xbfe0 l
cursor_row 0xbfe1 l
cursor_col 0xbfe2 l
curr_color 0xbfe3 l
esc_hex_cmd 0xbfe5 l
row_shift 0xbfe5 l
codepage 0xbfe6 l
cur_palette 0xbfe7 l
beep_period 0xbfe8 l
beep_duration 0xbfea l
pix_shift 0xbfec l
strobe_state 0xbfed l
prn_start_x 0xbfee l
drv_B_inited 0xbfef l
drv_C_inited 0xbff0 l
drv_current 0xbff1 l
drv_B_track 0xbff2 l
drv_C_track 0xbff3 l
drv_dir_inout 0xbff4 l
esc_var0 0xbff5 l
esc_var1 0xbff6 l
esc_var2 0xbff7 l
esc_var3 0xbff8 l

View File

@ -18,13 +18,13 @@ paint_stack EQU $ ; 0xbfa4
DS 32
stack1: EQU $ ; 0xbfc4
DS 1
paint_var1 DS 1 ; 0xbfc5
paint_var2 DS 1 ; 0xbfc6
paint_var3 DS 1 ; 0xbfc7
paint_var4 DS 1 ; 0xbfc8
paint_var5 DS 1 ; 0xbfc9
paint_y DS 1 ; 0xbfca
paint_var7 DS 1 ; 0xbfcb
paint_var1 DS 1 ; 0xbfc5
paint_var2 DS 1 ; 0xbfc6
paint_var3 DS 1 ; 0xbfc7
paint_var4 DS 1 ; 0xbfc8
paint_var5 DS 1 ; 0xbfc9
paint_y DS 1 ; 0xbfca
paint_var7 DS 1 ; 0xbfcb
cmp_color DS 1 ; 0xbfcc
paint_sp_save DS 2
@ -43,12 +43,13 @@ esc_param DS 7 ; 0xbfd6
; Left inverse pixel mask ex: 00011111
pixel_mask_l_i DS 1
; Right inverse pixel mask ex: 00011111
pixel_mask_r_i DS 1
pixel_mask_r_i DS 1
; Left pixel mask ex: 11100000
pixel_mask_l DS 1
pixel_mask_l DS 1
; Current screen mode, bit 3 - hide/show cursor, bit 4 - only 20 rows
screen_mode DS 1 ; 0xbfe0
cursor_pos:
cursor_row DS 1 ; 0xbfe1 Cursor Y position
cursor_col DS 1 ; 0xbfe2 Cursor X position
curr_color DS 2 ; 0xbfe3 Current color low and hi bytes
@ -62,13 +63,13 @@ beep_period DS 2 ; 0xbfe8
beep_duration DS 2 ; 0xbfea
pix_shift DS 1 ; 0xbfec
strobe_state DS 1 ; 0xbfed
ul_var0 DS 1 ; 0xbfee
ul_A_var1 DS 1 ; 0xbfef
ul_B_var2 DS 1 ; 0xbff0
ul_var3 DS 1 ; 0xbff1
ul_A_var4 DS 1 ; 0xbff2
ul_B_var5 DS 1 ; 0xbff3
ul_var6 DS 1 ; 0xbff4
prn_start_x DS 1 ; 0xbfee
drv_B_inited DS 1 ; 0xbfef
drv_C_inited DS 1 ; 0xbff0
drv_current DS 1 ; 0xbff1
drv_B_track DS 1 ; 0xbff2
drv_C_track DS 1 ; 0xbff3
drv_dir_inout DS 1 ; 0xbff4
esc_var0 DS 1 ; 0xbff5
esc_var1 DS 1 ; 0xbff6
esc_var2 DS 1 ; 0xbff7
@ -89,7 +90,7 @@ esc_var3 DS 1 ; 0xbff8
ASSERT esc_mode = 0xbfd3
ASSERT screen_mode = 0xbfe0
ASSERT cur_palette = 0xbfe7
ASSERT ul_var0 = 0xbfee
ASSERT prn_start_x = 0xbfee
ASSERT paint_stack = 0xbfa4
ASSERT esc_var3 = 0xbff8

View File

@ -405,10 +405,10 @@ MONITOR.m_tape_wait.wait_tmr_key 0xfd6d f
MONITOR.m_tape_wait.wait_no_rst4 0xfd86 f
MONITOR.m_tape_wait.key_pressed 0xfd8d f
MONITOR.m_tape_blk_detect 0xfd95 f
MONITOR.fdc_unload_head 0xfd9e f
MONITOR.fdc_unload_head.wait_no_busy 0xfda8 f
MONITOR.fdc_unload_head.tr0_ok 0xfdba f
MONITOR.fdc_unload_head.b1 0xfdc9 f
MONITOR.floppy_reset 0xfd9e f
MONITOR.floppy_reset.wait_no_busy 0xfda8 f
MONITOR.floppy_reset.tr0_ok 0xfdba f
MONITOR.floppy_reset.b1 0xfdc9 f
MONITOR.m_select_drive 0xfdd1 f
MONITOR.m_select_drive.sel_A 0xfddf f
MONITOR.m_select_drive.sel_B 0xfde1 f

View File

@ -13,7 +13,9 @@
INCLUDE "ram.inc"
INCLUDE "bios_entries.inc"
OUTPUT mon_E000.bin
DEFINE CHECK_INTEGRITY
OUTPUT mon_E000.bin
MODULE MONITOR
@ -224,9 +226,8 @@ m_con_in:
NOP ; do not reset hi bit
NOP
PUSH AF
; TODO: Check if it is keyboard ACK
; PC7 Set Hi (ACK?)
LD A, 0x80
; PC7 Set Hi - ACK
LD A, KBD_ACK
OUT (KBD_DD78PC), A
; PC7 Set Lo
XOR A
@ -467,7 +468,7 @@ m_print_hor_line:
; Set printer X coordinate = 0
CALL m_print_cmd
LD HL, 4
LD (M_VARS.ul_var0), HL ; Set start coord X = 4
LD (M_VARS.prn_start_x), HL ; Set start coord X = 4
LD B, 0x0 ; TODO: LD B, H (save 1b 3t)
.print_next_col:
@ -476,20 +477,20 @@ m_print_hor_line:
CALL m_get_7vpix
AND D
CALL NZ, m_print_vert_7pix
LD HL, (M_VARS.ul_var0)
LD HL, (M_VARS.prn_start_x)
INC HL
; inc X
LD (M_VARS.ul_var0), HL
LD (M_VARS.prn_start_x), HL
LD C, 0x1
; 2
CALL m_get_7vpix
AND D
CALL NZ, m_print_vert_7pix
LD HL, (M_VARS.ul_var0)
LD HL, (M_VARS.prn_start_x)
INC HL
; inc X
LD (M_VARS.ul_var0), HL
LD (M_VARS.prn_start_x), HL
INC B
LD A, B
CP 236
@ -525,7 +526,7 @@ m_print_vert_7pix:
; Set coordinate X to 0
LD HL, cmd_esc_set_X
CALL m_print_cmd
LD HL, (M_VARS.ul_var0)
LD HL, (M_VARS.prn_start_x)
LD C,H
CALL m_char_print
LD C,L
@ -5188,98 +5189,123 @@ m_tape_blk_detect:
; FDC DRIVER
; ======================================================
fdc_unload_head:
LD A, 0x0
; ------------------------------------------------------
; Set drive head to Track-0 and wait to complete
; Inp: B = drive 0-B, 1-C
; Out: CF set if error
; A = 0x20 if timeout
; ------------------------------------------------------
floppy_init:
; reset data register
LD A, 0
OUT (FDC_DATA), A
LD A, FDC_RESTORE_UH_NV
; send seek track 0 command
LD A, FDC_RESTORE
OUT (FDC_CMD), A
; wait
NOP
NOP
.wait_no_busy:
IN A, (FDC_CMD)
AND 00000101b ; Track0 , Busy
AND 00000101b ; TR0, Busy
CP 00000100b
JP Z, .tr0_ok
;
IN A, (FLOPPY)
RLCA ; MOTST -> CF
JP NC, .wait_no_busy
; timeout
LD A, 0x20
RET
; ok, head at track 0
; set flags
.tr0_ok:
LD A, B
DEC A
LD A, 0x1
LD A, 1
JP Z, .b1
LD (M_VARS.ul_A_var1), A
LD (M_VARS.drv_B_inited), A
XOR A
LD (M_VARS.ul_A_var4), A
LD (M_VARS.drv_B_track), A
RET
.b1:
LD (M_VARS.ul_B_var2), A
LD (M_VARS.drv_C_inited), A
XOR A
LD (M_VARS.ul_B_var5), A
LD (M_VARS.drv_C_track), A
RET
; ---------------------------------------------------
;
; Inp: A - Drive
; C - FD1793 CMD
; D - Track
; ---------------------------------------------------
m_select_drive:
PUSH AF
CALL delay_1.4mS
CP 0x1 ; TODO: DEC A to save 1b 3t
JP Z, .sel_A
JP Z, .sel_b
LD A, 0x2
JP .sel_B
.sel_A
JP .sel_c
.sel_b:
LD A, 0x5
.sel_B
.sel_c:
LD B, A ; 010b or 101b
IN A, (FLOPPY) ; read Floppy controller reg
AND 0x40 ; SSEL
RRA ; SSEL for out
OR B ; 0x22 or 0x25 if WP
OUT (FLOPPY), A ; Select drive A or B
OUT (FLOPPY), A ; Select drive B or C
LD B, A
POP AF
; ckeck drive A = B-0, C-1
DEC A
JP Z, .dpar_a
LD A, (bios_var2)
JP .dpar_b
.dpar_a
LD A, (BIOS.bios_var04)
.dpar_b
JP Z, .side_b
LD A, (disk_C_tracks)
JP .side_c
.side_b:
LD A, (BIOS.drive_B_tracks)
.side_c:
PUSH BC
LD B, A ; B = dpar_A or B
LD A, D ; compare with D?
LD B, A ; B - track_no
LD A, D ; D - track
CP B
JP C, .l_le ; D < B
JP C, .side_0 ; track < track_count -> side_0
SUB B
LD D, A
POP BC
; Set hi bit of sector to 1
LD A, C
OR 0x8
LD C, A
; A = ssel+drsel+mot_x
LD A, B
AND 0x20
; get SSEL (Side Selected)
AND FLOPPY_SSEL
OR A
; return if already side 1
RET NZ
; else select side 1
LD A, B
OR 0x20 ; set SSEL to 1
OR FLOPPY_SSEL ; set SSEL to 1
OUT (FLOPPY), A
CALL delay_136uS
RET
.l_le
.side_0:
POP BC
; A = ssel+drsel+mot_x
LD A, B
AND 0x20
; get SSEL
AND FLOPPY_SSEL
OR A
; return if already side 0 (SSEL=0)
RET Z
; else select side 0 (set SSEL=0)
LD A, B
AND 0x7
; mask only drsel+mot_x
AND 0x07
OUT (FLOPPY), A
CALL delay_136uS
RET
@ -5320,7 +5346,9 @@ m_read_floppy:
RET
; ---------------------------------------------------
;
; Write data to floppy drive
; Inp: A - Drive No
; HL -> buffer
; ---------------------------------------------------
m_write_floppy:
PUSH AF
@ -5334,25 +5362,31 @@ m_write_floppy:
RET
; ---------------------------------------------------
;
; Start floppy and seek track
; Inp: A - drive
; D - track
; E - sector
; ---------------------------------------------------
m_start_seek_track:
CALL m_start_floppy
RET C
CALL m_fdc_seek_trk
RET C
RET ; TODO: remove
RET C ; TODO: remove
RET
; ---------------------------------------------------
;
; Start floppy motor
; Inp: A - drive
; Out: A = 0 if ok, A = 0x20 if timeout to start motor
; ---------------------------------------------------
m_start_floppy:
LD B, A
LD A, (M_VARS.ul_var3)
LD A, (M_VARS.drv_current)
CP B
JP Z, .need_m_start
CALL .wait_motor ; TODO: replace call+ret to jp
RET
.need_m_start:
IN A, (FLOPPY)
RLCA ; check MOTST
@ -5361,112 +5395,136 @@ m_start_floppy:
AND FDC_NOT_READY ; not ready flag
RET Z
; ---------------------------------------------------
;
; ---------------------------------------------------
.wait_motor:
PUSH BC
LD BC, 65535
CALL fdc_init
.wait_rdy1:
IN A, (FDC_CMD)
AND FDC_NOT_READY
JP Z, .long_delay
; stop wait if FDC ready
JP Z, .stop_wait
; wait motor start
IN A, (FLOPPY)
RLCA ; CF<-A[7] MOTST flag
JP NC, .wait_rdy1
LD A, 0x20
JP .mst_exi
JP .exit
.stop_wait:
.long_delay:
DEC BC
LD A, B
OR A
JP NZ, .long_delay
.mst_exi:
; exit with A=0 if no error
.exit:
POP BC
RET
; ---------------------------------------------------
;
; Init floppy controller
; ---------------------------------------------------
fdc_init:
; get controller register state
IN A, (FLOPPY)
AND 01001110b ; Get SSEL, DRSEL, MOT1, MOT0
RRA
OUT (FLOPPY), A
OR 0x08 ; Set INIT bit
; Set INIT bit
OR 0x08
; Sent to controller
OUT (FLOPPY), A
RET
; ---------------------------------------------------
; Seek track on floppy
; Inp: DE - track/sector
; Inp: B - floppy drive 0-B, 1-C
; DE - track/sector
; ---------------------------------------------------
m_fdc_seek_trk:
LD A, B
DEC A
JP Z, .drv_b
LD A, (M_VARS.ul_A_var1)
JP Z, .drv_c
; check init flag and init drive if needed
LD A, (M_VARS.drv_B_inited)
OR A
CALL Z, fdc_unload_head
CALL Z, floppy_init
; return if init error
RET C
LD A, (M_VARS.ul_A_var4)
; out previous track to FDC
LD A, (M_VARS.drv_B_track)
OUT (FDC_TRACK), A
; store new track no
LD A, D
LD (M_VARS.ul_A_var4), A
LD (M_VARS.drv_B_track), A
JP .cmn
.drv_b:
LD A, (M_VARS.ul_B_var2)
.drv_c:
LD A, (M_VARS.drv_C_inited)
OR A
CALL Z, fdc_unload_head
CALL Z, floppy_init
RET C
LD A, (M_VARS.ul_B_var5)
LD A, (M_VARS.drv_C_track)
OUT (FDC_TRACK), A
LD A, D
LD (M_VARS.ul_B_var5), A
.cmn:
LD A, (M_VARS.ul_var3)
LD A, (M_VARS.drv_current)
CP B
LD A, B
LD (M_VARS.ul_var3), A
JP NZ, .l2
; set new current drive
LD (M_VARS.drv_current), A
; seek track if drive changed
JP NZ, .set_track
; compare new and current track no
IN A, (FDC_TRACK)
CP D
JP Z, .l2
JP Z, .set_track
JP C, .l1
LD A, (M_VARS.ul_var6)
; new track < prev
LD A, (M_VARS.drv_dir_inout)
OR A
JP NZ, .l2
JP NZ, .set_track
LD B, 0xff
CALL delay_b
LD A, 0x1
LD (M_VARS.ul_var6), A
JP .l2
LD (M_VARS.drv_dir_inout), A
JP .set_track
.l1:
LD A, (M_VARS.ul_var6)
; new track > prev
LD A, (M_VARS.drv_dir_inout)
OR A
JP Z, .l2
JP Z, .set_track
LD B, 0xff
CALL delay_b
LD A, 0x0
LD (M_VARS.ul_var6), A
.l2:
LD (M_VARS.drv_dir_inout), A
.set_track:
; set track no to FDC
LD A, D
OUT (FDC_DATA), A
; seek track command to FDC (Load head & verify trk)
LD A, 0x1f
OUT (FDC_CMD), A
; wait
NOP
NOP
; check status
IN A, (FDC_WAIT)
IN A, (FDC_CMD)
AND 0x19
CP 0x0
JP NZ, .l3
JP .l4
.l3:
AND 0b00011001 ; SEEK_ERR, CRC_ERR, BUSY
CP 0
JP NZ, .seek_errs
JP .seek_ok
.seek_errs:
SCF
LD A, 0x40
.l4:
.seek_ok:
PUSH AF
LD A, E
OUT (FDC_SECT), A
@ -5474,36 +5532,49 @@ m_fdc_seek_trk:
RET
; ---------------------------------------------------
;
; Write bytes to floppy
; Inp: C - write sector command
; HL -> byte buffer
; ---------------------------------------------------
m_fdc_write_bytes:
; Send command to FDC
LD A, C
OUT (FDC_CMD), A
.w_next:
; DRQ -> CF
IN A, (FDC_WAIT)
RRCA
; Send byte to FDC
LD A, (HL)
OUT (FDC_DATA), A
INC HL
; repeat until DRQ active
JP C, .w_next
CALL fdc_check_status ; TODO: replace call+ret to jp
RET
; ---------------------------------------------------
;
; Read bytes from floppy
; Inp: C - read sector command
; HL -> byte buffer
; ---------------------------------------------------
m_fdc_read_c_bytes:
; Send command to FDC
LD A, C
OUT (FDC_CMD), A
JP .l2
.l1:
JP .get_drq
.read_next:
; put byte to buffer
LD (HL), A
INC HL
.l2:
.get_drq:
; DRQ -> CF
IN A, (FDC_WAIT)
RRCA
; read byte from FDC
IN A, (FDC_DATA)
JP C, .l1
JP C, .read_next
CALL fdc_check_status ; TODO: replace call+ret to jp
RET
@ -5512,10 +5583,13 @@ m_fdc_read_c_bytes:
; Out: CF set if errors
; ---------------------------------------------------
fdc_check_status:
; get FDC Status of last command
IN A, (FDC_CMD)
; mask Write Protect
AND 11011111b
CP 0x0
CP 0
JP Z, fdc_ret
; error found, set CF
SCF
fdc_ret:
RET
@ -5533,51 +5607,52 @@ CODE_SIZE EQU LAST-0xE000
FILL_SIZE EQU ROM_CHIP_SIZE-CODE_SIZE
ASSERT m_start = 0xe051
ASSERT m_out_strz = 0xe0f1
ASSERT m_con_out_int = 0xe16d
ASSERT get_esc_param = 0xe187
ASSERT esc_params_tab = 0xe1cb
ASSERT esc_handler_tab = 0xe1db
ASSERT esc_set_beep = 0xe1f9
ASSERT m_print_hor_line = 0xe23a
ASSERT m_get_7vpix = 0xe2b4
ASSERT esc_set_palette = 0xe2fe
ASSERT m_get_glyph = 0xe320
ASSERT m_print_no_esc = 0xe349
ASSERT calc_addr_40 = 0xe439
ASSERT mp_mode_64 = 0xe4b8
ASSERT calc_addr_80 = 0xe612
ASSERT m_clear_screen = 0xe639
ASSERT m_cursor_home = 0xe66c
ASSERT m_draw_cursor = 0xe69a
ASSERT m_handle_esc_code = 0xe77c
ASSERT handle_cc_common = 0xe7c4
ASSERT handle_cc_80x25 = 0xe833
ASSERT m_beep = 0xe85a
ASSERT esc_set_cursor = 0xe890
ASSERT esc_set_vmode = 0xe8e9
ASSERT esc_set_color = 0xe92f
ASSERT m_print_at_xy = 0xe943
ASSERT game_sprite_tab = 0xea39
ASSERT esc_draw_fill_rect = 0xeb64
ASSERT draw_line_h = 0xeed1
ASSERT esc_draw_line = 0xef0b
ASSERT esc_draw_dot = 0xf052
ASSERT esc_picture = 0xf0a4
ASSERT m_fn_39 = 0xf10f
ASSERT get_image_hdr = 0xf177
ASSERT esc_get_put_image = 0xf1b5
ASSERT pict_sub2 = 0xf3ca
ASSERT m_font_cp0 = 0xf5bc
ASSERT me_out_strz = 0xfb36
ASSERT m_ramdisk_write = 0xfb6d
ASSERT m_tape_write = 0xfb97
ASSERT m_tape_wr_byte = 0xfc0e
ASSERT m_tape_read_byte = 0xfcee
ASSERT m_read_tape_bit = 0xfd08
ASSERT m_tape_wait = 0xfd58
IFDEF CHECK_INTEGRITY
ASSERT m_start = 0xe051
ASSERT m_out_strz = 0xe0f1
ASSERT m_con_out_int = 0xe16d
ASSERT get_esc_param = 0xe187
ASSERT esc_params_tab = 0xe1cb
ASSERT esc_handler_tab = 0xe1db
ASSERT esc_set_beep = 0xe1f9
ASSERT m_print_hor_line = 0xe23a
ASSERT m_get_7vpix = 0xe2b4
ASSERT esc_set_palette = 0xe2fe
ASSERT m_get_glyph = 0xe320
ASSERT m_print_no_esc = 0xe349
ASSERT calc_addr_40 = 0xe439
ASSERT mp_mode_64 = 0xe4b8
ASSERT calc_addr_80 = 0xe612
ASSERT m_clear_screen = 0xe639
ASSERT m_cursor_home = 0xe66c
ASSERT m_draw_cursor = 0xe69a
ASSERT m_handle_esc_code = 0xe77c
ASSERT handle_cc_common = 0xe7c4
ASSERT handle_cc_80x25 = 0xe833
ASSERT m_beep = 0xe85a
ASSERT esc_set_cursor = 0xe890
ASSERT esc_set_vmode = 0xe8e9
ASSERT esc_set_color = 0xe92f
ASSERT m_print_at_xy = 0xe943
ASSERT game_sprite_tab = 0xea39
ASSERT esc_draw_fill_rect = 0xeb64
ASSERT draw_line_h = 0xeed1
ASSERT esc_draw_line = 0xef0b
ASSERT esc_draw_dot = 0xf052
ASSERT esc_picture = 0xf0a4
ASSERT m_fn_39 = 0xf10f
ASSERT get_image_hdr = 0xf177
ASSERT esc_get_put_image = 0xf1b5
ASSERT pict_sub2 = 0xf3ca
ASSERT m_font_cp0 = 0xf5bc
ASSERT me_out_strz = 0xfb36
ASSERT m_ramdisk_write = 0xfb6d
ASSERT m_tape_write = 0xfb97
ASSERT m_tape_wr_byte = 0xfc0e
ASSERT m_tape_read_byte = 0xfcee
ASSERT m_read_tape_bit = 0xfd08
ASSERT m_tape_wait = 0xfd58
ENDIF
; DISPLAY "Code size is: ", /A, CODE_SIZE

View File

@ -28,7 +28,7 @@
;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_C_tracks EQU 0x0042 ; 0x00 - bios init r8
@bios_var3 EQU 0x0043 ; 0xff - bios init r8
@interleave_0 EQU 0x0044
;reserve2 EQU 0x0050

9
Mon_r9/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,9 @@
{
"recommendations": [
"maziac.asm-code-lens",
"maziac.dezog",
"maziac.hex-hover-converter",
"maziac.z80-instruction-set",
"maziac.sna-fileviewer"
]
}

42
Mon_r9/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,42 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "dezog",
"request": "launch",
"name": "Simulator - ZX48K Spectrum",
"remoteType": "zsim",
"zsim": {
"visualMemory": true,
"memoryModel": "ZX48K",
"ulaScreen": "spectrum",
"zxKeyboard": "spectrum",
"zxBeeper": true
},
"sjasmplus": [
{
"path": "monitor.sld"
}
],
"commandsAfterLaunch": [],
"history": {
"reverseDebugInstructionCount": 1000000,
"spotCount": 10,
"codeCoverageEnabled": true
},
"startAutomatically": false,
"rootFolder": "${workspaceFolder}",
"topOfStack": "stack_top",
"loadObjs": [
{ "path": "mon_E000.bin", "start": "0xe000" }
],
"execAddress": "0xe021"
}
]
}

32
Mon_r9/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,32 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "make MONITOR (sjasmplus)",
"type": "shell",
"command": "sjasmplus",
"args": [
"--exp=monitor.inc",
"--fullpath",
"--nofakes",
"--i8080",
"monitor.asm"
],
"problemMatcher": {
"owner": "sjasmplus",
"fileLocation": "autoDetect",
"pattern": {
"regexp": "^(.*)\\((\\d+)\\):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

Binary file not shown.

19
Mon_r9/README.md Normal file
View File

@ -0,0 +1,19 @@
# Ocean-240.2 ROM Monitor V8 checksum 9c6c6546
Source codes of Monitor v8 for Ocean-240.2 with Floppy controller.
In Z80 mnemonics, but limited for i8080 instruction set.
## Differences
1) Font. Other russian letters б and д;
2) Calculate values for extended ram access in procedures m_ramdisk_read, m_ramdisk_write.
3) Don't reset hi bit when read keyboard
4) Other params count at last esc commands
## Compile
Code is located in memory at address: 0xE000..0xFFFF
sjasmplus --sld=monitor.sld --sym=monitor.labels --raw=monitor.obj --fullpath monitor.asm
To compile sources, use [sjasmplus Z80 assembler](https://github.com/z00m128/sjasmplus).

41
Mon_r9/bios_entries.inc Normal file
View File

@ -0,0 +1,41 @@
; =======================================================
; Ocean-240.2
; Definition of CPM BIOS entries to compile depended
; modules
;
; By Romych 2025-09-09
; ======================================================
IFNDEF _BIOS
DEFINE _BIOS
MODULE BIOS
boot_f EQU 0xD600
wboot_f EQU 0xD603
const_f EQU 0xD606
conin_f EQU 0xD609
conout_f EQU 0xD60C
list_f EQU 0xD60F
punch_f EQU 0xD612
reader_f EQU 0xD615
home_f EQU 0xD618
seldsk_f EQU 0xD61B
settrk_f EQU 0xD61E
setsec_f EQU 0xD621
setdma_f EQU 0xD624
read_f EQU 0xD627
write_f EQU 0xD62A
sectran_f EQU 0xD630
reserved_f1 EQU 0xD633
reserved_f2 EQU 0xD636
tape_read_f EQU 0xD639
tape_write_f EQU 0xD63C
tape_wait_f EQU 0xD63F
bios_var04 EQU 0xD64B
ENDMODULE
ENDIF

17
Mon_r9/config.inc Normal file
View File

@ -0,0 +1,17 @@
; =======================================================
; Ocean-240.2
; Configuration
;
; By Romych 2026-02-2
; ======================================================
IFNDEF _CONF
DEFINE _CONF
DEFINE DEFAULT_KB_ACK ; if defined, KB_ACK on pin PC4 DD78, else on pin PC7
DEFINE RAM_DISK_192K
;DEFINE CHECK_INTEGRITY ; if defined, check original labels offset
ENDIF

157
Mon_r9/equates.inc Normal file
View File

@ -0,0 +1,157 @@
; ======================================================
; Ocean-240.2
; Equates for all assembly sources
;
; By Romych 2025-09-09
; ======================================================
INCLUDE "config.inc"
IFNDEF _EQUATES
DEFINE _EQUATES
ADDLIST EQU 0x08
ASCII_BELL EQU 0x07 ; Make Beep
ASCII_BS EQU 0x08 ; Move cursor left (Back Space)
ASCII_TAB EQU 0x09 ; Move cursor right +8 pos
ASCII_LF EQU 0x0A ; Move cursor down (Line Feed)
ASCII_FF EQU 0x0C ; Move cursor to home (Form Feed)
ASCII_CR EQU 0x0D ; Move gursor to 1st pos (Cariage Return)
ASCII_CAN EQU 0x18 ; Move cursor right
ASCII_EM EQU 0x19 ; Move cursor up
ASCII_SUB EQU 0x1A ; CTRL-Z - end of text file marker
ASCII_ESC EQU 0x1B ;
ASCII_US EQU 0x1F ; Clear screen
ASCII_SP EQU 0x20
ASCII_DEL EQU 0x7F
; ------------------------------------------------------
BDOS_NFUNCS EQU 41
BELL_PIN EQU 0x08 ; DD67 Pin PC3 - "BELL"
; ------------------------------------------------------
CCP_COMMAND_SIZE EQU 5 ; max length of CCP command
CCP_COMMAND_COUNT EQU 3 ; Count of CCP commands
CCP_COMMAND_CNT EQU 6
CCP_COMMAND_LEN EQU 4
CCP_SRC_ADDR EQU 0xc000 ; Address of CCP resident part in ROM
CCP_DST_ADDR EQU 0xb200 ; Address of CCP resident part in RAM
CCP_SIZE EQU 0x809
CPM_VERSION EQU 0x22 ; Version of CP/M as byte nibbles '2.2'
CTRL EQU 0x5E ; ^
CTRL_C EQU 0x03 ; Warm boot
CTRL_H EQU 0x08 ; Backspace
CTRL_E EQU 0x05 ; Move to beginning of new line (Physical EOL)
CTRL_J EQU 0x0A ; LF - Line Feed
CTRL_M EQU 0x0D ; CR - Carriage Return
CTRL_P EQU 0x10 ; turn on/off printer
CTRL_R EQU 0x12 ; Repeat current cmd line
CTRL_S EQU 0x13 ; Temporary stop display data to console (aka DC3)
CTRL_U EQU 0x15 ; Cancel (erase) current cmd line
CTRL_X EQU 0x18 ; Cancel (erase) current cmd line
; ------------------------------------------------------
DBPLIST EQU 0x0F
DEF_DISK_A_SIZE EQU 0x3F
DEF_DISK_B_SIZE EQU 0x0168
DIR_BUFF_SIZE EQU 128
DSK_MAP EQU 0x10
DSK_MSK EQU 0x03
DSK_SHF EQU 0x02
DMA_BUFF_SIZE EQU 0x80
; ------------------------------------------------------
ENDDIR EQU 0xFFFF
ESC_CMD_END EQU 0x1A
;EXT_NUM EQU 12 ; Extent byte offset
; ------------------------------------------------------
FALSE EQU 0x00
FDC_DD80RB EQU 0x21
FDC_NOT_READY EQU 0x80
FDC_RESTORE_L EQU 0x08
FDC_SEEK_LV EQU 0x1C
FDC_RESTORE_UH_NV EQU 0x03 ; Restore Unload Head, No Verify, 15ms Rate
FILE_DELETED EQU 0xE5
FWF_MASK EQU 0x80 ; File Write Flag mask
; ---------------------------------------------------
; FCB Offsets
; ---------------------------------------------------
FCB_LEN EQU 32 ; length of FCB
FCB_SHF EQU 5
FN_LEN EQU 12 ; Length of filename in FCB
FCB_DR EQU 0 ; Drive. 0 for default, 1-16 for A-P
FCB_FN EQU 1 ; Fn - Filename, 7-bit ASCII. The top bits - attributes
FCB_FT EQU 9 ; Filetype, 7-bit ASCII.
; T1' to T3' have the following
; T1' - Read-Only
; T2' - System (hidden)
; T3' - Archive
FCB_EXT EQU 12 ; EX - Set this to 0 when opening a file and then leave it to
; CP/M. You can rewind a file by setting EX, RC, S2 and CR to 0.
FCB_S1 EQU 13 ; S1 - Reserved.
FCB_S2 EQU 14 ; S2 - Reserved. Bit 7 - wile write flag, [6:0] module number (Extent hi bits)
FCB_RC EQU 15 ; RC - Set this to 0 when opening a file and then leave it to CP/M.
FCB_AL EQU 16 ; AL - Image of the second half of the directory entry,
; containing the file's allocation (which disc blocks it owns).
FCB_CR EQU 32 ; CR - Current record within extent. It is usually best to set
; this to 0 immediately after a file has been opened and
; then ignore it.
FCB_RN EQU 33 ; Rn - Random access record number. A 16-bit (with R2 used for overflow)
; ------------------------------------------------------
JP_OPCODE EQU 0xC3
; ------------------------------------------------------
IRQ_0 EQU 0x01
IRQ_1 EQU 0x02
IRQ_2 EQU 0x04
;LP_IRQ EQU 0x08
KBD_IRQ EQU 0x02
IFDEF DEFAULT_KB_ACK
KBD_ACK EQU 0x10
ELSE
KBD_ACK EQU 0x80
ENDIF
KEY_ALF EQU 0x0D
KEY_FIX EQU 0x15
; ------------------------------------------------------
LST_REC EQU 0x7F
; ------------------------------------------------------
MAX_EXT EQU 0x1F
MAX_MOD EQU 0x0F
;MOD_NUM EQU 0x0E
; ------------------------------------------------------
FCB_INFO_LEN EQU 15 ; length of FCB info bytes to match
;NXT_REC EQU 0x20
; ------------------------------------------------------
PIC_POLL_MODE EQU 0x0A
PORT_C4 EQU 0x10
PRINTER_ACK EQU 0x10
PRINTER_IRQ EQU 0x08
; ------------------------------------------------------
;RAN_REC EQU 0x21
;FCB_RC EQU 0x0F
RO_FILE EQU 0x09
ROM_CHIP_SIZE EQU 8192 ; ROM Size, used to limit monitor code size
RX_READY EQU 0x02
; ------------------------------------------------------
TAPE_D EQU 0x08
TAPE_P EQU 0x04
TIMER_IRQ EQU 0x10
TL_HIGH EQU 0x05
TL_LOW EQU 0x03
TL_MID EQU 0x04
TMR0_SQWAVE EQU 0x36
TRUE EQU 0xFF
TX_READY EQU 0x01
; ------------------------------------------------------
stack_top EQU 0x100
ENDIF

165
Mon_r9/font-6x7.inc Normal file
View File

@ -0,0 +1,165 @@
; 96 symbols 6x7, with codes 0x20..0x7f KOI-7 H0
m_font_cp0:
DB 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; ' ' - 0x20
DB 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x04 ; '!' - 0x21
DB 0x14, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00 ; '"' - 0x22
DB 0x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a ; '#' - 0x23
DB 0x04, 0x1e, 0x05, 0x0e, 0x14, 0x0f, 0x04 ; '$' - 0x24
DB 0x03, 0x13, 0x08, 0x04, 0x02, 0x19, 0x18 ; '%' - 0x25
DB 0x06, 0x09, 0x05, 0x02, 0x15, 0x09, 0x16 ; '&' - 0x26
DB 0x06, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00 ; ' - 0x27
DB 0x08, 0x04, 0x02, 0x02, 0x02, 0x04, 0x08 ; '(' - 0x28
DB 0x02, 0x04, 0x08, 0x08, 0x08, 0x04, 0x02 ; ')' - 0x29
DB 0x00, 0x0a, 0x04, 0x1f, 0x04, 0x0a, 0x00 ; '*' - 0x2a
DB 0x00, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x00 ; '+' - 0x2b
DB 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x02 ; ',' - 0x2c
DB 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00 ; '-' - 0x2d
DB 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06 ; '.' - 0x2e
DB 0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00 ; '/' - 0x2f
DB 0x0e, 0x11, 0x19, 0x15, 0x13, 0x11, 0x0e ; '0' - 0x30
DB 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x0e ; '1' - 0x31
DB 0x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f ; '2' - 0x32
DB 0x1f, 0x08, 0x04, 0x08, 0x10, 0x11, 0x0e ; '3' - 0x33
DB 0x08, 0x0c, 0x0a, 0x09, 0x1f, 0x08, 0x08 ; '4' - 0x34
DB 0x1f, 0x01, 0x0f, 0x10, 0x10, 0x11, 0x0e ; '5' - 0x35
DB 0x0c, 0x02, 0x01, 0x0f, 0x11, 0x11, 0x0e ; '6' - 0x36
DB 0x1f, 0x10, 0x08, 0x04, 0x02, 0x02, 0x02 ; '7' - 0x37
DB 0x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e ; '8' - 0x38
DB 0x0e, 0x11, 0x11, 0x1e, 0x10, 0x08, 0x06 ; '9' - 0x39
DB 0x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00 ; ':' - 0x3a
DB 0x00, 0x06, 0x06, 0x00, 0x06, 0x04, 0x02 ; ';' - 0x3b
DB 0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08 ; '<' - 0x3c
DB 0x00, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x00 ; '=' - 0x3d
DB 0x02, 0x04, 0x08, 0x10, 0x08, 0x04, 0x02 ; '>' - 0x3e
DB 0x0e, 0x11, 0x10, 0x08, 0x04, 0x00, 0x04 ; '?' - 0x3f
DB 0x0e, 0x11, 0x10, 0x16, 0x15, 0x15, 0x0e ; '@' - 0x40
DB 0x04, 0x0a, 0x11, 0x11, 0x1f, 0x11, 0x11 ; 'A' - 0x41
DB 0x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f ; 'B' - 0x42
DB 0x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e ; 'C' - 0x43
DB 0x07, 0x09, 0x11, 0x11, 0x11, 0x09, 0x07 ; 'D' - 0x44
DB 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f ; 'E' - 0x45
DB 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x01 ; 'F' - 0x46
DB 0x0e, 0x11, 0x01, 0x1d, 0x11, 0x11, 0x1e ; 'G' - 0x47
DB 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11 ; 'H' - 0x48
DB 0x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e ; 'I' - 0x49
DB 0x1c, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06 ; 'J' - 0x4a
DB 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11 ; 'K' - 0x4b
DB 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f ; 'L' - 0x4c
DB 0x11, 0x1b, 0x15, 0x15, 0x11, 0x11, 0x11 ; 'M' - 0x4d
DB 0x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11 ; 'N' - 0x4e
DB 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e ; 'O' - 0x4f
DB 0x0f, 0x11, 0x11, 0x0f, 0x01, 0x01, 0x01 ; 'P' - 0x50
DB 0x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16 ; 'Q' - 0x51
DB 0x0f, 0x11, 0x11, 0x0f, 0x05, 0x09, 0x11 ; 'R' - 0x52
DB 0x1e, 0x01, 0x01, 0x0e, 0x10, 0x10, 0x0f ; 'S' - 0x53
DB 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 ; 'T' - 0x54
DB 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e ; 'U' - 0x55
DB 0x11, 0x11, 0x11, 0x11, 0x0a, 0x0a, 0x04 ; 'V' - 0x56
DB 0x11, 0x11, 0x11, 0x15, 0x15, 0x15, 0x0a ; 'W' - 0x57
DB 0x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11 ; 'X' - 0x58
DB 0x11, 0x11, 0x11, 0x0a, 0x04, 0x04, 0x04 ; 'Y' - 0x59
DB 0x1f, 0x10, 0x08, 0x04, 0x02, 0x01, 0x1f ; 'Z' - 0x5a
DB 0x0e, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0e ; '[' - 0x5b
DB 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x00 ; '\' - 0x5c
DB 0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x0e ; ']' - 0x5d
DB 0x0e, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00 ; '^' - 0x5r
DB 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f ; '_' - 0x5f
DB 0x1c, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 ; '`' - 0x60
DB 0x00, 0x00, 0x0e, 0x10, 0x1e, 0x13, 0x1e ; 'a' - 0x61
DB 0x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x0f ; 'b' - 0x62
DB 0x00, 0x00, 0x0e, 0x01, 0x01, 0x01, 0x0e ; 'c' - 0x63
DB 0x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x1e ; 'd' - 0x64
DB 0x00, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x0e ; 'e' - 0x65
DB 0x18, 0x04, 0x04, 0x0e, 0x04, 0x04, 0x04 ; 'f' - 0x66
DB 0x00, 0x0e, 0x11, 0x11, 0x1e, 0x10, 0x0e ; 'g' - 0x67
DB 0x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11 ; 'h' - 0x68
DB 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04 ; 'i' - 0x69
DB 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x06 ; 'j' - 0x6a
DB 0x01, 0x01, 0x09, 0x05, 0x03, 0x05, 0x09 ; 'k' - 0x6b
DB 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08 ; 'l' - 0x6c
DB 0x00, 0x00, 0x0f, 0x15, 0x15, 0x15, 0x15 ; 'm' - 0x6d
DB 0x00, 0x00, 0x09, 0x13, 0x11, 0x11, 0x11 ; 'n' - 0x6e
DB 0x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e ; 'o' - 0x6f
DB 0x00, 0x00, 0x0e, 0x11, 0x11, 0x0f, 0x01 ; 'p' - 0x70
DB 0x00, 0x00, 0x0e, 0x11, 0x11, 0x1e, 0x10 ; 'q' - 0x71
DB 0x00, 0x00, 0x0d, 0x13, 0x01, 0x01, 0x01 ; 'r' - 0x72
DB 0x00, 0x00, 0x1e, 0x01, 0x0e, 0x10, 0x0f ; 's' - 0x73
DB 0x04, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x18 ; 't' - 0x74
DB 0x00, 0x00, 0x11, 0x11, 0x11, 0x19, 0x16 ; 'u' - 0x75
DB 0x00, 0x00, 0x11, 0x11, 0x0a, 0x0a, 0x04 ; 'v' - 0x76
DB 0x00, 0x00, 0x11, 0x15, 0x15, 0x15, 0x0a ; 'w' - 0x77
DB 0x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11 ; 'x' - 0x78
DB 0x00, 0x00, 0x11, 0x11, 0x1e, 0x10, 0x0c ; 'y' - 0x79
DB 0x00, 0x00, 0x1f, 0x08, 0x04, 0x02, 0x1f ; 'z' - 0x7a
DB 0x0c, 0x02, 0x02, 0x01, 0x02, 0x02, 0x0c ; '{' - 0x7b
DB 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 ; '|' - 0x7c
DB 0x03, 0x04, 0x04, 0x08, 0x04, 0x04, 0x03 ; '}' - 0x7d
DB 0x00, 0x02, 0x15, 0x0a, 0x15, 0x08, 0x00 ; '~' - 0x7e
DB 0x15, 0x00, 0x15, 0x00, 0x15, 0x00, 0x15 ; [DEL] - 0x7f
; 64 symbols 6x7, with codes 0x40..0x7f KOI-7 H1
m_font_cp1:
DB 0x00, 0x00, 0x09, 0x15, 0x17, 0x15, 0x09 ; ю - 0x40
DB 0x00, 0x00, 0x06, 0x08, 0x0e, 0x09, 0x16 ; а - 0x41
DB 0x07, 0x02, 0x04, 0x0e, 0x09, 0x09, 0x06 ; б - 0x42 DIFF
DB 0x00, 0x00, 0x09, 0x09, 0x09, 0x1f, 0x10 ; ц - 0x43
DB 0x03, 0x04, 0x08, 0x0e, 0x09, 0x09, 0x06 ; д - 0x44 DIFF
DB 0x00, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x1e ; е - 0x45
DB 0x00, 0x04, 0x0e, 0x15, 0x15, 0x0e, 0x04 ; ф - 0x46
DB 0x00, 0x00, 0x0f, 0x09, 0x01, 0x01, 0x01 ; г - 0x47
DB 0x00, 0x00, 0x11, 0x0a, 0x04, 0x0a, 0x11 ; х - 0x48
DB 0x00, 0x00, 0x11, 0x19, 0x15, 0x13, 0x11 ; и - 0x49
DB 0x0a, 0x04, 0x11, 0x19, 0x15, 0x13, 0x11 ; й - 0x4a
DB 0x00, 0x00, 0x11, 0x09, 0x07, 0x09, 0x11 ; к - 0x4b
DB 0x00, 0x00, 0x1c, 0x12, 0x12, 0x12, 0x11 ; л - 0x4c
DB 0x00, 0x00, 0x11, 0x1b, 0x15, 0x11, 0x11 ; м - 0x4d
DB 0x00, 0x00, 0x11, 0x11, 0x1f, 0x11, 0x11 ; н - 0x4e
DB 0x00, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e ; о - 0x4f
DB 0x00, 0x00, 0x1f, 0x11, 0x11, 0x11, 0x11 ; п - 0x50
DB 0x00, 0x00, 0x1e, 0x11, 0x1e, 0x14, 0x12 ; я - 0x51
DB 0x00, 0x00, 0x07, 0x09, 0x07, 0x01, 0x01 ; р - 0x52
DB 0x00, 0x00, 0x0e, 0x01, 0x01, 0x01, 0x0e ; с - 0x53
DB 0x00, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04 ; т - 0x54
DB 0x00, 0x00, 0x11, 0x11, 0x1e, 0x10, 0x0e ; у - 0x55
DB 0x00, 0x00, 0x15, 0x15, 0x0e, 0x15, 0x15 ; ж - 0x56
DB 0x00, 0x00, 0x03, 0x05, 0x07, 0x09, 0x07 ; в - 0x57
DB 0x00, 0x00, 0x01, 0x01, 0x07, 0x09, 0x07 ; ь - 0x58
DB 0x00, 0x00, 0x11, 0x11, 0x13, 0x15, 0x13 ; ы - 0x59
DB 0x00, 0x00, 0x0e, 0x11, 0x0c, 0x11, 0x0e ; з - 0x5a
DB 0x00, 0x00, 0x15, 0x15, 0x15, 0x15, 0x1f ; ш - 0x5b
DB 0x00, 0x00, 0x07, 0x08, 0x0e, 0x08, 0x07 ; э - 0x5c
DB 0x00, 0x00, 0x15, 0x15, 0x15, 0x1f, 0x10 ; щ - 0x5d
DB 0x00, 0x00, 0x09, 0x09, 0x0e, 0x08, 0x08 ; ч - 0x5e
DB 0x00, 0x00, 0x06, 0x05, 0x0c, 0x14, 0x0c ; ъ - 0x5f
DB 0x09, 0x15, 0x15, 0x17, 0x15, 0x15, 0x09 ; Ю - 0x60
DB 0x04, 0x0a, 0x11, 0x11, 0x1f, 0x11, 0x11 ; А - 0x61
DB 0x1f, 0x11, 0x01, 0x0f, 0x11, 0x11, 0x1f ; Б - 0x62
DB 0x09, 0x09, 0x09, 0x09, 0x09, 0x1f, 0x10 ; С - 0x63
DB 0x0c, 0x0a, 0x0a, 0x0a, 0x0a, 0x1f, 0x11 ; Д - 0x64
DB 0x1f, 0x01, 0x01, 0x0f, 0x01, 0x01, 0x1f ; Е - 0x65
DB 0x04, 0x0e, 0x15, 0x15, 0x15, 0x0e, 0x04 ; Ф - 0x66
DB 0x1f, 0x11, 0x01, 0x01, 0x01, 0x01, 0x01 ; Г - 0x67
DB 0x11, 0x11, 0x0a, 0x04, 0x0a, 0x11, 0x11 ; Х - 0x68
DB 0x11, 0x11, 0x19, 0x15, 0x13, 0x11, 0x11 ; И - 0x69
DB 0x04, 0x15, 0x11, 0x19, 0x15, 0x13, 0x11 ; Й - 0x6a
DB 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11 ; К - 0x6b
DB 0x1c, 0x12, 0x12, 0x12, 0x12, 0x12, 0x11 ; Л - 0x6c
DB 0x11, 0x1b, 0x15, 0x15, 0x11, 0x11, 0x11 ; М - 0x6d
DB 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11 ; Н - 0x6e
DB 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e ; О - 0x6f
DB 0x1f, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 ; П - 0x70
DB 0x1e, 0x11, 0x11, 0x11, 0x1e, 0x12, 0x11 ; Я - 0x71
DB 0x0f, 0x11, 0x11, 0x11, 0x0f, 0x01, 0x01 ; Р - 0x72
DB 0x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e ; С - 0x73
DB 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 ; Т - 0x74
DB 0x11, 0x11, 0x11, 0x11, 0x1e, 0x10, 0x0e ; У - 0x75
DB 0x15, 0x15, 0x15, 0x0e, 0x15, 0x15, 0x15 ; Ж - 0x76
DB 0x0f, 0x11, 0x11, 0x0f, 0x11, 0x11, 0x0f ; В - 0x77
DB 0x01, 0x01, 0x01, 0x0f, 0x11, 0x11, 0x0f ; Ь - 0x78
DB 0x11, 0x11, 0x11, 0x13, 0x15, 0x15, 0x13 ; Ы - 0x79
DB 0x0e, 0x11, 0x10, 0x0c, 0x10, 0x11, 0x0e ; З - 0x7a
DB 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x1f ; Ш - 0x7b
DB 0x0e, 0x11, 0x10, 0x1c, 0x10, 0x11, 0x0e ; Э - 0x7c
DB 0x15, 0x15, 0x15, 0x15, 0x15, 0x1f, 0x10 ; Щ - 0x7d
DB 0x11, 0x11, 0x11, 0x1e, 0x10, 0x10, 0x10 ; Ч - 0x7e
DB 0x1f, 0x15, 0x1f, 0x15, 0x1f, 0x15, 0x1f ; [DEL] - 0x7f

103
Mon_r9/io.inc Normal file
View File

@ -0,0 +1,103 @@
; =======================================================
; Ocean-240.2
; Computer with FDC variant.
; IO Ports definitions
;
; By Romych 2025-09-09
; =======================================================
IFNDEF _IO_PORTS
DEFINE _IO_PORTS
; -------------------------------------------------------
; КР580ВВ55 DD79
; -------------------------------------------------------
USR_DD79PA EQU 0x00 ; User port A
USR_DD79PB EQU 0x01 ; User port B
USR_DD79PC EQU 0x02 ; User port C
; Config: [1][ma1,ma0][0-aO|1-aI],[0-chO,1-chI],[mb],[0-bO|1-bI],[0-clO,1-clI]
; Set bit: [0][xxx][bbb][0|1]
USR_DD79CTR EQU 0x03
; -------------------------------------------------------
; КР1818ВГ93
; -------------------------------------------------------
FDC_CMD EQU 0x20 ; FDC Command
FDC_TRACK EQU 0x21 ; FDC Track No
FDC_SECT EQU 0x22 ; FDC Sector
FDC_DATA EQU 0x23 ; FDC Data
FDC_WAIT EQU 0x24 ; FDC Wait
; Floppy Controller port
; WR: 5-SSEN, 4-#DDEN, 3-INIT, 2-DRSEL, 1-MOT1, 0-MOT0
; RD: 7-MOTST, 6-SSEL, 5,4-x , 3-DRSEL, 2-MOT1, 1-MOT0, 0-INT
FLOPPY EQU 0x25 ; Floppy Controller port
; -------------------------------------------------------
; КР580ВВ55 DD78
; -------------------------------------------------------
KBD_DD78PA EQU 0x40 ; Port A - Keyboard Data
KBD_DD78PB EQU 0x41 ; Port B - JST3,SHFT,CTRL,ACK,TAPE5,TAPE4,GK,GC
KBD_DD78PC EQU 0x42 ; Port C - [PC7:5],[KBD_ACK],[PC3:0]
; Сonfig: [1][ma1,ma0][0-aO|1-aI],[0-chO,1-chI],[mb],[0-bO|1-bI],[0-clO,1-clI]
; Set bit: [0][xxx][bbb][0|1];
KBD_DD78CTR EQU 0x43
; -------------------------------------------------------
; КР580ВИ53 DD70
; -------------------------------------------------------
TMR_DD70C1 EQU 0x60 ; Timer counter 1
TMR_DD70C2 EQU 0x61 ; Timer counter 2
TMR_DD70C3 EQU 0x62 ; Timer counter 3
; Timer config: [sc1,sc0][rl1,rl0][m2,m1,m0][bcd]
; sc - timer, rl=01-LSB, 10-MSB, 11-LSB+MSB
; mode 000 - int on fin,
; 001 - one shot,
; x10 - rate gen,
; x11-sq wave
TMR_DD70CTR EQU 0x63
; Programable Interrupt controller PIC KR580VV59
PIC_DD75RS EQU 0x80 ; PIC RS
PIC_DD75RM EQU 0x81 ; PIC RM
; -------------------------------------------------------
; КР580ВВ51 DD72
; -------------------------------------------------------
UART_DD72RD EQU 0xA0 ; Serial data
UART_DD72RR EQU 0xA1 ; Serial status [RST,RQ_RX,RST_ERR,PAUSE,RX_EN,RX_RDY,TX_RDY]
; -------------------------------------------------------
; КР580ВВ55 DD17
; -------------------------------------------------------
SYS_DD17PA EQU 0xC0 ; Port A - VShift[8..1]
SYS_DD17PB EQU 0xC1 ; Port B - [ROM14,13][REST][ENROM-][A18,17,16][32k]
SYS_DD17PC EQU 0xC2 ; Port C - HShift[HS5..1,SB3..1]
; Сonfig: [1][ma1,ma0][0-aO|1-aI],[0-chO,1-chI],[mb],[0-bO|1-bI],[0-clO,1-clI]
; Set bit: [0][xxx][bbb][0|1];
SYS_DD17CTR EQU 0xC3
; -------------------------------------------------------
; КР580ВВ55 DD67
; -------------------------------------------------------
LPT_DD67PA EQU 0xE0 ; Port A - LPT Data
VID_DD67PB EQU 0xE1 ; Port B - [VSU,C/M,FL3..1,COL3..1]
DD67PC EQU 0xE2 ; Port C - [USER3..1,STB-LP,BELL,TAPE3..1]
; Сonfig: [1][ma1,ma0][0-aO|1-aI],[0-chO,1-chI],[mb],[0-bO|1-bI],[0-clO,1-clI]
; Set bit: [0][xxx][bbb][0|1];
DD67CTR EQU 0xE3
ENDIF

105
Mon_r9/m_vars.inc Normal file
View File

@ -0,0 +1,105 @@
; =======================================================
; Ocean-240.2
; Module M_VARS - Monitor variables
; RAM Range: 0xBA09-0xBFFF
;
; Disassembled by Romych 2025-02-05
; =======================================================
IFNDEF _M_VARS
DEFINE _M_VARS
MODULE M_VARS
ORG 0xbf00
stack_top EQU 0x100
buffer DS 128 ; 0xbf00 search text or buffer to search?
DS 36
paint_stack EQU $ ; 0xbfa4
DS 32
stack1: EQU $ ; 0xbfc4
DS 1
paint_var1 DS 1 ; 0xbfc5
paint_var2 DS 1 ; 0xbfc6
paint_var3 DS 1 ; 0xbfc7
paint_var4 DS 1 ; 0xbfc8
paint_var5 DS 1 ; 0xbfc9
paint_y DS 1 ; 0xbfca
paint_var7 DS 1 ; 0xbfcb
cmp_color DS 1 ; 0xbfcc
paint_sp_save DS 2
; Right pixel mask ex: 11111000
pixel_mask_r DS 1 ; 0xbfcf
tmp_color DS 1 ; 0xbfd0
rect_var2 DS 1 ; 0xbfd1
stack_0 EQU $
rect_var3 DS 1 ; 0xbfd2
esc_mode DS 1 ; 0xbfd3
esc_cmd DS 1 ; 0xbfd4
esc_param_cnt DS 1 ; 0xbfd5
esc_param DS 7 ; 0xbfd6
; Left inverse pixel mask ex: 00011111
pixel_mask_l_i DS 1
; Right inverse pixel mask ex: 00011111
pixel_mask_r_i DS 1
; Left pixel mask ex: 11100000
pixel_mask_l DS 1
; Current screen mode, bit 3 - hide/show cursor, bit 4 - only 20 rows
screen_mode DS 1 ; 0xbfe0
cursor_row DS 1 ; 0xbfe1 Cursor Y position
cursor_col DS 1 ; 0xbfe2 Cursor X position
curr_color DS 2 ; 0xbfe3 Current color low and hi bytes
esc_hex_cmd:
row_shift DS 1 ; 0xbfe5
codepage DS 1 ; 0xbfe6
cur_palette DS 1 ; 0xbfe7 00bbbfff - background and foreground colors
beep_period DS 2 ; 0xbfe8
beep_duration DS 2 ; 0xbfea
pix_shift DS 1 ; 0xbfec
strobe_state DS 1 ; 0xbfed
ul_var0 DS 1 ; 0xbfee
ul_A_var1 DS 1 ; 0xbfef
ul_B_var2 DS 1 ; 0xbff0
ul_var3 DS 1 ; 0xbff1
ul_A_var4 DS 1 ; 0xbff2
ul_B_var5 DS 1 ; 0xbff3
ul_var6 DS 1 ; 0xbff4
esc_var0 DS 1 ; 0xbff5
esc_var1 DS 1 ; 0xbff6
esc_var2 DS 1 ; 0xbff7
esc_var3 DS 1 ; 0xbff8
DS 1 ; 0xbff9
DS 1 ; 0xbffa
DS 1 ; 0xbffb
DS 1 ; 0xbffc
DS 1 ; 0xbffd
DS 1 ; 0xbffe
DS 1 ; 0xbfff
IFDEF CHECK_INTEGRITY
ASSERT stack1 = 0xbfc4
ASSERT buffer = 0xbf00
ASSERT paint_var1 = 0xbfc5
ASSERT pixel_mask_r = 0xbfcf
ASSERT stack_0 = 0xbfd2
ASSERT esc_mode = 0xbfd3
ASSERT screen_mode = 0xbfe0
ASSERT cur_palette = 0xbfe7
ASSERT ul_var0 = 0xbfee
ASSERT paint_stack = 0xbfa4
ASSERT esc_var3 = 0xbff8
ENDIF
;DISPLAY "screen_mode: ", /H, screen_mode
;DISPLAY "fn48_var1: ", /H, fn48_var1
ENDMODULE
ENDIF

5613
Mon_r9/monitor.asm Normal file

File diff suppressed because it is too large Load Diff

19
Mon_r9/monitor.inc Normal file
View File

@ -0,0 +1,19 @@
mon_start: EQU 0x0000E000
mon_hexb: EQU 0x0000E003
non_con_status: EQU 0x0000E006
mon_con_in: EQU 0x0000E009
mon_con_out: EQU 0x0000E00C
mon_serial_in: EQU 0x0000E00F
mon_serial_out: EQU 0x0000E012
mon_char_print: EQU 0x0000E015
mon_tape_read: EQU 0x0000E018
mon_tape_write: EQU 0x0000E01B
mon_ram_disk_read: EQU 0x0000E01E
mon_ram_disk_write: EQU 0x0000E021
mon_tape_read_ram: EQU 0x0000E024
mon_tape_write_ram: EQU 0x0000E027
mon_tape_wait: EQU 0x0000E02A
mon_tape_detect: EQU 0x0000E02D
mon_read_floppy: EQU 0x0000E030
mon_write_floppy: EQU 0x0000E033
mon_out_str_z: EQU 0x0000E036

49
Mon_r9/ram.inc Normal file
View File

@ -0,0 +1,49 @@
; =======================================================
; Ocean-240.2
;
; RAM area at address: 0x0000 - 0x0100, used by CP/M and
; HW-Monitor
; By Romych 2026-02-03
; =======================================================
IFNDEF _RAM
DEFINE _RAM
MODULE RAM
@warm_boot EQU 0x0000 ; Jump warm_boot (Restart)
@warm_boot_addr EQU 0x0001 ; address of warm boot entry point
@iobyte EQU 0x0003 ; Input/Output mapping
@cur_user_drv EQU 0x0004 ; [7:4] - curent user, [3:0] - current drive
@jp_bdos_enter EQU 0x0005 ; Jump bdos (CALL 5 to make CP/M requests)
@bdos_ent_addr EQU 0x0006 ; addres of BDOS entry point
@RST1 EQU 0x0008
@RST1_handler_addr EQU 0x0009
;RST2 EQU 0x0010
;RST3 EQU 0x0018
;RST4 EQU 0x0020
;RST5 EQU 0x0028
;RST6 EQU 0x0030
;RST7 EQU 0x0038
;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
@bios_var3 EQU 0x0043 ; 0xff - bios init r8
@interleave_0 EQU 0x0044
;reserve2 EQU 0x0050
@fcb1 EQU 0x005c ; Default FCB, 16 bytes
@fcb2 EQU 0x006c
;NMI_ISR EQU 0x0066
@dma_buffer EQU 0x0080 ; Default "DMA" 128 bytes buffer
@p_cmd_line_len EQU 0x0080 ; command line character count
@p_cmd_line EQU 0x0081 ; command line buffer
@fcb_ra_record_num EQU 0x00a1
@bios_stack EQU 0x0100
@tpa_start EQU 0x0100 ; start of program
@video_ram EQU 0x4000
ENDMODULE
ENDIF

48
Mon_r9/sprites.inc Normal file
View File

@ -0,0 +1,48 @@
; --------------------------------------------------
; Ocean-240.2
; Monitor V8 - Sprites for games
;
; Disassembled by Romych 2026-02-22
; --------------------------------------------------
IFNDEF _SPRITES
DEFINE _SPRITES
game_sprite_tab:
DB 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; 0x00
DB 0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E ; 0x01
DB 0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E ; 0x02
DB 0x00, 0x08, 0x08, 0x14, 0x63, 0x14, 0x08, 0x08 ; 0x03
DB 0x36, 0x7F, 0x7F, 0x7F, 0x3E, 0x1C, 0x08, 0x00 ; 0x04
DB 0x08, 0x1C, 0x3E, 0x7F, 0x3E, 0x1C, 0x08, 0x00 ; 0x05
DB 0x1C, 0x3E, 0x1C, 0x7F, 0x7F, 0x6B, 0x08, 0x1C ; 0x06
DB 0x08, 0x08, 0x1C, 0x3E, 0x7F, 0x3E, 0x08, 0x1C ; 0x07
DB 0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18 ; 0x08
DB 0x18, 0xDB, 0x3C, 0xE7, 0xE7, 0x3C, 0xDB, 0x18 ; 0x09
DB 0xE7, 0xE7, 0x00, 0x7E, 0x7E, 0x00, 0xE7, 0xE7 ; 0x0a
DB 0x7E, 0x81, 0x81, 0xFF, 0xFF, 0x81, 0x81, 0x7E ; 0x0b
DB 0x00, 0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18 ; 0x0c
DB 0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00 ; 0x0d
DB 0x00, 0x10, 0x30, 0x7F, 0x7F, 0x30, 0x10, 0x00 ; 0x0e
DB 0x00, 0x08, 0x0C, 0xFE, 0xFE, 0x0C, 0x08, 0x00 ; 0x0f
DB 0x88, 0x44, 0x22, 0x11, 0x88, 0x44, 0x22, 0x11 ; 0x10
DB 0x11, 0x22, 0x44, 0x88, 0x11, 0x22, 0x44, 0x88 ; 0x11
DB 0x0F, 0x0F, 0x0F, 0x0F, 0xF0, 0xF0, 0xF0, 0xF0 ; 0x12
DB 0xF0, 0xF0, 0xF0, 0xF0, 0x0F, 0x0F, 0x0F, 0x0F ; 0x13
DB 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ; 0x14
DB 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF ; 0x15
DB 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F ; 0x16
DB 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0 ; 0x17
DB 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00 ; 0x18
DB 0xCC, 0xCC, 0x33, 0x33, 0xCC, 0xCC, 0x33, 0x33 ; 0x19
DB 0x70, 0x08, 0x76, 0xFF, 0xFF, 0xFF, 0x7E, 0x18 ; 0x1a
DB 0xC3, 0xDB, 0xDB, 0x18, 0x18, 0xDB, 0xDB, 0xC3 ; 0x1b
DB 0xFC, 0xCC, 0xFC, 0x0C, 0x0C, 0x0E, 0x0F, 0x07 ; 0x1c
DB 0xFE, 0xC6, 0xFE, 0xC6, 0xC6, 0xE6, 0x67, 0x03 ; 0x1d
DB 0x18, 0x3C, 0x3C, 0x18, 0x7E, 0x18, 0x24, 0x66 ; 0x1e
DB 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 ; 0x1f
DB 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 ; 0x20
DB 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 ; 0x21
DB 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF ; 0x22
ENDIF

9
Type/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,9 @@
{
"recommendations": [
"maziac.asm-code-lens",
"maziac.dezog",
"maziac.hex-hover-converter",
"maziac.z80-instruction-set",
"maziac.sna-fileviewer"
]
}

42
Type/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,42 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "dezog",
"request": "launch",
"name": "Simulator - ZX48K Spectrum",
"remoteType": "zsim",
"zsim": {
"visualMemory": true,
"memoryModel": "ZX48K",
"ulaScreen": "spectrum",
"zxKeyboard": "spectrum",
"zxBeeper": true
},
"sjasmplus": [
{
"path": "monitor.sld"
}
],
"commandsAfterLaunch": [],
"history": {
"reverseDebugInstructionCount": 1000000,
"spotCount": 10,
"codeCoverageEnabled": true
},
"startAutomatically": false,
"rootFolder": "${workspaceFolder}",
"topOfStack": "stack_top",
"loadObjs": [
{ "path": "mon_E000.bin", "start": "0xe000" }
],
"execAddress": "0xe021"
}
]
}

31
Type/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,31 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "make TYPE (sjasmplus)",
"type": "shell",
"command": "sjasmplus",
"args": [
"--fullpath",
"--nofakes",
"--i8080",
"type.asm"
],
"problemMatcher": {
"owner": "sjasmplus",
"fileLocation": "autoDetect",
"pattern": {
"regexp": "^(.*)\\((\\d+)\\):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"severity": 3,
"message": 4
}
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

BIN
Type/TYPE.COM Normal file

Binary file not shown.

72
Type/equates.inc Normal file
View File

@ -0,0 +1,72 @@
; ==================================================
; Equates for TYPE.COM
;
; By Romych, 2026-03-01
; ==================================================
IFNDEF _EQUATES
DEFINE _EQUATES
; --------------------------------------------------
; ASCII CODES
; --------------------------------------------------
ASCII_BELL EQU 0x07 ; Make Beep
ASCII_BS EQU 0x08 ; Move cursor left (Back Space)
ASCII_TAB EQU 0x09 ; Move cursor right +8 pos
ASCII_LF EQU 0x0A ; Move cursor down (Line Feed)
ASCII_FF EQU 0x0C ; Move cursor to home (Form Feed)
ASCII_CR EQU 0x0D ; Move gursor to 1st pos (Cariage Return)
ASCII_SO EQU 0x0E ; ^N Shift Out
ASCII_SI EQU 0x0F ; ^O Shift In
ASCII_CAN EQU 0x18 ; Move cursor right
ASCII_EM EQU 0x19 ; Move cursor up
ASCII_SUB EQU 0x1A ; CTRL-Z - end of text file marker
ASCII_ESC EQU 0x1B ;
ASCII_US EQU 0x1F ; Clear screen
ASCII_SP EQU 0x20
ASCII_DEL EQU 0x7F
; --------------------------------------------------
; KEYBOARD Ctrl+Key CODES
; --------------------------------------------------
CTRL_A EQU 0x01
CTRL_B EQU 0x02
CTRL_C EQU 0x03 ; Warm boot
CTRL_D EQU 0x04
CTRL_E EQU 0x05 ; Move to beginning of new line (Physical EOL)
CTRL_F EQU 0x06
CTRL_G EQU 0x07
CTRL_H EQU 0x08 ; Backspace
CTRL_I EQU 0x09
CTRL_J EQU 0x0A ; LF - Line Feed
CTRL_K EQU 0x0B
CTRL_L EQU 0x0C
CTRL_M EQU 0x0D ; CR - Carriage Return
CTRL_N EQU 0x0E
CTRL_O EQU 0x0F
CTRL_P EQU 0x10 ; turn on/off printer
CTRL_Q EQU 0x11
CTRL_R EQU 0x12 ; Repeat current cmd line
CTRL_S EQU 0x13 ; Temporary stop display data to console (aka DC3)
CTRL_T EQU 0x14
CTRL_U EQU 0x15 ; Cancel (erase) current cmd line
CTRL_V EQU 0x16
CTRL_W EQU 0x17
CTRL_X EQU 0x18 ; Cancel (erase) current cmd line
CTRL_Y EQU 0x19
CTRL_Z EQU 0x1A ; CTRL-Z - end of text file marker
; --------------------------------------------------
; BIOS RAM Entries
; --------------------------------------------------
jp_bdos_enter EQU 0x0005 ; Jump bdos (CALL 5 to make CP/M requests)
fcb1 EQU 0x005c ; Default FCB, 16 bytes
dma_buffer EQU 0x0080 ; Default "DMA" 128 bytes buffer
p_cmd_line_len EQU 0x0080 ; command line character count
p_cmd_line EQU 0x0081 ; command line buffer
tpa EQU 0x0100 ; Program area
ENDIF

497
Type/type.asm Normal file
View File

@ -0,0 +1,497 @@
; ==================================================
; TYPE.COM
;
; Disassembled by Romych, 2026-03-01
; ==================================================
DEVICE NOSLOT64K
INCLUDE "equates.inc"
OUTPUT TYPE.COM
MODULE TYPE
ORG 0x0100
; ---------------------------------------------------
; Entry point
; ---------------------------------------------------
start:
LD HL, t_start
LD SP, HL
LD DE, 0x0
PUSH DE
JP (HL)
DB "roDOS TYPE FILE Utility(C) IRIMS, Moscow 1985"
t_start:
CALL t_check_version
; unsupported bdos call
LD C, 49
LD DE, t_scb_1
CALL jp_bdos_enter
DEC A
DEC A
LD (t_scb_mm), A
; At start command line params here
LD HL, p_cmd_line_len
LD (t_buff_addr), HL
LD A, (HL)
LD (cmd_par_len), A
; skip spaces before first parameter
.skip_sp_0:
CALL t_get_cmdl_char
JP C, t_handle_error
CP ASCII_SP
JP Z, .skip_sp_0
; get filename
.get_next_ch:
CALL t_get_cmdl_char
JP C, t_open_file
CP ASCII_SP
JP NZ, .get_next_ch
; get
.skip_sp_1:
CALL t_get_cmdl_char
JP C, t_open_file
CP ASCII_SP
JP Z, .skip_sp_1
CP 'P'
JP Z, t_param_P
CP 'D'
JP NZ, t_param_no_PD
LD A, 1
JP t_param_cmn
t_param_no_PD:
CP 'C'
JP NZ, t_param_no_D
LD A, 2
JP t_param_cmn
t_param_no_D:
CP 'F'
JP NZ, t_param_unknown
LD A, 3
t_param_cmn:
LD (cmd_switch), A
.skip_sp_2:
CALL t_get_cmdl_char
JP C, t_open_file
CP ASCII_SP
JP Z, .skip_sp_2
t_param_P:
CP 'P'
JP NZ, t_param_unknown
LD A, 0xff
LD (flag1), A
CALL get_numbr
JP C, t_open_file
LD A, L
OR A
JP Z, t_open_file
LD (t_scb_mm), A
t_open_file:
LD C, 15
LD DE, fcb1
CALL jp_bdos_enter
CP 0xff
JP Z, t_handle_error
LD HL, tpa
LD (t_buff_addr), HL
t_dump_part:
LD A, (t_scb_mm)
LD (cmd_par_len), A
print_next_byte:
; get next byte, return if error
CALL t_get_nxt_byte
RET C
; return if end of text marker
CP ASCII_SUB
RET Z
; print character
LD (t_cut_byte), A
LD E, A
CALL t_print
LD A, (t_cut_byte)
CP ASCII_LF
JP NZ, print_next_byte
; LF
LD A, (flag0)
OR A
JP Z, lo_ctr_0
; wait until keyboard key pressed
wait_for_key:
CALL t_get_key_wo_echo
OR A
JP Z, wait_for_key
; check for Ctrl+C - interrupt
CP CTRL_C
JP Z, t_is_ctrl_c
; Space - fro continue
CP ASCII_SP
JP Z, print_next_byte
CP CTRL_P
JP NZ, is_no_ctrl_p
; Access the System Control Block (Unsupported!)
; get value at offset
LD C, 49
LD DE, t_scb_2
CALL jp_bdos_enter
XOR 0xff
LD (t_scb_3+2), A
; set new value an offset
LD C, 49
LD DE, t_scb_3
CALL jp_bdos_enter
; and wait for next key
JP wait_for_key
is_no_ctrl_p:
; Return key
CP ASCII_CR
JP NZ, t_is_no_cr
; update hi counter
LD A, 0xff
LD (flag1), A
; zero to low counter
XOR A
LD (flag0), A
; and dump next part
JP t_dump_part
t_is_no_cr:
; other key - zero counters
XOR A
LD (flag0), A
LD (flag1), A
JP print_next_byte
lo_ctr_0:
CALL t_get_key_wo_echo
OR A
JP Z, no_key_pressd
lo_ctr_set_ff:
LD A, 0xff
LD (flag0), A
JP wait_for_key
no_key_pressd:
LD A, (flag1)
OR A
JP Z, print_next_byte
LD A, (cmd_par_len)
DEC A
LD (cmd_par_len), A
JP NZ, print_next_byte
JP lo_ctr_set_ff
; ---------------------------------------------------
;
; ---------------------------------------------------
t_check_version
LD C, 12
CALL jp_bdos_enter
CP 0x26
JP C, t_ver_unsupported
CP 0x30
JP NC, t_ver_unsupported
RET
t_param_unknown:
LD E, 0x0
JP t_calc_msg_offset
t_handle_error:
LD E, 0x1
JP t_calc_msg_offset
t_is_ctrl_c:
LD E, 0x2
t_calc_msg_offset:
LD HL, t_message_tab
LD D, 0x0
ADD HL, DE
ADD HL, DE
LD E, (HL)
INC HL
LD D, (HL)
; C_WRITESTR - Output string
LD C, 9
JP jp_bdos_enter
; ---------------------------------------------------
; Print character
; Inp: E - charater to print
; ---------------------------------------------------
t_print:
LD A, (cmd_switch)
OR A
JP Z, t_con_output ; D
CP 1
JP Z, t_get_key_echo ; C
LD A, E
AND 0x7f ; limit to 0..127 codes
; check for printable
CP ASCII_SP
JP NC, t_con_output
CP ASCII_CR
JP Z, t_con_output
CP ASCII_LF
JP Z, t_con_output
CP ASCII_TAB
JP Z, t_con_output
CP ASCII_SO ; ^N 0xe
JP Z, t_con_output
CP ASCII_SI ; ^O 0xf
JP Z, t_con_output
LD A, (cmd_switch)
; if param='F', and unprintable char, do not print
CP 3
RET Z
; replace unprintable with '^'
PUSH DE
LD E, '^'
CALL t_con_output
POP DE
;
LD A, E
OR 0x40
LD E, A
JP t_con_output
; --------------------------------------------------
; Return keyboard key if pressed
; Out: A - key code, 0 - no key
; --------------------------------------------------
t_get_key_wo_echo:
LD E, 0xff
t_get_key_echo:
LD C, 6
JP jp_bdos_enter
t_con_output:
LD C, 2
JP jp_bdos_enter
t_ver_unsupported:
HALT
; ---------------------------------------------------
; Get next character from command line
; Out: A - character
; CF is set if EOL
; ZF is set if A=0
; ---------------------------------------------------
t_get_cmdl_char:
; there are still characters in the cmd line?
LD A, (cmd_par_len)
OR A
JP NZ, t_get_next_cmdc ; jump if not eol
CCF
RET
t_get_next_cmdc:
; decrement characters count
DEC A
LD (cmd_par_len), A
; get next character to A
LD HL, (t_buff_addr)
INC HL
LD A, (HL)
; update pointer
LD (t_buff_addr), HL
OR A
RET
; ---------------------------------------------------
;
; ---------------------------------------------------
get_numbr:
LD C, 10
CALL t_get_cmdl_char
LD HL, 0x0
t_do_nxt_lettr:
JP NC, t_has_a_lettr
OR A
RET
t_has_a_lettr:
CP ASCII_SP
RET Z
CALL t_is_digits
RET C
CP C
CCF
RET C
LD D, H
LD E, L
LD L, A
LD H, 0
LD A, C
CALL t_next_hl_de
PUSH HL
CALL t_get_cmdl_char
POP HL
JP t_do_nxt_lettr
; ---------------------------------------------------
;
; ---------------------------------------------------
t_is_digits:
SBC A, '0'
RET C
CP 10
JP C, .digit
SBC A, 7
CP 10
RET C
.digit:
CP 16
CCF
RET
; ---------------------------------------------------
;
; ---------------------------------------------------
t_next_hl_de:
OR A
RET Z
RRA
JP NC, .a0_is_0
ADD HL, DE
.a0_is_0:
EX DE, HL
ADD HL, HL
EX DE, HL
JP t_next_hl_de
; ---------------------------------------------------
;
; ---------------------------------------------------
t_get_nxt_byte:
LD HL, (t_buff_addr)
LD DE, 0xff00
ADD HL, DE
LD A, H
OR L
CALL Z, t_read_next_128
RET C
LD HL, (t_buff_addr)
LD A, (HL)
INC HL
LD (t_buff_addr), HL
RET
; ---------------------------------------------------
;
; ---------------------------------------------------
t_read_next_128:
LD DE, dma_buffer
;(F_DMAOFF) - Set DMA address
LD C, 26
CALL jp_bdos_enter
LD DE, fcb1
;(F_READ) - read next record
LD C, 20
CALL jp_bdos_enter
RRA
LD HL, dma_buffer
LD (t_buff_addr), HL
RET
; ---------------------------------------------------
; Variables
; ---------------------------------------------------
flag0:
db 0x00
flag1:
db 0x00
; Cmd line switch D-1, C-2, F-3
cmd_switch:
db 0x00
t_scb_mm:
db 0x00
t_cut_byte:
db 0x00
cmd_par_len:
db 0x00
t_buff_addr:
dw 0x0000
t_scb_1:
db 0x1c ; offset
db 0 ; read byte at offset onto a, and word into hl
db 0, 0
t_scb_2:
db 0x38 ; offset
db 0, ; read byte at offset onto a, and word into hl
db 0 ,0
t_scb_3:
db 0x38 ; offset
db 0xff ; save next byte to SCB+offset
db 0 , 0
;t_val_scb1
; dw 0x0000
t_message_tab:
dw msg_err_cmdline
dw msg_no_file
dw msg_interrupted
msg_err_cmdline:
db "o{ibka komandnoj stroki. ispolxzujte\r\n"
db "TYPE UFN SWITCH \t ili\r\n"
db "TYPE UFN SWITCH P \t ili\r\n"
db "TYPE UFN SWITCH P#\r\n\t"
db "s perekl`~atelem SWITCH:\tNO D C F\r\n"
db "$"
msg_no_file:
db "net fajla$"
msg_interrupted:
db "\r\nTYPE prerwana$"
filler1:
ds 88, 0x1A
filler2:
ds 1024+start-filler2, 0xe5
ENDMODULE

BIN
Type/type.com Normal file

Binary file not shown.