Package screens
Class Screen0
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
The emulated machine's screen - a QL mode 4 or 8 screen.
In ql screen mode 4/0, colours for 8 pixels are in 1 word - 4 pixels per byte.
The lower (even) address = green bits, the higer (odd) byte of the word = red bits
"Drawing" on the screen is done by copying the image back to the screen. The "video ram" data structure is an array of short : in QL modes 4 and 8, pixels are addressed as words (8 or 4 pixels per word)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class screens.Screen
colourMode, copyMode, dataBuffer, divisior, isDirty, isDouble, isMac, isWindows, monitor, nbrOfBytesPerLine, pixelmask4, pixelmask8, QLmode, raster, screenImage, startAddress, stopAddress, vibrantColours, xEnd, xsize, yEnd, ysize
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
combineBlocks
(MC68000Cpu cpu) This combines two blocks with alpha blending - not implemented here.void
displayRegion
(MC68000Cpu cpu, int start, int nbrOfBytes) Displays a region if bytes were loaded directly to the screen memory.void
fillBlock
(MC68000Cpu cpu, boolean resolveStipple) Fills a block with colour - not implemented here.final int
Gets size, in bytes, of the vram.boolean
Checks whether this is a QL type screenvoid
moveBlock
(MC68000Cpu cpu, boolean copyFromScreen) This is called when a block of memory was copied to the vram - not implemented here.void
setColourMode
(int mode) Sets the screen mode when in QL compatible mode.void
setVibrantColours
(boolean b, char[] s) Sets whether brighter colours should be used - ignored.void
setVramBase
(int vrambase) Sets the new Vrambase for the screen buffer if we are in QL compatible mode (this implies that the CPU or its memory changed).void
writeByteToScreen
(int address, int value, int wordValue) Writes a byte to the screen, painting the corresponding pixel(s).void
writeLongToScreen
(int addr, int value) Writes a long word to the java screen.void
writeWordToScreen
(int addr, int value) Writes a word to the screen, painting the corresponding pixel(s).void
xorBlock
(MC68000Cpu cpu, boolean resolveStrip) XORS a block with colour - not implemented here.Methods inherited from class screens.Screen
changeDoubleSize, copyScreen, fillScreen, fillScreen, getColourMode, getDivisor, getImageSize, getKeysType, getLineSize, getMonitor, getMyMousePosition, getPreferredSize, getScreenBase, getScreenTop, getSizeInBytes, getXSize, getYSize, isDoubleSize, isVibrantColours, mouseInScreen, paintComponent, resetMouseButtons, screenPanelKeyPressed, screenPanelKeyReleased, screenPanelKeyTyped, screenPanelMouseEntered, screenPanelMouseExited, screenPanelMouseMoved, screenPanelMousePressed, screenPanelMouseReleased, setDisplayRegion, setEmuColourMode, setEndPositions, setFullSize, setIsMac, setIsWindows, setKeysType, setMonitor, setMouseClickDelay, setMousePosition, setMousewheelAccel, setPixels, setQLEmulationMode
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
Screen0
public Screen0(int xsize, int ysize, int vrambase, Monitor monitor, boolean isMac, boolean ddouble, int windowMode, boolean pctype) Creates the object.- Parameters:
xsize
- the xsize of the screen in pixelsysize
- the ysize of the screen in pixels. If they are both - 1, then use a QL screen.vrambase
- the start of the "videoram" as far as the CPU is concerned.monitor
- the monitor running the cpu.isMac
- true if we're running on a mac.ddouble
- true if double sized pixelswindowMode
- mode of window 0 = window , 1 = full size, 2 = special fullsizepctype
- true if standard home etc keys
-
-
Method Details
-
writeByteToScreen
public void writeByteToScreen(int address, int value, int wordValue) Writes a byte to the screen, painting the corresponding pixel(s).- Specified by:
writeByteToScreen
in classScreen
- Parameters:
address
- where to write to. This is the SMSQE address, where it thinks video memory lies. It has already been checked that the address is in my memory space.value
- the value to write.wordValue
- the value to write into the word this byte is part of
-
writeWordToScreen
public void writeWordToScreen(int addr, int value) Writes a word to the screen, painting the corresponding pixel(s).- Specified by:
writeWordToScreen
in classScreen
- Parameters:
addr
- the address where to write to. It is presumed that it has been checked that this is in screen mem.value
- the value to write to screen mem.
-
writeLongToScreen
public void writeLongToScreen(int addr, int value) Writes a long word to the java screen.- Specified by:
writeLongToScreen
in classScreen
- Parameters:
addr
- where to write tovalue
- the value to write
-
setColourMode
public void setColourMode(int mode) Sets the screen mode when in QL compatible mode. Only modes 4 and 8 are supported.- Overrides:
setColourMode
in classScreen
- Parameters:
mode
- 0 for mode 4 ,8 for mode 8
-
fillBlock
Fills a block with colour - not implemented here. -
xorBlock
XORS a block with colour - not implemented here. -
combineBlocks
This combines two blocks with alpha blending - not implemented here. Not used here.- Specified by:
combineBlocks
in classScreen
- Parameters:
cpu
- the CPU used
-
moveBlock
This is called when a block of memory was copied to the vram - not implemented here. It must copy the data from the vram into the image. -
displayRegion
Displays a region if bytes were loaded directly to the screen memory. Used from CPU.- Specified by:
displayRegion
in classScreen
- Parameters:
cpu
- the cpu used.start
- where the bytes were loaded to.nbrOfBytes
- how many bytes were loaded.
-
setVramBase
public void setVramBase(int vrambase) Sets the new Vrambase for the screen buffer if we are in QL compatible mode (this implies that the CPU or its memory changed). Adjust vramtop accordingly.- Specified by:
setVramBase
in classScreen
- Parameters:
vrambase
- the new video ram base.
-
setVibrantColours
public void setVibrantColours(boolean b, char[] s) Sets whether brighter colours should be used - ignored. This does nothing here.- Specified by:
setVibrantColours
in classScreen
- Parameters:
b
-true
if brighter colours should be used.s
- ignored
-
getScreenSizeInBytes
public final int getScreenSizeInBytes()Gets size, in bytes, of the vram.- Specified by:
getScreenSizeInBytes
in classScreen
- Returns:
- screen size, in number of bytes.
-
isQLScreen
public boolean isQLScreen()Checks whether this is a QL type screen- Specified by:
isQLScreen
in classScreen
- Returns:
- true if this is a QL screen (512*256 i mode 4, 256*256 in mode 8), else false
-