;
;	Copyright (C) 2021 by Ladislau Szilagyi
;
SIM	equ     0       ;1=executed on Z80SIM, 0=executed on RC2014
MM	equ	0	;1=Memory Module
SC108	equ	0	;1=SC108
M512	equ	0	;1=512KB RAM & ROM
Z80ALL	equ	1	;1=Z80ALL
PS2	equ	1	;1=PS/2
;
;	RC2014 memory map
;
; 0000H - 1800H : Watson code & data
; 1800H - D400H : sys & app code, data
; D400H - DF00H : RTM/Z80 pointers, data
; DF00H - E000H : Watson bss, stack 
; E000H - FFFFH : Dynamic memory
;
IF	SC108 .or. MM .or. M512
SIO_A_C equ     80H
SIO_A_D equ     81H
ELSE
SIO_A_C equ     89H
SIO_A_D equ     88H
ENDIF

;
MACRO   PRINT   msg
        push    hl
        ld      hl,msg
        call    TypeString
        pop     hl
ENDM
;
;       SCM API functions used
;
RESET   equ     0       ;reset
;
CR              equ     0DH
LF              equ     0AH
BLANK           equ     20H
DELETE          equ     7FH
BACKSPACE       equ     8
ESC             equ     1BH             ; ESC[K is VT100 "erase till end of line"
FORDEL          equ     5BH             ;'['
TOEOL           equ     4BH             ;'K'
;
NXPV_OFF        equ     16      ;relative offset of (NextTask,PrevTask)

IF	SC108
;
;	Top of RAM area, before Dynamic Memory
;
UP_TO_LOW_6W	equ	0DF4DH
UP_TO_LOW_4B	equ	0DF7CH
LOW_TO_UP_6W	equ	0DF91H
LOW_TO_UP_4B	equ	0DFC7H
GOTO_SCM	equ	0DFE3H
;
ENDIF

IF	Z80ALL
COPY_2_TO_3	equ	0DFC9H
BANK_PORT	equ	1FH
ENDIF

;	Address of Registers saved after a breakpoint
;	order: AF,BC,DE,HL,AF',BC',DE',HL',IX,IY,SP,PC
_REGS		equ	0DFE8H
_PC		equ	0DFFEH
;
;	Pointers of RTM/Z80 sys data
;
IF	SIM
W_P	equ	7F00H
ELSE
IF	PS2
W_P	equ	0D500H
ELSE
W_P	equ	0D400H
ENDIF
ENDIF
;
