The display parameter refers to the host display which this device draws to. The charROM is a pointer to any character or sprite ROM of the video device, or NULL if none.
setupDisplay() should set the screen resolution and palette, via calls to the display object. This method will be invoked by the Machine's emulate() function.
update() is called once every frame by the emulate() method. It should render the Machine's screen.
This method is called to indicate to the video device that the video RAM has been written to. It may be used to render that part of the display there and then, or, more likely, to mark the address in a dirty buffer.
It is up to the device writer to decide whether the address should be an offset into video RAM, or the machine address which that RAM is mapped to.
This method is called by emulate() and instructs the video device to do any decoding of the char/sprite ROM which it needs to do. This method will usually use the createSpriteBank() method of the display to create arrays of bitmaps which will be used to render the screen.
If the device is not character-based and has no sprites, then leave this method empty (it won't be called anyway, since the Machine is pretty likely to know what type of display it has).
Return the host palette entry for the colour value in the specified sprite in the specified sprite and palette banks.
For example, if you have two sprite banks of eight-colour sprites, with four possible palette bank settings, you decode the sprite ROM and get a value of 0-7 for each pixel in the sprite. This method converts that value into the correct colour given which sprite it is and which bank it is in. See the PhoenixVideo class for an example.
This function sets eight pixels in the given sprite to the values given in the data array. The function calls lookupColour() to resolve the data elements to palette entries before setting them.
The pixels which are set start at (x, y) and go in the specified direction (either up, down, left or right). Again, see the the Phoenix driver for an example.
This function decodes a byte's worth of data from the charROM, arranged using bitplanes. planes specifies the depth (eg. for 8 colour plane data, planes would be 3) and offset specifies the address of the first byte. plane_length specifies the length of one complete bitplane.
The returned value is a pointer to an eight byte array of data values.
A pointer to the host display object.
A pointer to the char/sprite ROM. This will be used by createBanks() and some built-in methods.