main.CPUClock=2500KHz
main.Caption="Орион-128"

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

mem1 : Memory {
  size=10000
}

mem2 : Memory {
  size=10000
}

mem3 : Memory {
  size=10000
}

mem4 : Memory {
  size=10000
}

bios : Memory {
  rom="Orion\bios.rom"
}

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

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

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

dsk : KR1818wg93 {
  ext="odi"
  image[0].file="Orion\disk1.odi"
  image[1].file="Orion\disk2.odi"
  vdpb="2800040F0084017F00C00020000400"
  vdpb.boot="Orion\disk1.odi"
}

mm : MemMap {
  map[0][0000-F3FF]=mem1[0000]
  map[0][F400-F4FF]=sys.data
  map[0][F500-F5FF]=app1.data
  map[0][F700-F7FF]=extmap
  map[0][F800-F8FF].wo=vid.mode
  map[0][F900-F9FF].wo=mm.page
  map[0][FA00-FAFF].wo=vid.page
  map[0][F800-FFFF].ro=bios[0000]

  map[1][0000-EFFF]=mem2[0000]
  map[1][F000-F3FF]=mem1[F000]
  map[1][F400-F4FF]=sys.data
  map[1][F500-F5FF]=app1.data
  map[1][F700-F7FF]=extmap
  map[1][F800-F8FF].wo=vid.mode
  map[1][F900-F9FF].wo=mm.page
  map[1][FA00-FAFF].wo=vid.page
  map[1][F800-FFFF].ro=bios[0000]

  map[2][0000-EFFF]=mem3[0000]
  map[2][F000-F3FF]=mem1[F000]
  map[2][F400-F4FF]=sys.data
  map[2][F500-F5FF]=app1.data
  map[2][F700-F7FF]=extmap
  map[2][F800-F8FF].wo=vid.mode
  map[2][F900-F9FF].wo=mm.page
  map[2][FA00-FAFF].wo=vid.page
  map[2][F800-FFFF].ro=bios[0000]

  map[3][0000-EFFF]=mem4[0000]
  map[3][F000-F3FF]=mem1[F000]
  map[3][F400-F4FF]=sys.data
  map[3][F500-F5FF]=app1.data
  map[3][F700-F7FF]=extmap
  map[3][F800-F8FF].wo=vid.mode
  map[3][F900-F9FF].wo=mm.page
  map[3][FA00-FAFF].wo=vid.page
  map[3][F800-FFFF].ro=bios[0000]
}

regs1 : K580ww55 {
  portA[0-1]=dsk.drive
  portA[4]=dsk.side[0]
}

extmap : MemMap2 {
  map[00-03]=dsk.data
  map[04]=regs1.data[0]
  map[10-13]=dsk.data
  map[14]=regs1.data[0]
  map[20]=regs1.data[0]
}

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

vid : orion-video {
  plane[0][0]=mem1[C000]
  plane[0][1]=mem2[C000]
  plane[1][0]=mem1[8000]
  plane[1][1]=mem2[8000]
  plane[2][0]=mem1[4000]
  plane[2][1]=mem2[4000]
  plane[3][0]=mem1[0000]
  plane[3][1]=mem2[0000]
}

cas : tape-recorder {
}

beep : beep {
  input=cpu.int
}
