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

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

mem1 : Memory {
  size=40000
  frame[0].size=10000
}

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

romdisk : Memory {
  rom="Orion\romdisk.bin"
  romselect="Change ROM-disk"
  romfiles="ROM files (*.bin)|*.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-EFFF]=mem1.frame[0]
  map[0][F000-F3FF]=mem1[F000]
  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=mem1.frame[0].page
  map[0][FA00-FAFF].wo=vid.page
  map[0][F800-FFFF].ro=bios[0000]
}

reg1 : Register {
  read[0]=dsk.drq
  read[7]=dsk.irq
}

reg2 : Register {
  write[0]=dsk.side
  write[1]=dsk.drive
}

reg3 : Register {
  write[0-1]=dsk.drive
  write[4]=dsk.side[0]
}

extmap : MemMap2 {
  map[00-03]=dsk.data
  map[04]=reg1
  map[08]=reg2
  map[10-13]=dsk.data
  map[14]=reg3
  map[20]=reg3
}

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

vid : orion-video {
  plane[0][0]=mem1[0C000]
  plane[0][1]=mem1[1C000]
  plane[1][0]=mem1[08000]
  plane[1][1]=mem1[18000]
  plane[2][0]=mem1[04000]
  plane[2][1]=mem1[14000]
  plane[3][0]=mem1[00000]
  plane[3][1]=mem1[10000]
}

cas : tape-recorder {
}

beep : beep {
  input=cpu.int
}
