automap.screen¶
Reading the C64’s text screen, from anything that can read memory.
Split out of vice.py because none of it is VICE-specific. The screen is
40x25 screen codes wherever the VIC is currently pointed, and finding it costs
three reads of the I/O registers – so any backend with a
read(addr, length) -> bytes can do it, and so can a dictionary of bytes in a
test.
read is passed as a callable rather than an object with a method, so a
backend that has to batch, resume or rate-limit around a burst of reads keeps
that decision to itself: ViceTarget hands in its monitor’s raw read and
resumes once at the end, where its public Target.read resumes every time.
Functions
|
A column band, out of a block read as whole screen rows. |
|
|
|
Title and credit screens are bitmaps and cannot be read as text. |
|
|
|
Where the VIC is fetching characters from, right now. |
|
One row as text. |
Classes
One snapshot: 1000 screen codes and 1000 colour nybbles. |
- class automap.screen.Screen[source]¶
Bases:
objectOne snapshot: 1000 screen codes and 1000 colour nybbles.
- highlighted_rows(colour=1, column=None)[source]¶
Rows drawn in the menu highlight colour (white by default).
- automap.screen.band(codes, left, right)[source]¶
A column band, out of a block read as whole screen rows.
The game draws in windows – combat’s messages are columns 23 to 38 of rows 10 to 22 – and a window is not contiguous in memory, so it is read as whole rows and sliced here.
rightis one past the last column, which is how the game itself holds it at$03F3.
- automap.screen.is_bitmap(read)[source]¶
Title and credit screens are bitmaps and cannot be read as text.