-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #22: Minor progress hooking up state manager; still doesn't wor…
…k and crashes the emulator when triggered. :/
- Loading branch information
Showing
4 changed files
with
43 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,10 +29,9 @@ | |
* Generic abstraction of a 560x192 video output device which renders 40 columns | ||
* per scanline. This also triggers VBL and updates the physical screen. | ||
* Subclasses are used to manage actual rendering via ScreenWriter | ||
* implementations. | ||
* Created on November 10, 2006, 4:29 PM | ||
* implementations. Created on November 10, 2006, 4:29 PM | ||
* | ||
* @author Brendan Robert (BLuRry) [email protected] | ||
* @author Brendan Robert (BLuRry) [email protected] | ||
*/ | ||
@Stateful | ||
public abstract class Video extends Device { | ||
|
@@ -90,6 +89,7 @@ public abstract class Video extends Device { | |
|
||
/** | ||
* Creates a new instance of Video | ||
* | ||
* @param computer | ||
*/ | ||
public Video(Computer computer) { | ||
|
@@ -99,21 +99,21 @@ public Video(Computer computer) { | |
visible = new WritableImage(560, 192); | ||
vPeriod = 0; | ||
hPeriod = 0; | ||
forceRefresh(); | ||
_forceRefresh(); | ||
} | ||
|
||
public void setWidth(int w) { | ||
width = w; | ||
} | ||
|
||
public int getWidth() { | ||
return width; | ||
} | ||
|
||
public void setHeight(int h) { | ||
height = h; | ||
} | ||
|
||
public int getHeight() { | ||
return height; | ||
} | ||
|
@@ -136,6 +136,7 @@ public void setCurrentWriter(VideoWriter currentWriter) { | |
visible.getPixelWriter().setPixels(0, 0, 560, 192, video.getPixelReader(), 0, 0); | ||
} | ||
}; | ||
|
||
public void redraw() { | ||
screenDirty = false; | ||
javafx.application.Platform.runLater(redrawScreen); | ||
|
@@ -209,8 +210,8 @@ public void tick() { | |
abstract public void configureVideoMode(); | ||
|
||
protected static int byteDoubler(byte b) { | ||
int num = | ||
// Skip hi-bit because it's not used in display | ||
int num | ||
= // Skip hi-bit because it's not used in display | ||
// ((b&0x080)<<7) | | ||
((b & 0x040) << 6) | ||
| ((b & 0x020) << 5) | ||
|
@@ -271,18 +272,22 @@ private void setFloatingBus(byte floatingBus) { | |
} | ||
|
||
@InvokableAction(name = "Refresh screen", | ||
category = "display", | ||
description = "Marks screen contents as changed, forcing full screen redraw", | ||
alternatives = "redraw", | ||
defaultKeyMapping = {"ctrl+shift+r"}) | ||
category = "display", | ||
description = "Marks screen contents as changed, forcing full screen redraw", | ||
alternatives = "redraw", | ||
defaultKeyMapping = {"ctrl+shift+r"}) | ||
public static final void forceRefresh() { | ||
if (Emulator.computer != null && Emulator.computer.video != null) { | ||
Emulator.computer.video.lineDirty = true; | ||
Emulator.computer.video.screenDirty = true; | ||
Emulator.computer.video.forceRedrawRowCount = APPLE_SCREEN_LINES + 1; | ||
Emulator.computer.video._forceRefresh(); | ||
} | ||
} | ||
|
||
private void _forceRefresh() { | ||
lineDirty = true; | ||
screenDirty = true; | ||
forceRedrawRowCount = APPLE_SCREEN_LINES + 1; | ||
} | ||
|
||
@Override | ||
public String getShortName() { | ||
return "vid"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters