2024-03-19 22:22:29 +01:00
|
|
|
/*
|
|
|
|
* kml.h
|
|
|
|
*
|
|
|
|
* This file is part of Emu48
|
|
|
|
*
|
|
|
|
* Copyright (C) 1995 Sebastien Carlier
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2024-03-19 23:35:29 +01:00
|
|
|
#define LEX_BLOCK 0
|
|
|
|
#define LEX_COMMAND 1
|
|
|
|
#define LEX_PARAM 2
|
2024-03-19 22:22:29 +01:00
|
|
|
|
|
|
|
typedef enum eTokenId
|
|
|
|
{
|
|
|
|
TOK_NONE, //0
|
|
|
|
TOK_ANNUNCIATOR, //1
|
|
|
|
TOK_BACKGROUND, //2
|
|
|
|
TOK_IFPRESSED, //3
|
|
|
|
TOK_RESETFLAG, //4
|
|
|
|
TOK_SCANCODE, //5
|
2024-03-19 22:38:33 +01:00
|
|
|
TOK_HARDWARE, //6
|
|
|
|
TOK_MENUITEM, //7
|
|
|
|
TOK_INTEGER, //8
|
|
|
|
TOK_SETFLAG, //9
|
|
|
|
TOK_RELEASE, //10
|
|
|
|
TOK_VIRTUAL, //11
|
|
|
|
TOK_INCLUDE, //12
|
|
|
|
TOK_STRING, //13
|
|
|
|
TOK_GLOBAL, //14
|
|
|
|
TOK_AUTHOR, //15
|
|
|
|
TOK_BITMAP, //16
|
|
|
|
TOK_OFFSET, //17
|
|
|
|
TOK_BUTTON, //18
|
|
|
|
TOK_IFFLAG, //19
|
|
|
|
TOK_ONDOWN, //20
|
|
|
|
TOK_NOHOLD, //21
|
2024-03-19 23:35:29 +01:00
|
|
|
TOK_TOPBAR, //22
|
2024-03-19 23:35:29 +01:00
|
|
|
TOK_MENUBAR, // 23
|
|
|
|
TOK_TITLE, //24
|
|
|
|
TOK_OUTIN, //25
|
|
|
|
TOK_PATCH, //26
|
|
|
|
TOK_PRINT, //27
|
|
|
|
TOK_DEBUG, //28
|
|
|
|
TOK_COLOR, //29
|
|
|
|
TOK_MODEL, //30
|
|
|
|
TOK_CLASS, //31
|
|
|
|
TOK_PRESS, //32
|
|
|
|
TOK_TYPE, //33
|
|
|
|
TOK_SIZE, //34
|
|
|
|
TOK_DOWN, //35
|
|
|
|
TOK_ZOOM, //36
|
|
|
|
TOK_ELSE, //37
|
|
|
|
TOK_ONUP, //38
|
|
|
|
TOK_EOL, //39
|
|
|
|
TOK_MAP, //40
|
|
|
|
TOK_ROM, //41
|
|
|
|
TOK_VGA, //42
|
|
|
|
TOK_LCD, //43
|
|
|
|
TOK_NOTFLAG, //44
|
|
|
|
TOK_END //45
|
2024-03-19 22:22:29 +01:00
|
|
|
} TokenId;
|
|
|
|
|
|
|
|
#define TYPE_NONE 00
|
|
|
|
#define TYPE_INTEGER 01
|
|
|
|
#define TYPE_STRING 02
|
|
|
|
|
2024-03-19 22:37:54 +01:00
|
|
|
typedef struct KmlToken
|
2024-03-19 22:22:29 +01:00
|
|
|
{
|
|
|
|
TokenId eId;
|
|
|
|
DWORD nParams;
|
|
|
|
DWORD nLen;
|
2024-03-19 22:37:03 +01:00
|
|
|
TCHAR szName[20];
|
2024-03-19 22:37:54 +01:00
|
|
|
} KmlToken;
|
2024-03-19 22:22:29 +01:00
|
|
|
|
2024-03-19 22:37:54 +01:00
|
|
|
typedef struct KmlLine
|
2024-03-19 22:22:29 +01:00
|
|
|
{
|
2024-03-19 22:37:54 +01:00
|
|
|
struct KmlLine* pNext;
|
2024-03-19 22:22:29 +01:00
|
|
|
TokenId eCommand;
|
2024-03-19 23:35:29 +01:00
|
|
|
DWORD_PTR nParam[6];
|
2024-03-19 22:37:54 +01:00
|
|
|
} KmlLine;
|
2024-03-19 22:22:29 +01:00
|
|
|
|
2024-03-19 22:37:54 +01:00
|
|
|
typedef struct KmlBlock
|
2024-03-19 22:22:29 +01:00
|
|
|
{
|
|
|
|
TokenId eType;
|
|
|
|
DWORD nId;
|
2024-03-19 22:37:54 +01:00
|
|
|
struct KmlLine* pFirstLine;
|
|
|
|
struct KmlBlock* pNext;
|
|
|
|
} KmlBlock;
|
2024-03-19 22:22:29 +01:00
|
|
|
|
|
|
|
#define BUTTON_NOHOLD 0x0001
|
|
|
|
#define BUTTON_VIRTUAL 0x0002
|
2024-03-19 22:37:54 +01:00
|
|
|
typedef struct KmlButton
|
2024-03-19 22:22:29 +01:00
|
|
|
{
|
|
|
|
UINT nId;
|
|
|
|
BOOL bDown;
|
|
|
|
UINT nType;
|
|
|
|
DWORD dwFlags;
|
|
|
|
UINT nOx, nOy;
|
|
|
|
UINT nDx, nDy;
|
|
|
|
UINT nCx, nCy;
|
|
|
|
UINT nOut, nIn;
|
2024-03-19 22:37:54 +01:00
|
|
|
KmlLine* pOnDown;
|
|
|
|
KmlLine* pOnUp;
|
|
|
|
} KmlButton;
|
2024-03-19 22:22:29 +01:00
|
|
|
|
2024-03-19 22:37:54 +01:00
|
|
|
typedef struct KmlAnnunciator
|
2024-03-19 22:22:29 +01:00
|
|
|
{
|
|
|
|
UINT nOx, nOy;
|
|
|
|
UINT nDx, nDy;
|
|
|
|
UINT nCx, nCy;
|
2024-03-19 22:37:54 +01:00
|
|
|
} KmlAnnunciator;
|
2024-03-19 22:22:29 +01:00
|
|
|
|
2024-03-19 22:37:54 +01:00
|
|
|
extern KmlBlock* pKml;
|
2024-03-19 22:22:29 +01:00
|
|
|
extern BOOL DisplayChooseKml(CHAR cType);
|
2024-03-19 22:37:54 +01:00
|
|
|
extern VOID FreeBlocks(KmlBlock* pBlock);
|
2024-03-19 22:22:29 +01:00
|
|
|
extern VOID DrawAnnunciator(UINT nId, BOOL bOn);
|
2024-03-19 23:33:35 +01:00
|
|
|
extern VOID ReloadButtons(BYTE *Keyboard_Row, UINT nSize);
|
2024-03-19 22:37:03 +01:00
|
|
|
extern VOID RefreshButtons(RECT *rc);
|
2024-03-19 22:22:29 +01:00
|
|
|
extern VOID MouseButtonDownAt(UINT nFlags, DWORD x, DWORD y);
|
|
|
|
extern VOID MouseButtonUpAt(UINT nFlags, DWORD x, DWORD y);
|
|
|
|
extern VOID MouseMovesTo(UINT nFlags, DWORD x, DWORD y);
|
|
|
|
extern VOID RunKey(BYTE nId, BOOL bPressed);
|
2024-03-19 23:33:35 +01:00
|
|
|
extern VOID PlayKey(UINT nOut, UINT nIn, BOOL bPressed);
|
2024-03-19 22:37:03 +01:00
|
|
|
extern BOOL InitKML(LPCTSTR szFilename, BOOL bNoLog);
|
|
|
|
extern VOID KillKML(VOID);
|