1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-11-23 23:32:45 +00:00

Add color mode, text video modes

This commit is contained in:
Peter Evans 2017-12-21 11:52:56 -06:00
parent 87b67216b0
commit adac6346e8
2 changed files with 29 additions and 0 deletions

View File

@ -6,12 +6,21 @@
#include "vm_screen.h"
enum video_modes {
VIDEO_40COL_TEXT,
VIDEO_LORES,
VIDEO_HIRES,
VIDEO_80COL_TEXT,
VIDEO_DOUBLE_LORES,
VIDEO_DOUBLE_HIRES,
};
enum color_modes {
COLOR_GREEN,
COLOR_AMBER,
COLOR_GRAY,
COLOR_FULL,
};
typedef struct {
/*
* The apple 2 hardware used an MOS-6502 processor.
@ -37,6 +46,14 @@ typedef struct {
*/
int video_mode;
/*
* This is the color mode we want to emulate. You can have a few
* different styles of monochromatic displays: green, amber, and
* light gray on black; you can also emulate a full color display,
* in which text mode tends to look like light gray.
*/
int color_mode;
/*
* Our two disk drives.
*/

View File

@ -58,12 +58,24 @@ apple2_create(int width, int height)
return NULL;
}
// Default to full color
apple2_set_color(mach, COLOR_FULL);
// We default to lo-res mode.
apple2_set_video(mach, VIDEO_LORES);
return mach;
}
void
apple2_set_color(apple2 *mach, int mode)
{
mach->color_mode = mode;
// FIXME: doing this should force us to redraw everything in the
// correct color interpretation
}
void
apple2_run_loop(apple2 *mach)
{