Skip to content

Commit

Permalink
hud to bottom screen, automap sticky, default to fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
elhobbs committed May 9, 2017
1 parent 0ac1bae commit 5786861
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 30 deletions.
3 changes: 2 additions & 1 deletion arm11/include/keyboard.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

/*
#define KEY_AUX1 207
#define KEY_AUX2 208
#define KEY_AUX3 209
Expand Down Expand Up @@ -55,7 +56,7 @@
#define KEY_EIGHT 0x38
#define KEY_NINE 0x39
#define KEY_ZERO 0x30
#define KEY_BACKSLASH 0x5C
#define KEY_BACKSLASH 0x5C */

typedef struct {
int x, y, type, dx, dy, key;
Expand Down
50 changes: 25 additions & 25 deletions arm11/source/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ static char key_buttons[] = "1234567890";
sregion_t key_button_array[] = {
{ 32, 0, 0, 0, 0, 0, key_buttons, key_buttons },
{ 270, 0, 6, 0, 0, 0x200, 0 },
{ -30, 32 * 1, 7, 0, 0, KEY_AUX1, KEY_AUX1 },
{ -30, 32 * 2, 7, 0, 0, KEY_AUX2, KEY_AUX2 },
{ -30, 32 * 3, 7, 0, 0, KEY_AUX3, KEY_AUX3 },
{ -30, 32 * 4, 7, 0, 0, KEY_AUX4, KEY_AUX4 },
{ 254, 32 * 1, 7, 0, 0, KEY_AUX5, KEY_AUX5 },
{ 254, 32 * 2, 7, 0, 0, KEY_AUX6, KEY_AUX6 },
{ 254, 32 * 3, 7, 0, 0, KEY_AUX7, KEY_AUX7 },
{ 254, 32 * 4, 7, 0, 0, KEY_AUX8, KEY_AUX8 },
{ -30, 32 * 1, 7, 0, 0, KEYD_AUX1, KEYD_AUX1 },
{ -30, 32 * 2, 7, 0, 0, KEYD_AUX2, KEYD_AUX2 },
{ -30, 32 * 3, 7, 0, 0, KEYD_AUX3, KEYD_AUX3 },
{ -30, 32 * 4, 7, 0, 0, KEYD_AUX4, KEYD_AUX4 },
{ 254, 32 * 1, 7, 0, 0, KEYD_AUX5, KEYD_AUX5 },
{ 254, 32 * 2, 7, 0, 0, KEYD_AUX6, KEYD_AUX6 },
{ 254, 32 * 3, 7, 0, 0, KEYD_AUX7, KEYD_AUX7 },
{ 254, 32 * 4, 7, 0, 0, KEYD_AUX8, KEYD_AUX8 },
};

static char key_row_1[] = "~1234567890-=";
Expand All @@ -58,23 +58,23 @@ static char key_return[] = "Rtrn";

static sregion_t key_array[] = {
{ 0, 0 * 16, 0, 0, 0, 0, key_row_1, key_row_1_shift },
{ 13 * 16 + 2, 0 * 16, 1, 0, 0, KEY_BACKSPACE, key_backspace },
{ 0, 1 * 16, 1, 0, 0, KEY_TAB, key_tab },
{ 13 * 16 + 2, 0 * 16, 1, 0, 0, KEYD_BACKSPACE, key_backspace },
{ 0, 1 * 16, 1, 0, 0, KEYD_TAB, key_tab },
{ 4 * 8, 1 * 16, 0, 0, 0, 0, key_row_2, key_row_2_shift },
{ 0, 2 * 16, 1, 0, 0, KEY_CAPSLOCK, key_caps },
{ 0, 2 * 16, 1, 0, 0, KEYD_CAPSLOCK, key_caps },
{ 5 * 8, 2 * 16, 0, 0, 0, 0, key_row_3, key_row_3_shift },
{ 5 * 8 +
11 * 16 +
2, 2 * 16, 1, 0, 0, KEY_ENTER, key_return },
{ 0, 3 * 16, 1, 0, 0, KEY_RSHIFT, key_shift },
2, 2 * 16, 1, 0, 0, KEYD_ENTER, key_return },
{ 0, 3 * 16, 1, 0, 0, KEYD_RSHIFT, key_shift },
{ 6 * 8, 3 * 16, 0, 0, 0, 0, key_row_4, key_row_4_shift },
{ 256 - 16 * 2, 3 * 16, 2, 0, 0, KEY_UPARROW, 0 },
{ 0, 4 * 16, 1, 0, 0, KEY_RCTRL, key_ctrl },
{ 5 * 8, 4 * 16, 1, 0, 0, KEY_RALT, key_alt },
{ 256 - 16 * 2, 3 * 16, 2, 0, 0, KEYD_UPARROW, 0 },
{ 0, 4 * 16, 1, 0, 0, KEYD_RCTRL, key_ctrl },
{ 5 * 8, 4 * 16, 1, 0, 0, KEYD_RALT, key_alt },
{ 9 * 8, 4 * 16, 1, 0, 0, ' ', key_space },
{ 256 - 16 * 3, 4 * 16, 3, 0, 0, KEY_LEFTARROW, 0 },
{ 256 - 16 * 2, 4 * 16, 4, 0, 0, KEY_DOWNARROW, 0 },
{ 256 - 16 * 1, 4 * 16, 5, 0, 0, KEY_RIGHTARROW, 0 },
{ 256 - 16 * 3, 4 * 16, 3, 0, 0, KEYD_LEFTARROW, 0 },
{ 256 - 16 * 2, 4 * 16, 4, 0, 0, KEYD_DOWNARROW, 0 },
{ 256 - 16 * 1, 4 * 16, 5, 0, 0, KEYD_RIGHTARROW, 0 },
{ 270, 4 * 16, 6, 0, 0, 0x200, 0 },
};

Expand Down Expand Up @@ -217,12 +217,12 @@ void keyboard_mark(sregion_t *region, int index, int in_touch) {
key_touching = last_touching = 0;
key_touching_index = last_index = -1;
break;
case KEY_RSHIFT:
case KEYD_RSHIFT:
//force whole refresh
keyboard_visible_last = -1;
key_in_shift = key_in_shift ? 0 : 1;
break;
case KEY_CAPSLOCK:
case KEYD_CAPSLOCK:
//force whole refresh
keyboard_visible_last = -1;
key_in_caps = key_in_caps ? 0 : 1;
Expand Down Expand Up @@ -498,10 +498,10 @@ void keyboard_draw_region_sub(sregion_t *region, int index, u16 cc) {
if (region == key_touching) {
c = keyboard_bg_sub;
}
else if ((region->key == KEY_CAPSLOCK && key_in_caps) || (region->key == KEY_RSHIFT && key_in_shift)) {
else if ((region->key == KEYD_CAPSLOCK && key_in_caps) || (region->key == KEYD_RSHIFT && key_in_shift)) {
c = 11 * 16;
}
else if ((region->key == KEY_CAPSLOCK && !key_in_caps) || (region->key == KEY_RSHIFT && !key_in_shift)) {
else if ((region->key == KEYD_CAPSLOCK && !key_in_caps) || (region->key == KEYD_RSHIFT && !key_in_shift)) {
c = cc;
}
else {
Expand Down Expand Up @@ -721,10 +721,10 @@ void keyboard_draw_region(sregion_t *region, int index, u16 c) {
}
else if (region->type == 1)
{
if ((region->key == KEY_CAPSLOCK && key_in_caps) || (region->key == KEY_RSHIFT && key_in_shift)) {
if ((region->key == KEYD_CAPSLOCK && key_in_caps) || (region->key == KEYD_RSHIFT && key_in_shift)) {
c = keyboard_bg;
}
else if ((region->key == KEY_CAPSLOCK && !key_in_caps) || (region->key == KEY_RSHIFT && !key_in_shift)) {
else if ((region->key == KEYD_CAPSLOCK && !key_in_caps) || (region->key == KEYD_RSHIFT && !key_in_shift)) {
c = keyboard_fg;
}
ch = region->text;
Expand Down
1 change: 1 addition & 0 deletions prboom.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="arm11\include\font8x8_basic.h" />
<ClInclude Include="arm11\include\keyboard.h" />
<ClInclude Include="arm11\include\Mixer_dsp.h" />
<ClInclude Include="arm11\source\dbopl.h" />
<ClInclude Include="arm11\source\keyboard.h" />
Expand Down
3 changes: 3 additions & 0 deletions prboom.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,9 @@
<ClInclude Include="arm11\include\Mixer_dsp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="arm11\include\keyboard.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="src\r_drawcolpipeline.inl">
Expand Down
Binary file modified prboom3ds.3ds
Binary file not shown.
Binary file modified prboom3ds.3dsx
Binary file not shown.
Binary file modified prboom3ds.cia
Binary file not shown.
9 changes: 9 additions & 0 deletions src/doomdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,15 @@ typedef enum {
#define KEYD_ZL 0x208
#define KEYD_ZR 0x209

#define KEYD_AUX1 0x20A
#define KEYD_AUX2 0x20B
#define KEYD_AUX3 0x20C
#define KEYD_AUX4 0x20D
#define KEYD_AUX5 0x20E
#define KEYD_AUX6 0x20F
#define KEYD_AUX7 0x210
#define KEYD_AUX8 0x211

// phares 4/19/98:
// Defines Setup Screen groups that config variables appear in.
// Used when resetting the defaults for every item in a Setup group.
Expand Down
15 changes: 13 additions & 2 deletions src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ int autorun = false; // always running? // phares
int totalleveltimes; // CPhipps - total time for all completed levels
int longtics;

boolean automapmode_restart = false;

//
// controls (have defaults)
//
Expand Down Expand Up @@ -649,6 +651,10 @@ static void G_DoLoadLevel (void)
// killough 5/13/98: in case netdemo has consoleplayer other than green
ST_Start();
HU_Start();
if (automapmode_restart) {
automapmode_restart |= am_active;
AM_Start();
}
}


Expand Down Expand Up @@ -1290,8 +1296,13 @@ void G_DoCompleted (void)
if (playeringame[i])
G_PlayerFinishLevel(i); // take away cards and stuff

if (automapmode & am_active)
AM_Stop();
if (automapmode & am_active) {
AM_Stop();
automapmode_restart = true;
}
else {
automapmode_restart = false;
}

if (gamemode != commercial) // kilough 2/7/98
switch(gamemap)
Expand Down
2 changes: 1 addition & 1 deletion src/hu_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/* background and foreground screen numbers
* different from other modules. */
#define BG 1
#define FG 0
#define FG ((viewheight != SCREENHEIGHT) ? 0 : 5)

/* font stuff
* #define HU_CHARERASE KEYD_BACKSPACE / not used / phares
Expand Down
8 changes: 8 additions & 0 deletions src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3885,6 +3885,14 @@ int M_GetKeyString(int c,int offset)
case KEYD_CPAD_DOWN: s = "CPD"; break;
case KEYD_ZL: s = "ZL"; break;
case KEYD_ZR: s = "ZR"; break;
case KEYD_AUX1: s = "AUX1"; break;
case KEYD_AUX2: s = "AUX2"; break;
case KEYD_AUX3: s = "AUX3"; break;
case KEYD_AUX4: s = "AUX4"; break;
case KEYD_AUX5: s = "AUX5"; break;
case KEYD_AUX6: s = "AUX6"; break;
case KEYD_AUX7: s = "AUX7"; break;
case KEYD_AUX8: s = "AUX8"; break;
default: s = "JUNK"; break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/m_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ default_t defaults[] =
def_bool,ss_none}, // enables translucency
{"tran_filter_pct",{&tran_filter_pct},{66},0,100, // killough 2/21/98
def_int,ss_none}, // set percentage of foreground/background translucency mix
{"screenblocks",{&screenblocks},{10},3,11, // killough 2/21/98: default to 10
{"screenblocks",{&screenblocks},{11},3,11, // killough 2/21/98: default to 10
def_int,ss_none},
{"usegamma",{&usegamma},{3},0,4, //jff 3/6/98 fix erroneous upper limit in range
def_int,ss_none}, // gamma correction level // killough 1/18/98
Expand Down

0 comments on commit 5786861

Please sign in to comment.