main.CPUClock=5MHz
main.Caption="Орион-128 + Z80 Card II"

CPU : Z80 {
  mem=mm
  port[F8]=vid.mode
  port[F9]=mem1.frame[0].page
  port[FA]=vid.page
  port[FB]=regs1.data[1]
  port[FD]=portFD
  port[FE]=regs1.data[2]
  port[FF]=AY.flip
  rst[7]=vid.irq
  pc=F800
}

portFD : MemMap2 {
  offset=cpu.port.msb
  map[BE]=AY.data
  map[BF]=AY.data
  map[FF]=AY.regno
}

mem1 : Memory {
  size=80000
  frame[0].size=10000
  frame[1].size=4000
}

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

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\disk26.odi"
  vdpb="2800040F0084017F00C00020000400"
  vdpb.boot="Orion\disk1.odi"
}

mm : MemMap {
  map[0][0000-3FFF]=mem1.frame[1]
  map[0][4000-EFFF]=mem1.frame[0][4000]
  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]

  map[1][0000-3FFF]=mem1.frame[1]
  map[1][4000-FFFF]=mem1.frame[0][4000]

  map[2][0000-EFFF]=mem1.frame[0]
  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=mem1.frame[0].page
  map[2][FA00-FAFF].wo=vid.page
  map[2][F800-FFFF].ro=bios[0000]

  map[3][0000-FFFF]=mem1.frame[0]
}

regs1 : K580ww55 {
  portA[0-1]=dsk.drive
  portA[4]=dsk.side[0]
  portB[0-3]=mem1.frame[1].page
  portB[5]=mm.page[0]
  portB[6]=vid.irqenable
  portB[7]=mm.page[1]
  portC[4]=AY.input
}

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]
  map[60]=clock.regno
  map[61]=clock.data
  map[70-8F]=net.data
}

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 {
}

AY : AY-3-8910 {
  freq=1773400
}

clock : KR512wi1 {
  cmos="Orion\cmos.dat"
}

net : RTL8019AS {
  mac="000102030405"
  ifname="any"
}
