Skip to content

Commit

Permalink
Managing of new WiC64 emulation.
Browse files Browse the repository at this point in the history
Added zoom x 3 in GUI.
  • Loading branch information
abbruzze committed Feb 15, 2022
1 parent ee413c7 commit c7df0f1
Show file tree
Hide file tree
Showing 6 changed files with 896 additions and 6 deletions.
16 changes: 14 additions & 2 deletions Kernal64/src/ucesoft/cbm/CBMComputer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ trait CBMComputer extends CBMComponent with GamePlayer { cbmComputer =>
}
// ------------------------------------ Drag and Drop ----------------------------
protected val DNDHandler = new DNDHandler(handleDND(_,true,true))
// ------------------- INITIALIZATION ------------------------
// ----------------------WiC64 ---------------------------------------------------
protected var wic64Panel : WiC64Panel = _
// ------------------- INITIALIZATION --------------------------------------------
initComputer

protected def initComputer : Unit = {
Expand Down Expand Up @@ -1366,6 +1368,8 @@ trait CBMComputer extends CBMComponent with GamePlayer { cbmComputer =>
if (vicChip.VISIBLE_SCREEN_WIDTH == dim.width && vicChip.VISIBLE_SCREEN_HEIGHT == dim.height) vicZoomFactor = 1
else
if (vicChip.VISIBLE_SCREEN_WIDTH * 2 == dim.width && vicChip.VISIBLE_SCREEN_HEIGHT * 2 == dim.height) vicZoomFactor = 2
else
if (vicChip.VISIBLE_SCREEN_WIDTH * 3 == dim.width && vicChip.VISIBLE_SCREEN_HEIGHT * 3 == dim.height) vicZoomFactor = 3
else vicZoomFactor = 0 // undefined
}

Expand Down Expand Up @@ -1469,7 +1473,7 @@ trait CBMComputer extends CBMComponent with GamePlayer { cbmComputer =>
finally loadStateFromOptions = false
}
}
preferences.add(PREF_SCREENDIM,"Zoom factor. Valued accepted are 1 and 2",0,Set(1,2),false) { dim =>
preferences.add(PREF_SCREENDIM,"Zoom factor. Valued accepted are 1,2,3",0,Set(1,2,3),false) { dim =>
vicZoom(dim)
zoomOverride = true
}
Expand Down Expand Up @@ -2261,6 +2265,14 @@ trait CBMComputer extends CBMComponent with GamePlayer { cbmComputer =>
}) :: resetSettingsActions
}

protected def setWiC64Settings(parent:JMenu): Unit = {
val wic64Item = new JMenuItem("WiC64 panel ...")
parent.add(wic64Item)
wic64Item.addActionListener(_ => {
wic64Panel.dialog.setVisible(true)
})
}

protected def setFlyerSettings(parent:JMenu) : Unit = {
// FLYED-ENABLED =======================================================================================
val flyerItem = new JMenu("Flyer internet modem")
Expand Down
8 changes: 7 additions & 1 deletion Kernal64/src/ucesoft/cbm/c128/C128.scala
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ class C128 extends CBMComputer with MMUChangeListener {
cia2CP1,
cia2CP2,
nmiSwitcher.setLine(Switcher.CIA,_),idle => cia12Running(1) = !idle)
WiC64.flag2Action = cia2.setFlagLow _
wic64Panel = new WiC64Panel(displayFrame)
WiC64.setListener(wic64Panel)
rs232.setCIA12(cia1,cia2)
ParallelCable.ca2Callback = cia2.setFlagLow _
add(ParallelCable)
Expand Down Expand Up @@ -599,12 +602,13 @@ class C128 extends CBMComputer with MMUChangeListener {
val groupZ = new ButtonGroup
vicAdjMenu.add(zoomItem)
setVICModel(vicAdjMenu)
for(z <- 1 to 2) {
for(z <- 1 to 3) {
val zoom1Item = new JRadioButtonMenuItem(s"Zoom x $z")
zoom1Item.addActionListener(_ => vicZoom(z) )
val kea = z match {
case 1 => java.awt.event.KeyEvent.VK_1
case 2 => java.awt.event.KeyEvent.VK_2
case 3 => java.awt.event.KeyEvent.VK_3
}
zoom1Item.setAccelerator(KeyStroke.getKeyStroke(kea,java.awt.event.InputEvent.ALT_DOWN_MASK))
zoomItem.add(zoom1Item)
Expand Down Expand Up @@ -695,6 +699,8 @@ class C128 extends CBMComputer with MMUChangeListener {

setFlyerSettings(IOItem)

setWiC64Settings(IOItem)

setREUSettings(IOItem)

setGEORamSettings(IOItem)
Expand Down
9 changes: 8 additions & 1 deletion Kernal64/src/ucesoft/cbm/c64/C64.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ class C64 extends CBMComputer {
cia2CP2,
nmiSwitcher.setLine(Switcher.CIA,_),
idle => cia12Running(1) = !idle)
WiC64.flag2Action = cia2.setFlagLow _
wic64Panel = new WiC64Panel(displayFrame)
WiC64.setListener(wic64Panel)
add(WiC64)
rs232.setCIA12(cia1,cia2)
ParallelCable.ca2Callback = cia2.setFlagLow _
add(ParallelCable)
Expand Down Expand Up @@ -249,12 +253,13 @@ class C64 extends CBMComputer {
val zoomItem = new JMenu("Zoom")
val groupZ = new ButtonGroup
optionMenu.add(zoomItem)
for(z <- 1 to 2) {
for(z <- 1 to 3) {
val zoom1Item = new JRadioButtonMenuItem(s"Zoom x $z")
zoom1Item.addActionListener(_ => vicZoom(z) )
val kea = z match {
case 1 => java.awt.event.KeyEvent.VK_1
case 2 => java.awt.event.KeyEvent.VK_2
case 3 => java.awt.event.KeyEvent.VK_3
}
zoom1Item.setAccelerator(KeyStroke.getKeyStroke(kea,java.awt.event.InputEvent.ALT_DOWN_MASK))
zoomItem.add(zoom1Item)
Expand Down Expand Up @@ -343,6 +348,8 @@ class C64 extends CBMComputer {

setFlyerSettings(IOItem)

setWiC64Settings(IOItem)

setREUSettings(IOItem)

setGEORamSettings(IOItem)
Expand Down
Loading

0 comments on commit c7df0f1

Please sign in to comment.