MCPcopy Create free account
hub / github.com/badvision/jace / tick

Method tick

src/main/java/jace/core/Video.java:151–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149 }
150
151 @Override
152 public void tick() {
153 addWaitCycles(waitsPerCycle);
154 if (y < APPLE_SCREEN_LINES) setScannerLocation(currentWriter.getYOffset(y));
155 setFloatingBus(getMemory().readRaw(scannerAddress + x));
156 if (hPeriod > 0) {
157 hPeriod--;
158 if (hPeriod == 0) {
159 x = -1;
160 }
161 } else {
162 int xVal = x;
163 if (!isVblank && xVal < APPLE_CYCLES_PER_LINE && xVal >= 0) {
164 draw(xVal);
165 }
166 if (xVal >= APPLE_CYCLES_PER_LINE - 1) {
167 int yy = y + hblankOffsetY;
168 if (yy < 0) {
169 yy += APPLE_SCREEN_LINES;
170 }
171 if (yy >= APPLE_SCREEN_LINES) {
172 yy -= (TOTAL_LINES - APPLE_SCREEN_LINES);
173 }
174 x = hblankOffsetX - 1;
175 if (!isVblank) {
176 if (lineDirty) {
177 screenDirty = true;
178 currentWriter.clearDirty(y);
179 }
180 hblankStart(video, y, lineDirty);
181 lineDirty = false;
182 forceRedrawRowCount--;
183 }
184 hPeriod = HBLANK;
185 y++;
186 getCurrentWriter().setCurrentRow(y);
187 if (y >= APPLE_SCREEN_LINES) {
188 if (!isVblank) {
189 y = APPLE_SCREEN_LINES - (TOTAL_LINES - APPLE_SCREEN_LINES);
190 isVblank = true;
191 vblankStart();
192 Emulator.withComputer(c->c.getMotherboard().vblankStart());
193 } else {
194 y = 0;
195 isVblank = false;
196 vblankEnd();
197 Emulator.withComputer(c->c.getMotherboard().vblankEnd());
198 }
199 }
200 }
201 }
202 x++;
203 }
204
205 abstract public void configureVideoMode();
206

Callers

nothing calls this directly

Calls 15

setScannerLocationMethod · 0.95
setFloatingBusMethod · 0.95
drawMethod · 0.95
hblankStartMethod · 0.95
getCurrentWriterMethod · 0.95
vblankStartMethod · 0.95
withComputerMethod · 0.95
vblankEndMethod · 0.95
addWaitCyclesMethod · 0.80
readRawMethod · 0.80
setCurrentRowMethod · 0.80
getMotherboardMethod · 0.80

Tested by

no test coverage detected