main.CPUClock=2MHz
main.Caption="Специалист + SD ATMega8 (alemorf)"

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

mem1 : Memory {
  size=10000
}

bios : Memory {
  rom="Specialist\bios8.rom"
}

sys : K580ww55 {
  portA=kbd.row
  portB[0]=cas.playback
  portB[1]=kbd.shift
  portB[2-7]=kbd.col
  portC[0-3]=kbd.row2
  portC[7]=cas.record
}

romdisk : SD-Mega {
  root="Specialist"
  boot="Specialist\BOOT\BOOT.RKS"
  s0="(@00|@80 @00 {1300 B400 5700 on (s1|s2|s3|s4|s5|s6|s7|s8|s9|xx) xx off})*"
  s1="0040 40 run:BOOT\SDBIOS.RKS sub1"
  s2="0140 40 42 42 01 45 4D 55 20 42 32 4D 20 56 20 31 2E 30 31 20 20"
  s3="0240 40 42 42 xx ins 41 run sub1"
  s4="0340 40 42 42 xx ins r0xx r1xx (45/43 dir xx outs:14)*"
  s5="0440 40 42 42 r0xx xx ins 43 open"
  s6="0540 40 42 42 r4xx r0xx r1xx r2xx r3xx 43 seek r0 r1 r2 r3"
  s7="0640 40 42 42 r0xx r1xx (00/44 rblk r0 r1 xx read 44|)"
  s8="0740 40 42 42 r0xx r1xx 46 r0 r1 43 xx write 43"
  s9="0840 40 42 42 xx ins 46 xx xx ins:1 43 rename"
  sub1="47 read:4 r0 r1 (00/44 rblk:4000 r0 r1 xx read)*"
}

app : K580ww55 {
  portB=romdisk.addr
  portC=romdisk.data
}

mm : MemMap {
  map[0][0000-8FFF]=mem1[0000]
  map[0][9000-BFFF]=vid.mem
  map[0][C000-EFFF].ro=bios[0000]
  map[0][F000-F7FF]=app.data
  map[0][F800-FFFF]=sys.data
}

kbd : Specialist-Keyboard {
  layout="Specialist\layout.kbd"
}

vid : Specialist-Video {
}

beep : beep {
  input=sys.portC[5]
}

cas : tape-recorder {
  biproc[C377-C3C8]=rk
  boproc[C3D0-C3F4]=sp
}
