|
25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more... |
Home Projects Up Sitemap Search Blog Forum+Chat About Us Privacy Terms of Use Feedback FAQ Images Services Payments Humor Music |
Heathkit H-100 functions to manage 2 video display pages, in DeSmet CThe Heathkit H-100 (Zenith Z-100) computer has 2 video pages. These DeSmet C functions allow you to:
These functions directly access the H-100 hardware and will not work on PC compatibles or any other computer that I know of. |
/* ===========================================================*/
/* H100 VIDEO DISPLAY MANAGEMENT FUNCTIONS FOR MULTIPLE DISPLAY PAGES. */
/* THERE ARE 2 VIDEO PAGES. YOU CAN INDEPENDENTLY CHOOSE WHICH IS WRITTEN TO */
/* AND WHICH IS CURRENTLY DISPLAYED */
/* Copyright (C)1993 Steven Whitney. Published under the */
/* GNU GPL (General Public License) Version 3, with ABSOLUTELY NO WARRANTY. */
/* Initially published by http://25yearsofprogramming.com. */
/* ===========================================================*/
/* -> These functions are highly specific to the H100 computer hardware, */
/* -> and could have disastrous consequences on any other computer. */
/* -------------------------------------------------------------- */
/* FLIPCPU() 10-12-93 */
/* determines which page VRAM WRITES go to */
/* toggles bit 7 of address latch, port DA */
/* toggles between pages 1 & 2 as seen by CPU */
/* -------------------------------------------------------------- */
int flipcpu()
{
char _inb();
void _outb();
/* get value in DA */
_outb(((_inb(0xDA))^(0x80)),0xDA); /* XOR with 80h & write back */
return 1;
}
/* -------------------------------------------------------------- */
/* FLIPCRTC() toggles between pages 1 & 2 as seen by CRTC */
/* determines which page is DISPLAYED on the screen */
/* toggles bit 3 of R12, the high byte of the start address register */
/* R12 bit 3 = bit 11 of word R12-R13, and corresponds to */
/* bit 7 of the address latch */
/* 10-12-93 */
/* -------------------------------------------------------------- */
int flipcrtc()
{
char _inb();
void _outb();
_outb(12,0xDC); /* write 12 to pointer register */
_outb((_inb(0xDD)^8),0xDD); /* XOR contents with 8 & write back */
return 1;
}
/* -------------------------------------------------------------- */
/* RESTOREPG1() sets both CPU and CRTC to video page 1 */
/* emergency exit used in case I can't figure out which page is which */
/* 10-12-93 */
/* -------------------------------------------------------------- */
int restorepg1()
{
char _inb();
void _outb();
/* get value in DA */
_outb(((_inb(0xDA))&(~(0x80))),0xDA); /* turn off bit 7 & write back */
_outb(12,0xDC); /* write 12 to pointer register */
_outb((_inb(0xDD)&(~8)),0xDD); /* turn off bit 3 & write back */
return 1;
}
|
|
|
|
|
|
|
Copyright ©2012 Steven Whitney. Last modified Sun 07/29/2012 11:36:22 -0700. |
||