A display plugin for emu6502. Reads video part of memory and displays what it contains. Also paints the text mode screen with given charset.
Definition in file videodll.c.#include "../dllkit/dllkit.h"
#include "../usrmsgs.h"
#include "resource.h"
#include <stdio.h>
#include <tchar.h>
Go to the source code of this file.
Data Structures | |
struct | b4iheader |
DIB header. More... | |
Timer defs | |
#define | MYTIMER 10001 |
ID of local timer. | |
#define | PERIOD 50 |
The period between refreshing screen in ms. | |
Screen defs | |
#define | FWIDTH 8 |
Pixels per character. | |
#define | FHEIGHT 8 |
Pixels per character. | |
#define | YCOUNT 32 |
Characters per screen. | |
#define | XCOUNT 32 |
Characters per screen. | |
#define | WIDTH FWIDTH * XCOUNT |
Width of the screen. | |
#define | HEIGHT FHEIGHT * YCOUNT |
Height of the screen. | |
IO adresses | |
#define | GRMODE IOLO + 0 |
#define | LOADR IOLO + 1 |
#define | HIADR IOLO + 2 |
#define | LOCHR IOLO + 3 |
#define | HICHR IOLO + 4 |
#define | FGCOLR IOLO + 5 |
#define | FGCOLG IOLO + 6 |
#define | FGCOLB IOLO + 7 |
#define | BKCOLR IOLO + 8 |
#define | BKCOLG IOLO + 9 |
#define | BKCOLB IOLO + 10 |
#define | VIDEOON IOLO + 14 |
#define | COMMAND IOLO + 15 |
IO registers - copied after COMMAND | |
unsigned char volatile | _GrMode = 0 |
unsigned char volatile | _LoAdr = 0x00 |
unsigned char volatile | _HiAdr = 0xA0 |
unsigned char volatile | _LoChr = 0x00 |
unsigned char volatile | _HiChr = 0xC0 |
unsigned char volatile | _BkColR = 0xFF |
unsigned char volatile | _BkColG = 0xFF |
unsigned char volatile | _BkColB = 0xFF |
unsigned char volatile | _FgColR = 0x00 |
unsigned char volatile | _FgColG = 0x00 |
unsigned char volatile | _FgColB = 0x00 |
unsigned char volatile | GrMode = 0 |
unsigned char volatile | LoAdr = 0x00 |
unsigned char volatile | HiAdr = 0xA0 |
unsigned char volatile | LoChr = 0x00 |
unsigned char volatile | HiChr = 0xC0 |
unsigned char volatile | VideoOn = 0 |
Standard plugin variables | |
HANDLE | hThisModule |
MSGLIST | VideoMsgs |
volatile BOOL | Running = FALSE |
INITDLLSTRUCT | info |
Defines | |
#define | ADR(X, Y) (((X) << 8) + (Y)) |
#define | IOSETGET(GVAR, SVAR) |
Functions | |
void | InitGraphics () |
Inits DIB and logo structures. | |
VOID CALLBACK | TimerProc (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) |
Paints the screen every n ms if needed. | |
void | Repaint () |
Invalidates whole screen and evokes WM_PAINT. | |
void | PaintScreen (HDC hdc) |
Paints whole screen. | |
void | CopyChar (char *dest, UINT adr, int x, int y, BOOL invert) |
Copies one character to given coordinates. | |
BOOL APIENTRY | DllMain (HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) |
DLLEXPORT void __cdecl | InitDll (INITDLLSTRUCT *ids, INITDLLINFO *idi) |
Inits dll data structures. | |
DLLEXPORT void __cdecl | OnMessage (MESSAGEDLLSTRUCT *mds) |
Recieves registered messages from emu6502 application. | |
DLLEXPORT void __cdecl | IOFunc (UINT adr, unsigned char *data, iomode mode) |
IO function mapped into some adress in memory. | |
Variables | |
UINT | memStart = 0xA000 |
adress of videomem | |
UINT | memChrStart = 0xC000 |
adress of charmap | |
b4iheader | bGrInfo |
DIB header. | |
char * | OffScreen |
An off-screen buffer for text mode. | |
HBITMAP | hLogo |
Handle to the logo bitmap. | |
HDC | hOffDC |
A compatible DC used for drawing the logo. |
|
Pixels per character.
Definition at line 31 of file videodll.c. |
|
Pixels per character.
Definition at line 29 of file videodll.c. |
|
Height of the screen.
Definition at line 39 of file videodll.c. |
|
Value: if (mode == IOREAD) { \ *data = GVAR; \ } \ else { \ SVAR = *data; \ } Definition at line 293 of file videodll.c. |
|
ID of local timer.
Definition at line 21 of file videodll.c. |
|
The period between refreshing screen in ms.
Definition at line 23 of file videodll.c. |
|
Width of the screen.
Definition at line 37 of file videodll.c. |
|
Characters per screen.
Definition at line 35 of file videodll.c. |
|
Characters per screen.
Definition at line 33 of file videodll.c. |
|
Copies one character to given coordinates.
Uses character map stored in emulators memory
Definition at line 396 of file videodll.c. |
|
Inits dll data structures.
Definition at line 175 of file videodll.c. |
|
Inits DIB and logo structures.
Definition at line 204 of file videodll.c. |
|
IO function mapped into some adress in memory.
Called directly when accesing adress to which is this function bound. Always write this function.
Definition at line 301 of file videodll.c. |
|
Recieves registered messages from emu6502 application.
This function is called by emu6502 when some message event registered by InitDll occures. Implement this function even when you don't want to catch any messages.
Definition at line 229 of file videodll.c. |
|
Paints whole screen.
Called by WM_PAINT if the window needs repaint or every n ms when emulator is running For creating text mode screen calls CopyChar.
Definition at line 369 of file videodll.c. |
|
Invalidates whole screen and evokes WM_PAINT.
Definition at line 287 of file videodll.c. |
|
Paints the screen every n ms if needed.
Definition at line 275 of file videodll.c. |
|
DIB header.
|
|
Handle to the logo bitmap.
Definition at line 100 of file videodll.c. |
|
A compatible DC used for drawing the logo.
Definition at line 102 of file videodll.c. |
|
adress of charmap
Definition at line 87 of file videodll.c. |
|
adress of videomem
Definition at line 85 of file videodll.c. |
|
An off-screen buffer for text mode.
Definition at line 97 of file videodll.c. |