main.CPUClock=1777777Hz
main.Caption="Радио-86РК + ORDOS 2.4"

CPU : K580wm80a {
  debug=cas
  mem=mm
  pc=F800
  port.maptomem=1
}

mem1 : Memory {
  size=10000
}

font : Memory {
  rom="symgen.bin"
}

bios1 : Memory {
  rom="Radio\ordos\r86-1.bin"
}

bios2 : Memory {
  rom="Radio\ordos\r86-2.bin"
}

romdisk : Memory {
  rom="Radio\ordos\romdisk.bin"
}

ramdisk1 : Memory {
  size=10000
}

ramdisk2 : Memory {
  size=10000
}

sys : K580ww55 {
  portA=kbd.~mask
  portB=kbd.~data
  portC[0]=cas.record
  portC[4]=cas.playback
  portC[5-7]=kbd.~data2
}

app : K580ww55 {
}

rmx : MemMap2 {
  map[00]=romdisk.data
  map[DF]=ramdisk2.data
  map[EF]=ramdisk1.data
  map[F0]=romdisk.data
}

app2 : K580ww55 {
  portA=rmx
  portB=romdisk.lsb
  portC=romdisk.msb
  portB=ramdisk1.lsb
  portC=ramdisk1.msb
  portB=ramdisk2.lsb
  portC=ramdisk2.msb
}

crt : K580wg75 {
  dma=dma[2]
  font=font[0C00]
  hilight=crt.ggh
}

dma : K580wt57 {
  mem=mem1
}

mmF6 : MemMap2 {
  map[84-87]=app2.data
  map[88]=rmx.offset
}

mmF7 : MemMap2 {
  map[00-3F]=sys.data
  map[80-BF]=crt.data
  map[C0-FF]=app.data
}

mm : MemMap {
  map[0][0000-DFFF]=mem1[0000]
  map[0][E000-E7FF].ro=bios2[0000]
  map[0][E800-F5FF]=mem1[E800]
  map[0][F600-F6FF]=mmF6
  map[0][F700-F7FF]=mmF7
  map[0][F800-FFFF].ro=bios1[0000]
  map[0][F800-FFFF].wo=dma.data
}

kbd : Keyboard {
  layout="Radio\layout.kbd"
}

beep : beep {
  input=cpu.int
  input2=sys.portC[0]
}

cas : tape-recorder {
  biproc[FB98-FCA4]=rk
  boproc[FC46-FCA4]=rk
}
