main.CPUClock=4MHz
main.CPUClock[0]=4MHz
main.CPUClock[1]=3250KHz
main.Caption="Aleste 520EX"
main.globalsound=1
main.scale.y=200%
main.fullscreen=800x600x16
main.fullscreen.scale.x=1
main.fullscreen.scale.y=2

cpu : Z80 {
  mem=mb.mem
  port[00-FF]=mb.port
  port.msb=mb.portmsb
  int[FF]=mb.irq
}

mb : aleste-video {
  rom="Aleste\al512.bin"
  mapper="Aleste\mapper.dat"
  port[F7]=ppi.data
  port[FA7F-FB7F]=fdc
  port[F8DF-F8DF]=magdma.data
  port[F8DB-F9DB]=tim1.data
  port[F8D7-F9D7]=tim2.data
  port[F8DF-FADF]=mag.volume
  port[F8DF-FBDF]=mag.page
  hight=main.CPUClock.index
  ppiamx=ppiA.offset
  rtccs=rtc[4]
}

ppi : K580ww55 {
  portA=ppiA
  portB[0]=mb.vrtc
  portB[1]=fdc.irq
  portB[2-5]=07
  portC[0-2]=rtc[123]
  portC[0-3]=kbd.mask
  portC[6-7]=AY.bc1
}

ppiA : MemMap2 {
  map[0]=AY.db
  map[1]=tim
  map[2]=rtc.ad
  map[3]=tim
}

AY : AY-3-8910 {
  freq=1/4
  portA=kbd.~idata
}

kbd : Keyboard {
  layout="Aleste\layout1.kbd"
}

rtc : KR512wi1 {
  cmos="Aleste\cmos.dat"
}

fdc : uPD765 {
}

magdma : i8237a {
  mem[0]=mag.mem[0]
  mem[1]=mag.mem[1]
  mem[2]=mag.mem[2]
  mem[3]=mag.mem[3]
  tc=cpu.nmi
}

tim1 : 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
  out[0]=mag.drq[0]
  out[1]=mag.drq[1]
  out[2]=mag.drq[2]
}

tim2 : 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
  out[0]=mag.drq[3]
}

mag : aleste-magicsound {
  mem=mb.dump.mem
  src[0]=magdma[0]
  src[1]=magdma[1]
  src[2]=magdma[2]
  src[3]=magdma[3]
}
