72 lines
1.9 KiB
C
72 lines
1.9 KiB
C
|
|
/*
|
||
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||
|
|
* running old operating systems and software designed for IBM
|
||
|
|
* PC systems and compatibles from 1981 through fairly recent
|
||
|
|
* system designs based on the PCI bus.
|
||
|
|
*
|
||
|
|
* This file is part of the 86Box distribution.
|
||
|
|
*
|
||
|
|
* Header files for the PCjr keyboard and video subsystems.
|
||
|
|
*
|
||
|
|
*
|
||
|
|
*
|
||
|
|
* Authors: Connor Hyde, <mario64crashed@gmail.com>
|
||
|
|
*
|
||
|
|
* Copyright 2025 starfrost
|
||
|
|
*/
|
||
|
|
|
||
|
|
#pragma once
|
||
|
|
|
||
|
|
#define PCJR_RGB 0
|
||
|
|
#define PCJR_COMPOSITE 1
|
||
|
|
|
||
|
|
typedef struct pcjr_s
|
||
|
|
{
|
||
|
|
/* Video Controller stuff. */
|
||
|
|
mem_mapping_t mapping;
|
||
|
|
uint8_t crtc[32];
|
||
|
|
int crtcreg;
|
||
|
|
int array_index;
|
||
|
|
uint8_t array[32];
|
||
|
|
int array_ff;
|
||
|
|
int memctrl;
|
||
|
|
uint8_t stat;
|
||
|
|
int addr_mode;
|
||
|
|
uint8_t *vram;
|
||
|
|
uint8_t *b8000;
|
||
|
|
int linepos;
|
||
|
|
int displine;
|
||
|
|
int sc;
|
||
|
|
int vc;
|
||
|
|
int dispon;
|
||
|
|
int cursorvisible; // Is the cursor visible on the current scanline?
|
||
|
|
int cursoron;
|
||
|
|
int blink;
|
||
|
|
int vsynctime;
|
||
|
|
int fullchange;
|
||
|
|
int vadj;
|
||
|
|
uint16_t ma;
|
||
|
|
uint16_t maback;
|
||
|
|
uint64_t dispontime;
|
||
|
|
uint64_t dispofftime;
|
||
|
|
pc_timer_t timer;
|
||
|
|
int firstline;
|
||
|
|
int lastline;
|
||
|
|
int composite;
|
||
|
|
int apply_hd;
|
||
|
|
|
||
|
|
/* Keyboard Controller stuff. */
|
||
|
|
int latched;
|
||
|
|
int data;
|
||
|
|
int serial_data[44];
|
||
|
|
int serial_pos;
|
||
|
|
uint8_t pa;
|
||
|
|
uint8_t pb;
|
||
|
|
pc_timer_t send_delay_timer;
|
||
|
|
|
||
|
|
} pcjr_t;
|
||
|
|
|
||
|
|
void pcjr_recalc_timings(pcjr_t *pcjr);
|
||
|
|
|
||
|
|
// Note: This is a temporary solution until the pcjr video is made its own gfx card
|
||
|
|
void pcjr_vid_init(pcjr_t *pcjr);
|