main.CPUClock=2MHz
main.Caption="Специалист-МХ + Commander"

CPU : K580wm80a {
  mem=mm
  port.maptomem=1
}

bios : Memory {
  rom="Specialist\ramfos.rom"
}

romdisk : Memory {
  rom="Specialist\romdisk.bin"
}

mem1 : Memory {
  size=10000
}

ramdisk : Memory {
  size=10000
}

sys : K580ww55 {
  portA=kbd.row
  portB[1]=kbd.shift
  portB[2-7]=kbd.col
  portC[0-3]=kbd.row2
}

app : K580ww55 {
  portA=romdisk.data
  portB=romdisk.lsb
  portC=romdisk.msb
}

dsk : KR1818wg93 {
  ext="odi"
  image[0].file="Specialist\bst_mx0.odi"
}

tim : K580wi53 {
  clock[0].rate=1/1
  clock[1].rate=1/1
  clock[2]=tim.out[1]
  ~gate[0]=tim.out[2]
  gate[1].value=1
  gate[2].value=1
}

mmport1 : MemMap2 {
  map[00-DF]=mem1[FF00]
  map[E0-E3]=sys.data
  map[E4-E7]=app.data
  map[E8-EB]=dsk.data
  map[EC-EF]=tim.data
  map[F2]=dsk.side
  map[F3]=dsk.drive
  map[F8-F8]=vid.color
  map[FC-FF]=mode
}

mmport2 : MemMap2 {
  map[00-BF]=ramdisk[FF00]
  map[C0-DF]=mem1[FFC0]
  map[E0-E3]=sys.data
  map[E4-E7]=app.data
  map[E8-EB]=dsk.data
  map[EC-EF]=tim.data
  map[F2]=dsk.side
  map[F3]=dsk.drive
  map[F8-F8]=vid.color
  map[FC-FF]=mode
}

mode : Decoder {
  adrxlat="10"
  addr.wo=mm.page
}

mm : MemMap {
  map[0][0000-8FFF]=mem1[0000]
  map[0][9000-BFFF]=vid.mem
  map[0][C000-FEFF]=mem1[C000]
  map[0][FF00-FFFF]=mmport1
  map[1][0000-FEFF]=ramdisk[0000]
  map[1][FF00-FFFF]=mmport2
  map[2][0000-BFFF]=bios[0000]
  map[2][C000-FEFF]=mem1[C000]
  map[2][FF00-FFFF]=mmport1
  map[3][0000-BFFF]=bios[0000]
  map[3][C000-FEFF]=mem1[C000]
  map[3][FF00-FFFF]=mmport1
  initpage=3
}

kbd : Specialist-Keyboard {
  layout="Specialist\layout.kbd"
}

vid : Specialist-Video {
}

beep : beep {
  input=sys.portC[5]
  input[0]=tim.out[0]
}
