mirror of
https://github.com/KrisKennaway/ii-vision.git
synced 2025-08-15 10:27:46 +00:00
Remove CycleCounter, it's unused
This commit is contained in:
@@ -7,35 +7,18 @@ import numpy as np
|
|||||||
import screen
|
import screen
|
||||||
|
|
||||||
|
|
||||||
class CycleCounter:
|
|
||||||
"""Counts clock cycles."""
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.cycles = 0 # type:int
|
|
||||||
|
|
||||||
def tick(self, cycles: int) -> None:
|
|
||||||
"""Advance cycle counter by some number of clock ticks.
|
|
||||||
|
|
||||||
:param cycles: How many clock cycles to advance
|
|
||||||
"""
|
|
||||||
self.cycles += cycles
|
|
||||||
|
|
||||||
def reset(self) -> None:
|
|
||||||
"""Reset cycle counter to 0."""
|
|
||||||
|
|
||||||
self.cycles = 0
|
|
||||||
|
|
||||||
|
|
||||||
class Machine:
|
class Machine:
|
||||||
"""Represents Apple II and player virtual machine state."""
|
"""Represents Apple II and player virtual machine state."""
|
||||||
|
|
||||||
def __init__(self, cycle_counter: CycleCounter,
|
def __init__(
|
||||||
memmap: screen.MemoryMap, update_priority: np.array):
|
self,
|
||||||
|
memmap: screen.MemoryMap,
|
||||||
|
update_priority: np.array
|
||||||
|
):
|
||||||
self.page = 0x20 # type: int
|
self.page = 0x20 # type: int
|
||||||
self.content = 0x7f # type: int
|
self.content = 0x7f # type: int
|
||||||
|
|
||||||
self.memmap = memmap # type: screen.MemoryMap
|
self.memmap = memmap # type: screen.MemoryMap
|
||||||
self.cycle_counter = cycle_counter # type: CycleCounter
|
|
||||||
self.update_priority = update_priority # type: np.array
|
self.update_priority = update_priority # type: np.array
|
||||||
|
|
||||||
def emit(self, opcode: "Opcode") -> Iterator[int]:
|
def emit(self, opcode: "Opcode") -> Iterator[int]:
|
||||||
|
@@ -30,13 +30,9 @@ class Movie:
|
|||||||
|
|
||||||
self.stream_pos = 0 # type: int
|
self.stream_pos = 0 # type: int
|
||||||
|
|
||||||
# TODO: don't use this as well as cycle_counter, it's a relic of when
|
|
||||||
# I relied on variable-duration opcodes for frame timings.
|
|
||||||
self.ticks = 0 # type: int
|
self.ticks = 0 # type: int
|
||||||
self.cycle_counter = machine.CycleCounter()
|
|
||||||
|
|
||||||
self.state = machine.Machine(
|
self.state = machine.Machine(
|
||||||
self.cycle_counter,
|
|
||||||
self.video.memory_map,
|
self.video.memory_map,
|
||||||
self.video.update_priority
|
self.video.update_priority
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user