Charpacker
Window
Bases: object
A plain pygame window. Nothing special about it.
__init__(w, h, title='c64 draw')
Generates and shows a pygame window.
Parameters: |
|
---|
run()
Processes the pygame window events.
Should be called in a loop to process the occuring events. Sets the self.show flag to False when being closed.
Memory
The representation of a c64 memory.
__init__(data=None)
Constructor
Assigns the given data. If no data is given, the data (memory) is initialiased with zeros.
Parameters: |
|
---|
load(fileName)
Loads the given files as a memory dump.
Reads the first two bytes as destination (starting address). Reads the reminder starting at this address, the rest of the memory is filled with zeros.
Loading assures that the memory is complete (is 65536 bytes long)
Parameters: |
|
---|
TODO: check destination byte order (not spent a thought on it)
drawAt(surface, x, y, cols, fgColor=(255, 255, 255, 255), bgColor=(0, 0, 0, 255))
Draws this memory at the given surface and the given position.
Parameters: |
|
---|
charAt(addr)
Returns the eight bytes at the given address as a char
Parameters: |
|
---|
Returns: |
|
---|
Bitmap
The representation of a c64 bitmap.
__init__(data=None)
Constructor
Assigns the given data. If no data is given, the data (bitmap) is initialiased with zeros.
Parameters: |
|
---|
charAt(col, row)
Returns the Char representation of the character at the given position.
Parameters: |
|
---|
Returns: |
|
---|
drawAt(surface, x, y, fgColor=(255, 255, 255, 255), bgColor=(0, 0, 0, 255))
Draws this bitmap at the given surface and the given position.
Parameters: |
|
---|
fromSurface(surface, x, y)
Generates the Bitmap from the given surface, starting at the given position.
Please note that only white pixels are assumed to be set
Parameters: |
|
---|
fromC64Screen(screen, chars)
Fills the bitmap using the given screen and character set information
Parameters: |
|
---|
Char
A single c64 character
__init__(data=None)
Constructor, allocates memory.
Assigns the given data. If no data is given, the data (character) is initialiased with zeros.
Parameters: |
|
---|
drawAt(surface, x, y, fgColor=(255, 255, 255, 255), bgColor=(0, 0, 0, 255))
Draws this character (in hires) at the given surface and the given position.
Parameters: |
|
---|
drawMulticolorAt(surface, x, y, fgColor=(255, 255, 255, 255), bgColor=(0, 0, 0, 255), multi1Color=(192, 192, 192, 255), multi2Color=(128, 128, 128, 255))
Draws this character in multicolor at the given surface and the given position.
Parameters: |
|
---|
same(c)
Returns whether the given character is same as this one.
Parameters: |
|
---|
Returns: |
|
---|
writeInto(f)
Writes this character to a file.
Parameters: |
|
---|
inverse()
Inverses this character.
Screen
The representation of a c64 screen
__init__(data=None)
Constructor, allocates memory.
Assigns the given data. If no data is given, the data (screen) is initialiased with zeros.
Parameters: |
|
---|
charAt(col, row)
Returns the caracter at the given position
Parameters: |
|
---|
Returns: |
|
---|
setCharAt(col, row, char)
Sets the given character at the given position
Parameters: |
|
---|
open2Write(fileName)
Opens a file for writing.
Parameters: |
|
---|
Returns: |
|
---|
saveChars(fileName, pos, chars)
Saves the given characters.
Parameters: |
|
---|
TODO: remove the pos-parameter
writeByte(f, b)
Writes the given byte as a one-byte-bytearray.
Parameters: |
|
---|
writeBytes(f, bs)
Writes the given array as a bytearray.
Parameters: |
|
---|