main.CPUClock=4MHz
main.Caption="มส-0011์"
main.ff.speed=10
main.ff.keymask[C]=1
main.scale.x=100%
main.scale.y=150%
main.globalsound=1
main.fullscreen=1280x1024x16
main.fullscreen.scale.x=2
main.fullscreen.scale.y=3

cpu : K1801wm1 {
  debug=cas
  mem=mm
  sel1=C000
  int[04]=kbd.halt
  int[30]=kbd.irq1
  int[40]=vid.irq
  int[BC]=kbd.irq2
  reset=kbd
}

mem1 : Memory {
  size=20000
  frame[0].size=4000
  frame[0].pagexlat="0105020304070006"
  frame[1].size=4000
  frame[1].pagexlat="0105020304070006"
}

rom1 : Memory {
  rom="BK0010\bas11m_0.rom"
}

rom2 : Memory {
  rom="BK0010\bas11m_1.rom"
}

rom3 : Memory {
  rom="BK0010\b11m_ext.rom"
}

rom4 : Memory {
  rom="BK0010\b11m_bos.rom"
}

rom5 : Memory {
  rom="BK0010\disk_327.rom"
}

ppi : bk001x-register {
}

sys : bk001x-register {
  default=C080
  read[5]=cas.playback
  read[6]=kbd.pressed
  write0[5]=cas.record
  write0[6]=AY.input
  write1[0-4]=mmr.page
  write1[8-A]=mem1.frame[1].page
  write1[C-E]=mem1.frame[0].page
}

vreg : bk001x-register {
  read=kbd.code
  write[8-F]=vid.ctl
}

r177700 : bk001x-register {
  default=FFE0
}

r177702 : bk001x-register {
  default=FFFF
}

r177704 : bk001x-register {
  default=FF20
}

mm1 : MemMap2 {
  default=cpu.nodevint
  map[58-59]=fdd.cmd
  map[5A-5B]=fdd.data
}

mm2 : MemMap2 {
  default=cpu.nodevint
  map[B0-B1]=kbd.state
  map[B2-B3]=vreg
  map[B4-B5]=vid.scroll
  map[C0-C1]=r177700
  map[C2-C3]=r177702
  map[C4-C5]=r177706
  map[C6-C7]=tim.init
  map[C8-C9]=tim.count
  map[CA-CB]=tim.csr
  map[CC-CD]=ppi
  map[CC-CD]=AY.dataw
  map[CE-CF]=sys
}

locnet : MemMap {
  map[0][0000-FFFF]=cpu.nodevint
}

extrom : MemMap {
  map[0][0000-FFFF]=cpu.nodevint
}

mmr : MemMap {
  default=cpu.nodevint
  map[0][0000-3FFF]=mem1.frame[1]
  map[1][0000-3FFF]=rom1[0]
  map[2][0000-1FFF]=rom2[0]
  map[2][2000-3FFF]=rom3[0]
  map[3][0000-3FFF]=rom1[0]
  map[4][0000-3FFF]=mem1.frame[1]
  map[5][0000-3FFF]=rom1[0]
  map[6][0000-1FFF]=rom2[0]
  map[6][2000-3FFF]=rom3[0]
  map[7][0000-3FFF]=rom1[0]
  map[8][0000-1FFF]=locnet
  map[9][0000-1FFF]=locnet
  map[A][0000-1FFF]=locnet
  map[B][0000-1FFF]=locnet
  map[C][0000-1FFF]=locnet
  map[D][0000-1FFF]=locnet
  map[E][0000-1FFF]=locnet
  map[F][0000-1FFF]=locnet
  map[10][0000-3FFF]=extrom
  map[11][0000-3FFF]=extrom
  map[12][0000-3FFF]=extrom
  map[13][0000-3FFF]=extrom
  map[14][0000-3FFF]=extrom
  map[15][0000-3FFF]=extrom
  map[16][0000-3FFF]=extrom
  map[17][0000-3FFF]=extrom
  map[18][0000-3FFF]=extrom
  map[19][0000-3FFF]=extrom
  map[1A][0000-3FFF]=extrom
  map[1B][0000-3FFF]=extrom
  map[1C][0000-3FFF]=extrom
  map[1D][0000-3FFF]=extrom
  map[1E][0000-3FFF]=extrom
  map[1F][0000-3FFF]=extrom
}

mm : MemMap {
  default=cpu.nodevint
  map[0][0000-3FFF]=mem1[0000]
  map[0][4000-7FFF]=mem1.frame[0]
  map[0][8000-BFFF]=mmr
  map[0][C000-DFFF]=rom4[0000]
  map[0][E000-EFFF]=rom5[0000]
  map[0][FE00-FEFF]=mm1
  map[0][FF00-FFFF]=mm2
}

kbd : bk0010-kbd {
  layout="BK0010\layout.kbd"
}

vid : bk0010-video {
  mode=2
  mem=mem1[14000]
}

tim : bk0010-timer {
}

AY : AY-3-8910 {
  freq=4/9
}

cas : tape-recorder {
  iproc[D98C-D98A]=bkm
  filter="BK-0010 files (*.bin;*.foc;*.cod)|*.bin;*.foc;*.cod"
}

fdd : bk0010-fdd {
  image[0].file="BK0010\C.BKD"
  image[1].file="BK0010\D.BKD"
  drive[0].tooltip="C:"
  drive[1].tooltip="D:"
  ext="bkd;*.img"
}
