1
0
mirror of https://github.com/pevans/erc-c.git synced 2025-02-17 07:32:05 +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" #include "vm_screen.h"
enum video_modes { enum video_modes {
VIDEO_40COL_TEXT,
VIDEO_LORES, VIDEO_LORES,
VIDEO_HIRES, VIDEO_HIRES,
VIDEO_80COL_TEXT,
VIDEO_DOUBLE_LORES, VIDEO_DOUBLE_LORES,
VIDEO_DOUBLE_HIRES, VIDEO_DOUBLE_HIRES,
}; };
enum color_modes {
COLOR_GREEN,
COLOR_AMBER,
COLOR_GRAY,
COLOR_FULL,
};
typedef struct { typedef struct {
/* /*
* The apple 2 hardware used an MOS-6502 processor. * The apple 2 hardware used an MOS-6502 processor.
@ -37,6 +46,14 @@ typedef struct {
*/ */
int video_mode; 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. * Our two disk drives.
*/ */

View File

@ -58,12 +58,24 @@ apple2_create(int width, int height)
return NULL; return NULL;
} }
// Default to full color
apple2_set_color(mach, COLOR_FULL);
// We default to lo-res mode. // We default to lo-res mode.
apple2_set_video(mach, VIDEO_LORES); apple2_set_video(mach, VIDEO_LORES);
return mach; 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 void
apple2_run_loop(apple2 *mach) apple2_run_loop(apple2 *mach)
{ {