Package screens
Class Screen16
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
An 8-bit Aurora compatible screen for SMSQmulator.
It sets up video memory (vram) as an array of bytes.
- 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 rectangular blocks (source 1, source2) with alpha blending and puts the result into the BufferedImage data and the CPU's videoram.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 : this updates the "screen memory" AND the underlying image.final int
Gets size, in bytes, of the video ram.boolean
Checks whether this is a QL type screenvoid
moveBlock
(MC68000Cpu cpu, boolean copyFromScreen) A block is to be blitted; either within the image, or from normal mem to image.void
setVibrantColours
(boolean b, char[] vramBuffer) Sets whether brighter colours should be used.void
setVramBase
(int vrambase) Sets the new Vrambase and adjust vramtop and vrambase accordingly.void
writeByteToScreen
(int addr, int value, int wordValue) Paints the corresponding pixel.void
writeLongToScreen
(int addr, int value) Writes a long word to the java screen, and paints the corresponding pixel on the screen.void
writeWordToScreen
(int addr, int value) Paints the corresponding pixels on the screen.void
xorBlock
(MC68000Cpu cpu, boolean resolveStipple) XORs a block with colour : this updates the "screen memory" AND the underlying image.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, setColourMode, 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
-
Screen16
public Screen16(int xsize, int ysize, int vramBase, boolean vibrantColours, Monitor monitor, boolean isMac, boolean ddouble, int windowMode, boolean pctype) This sets up the entire screen object, including the BufferedImage.- Parameters:
xsize
- the xsize of the screen, in pixels.ysize
- the ysize of the screen, in pixels.vramBase
- the start of the screen ram as the CPU sees it. For the CPU, this will generally be above the ROM.vibrantColours
- iftrue
, use full 8 bits per colour, else only the upper 5 (6 for green).monitor
- the monitor.isMac
- true if screen is on a mac.ddouble
- true if double sized pixelswindowMode
- mode of window 0 = window , 1 = full size, 2 = special fullsizepctype
- true if statndard home etc keys
-
-
Method Details
-
writeByteToScreen
public void writeByteToScreen(int addr, int value, int wordValue) Paints the corresponding pixel.- Specified by:
writeByteToScreen
in classScreen
- Parameters:
addr
- where to write to. This is the SMSQE address, where it thinks video memory lies.value
- the aurora colour value to write.wordValue
- the value to write into the word this byte is part of
-
writeWordToScreen
public void writeWordToScreen(int addr, int value) Paints the corresponding pixels on the screen.- Specified by:
writeWordToScreen
in classScreen
- Parameters:
addr
- the address where to write to.value
- the aurota colour values (for 2 pixels)to write to screen.
-
writeLongToScreen
public void writeLongToScreen(int addr, int value) Writes a long word to the java screen, and paints the corresponding pixel on the screen.- Specified by:
writeLongToScreen
in classScreen
- Parameters:
addr
- the address where to write to.value
- the aurota colour values (for 4 pixels) to write to screen.
-
fillBlock
Fills a block with colour : this updates the "screen memory" AND the underlying image.- Specified by:
fillBlock
in classScreen
- Parameters:
cpu
- the CPu used.resolveStipple
- true if we need to convert a stipple number in d6 into colours in d6/d7 The block size and origin are assumed to have been adjusted for correct position within the area to be set. Registers: Entry Exit D0 smashed D1 block size smashed D2 block origin smashed D3-D5 smashed D6 stipple Nbr (cn_block) OR long word colour for even row (bm_block) D7 colour mask in long word (cn_block) or long word colour for odd row (bm_block) smashed A1 area base address smashed A2 area row increment smashed
-
xorBlock
XORs a block with colour : this updates the "screen memory" AND the underlying image.- Specified by:
xorBlock
in classScreen
- Parameters:
cpu
- the CPu used. xo x origin of the block yo y origin of the block xs x size of the block ys y size of the block stipple how we stipple the colour (0xffff - solid colour, 0= 1 of 4 , 2 =vertical, 3 horiz., 3 checkerboard colour1x the stipple colour (in SMSQE format, mode 16). colour2x the main colour (in SMSQE format, mode 16).resolveStipple
- true if we need to convert a stipple number in d6 into colours in d6/d7
-
moveBlock
A block is to be blitted; either within the image, or from normal mem to image. -
combineBlocks
This combines two rectangular blocks (source 1, source2) with alpha blending and puts the result into the BufferedImage data and the CPU's videoram. If destination is not the screen, or source 1 or 2 are not in main memory, this returns to SMSQE with an error.- Specified by:
combineBlocks
in classScreen
- Parameters:
cpu
- the CPU used.
-
displayRegion
Displays a region if bytes were loaded directly to the screen memory. Used from CPU.- Specified by:
displayRegion
in classScreen
- Parameters:
cpu
- .start
- where the bytes were loaded to.nbrOfBytes
- how many bytes were loaded.
-
setVramBase
public void setVramBase(int vrambase) Sets the new Vrambase and adjust vramtop and vrambase accordingly.- Specified by:
setVramBase
in classScreen
- Parameters:
vrambase
- the new vrambase.
-
setVibrantColours
public void setVibrantColours(boolean b, char[] vramBuffer) Sets whether brighter colours should be used.- Specified by:
setVibrantColours
in classScreen
- Parameters:
b
-true
if brighter colours should be used.vramBuffer
- the video ram buffer.
-
getScreenSizeInBytes
public final int getScreenSizeInBytes()Gets size, in bytes, of the video ram.- 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
-