main.CPUClock=2222222Hz
main.Caption="Юниор"
main.ff.speed=10
main.ff.keymask[B]=2

CPU : K580wm80a {
  debug=cas
  mem=mm
  pc=F800
  port[30-38]=dma.data
  port[3C-3F]=app.data
  port[4C-4F]=sys.data
  port[50]=dma.autocopy.ff
  port[60-61]=crt.data
  port[DC-DF]=tim.data
  port[EC-ED]=com.data
  rst[7]=crt.irq
  rst[7]=kbd.irq
}

mem1 : Memory {
  size=20000
}

font : Memory {
  rom="Unior\unior.fnt"
  frame[0].size=400
}

bios : Memory {
  rom="Unior\unior.rom"
}

sys : K580ww55 {
  portA=kbd.mask
  portB=kbd.~idata
  portC[0-2]=dmm.~page
  portC[3]=font.frame[0].page
}

app : K580ww55 {
 portB[3]=cas.ioctl.rec
 portB[4]=cas.ioctl.play
 portB[5]=cas.ioctl.back
 portB[6]=cas.ioctl.ff
 portB[7]=cas.ioctl.stop
}

crt : K580wg75 {
  mode=3
  dma=dma[2]
  font=font.frame[0]
  palette="Unior\palette.rom"
  pindex=crt.ggh
}

dmm : MemMap {
  map[0][0000-FFFF]=mem1[00000]
  map[1][0000-FFFF]=mem1[10000]
  map[2][0000-FFFF]=dummy
  map[3][0000-FFFF]=dummy
  map[4][0000-FFFF]=dummy
  map[5][0000-FFFF]=dummy
  map[6][0000-FFFF]=dummy
  map[7][0000-FFFF]=dummy
}

dma : K580wt57 {
  mem=mem1
  mem[1]=dmm
  autocopy=1
  hrq=CPU.hold
  tc=crt.stopdrq
}

tim : K580wi53 {
  clock[0].rate=3/4
  clock[1].rate=1/1
  clock[2].rate=1/8e
  gate[0].value=1
  gate[1].value=1
  gate[2]=sys.portC[4]
}

com : K580ww51 {
  io=cas.ioctl
}

mm : MemMap {
  map[0][0000-F7FF]=mem1[0000]
  map[0][F800-FFFF].wo=mem1[F800]
  map[0][F800-FFFF].ro=bios[0000]
}

kbd : Keyboard {
  layout="Unior\layout.kbd"
  irqkey=58
}

beep : beep {
  input[0]=tim.out[2]
}

cas : tape-recorder {
}
