#include <windows.h>
#include "resources.h"

allegro_icon ICON atomulator.ico

#define KEY_A 1
#define KEY_B 2
#define KEY_C 3
#define KEY_D 4
#define KEY_E 5
#define KEY_F 6
#define KEY_G 7
#define KEY_H 8
#define KEY_I 9
#define KEY_J 10
#define KEY_K 11
#define KEY_L 12
#define KEY_M 13
#define KEY_N 14
#define KEY_O 15
#define KEY_P 16
#define KEY_Q 17
#define KEY_R 18
#define KEY_S 19
#define KEY_T 20
#define KEY_U 21
#define KEY_V 22
#define KEY_W 23
#define KEY_X 24
#define KEY_Y 25
#define KEY_Z 26
#define KEY_0 27
#define KEY_1 28
#define KEY_2 29
#define KEY_3 30
#define KEY_4 31
#define KEY_5 32
#define KEY_6 33
#define KEY_7 34
#define KEY_8 35
#define KEY_9 36
#define KEY_0_PAD 37
#define KEY_1_PAD 38
#define KEY_2_PAD 39
#define KEY_3_PAD 40
#define KEY_4_PAD 41
#define KEY_5_PAD 42
#define KEY_6_PAD 43
#define KEY_7_PAD 44
#define KEY_8_PAD 45
#define KEY_9_PAD 46
#define KEY_F1 47
#define KEY_F2 48
#define KEY_F3 49
#define KEY_F4 50
#define KEY_F5 51
#define KEY_F6 52
#define KEY_F7 53
#define KEY_F8 54
#define KEY_F9 55
#define KEY_F10 56
#define KEY_F11 57
#define KEY_F12 58
#define KEY_ESC 59
#define KEY_TILDE 60
#define KEY_MINUS 61
#define KEY_EQUALS 62
#define KEY_BACKSPACE 63
#define KEY_TAB 64
#define KEY_OPENBRACE 65
#define KEY_CLOSEBRACE 66
#define KEY_ENTER 67
#define KEY_COLON 68
#define KEY_QUOTE 69
#define KEY_BACKSLASH 70
#define KEY_BACKSLASH2 71
#define KEY_COMMA 72
#define KEY_STOP 73
#define KEY_SLASH 74
#define KEY_SPACE 75
#define KEY_INSERT 76
#define KEY_DEL 77
#define KEY_HOME 78
#define KEY_END 79
#define KEY_PGUP 80
#define KEY_PGDN 81
#define KEY_LEFT 82
#define KEY_RIGHT 83
#define KEY_UP 84
#define KEY_DOWN 85
#define KEY_SLASH_PAD 86
#define KEY_ASTERISK 87
#define KEY_MINUS_PAD 88
#define KEY_PLUS_PAD 89
#define KEY_DEL_PAD 90
#define KEY_ENTER_PAD 91
#define KEY_COLON2 101
#define KEY_EQUALS_PAD 103
#define KEY_BACKQUOTE 104
#define KEY_SEMICOLON 105

#define KEY_LSHIFT 115
#define KEY_RSHIFT 116
#define KEY_LCONTROL 117
#define KEY_RCONTROL 118
#define KEY_ALT 119
#define KEY_ALTGR 120
#define KEY_LWIN 121
#define KEY_RWIN 122
#define KEY_MENU 123
#define KEY_SCRLOCK 124
#define KEY_NUMLOCK 125
#define KEY_CAPSLOCK 126


MainMenu MENU DISCARDABLE
BEGIN
        POPUP "&File"
        BEGIN
                MENUITEM "&Reset",                 IDM_FILE_RESET
                MENUITEM "E&xit",                  IDM_FILE_EXIT
        END
        POPUP "&Tape"
        BEGIN
                MENUITEM "&Load tape...", IDM_TAPE_LOAD
                MENUITEM SEPARATOR
                MENUITEM "&Eject tape", IDM_TAPE_EJECT
                MENUITEM SEPARATOR
                MENUITEM "&Rewind tape", IDM_TAPE_REW
                MENUITEM "Show tape &catalogue", IDM_TAPE_CAT
                POPUP "&Tape speed"
                BEGIN
                        MENUITEM "Normal", IDM_TAPES_NORMAL
                        MENUITEM "Fast",   IDM_TAPES_FAST
                END
        END
        POPUP "&Disc"
        BEGIN
                MENUITEM "Load disc :&0/2...",     IDM_DISC_LOAD_0
                MENUITEM "Load disc :&1/3...",     IDM_DISC_LOAD_1
                MENUITEM SEPARATOR
                MENUITEM "Eject disc :0/2",        IDM_DISC_EJECT_0
                MENUITEM "Eject disc :1/3",        IDM_DISC_EJECT_1
                MENUITEM SEPARATOR
                MENUITEM "New disc :0/2",          IDM_DISC_NEW_0
                MENUITEM "New disc :1/3",          IDM_DISC_NEW_1
                MENUITEM SEPARATOR
                MENUITEM "Write protect disc :0/2",IDM_DISC_WPROT_0
                MENUITEM "Write protect disc :1/3",IDM_DISC_WPROT_1
                MENUITEM SEPARATOR
                MENUITEM "Default write protect",  IDM_DISC_WPROT_D
        END
        POPUP "&Settings"
        BEGIN
                POPUP "&Video"
                BEGIN
                        MENUITEM "&Snow",                  IDM_VID_SNOW
                        MENUITEM "&Fullscreen",            IDM_VID_FULLSCREEN
                END
                POPUP "&Hardware"
                BEGIN
                        MENUITEM "&Colour Board",          IDM_HARD_COLOUR
                        MENUITEM "&BBC BASIC",             IDM_HARD_BBC
                END
                POPUP "&Sound"
                BEGIN
                        MENUITEM "&Internal speaker",   IDM_SOUND_ATOM
                        MENUITEM "&Tape noise",         IDM_SOUND_TAPE
                        MENUITEM "&Disc drive noise",   IDM_SOUND_DDNOISE
                        MENUITEM SEPARATOR
                        POPUP "Disc drive &type"
                        BEGIN
                                MENUITEM "&5.25",IDM_DDT_525
                                MENUITEM "&3.5", IDM_DDT_35
                        END
                        POPUP "Disc drive &volume"
                        BEGIN
                                MENUITEM "&33%", IDM_DDV_33
                                MENUITEM "&66%", IDM_DDV_66
                                MENUITEM "&100%", IDM_DDV_100
                        END
                END
                POPUP "&Keyboard"
                BEGIN
                        MENUITEM "&Redefine keys...",      IDM_KEY_REDEFINE
                        MENUITEM "&Default mapping",       IDM_KEY_DEFAULT
                END
        END
        POPUP "&Misc"
        BEGIN
                POPUP "&Speed"
                BEGIN
                        MENUITEM "10%", IDM_SPD_10
                        MENUITEM "25%", IDM_SPD_25
                        MENUITEM "50%", IDM_SPD_50
                        MENUITEM "75%", IDM_SPD_75
                        MENUITEM "100%", IDM_SPD_100
                        MENUITEM "150%", IDM_SPD_150
                        MENUITEM "200%", IDM_SPD_200
                        MENUITEM "300%", IDM_SPD_300
                        MENUITEM "400%", IDM_SPD_400
                        MENUITEM "500%", IDM_SPD_500
                END
                MENUITEM "&Save screenshot",IDM_MISC_SCRSHOT
                MENUITEM SEPARATOR
                MENUITEM "&Debugger",              IDM_MISC_DEBUG
                MENUITEM "&Break",                 IDM_MISC_BREAK
        END
END

Catalogue DIALOG 20, 20, 197, 241
STYLE WS_CAPTION | WS_THICKFRAME | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU
CAPTION "Tape Catalogue"
FONT 8, "FixedSys"
BEGIN
   LISTBOX ListBox1, 7, 5, 179, 230, WS_TABSTOP
END

Redefine DIALOG 20, 20, 260, 132
STYLE WS_CAPTION | WS_THICKFRAME
CAPTION "Redefine keys"
FONT 7, "MS Sans Serif"
BEGIN
   PUSHBUTTON "ESC", Button1+KEY_ESC, 16, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "1", Button1+KEY_1, 32, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "2", Button1+KEY_2, 48, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "3", Button1+KEY_3, 64, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "4", Button1+KEY_4, 80, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "5", Button1+KEY_5, 96, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "6", Button1+KEY_6, 112, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "7", Button1+KEY_7, 128, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "8", Button1+KEY_8, 144, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "9", Button1+KEY_9, 160, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "0", Button1+KEY_0, 176, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "=", Button1+KEY_MINUS, 192, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON ":", Button1+KEY_QUOTE, 208, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "UP", Button1+KEY_EQUALS, 224, 24, 16, 15 , WS_TABSTOP
   PUSHBUTTON "<->", Button1+KEY_RIGHT, 8, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "CPY", Button1+KEY_TAB, 24, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "Q", Button1+KEY_Q, 40, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "W", Button1+KEY_W, 56, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "E", Button1+KEY_E, 72, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "R", Button1+KEY_R, 88, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "T", Button1+KEY_T, 104, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "Y", Button1+KEY_Y, 120, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "U", Button1+KEY_U, 136, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "I", Button1+KEY_I, 152, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "O", Button1+KEY_O, 168, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "P", Button1+KEY_P, 184, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "@", Button1+KEY_BACKSLASH, 200, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "\\", Button1+KEY_BACKSLASH2, 216, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "DEL", Button1+KEY_BACKSPACE, 232, 40, 16, 15 , WS_TABSTOP
   PUSHBUTTON "ADJ", Button1+KEY_UP, 12, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "CTL", Button1+KEY_LCONTROL, 28, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "A", Button1+KEY_A, 44, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "S", Button1+KEY_S, 60, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "D", Button1+KEY_D, 76, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "F", Button1+KEY_F, 92, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "G", Button1+KEY_G, 108, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "H", Button1+KEY_H, 124, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "J", Button1+KEY_J, 140, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "K", Button1+KEY_K, 156, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "L", Button1+KEY_L, 172, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON ";", Button1+KEY_SEMICOLON, 188, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "[", Button1+KEY_OPENBRACE, 204, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "]", Button1+KEY_CLOSEBRACE, 220, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "RET", Button1+KEY_ENTER, 236, 56, 16, 15 , WS_TABSTOP
   PUSHBUTTON "SLK", Button1+KEY_ALT, 20, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "SHF", Button1+KEY_LSHIFT, 36, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "Z", Button1+KEY_Z, 52, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "X", Button1+KEY_X, 68, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "C", Button1+KEY_C, 84, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "V", Button1+KEY_V, 100, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "B", Button1+KEY_B, 116, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "N", Button1+KEY_N, 132, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "M", Button1+KEY_M, 148, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON ",", Button1+KEY_COMMA, 164, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON ".", Button1+KEY_STOP, 180, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "/", Button1+KEY_SLASH, 196, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "SHF", Button1+KEY_RSHIFT, 212, 72, 16, 15 , WS_TABSTOP
   PUSHBUTTON "RPT", Button1+KEY_ALT, 228, 72, 16, 15 , WS_TABSTOP

   PUSHBUTTON "OK", IDOK, 96, 112, 32, 16, WS_TABSTOP
   PUSHBUTTON "Cancel", IDCANCEL, 136, 112, 32, 16, WS_TABSTOP
END

KeyDlg DIALOG 20,20,100,60
STYLE WS_CAPTION | WS_THICKFRAME
CAPTION "Press key to define"
FONT 7, "MS Sans Serif"
BEGIN
   PUSHBUTTON "Cancel", IDCANCEL, 64, 40, 32, 16, WS_TABSTOP
END
