v6502
The MOS 6502 Virtual Machine and Toolchain Infrastructure
Data Structures | Functions
Reference Platform Video/Keyboard

Data Structures

struct  v6502_textmode_video
 Virtual Text-Mode Hardware Object. More...
 

Functions

v6502_textmode_videotextMode_create (v6502_memory *mem)
 Create v6502_textmode_video.
 
void textMode_destroy (v6502_textmode_video *vid)
 Destroy v6502_textmode_video.
 
void textMode_rest (v6502_textmode_video *vid)
 Put virtual video into "rest" mode, where the hosting terminal is restored, but the video data is preserved and will be redisplayed on next access.
 
void textMode_refreshVideo (v6502_textmode_video *vid)
 Force a fullscreen refresh.
 
void textMode_updateCharacter (v6502_textmode_video *vid, int x, int y)
 Refresh a single character of the output (When memory is trapped, this is called automatically on memory interaction)
 
uint16_t textMode_addressForLocation (int x, int y)
 Convert x, y coordinates to the address in memory that is expected to hold the character.
 

Detailed Description

The first two kilobytes of memory (starting at textMode_characterMemoryStart or 0x2000) are character data, starting with the top right, ending with the bottom left, one row at a time, with no interruptions. After a short break for video hardware registers, another 2 kilobytes (starting at textMode_attributeMemoryStart or 0x3000) are attribute data, which correspond to each byte of character data + 0x1000.

Attribute data byte anatomy: B = Bright C = Color data <- fg -><- bg -> B C C C B C C C

textmode.png