The above are the results of the following code:
void cga_clear(uint8_t attributes)
{
uint32_t i;
for(i=0; i < CGA_VRAM_SIZE; i+=2)
{
//Apparently it's Character, Attribute
//(two bytes)
bus88_write(S20_WRITE_MEM,
cga_vramAddress + i+1,
attributes);
//Thought adding a buncha nops
// might've allowed the
// bus to stabilize,
// but they seem to have no effect
asm("nop;");
bus88_write(S20_WRITE_MEM,
cga_vramAddress + i,
'A'); //0);
//Here too...
asm("nop;");
}
}
combined with my bus88_write() function, which attempts to interface an AVR physically socketted in place of an 8088 on a PC/XT clone motherboard.And called with:
while(1)
{
mode++;
mode &= 0x7f; //don't use blinking
cga_clear(mode);
}
from main()(Here's bus88_write(), but it kinda relies on the physical interface, as well)
void bus88_write(uint8_t s20,
uint32_t address,
uint8_t data)
{
ADDR1916_PORT = (uint8_t)(address>>16);
ADDR158_PORT = (uint8_t)(address>>8);
ADDRDATA70_PORT = (uint8_t)(address);
S20_PORT = s20;
ADDRDATA70_PORT = data;
while(!(READY_PIN & READY_MASK)) {};
S20_PORT = S20_BUS_IDLE;
}
The AVR is inserted in the 8088's socket, with an inverter (or a few, for delay-purposes) between the 8088-clock and the AVR's clock-input. The CGA card is... in a questionable state. And its connection via composite to an LCD-TV probably accentuates that a bit.
-------------------------
If everything worked within-specs, what I *should* get is the letter 'A' filling the screen, with changing foreground and background colors.
What I get is much more interesting!
I've got some good names for some of these... e.g. "Zelda, in the Key of A", or "Goodnight Princess, in the Key of A", or "Zebra, in the Key of A", or... ok, the key of A is wearing out. We've got "Tetris Level 9," "Donkey Kong", and more!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
I found a book you might find useful:
http://minuszerodegrees.net/oa/OA%20-%20IBM%20Color%20Graphics%20Monitor%20Adapter%20(CGA).pdf
( From this thread: "Init CGA without BIOS" )
https://www.vogons.org/viewtopic.php?f=9&t=48310
Are you sure? yes | no
Thank you, sir! I should've known to look for this document, considering how well-documented the IBM PC/XT's motherboard is!
Here's something interesting, already... Weird to think the term "pixel" hadn't been established until after this document's writing; they called 'em "PELs"!
And, wow, who'da thunk they had add-in PC-compatibility boards for Apple IIe's?!
Are you sure? yes | no