main.CPUClock=1777777
main.Caption="Àïîãåé ÁÊ-01"

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

mem1 : Memory {
  size=EC00
}

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

fntmap : MemMap {
  map[0][000-3FF]=font[2000]
  map[1][000-3FF]=font[2400]
  page=cpu.int
}

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

tim : K580wi53 {
  clock[0].rate=1/1
  clock[1].rate=1/1
  clock[2].rate=1/1
  gate[0].value=1
  gate[1].value=1
  gate[2].value=1
}

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

romdisk : Memory {
  rom="Apogee\romdisk.rom"
  romselect="Change ROM-Disk"
  romfiles="ROM files (*.rom)|*.rom"
}

mab : Register {
  write=romdisk.addr[F-14]
}

app : K580ww55 {
  portA=romdisk.data
  portB=romdisk.lsb
  portB=mab.d
  portC[0-6]=romdisk.addr[8-E]
  portC[7]=mab.c
}

crt : K580wg75 {
  dma=dma[2]
  font=fntmap
  hilight2=crt.ggh
}

dma : K580wt57 {
  mem=mem1
}

mm : MemMap {
  map[0][0000-EBFF]=mem1[0000]
  map[0][EC00-ECFF]=tim.data
  map[0][ED00-EDFF]=sys.data
  map[0][EE00-EEFF]=app.data
  map[0][EF00-EFFF]=crt.data
  map[0][F000-F0FF].wo=dma.data
  map[0][F000-FFFF].ro=bios[0000]
}

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

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

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