Skip to content

Commit

Permalink
2Mhz mode fixed. File menu' fixed.
Browse files Browse the repository at this point in the history
2Mhz mode has been improved: the VIC refresh cycles are treated as I/O.

Drive 9 fixed on File menu'
  • Loading branch information
abbruzze committed Sep 10, 2018
1 parent 685814a commit 8dfd5f9
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions Kernal64/src/ucesoft/cbm/c128/C128.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
f
}
private[this] val vdcDisplayFrame = {
val f = new JFrame("Kernal128 " + ucesoft.cbm.Version.VERSION) {
override def getInsets = new Insets(0,0,0,0)
}
val f = new JFrame("Kernal128 " + ucesoft.cbm.Version.VERSION)
f.addWindowListener(new WindowAdapter {
override def windowClosing(e:WindowEvent) {
close
Expand Down Expand Up @@ -322,7 +320,7 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
import cia._
// control ports
val cia1CP1 = new CIA1Connectors.PortAConnector(keyb,controlPortA)
val cia1CP2 = new CIA1Connectors.PortBConnector(keyb,controlPortB,() => vicChip.triggerLightPen)
val cia1CP2 = new CIA1Connectors.PortBConnector(keyb,controlPortB,() => { vicChip.triggerLightPen ; vdc.triggerLightPen })
add(cia1CP1)
add(cia1CP2)

Expand Down Expand Up @@ -526,7 +524,7 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
if (z80Active) z80.clock(cycles,4)
else {
cpu.fetchAndExecute(1)
if (cpuFrequency == 2 && !mmu.isIOACC) cpu.fetchAndExecute(1)
if (cpuFrequency == 2 && !mmu.isIOACC && !vicChip.isRefreshCycle) cpu.fetchAndExecute(1)
}
}

Expand Down Expand Up @@ -931,7 +929,11 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
setDisplayRendering(java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR)
case "RENDERING_BICUBIC" =>
setDisplayRendering(java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC)

case "VDC_SCAN_LINES" =>
val lines = JOptionPane.showInputDialog(vdcDisplayFrame,"Insert VDC scan lines", "VDC Scan Lines",JOptionPane.QUESTION_MESSAGE,null,null,"312")
if (lines != null) {
vdc.setScanLines(lines.toString.toInt)
}
}
}

Expand Down Expand Up @@ -1730,6 +1732,10 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
attachDisk0Item.setActionCommand("ATTACH_DISK_0")
attachDisk0Item.addActionListener(this)
fileMenu.add(attachDisk0Item)
val attachDisk1Item = new JMenuItem("Attach disk 9...")
attachDisk1Item.setActionCommand("ATTACH_DISK_1")
attachDisk1Item.addActionListener(this)
fileMenu.add(attachDisk1Item)
// For settings see below, after drive type

val ejectMenu = new JMenu("Eject disk")
Expand Down Expand Up @@ -1938,6 +1944,7 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
)
// -----------------------------------
val vdcEnabled = new JCheckBoxMenuItem("VDC enabled")
vdcEnabled.setAccelerator(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E,java.awt.event.InputEvent.ALT_DOWN_MASK))
vdcEnabled.setSelected(true)
vdcEnabled.setActionCommand("VDCENABLED")
vdcEnabled.addActionListener(this)
Expand Down Expand Up @@ -2059,6 +2066,11 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
fullScreenItem.addActionListener(this)
adjustMenu.add(fullScreenItem)

val vdcScanLinesItem = new JMenuItem("VDC scan lines ...")
vdcScanLinesItem.setActionCommand("VDC_SCAN_LINES")
vdcScanLinesItem.addActionListener(this)
adjustMenu.add(vdcScanLinesItem)

val renderingItem = new JMenu("Rendering")
val groupR = new ButtonGroup
adjustMenu.add(renderingItem)
Expand All @@ -2083,10 +2095,10 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
"RENDERING_TYPE",
(dt:String) => {
dt match {
case "bilinear" =>
case "bilinear"|"" =>
setDisplayRendering(java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR)
renderingBilinear1Item.setSelected(true)
case "bicubic"|"" =>
case "bicubic" =>
setDisplayRendering(java.awt.RenderingHints.VALUE_INTERPOLATION_BICUBIC)
renderingBicubic1Item.setSelected(true)
case "default" =>
Expand Down Expand Up @@ -2302,11 +2314,6 @@ class C128 extends CBMComponent with ActionListener with GamePlayer with MMUChan
floppyComponents(0).drive.getFloppy.file
)
// -----------------------------------

val attachDisk1Item = new JMenuItem("Attach disk 9...")
attachDisk1Item.setActionCommand("ATTACH_DISK_1")
attachDisk1Item.addActionListener(this)
fileMenu.add(attachDisk1Item)
// Setting ---------------------------
settings.add("drive9-file",
"Attach a file to drive 9",
Expand Down

0 comments on commit 8dfd5f9

Please sign in to comment.