public abstract class VIC extends Bank
http://www.minet.uni-jena.de/~andreasg/c64/vic_artikel/vic_artikel_1.htm, http://cbmmuseum.kuto.de/zusatz_6569_vic2.html or http://unusedino.de/ec64/technical/misc/vic656x/vic656x-german.html. An English version of the documentation you can find at http://www.unusedino.de/ec64/technical/misc/vic656x/vic656x.html.
Modifier and Type | Class and Description |
---|---|
static class |
VIC.Model
Chip models supported by MOS656X.
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
areBadLinesEnabled
are bad lines enabled for this frame?
|
protected int |
bitmapMemBase
bitmap memory base address
|
protected int |
charMemBase
character memory base address
|
protected int[] |
combinedLinesCurrent |
protected int[] |
combinedLinesEven
Table for looking up color using a packed 2x8 value for even rasterlines
|
protected int[] |
combinedLinesOdd
Table for looking up color using a packed 2x8 value for odd rasterlines
|
protected EventScheduler |
context
CPU's event context.
|
protected int |
CYCLES_PER_LINE
Number of cycles per line.
|
protected static int |
FIRST_DMA_LINE
First line when we check for bad lines
|
protected boolean |
graphicsRendering
Is display rendering enabled?
|
protected static byte |
IRQ_SPRITE_BACKGROUND_COLLISION
sprite-background collision IRQ flag
|
protected static byte |
IRQ_SPRITE_SPRITE_COLLISION
sprite-sprite collision IRQ flag
|
protected boolean |
isBadLine
is the current line a bad line
|
protected boolean |
isDisplayActive
is the display active or idle?
|
protected static int |
LAST_DMA_LINE
Last line when we check for bad lines
|
protected int |
latchedXscroll
xscroll value within window region text columns 1 .. 39
|
protected int |
lineCycle
Current visible line
|
protected byte[] |
linePaletteCurrent
Prevailing VIC color palette for current line (odd/even)
|
protected byte[] |
linePaletteEven
VIC color palette for even rasterlines
|
protected byte[] |
linePaletteOdd
VIC color palette for odd rasterlines
|
protected boolean |
lpTriggered
Has light pen IRQ been triggered in this frame already?
|
static int |
MAX_HEIGHT |
protected int |
MAX_RASTERS
Number of raster lines
|
static int |
MAX_WIDTH |
protected int |
nextPixel
Index of next pixel to paint
|
protected int |
oldGraphicsData
Previous sequencer data
|
protected byte |
phi1Data
contains the memory fetch data
|
protected Consumer<int[]> |
pixelConsumer
Consumer for VIC screen output as ARGB data
|
protected int[] |
pixels
Output ARGB screen buffer as int32 array.
|
protected byte[] |
previousLineDecodedColor
Last line's color
|
protected int |
previousLineIndex
Index into last line
|
protected int |
rasterY
current raster line
|
protected boolean |
rasterYIRQCondition
Is rasterYIRQ condition true?
|
protected Event |
rasterYIRQEdgeDetector
RasterY IRQ edge detector.
|
protected int |
rc
row counter, a 3 bit counter
|
protected byte[] |
registers
memory for chip registers
|
protected boolean |
showBorderVertical
vertical border flip-flop
|
protected static int[] |
singleColorLUT |
protected Sprite |
spriteLinkedListHead
The head of sprite linked list.
|
protected Sprite[] |
sprites
the 8 sprites
|
protected boolean |
startOfFrame
Set when new frame starts.
|
protected int |
vc
video counter, a 10 bit counter
|
protected int |
vcBase
video counter base, a 10 bit data register
|
protected int |
videoMatrixBase
video matrix base address
|
protected byte[] |
videoMatrixData
contains the video matrix data for the current character
|
protected byte |
xscroll
horizontal scrolling value
|
Constructor and Description |
---|
VIC(PLA pla,
EventScheduler context,
int cpl,
int maxRasters)
Creates a new instance of VIC6569
|
Modifier and Type | Method and Description |
---|---|
protected void |
activateIRQFlag(byte flag)
Set an IRQ flag and trigger an IRQ if the corresponding IRQ mask is set.
|
void |
clearLightpen()
Clears the lightpen usage flag.
|
static String |
credits()
Gets the credit string.
|
protected void |
doVideoMatrixAccess()
Read video matrix and color data for the next character
|
protected void |
drawSpritesAndGraphics()
This monster method calculates:
graphics sequencer output,
sprite sequencer output,
border sequencer output
and combines all of them together.
|
protected boolean |
evaluateIsBadLine() |
protected void |
fetchSpriteData(int n)
Fetch 1 byte of memory starting from the sprite address.
|
protected void |
fetchSpritePointer(int n)
Get memory address of sprite data.
|
abstract int |
getBorderHeight() |
int |
getBorderWidth() |
byte |
getLastReadByte()
In certain cases, CPU sees the stale bus data from VIC.
|
abstract Palette |
getPalette()
Gets the currently used palette.
|
byte[] |
getRegisters() |
int |
getVideoMatrixBase() |
protected void |
interrupt(boolean b) |
protected void |
lightpenEdgeDetector()
Handle lightpen state change
|
byte |
read(int register)
Read VIC register.
|
protected boolean |
readDEN()
Read the DEN flag which tells whether the display is enabled
|
protected int |
readRasterLineIRQ()
Read the value of the raster line IRQ
|
protected boolean |
readRSEL()
Read the RSEL flag which determines whether we display 24 or 25 lines of
text
|
void |
reset()
Resets this VIC II Chip.
|
protected void |
setBA(boolean b) |
void |
setPixelConsumer(Consumer<int[]> consumer)
Set consumer of VIC screen output as ARGB data
|
protected void |
spriteCollisionsOnly()
This version just detects sprite-sprite collisions.
|
void |
triggerLightpen()
Trigger the lightpen.
|
abstract void |
updatePalette()
Updates the palette
|
protected byte |
vicReadColorMemoryPHI2(int address) |
protected byte |
vicReadMemoryPHI1(int address) |
protected byte |
vicReadMemoryPHI2(int address) |
void |
write(int register,
byte data)
Write to VIC register.
|
public static final int MAX_HEIGHT
public static final int MAX_WIDTH
protected static final int FIRST_DMA_LINE
protected static final int LAST_DMA_LINE
protected byte phi1Data
protected int[] combinedLinesCurrent
protected final int[] combinedLinesEven
protected final int[] combinedLinesOdd
protected byte[] linePaletteCurrent
protected final byte[] linePaletteEven
protected final byte[] linePaletteOdd
protected final byte[] previousLineDecodedColor
protected int previousLineIndex
protected static final byte IRQ_SPRITE_BACKGROUND_COLLISION
protected static final byte IRQ_SPRITE_SPRITE_COLLISION
protected final byte[] registers
protected int vc
protected int vcBase
protected int rc
protected boolean isDisplayActive
protected boolean areBadLinesEnabled
protected int rasterY
protected boolean rasterYIRQCondition
protected final Sprite[] sprites
protected final Sprite spriteLinkedListHead
protected final byte[] videoMatrixData
protected boolean showBorderVertical
protected boolean isBadLine
protected int videoMatrixBase
protected int charMemBase
protected int bitmapMemBase
protected byte xscroll
protected int latchedXscroll
protected final int[] pixels
protected int nextPixel
protected int lineCycle
protected boolean graphicsRendering
protected final EventScheduler context
protected boolean lpTriggered
protected boolean startOfFrame
protected final int CYCLES_PER_LINE
protected final int MAX_RASTERS
protected Consumer<int[]> pixelConsumer
protected static final int[] singleColorLUT
protected int oldGraphicsData
protected final Event rasterYIRQEdgeDetector
public VIC(PLA pla, EventScheduler context, int cpl, int maxRasters)
pla
- context
- cpl
- public void setPixelConsumer(Consumer<int[]> consumer)
consumer
- consumer of C64 screen pixels as ARGB dataprotected boolean readRSEL()
protected boolean readDEN()
protected int readRasterLineIRQ()
protected boolean evaluateIsBadLine()
protected void activateIRQFlag(byte flag)
protected void doVideoMatrixAccess()
public int getVideoMatrixBase()
protected void drawSpritesAndGraphics()
protected final void spriteCollisionsOnly()
public final byte getLastReadByte()
protected void fetchSpritePointer(int n)
n
- sprite numberprotected void fetchSpriteData(int n)
n
- sprite numberpublic final byte read(int register)
protected void lightpenEdgeDetector()
public final void write(int register, byte data)
public void reset()
public static String credits()
public abstract Palette getPalette()
public abstract void updatePalette()
public void triggerLightpen()
public void clearLightpen()
protected void interrupt(boolean b)
protected void setBA(boolean b)
protected byte vicReadColorMemoryPHI2(int address)
protected byte vicReadMemoryPHI1(int address)
protected byte vicReadMemoryPHI2(int address)
public int getBorderWidth()
public abstract int getBorderHeight()
public byte[] getRegisters()
Copyright © 2018 Ken Händel. All rights reserved.