Merge tag 'v1.28.3.0'

This commit is contained in:
Andrea Odetti 2019-04-19 21:00:22 +01:00
commit f1aa6d2e25
7 changed files with 126 additions and 18 deletions

View file

@ -8,6 +8,15 @@ https://github.com/AppleWin/AppleWin/issues/new
Tom Charlesworth
1.28.3.0 - 3 Mar 2019
---------------------
. [Change #625] AltGr+<key> does not send the <key> value to $C000.
- This reverts the default behaviour introduced from 1.27.6 (#558).
- Use -altgr-sends-wmchar to allow AltGr+<key> to work correctly together.
- NB. The reason for the revert was that it was preventing international keyboards from typing certain characters.
. [Change #616] Vertical blending now uses 560-pixel granularity for half-dot shift support (consistent with all other video modes).
1.28.2.0 - 24 Feb 2019
----------------------
. [Change #616] Support vertical blending for 'RGB (Color Monitor)' for hires.
@ -86,10 +95,10 @@ Tom Charlesworth
1.27.7.0 - 6 Aug 2018
---------------------
. [Bug #564] Fixed 'Save State on Exit' not working correctly when there's a Configuration change to the hardware.
. [Bug #556] Reverted default so that ALT+TAB is not hooked (#556)
. [Bug #556] Reverted default so that ALT+TAB is not hooked
- Support new command line switch: -hook-alt-tab to support hooking ALT+TAB.
. [Bug #558] Reverted default so that ALT GR's fake LEFT CONTROL is not hooked (#558)
- Support new command line switch: -hook-altgr-control to suppess ALR GR's fake LEFT CONTROL.
. [Bug #558] Reverted default so that ALT GR's fake LEFT CONTROL is not hooked
- Support new command line switch: -hook-altgr-control to suppress ALR GR's fake LEFT CONTROL.
1.27.6.0 - 28 Jul 2018

View file

@ -59,9 +59,12 @@
-hook-alt-tab<br>
By default the emulator doesn't hook ALT+TAB. Use this to allow Open Apple+TAB to be readable by the emulated machine.<br><br>
-hook-altgr-control<br>
By default the emulator doesn't suppress ALT GR's (Right Alt's) fake LEFT CONTROL. Use this to suppress this fake LEFT CONTROL to allow Closed Apple+CTRL+&lt;key&gt; to be readable by the emulated machine.<br>
NB. Suppressing this fake LEFT CONTROL seems to prevent international keyboards from being able to type certain keys.
<br><br>
By default the emulator doesn't suppress AltGr's (Right Alt's) fake LEFT CONTROL. Use this to suppress this fake LEFT CONTROL to allow Solid Apple+CTRL+&lt;key&gt; to be readable by the emulated machine.<br>
NB. Suppressing this fake LEFT CONTROL seems to prevent international keyboards from being able to type certain keys.<br><br>
-altgr-sends-wmchar<br>
Use this switch to allow Solid Apple (AltGr) to be used in combination with regular keys.<br>
When AltGr is pressed, Windows only sends a WM_CHAR message for (eg) international key codes; and so by default the emulator doesn't explicitly send a WM_CHAR message for regular keys when AltGr is being pressed.<br>
NB. Using this switch may prevent international keyboards from being able to type certain keys.<br><br>
-use-real-printer<br>
Enables Advanced configuration control to allow dumping to a real printer<br><br>
-noreg<br>

View file

@ -1,4 +1,4 @@
#define APPLEWIN_VERSION 1,28,2,0
#define APPLEWIN_VERSION 1,28,3,0
#define xstr(a) str(a)
#define str(a) #a

View file

@ -36,6 +36,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Frame.h"
#include "Harddisk.h"
#include "Joystick.h"
#include "Keyboard.h"
#include "LanguageCard.h"
#include "Log.h"
#include "Memory.h"
@ -1356,6 +1357,10 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
{
g_bHookAltGrControl = true;
}
else if (strcmp(lpCmdLine, "-altgr-sends-wmchar") == 0) // GH#625
{
KeybSetAltGrSendsWM_CHAR(true);
}
else if (strcmp(lpCmdLine, "-no-hook-alt") == 0) // GH#583
{
JoySetHookAltKeys(false);

View file

@ -53,11 +53,17 @@ static bool g_bCapsLock = true; //Caps lock key for Apple2 and Lat/Cyr lock for
static bool g_bP8CapsLock = true; //Caps lock key of Pravets 8A/C
static BYTE keycode = 0; // Current Apple keycode
static BOOL keywaiting = 0;
static bool g_bAltGrSendsWM_CHAR = false;
//
// ----- ALL GLOBALLY ACCESSIBLE FUNCTIONS ARE BELOW THIS LINE -----
//
void KeybSetAltGrSendsWM_CHAR(bool state)
{
g_bAltGrSendsWM_CHAR = state;
}
//===========================================================================
void KeybReset()
@ -306,7 +312,7 @@ void KeybQueueKeypress (WPARAM key, Keystroke_e bASCII)
return;
keycode = n;
}
else if ((GetKeyState(VK_RMENU) < 0)) // Right Alt (aka Alt Gr) - GH#558
else if (g_bAltGrSendsWM_CHAR && (GetKeyState(VK_RMENU) < 0)) // Right Alt (aka Alt Gr) - GH#558, GH#625
{
if (IsVirtualKeyAnAppleIIKey(key))
{

View file

@ -5,6 +5,7 @@ enum Keystroke_e {NOT_ASCII=0, ASCII};
void ClipboardInitiatePaste();
void KeybReset();
void KeybSetAltGrSendsWM_CHAR(bool state);
bool KeybGetCapsStatus();
bool KeybGetP8CapsStatus();
bool KeybGetAltStatus();

View file

@ -10,8 +10,9 @@
const int SRCOFFS_LORES = 0; // 0
const int SRCOFFS_HIRES = (SRCOFFS_LORES + 16); // 16
const int SRCOFFS_DHIRES = (SRCOFFS_HIRES + 512); // 528
const int SRCOFFS_TOTAL = (SRCOFFS_DHIRES + 2560); // 3088
const int SRCOFFS_HIRES2 = (SRCOFFS_HIRES + 512); // 528 // Style = Vertical Blend, 280-pixel (from 1.25)
const int SRCOFFS_DHIRES = (SRCOFFS_HIRES2 + 512); // 1040
const int SRCOFFS_TOTAL = (SRCOFFS_DHIRES + 2560); // 3600
const int MAX_SOURCE_Y = 512;
static LPBYTE g_aSourceStartofLine[ MAX_SOURCE_Y ];
@ -278,12 +279,14 @@ Legend:
Edge Case for Color Bleed !
2000:40 00
2400:40 80
Nox Archaist (GH#616)
2000:00 40 9E // Green Black White
*/
// Fixup missing pixels that normally have been scan-line shifted -- Apple "half-pixel" -- but cross 14-pixel boundaries.
if( hibit )
{
if ( aPixels[1] ) // preceeding pixel on?
if ( aPixels[1] ) // preceding pixel on?
#if 0 // Optimization: Doesn't seem to matter if we ignore the 2 pixels of the next byte
for (iPixel = 0; iPixel < 9; iPixel++) // NOTE: You MUST start with the preceding 2 pixels !!!
if (aPixels[iPixel]) // pixel on
@ -403,13 +406,93 @@ Legend:
//===========================================================================
void V_CreateLookup_Hires()
{
// int iMonochrome = GetMonochromeIndex();
// BYTE colorval[6] = {MAGENTA,BLUE,GREEN,ORANGE,BLACK,WHITE};
// BYTE colorval[6] = {HGR_VIOLET,HGR_BLUE,HGR_GREEN,HGR_ORANGE,HGR_BLACK,HGR_WHITE};
for (int iColumn = 0; iColumn < 16; iColumn++)
{
int coloffs = iColumn << 5;
for (unsigned iByte = 0; iByte < 256; iByte++)
{
int aPixels[11];
aPixels[ 0] = iColumn & 4;
aPixels[ 1] = iColumn & 8;
aPixels[ 9] = iColumn & 1;
aPixels[10] = iColumn & 2;
int nBitMask = 1;
int iPixel;
for (iPixel = 2; iPixel < 9; iPixel++) {
aPixels[iPixel] = ((iByte & nBitMask) != 0);
nBitMask <<= 1;
}
int hibit = ((iByte & 0x80) != 0);
int x = 0;
int y = iByte << 1;
while (x < 28)
{
int adj = (x >= 14) << 1;
int odd = (x >= 14);
for (iPixel = 2; iPixel < 9; iPixel++)
{
int color = CM_Black;
if (aPixels[iPixel])
{
if (aPixels[iPixel-1] || aPixels[iPixel+1])
color = CM_White;
else
color = ((odd ^ (iPixel&1)) << 1) | hibit;
}
else if (aPixels[iPixel-1] && aPixels[iPixel+1])
{
// Activate fringe reduction on white HGR text - drawback: loss of color mix patterns in HGR video mode.
// VT_COLOR_STANDARD = Fill in colors in between white pixels
// VT_COLOR_TVEMU = Fill in colors in between white pixels (Post Processing will mix/merge colors)
// VT_COLOR_TEXT_OPTIMIZED --> !(aPixels[iPixel-2] && aPixels[iPixel+2]) = Don't fill in colors in between white
if (/*(g_eVideoType == VT_COLOR_TVEMU) ||*/ !(aPixels[iPixel-2] && aPixels[iPixel+2]) )
color = ((odd ^ !(iPixel&1)) << 1) | hibit; // No white HGR text optimization
}
//if (g_eVideoType == VT_MONO_AUTHENTIC) {
// int nMonoColor = (color != CM_Black) ? iMonochrome : BLACK;
// SETSOURCEPIXEL(SRCOFFS_HIRES+coloffs+x+adj ,y , nMonoColor); // buggy
// SETSOURCEPIXEL(SRCOFFS_HIRES+coloffs+x+adj+1,y , nMonoColor); // buggy
// SETSOURCEPIXEL(SRCOFFS_HIRES+coloffs+x+adj ,y+1,BLACK); // BL
// SETSOURCEPIXEL(SRCOFFS_HIRES+coloffs+x+adj+1,y+1,BLACK); // BR
//} else
{
// Colors - Top/Bottom Left/Right
// cTL cTR
// cBL cBR
SETSOURCEPIXEL(SRCOFFS_HIRES2+coloffs+x+adj ,y ,HiresToPalIndex[color]); // cTL
SETSOURCEPIXEL(SRCOFFS_HIRES2+coloffs+x+adj+1,y ,HiresToPalIndex[color]); // cTR
SETSOURCEPIXEL(SRCOFFS_HIRES2+coloffs+x+adj ,y+1,HiresToPalIndex[color]); // cBL
SETSOURCEPIXEL(SRCOFFS_HIRES2+coloffs+x+adj+1,y+1,HiresToPalIndex[color]); // cBR
}
x += 2;
}
}
}
}
}
//===========================================================================
// For AppleWin 1.25 "tv emulation" HGR Video Mode
const UINT FRAMEBUFFER_W = 560;
const UINT FRAMEBUFFER_H = 384;
const UINT HGR_MATRIX_YOFFSET = 2;
static BYTE hgrpixelmatrix[FRAMEBUFFER_W/2][FRAMEBUFFER_H/2 + 2 * HGR_MATRIX_YOFFSET]; // 2 extra scan lines on bottom?
static BYTE hgrpixelmatrix[FRAMEBUFFER_W][FRAMEBUFFER_H/2 + 2 * HGR_MATRIX_YOFFSET]; // 2 extra scan lines on bottom?
static BYTE colormixbuffer[6]; // 6 hires colours
static WORD colormixmap[6][6][6]; // top x middle x bottom
@ -525,21 +608,20 @@ static void MixColorsVertical(int matx, int maty)
colormixbuffer[5] = (twoHalfPixel & 0x00FF);
}
// NB. This operates at the 7M pixel level: 2 identical 14M pixels are written per inner loop (so no support for half-dot-shift, eg. Archon's title)
static void CopyMixedSource(int x, int y, int sourcex, int sourcey, bgra_t *pVideoAddress)
{
const BYTE* const currsourceptr = g_aSourceStartofLine[sourcey]+sourcex;
UINT32* const currdestptr = (UINT32*) pVideoAddress;
const int matx = x;
const int matx = x*2;
const int maty = HGR_MATRIX_YOFFSET + y;
const int hgrlinesabove = (y > 0) ? 1 : 0;
const int hgrlinesbelow = VideoGetSWMIXED() ? ((y < 159)? 1:0) : ((y < 191)? 1:0);
const int istart = 2 - (hgrlinesabove*2);
const int iend = 3 + (hgrlinesbelow*2);
// transfer 7 pixels (i.e. the visible part of an apple hgr-byte) from row to pixelmatrix
for (int count = 0, bufxoffset = 0; count < 7; count++, bufxoffset += 2)
// transfer 14 pixels (i.e. the visible part of an apple hgr-byte) from row to pixelmatrix
for (int count = 0, bufxoffset = 0; count < 14; count++, bufxoffset += 1)
{
hgrpixelmatrix[matx+count][maty] = *(currsourceptr+bufxoffset);
@ -556,14 +638,14 @@ static void CopyMixedSource(int x, int y, int sourcex, int sourcey, bgra_t *pVid
if (IsVideoStyle(VS_HALF_SCANLINES) && (i & 1))
{
// 50% Half Scan Line clears every odd scanline (and SHIFT+PrintScreen saves only the even rows)
*currptr = *(currptr+1) = 0;
*currptr = 0;
}
else
{
_ASSERT( colormixbuffer[i] < (sizeof(PalIndex2RGB)/sizeof(PalIndex2RGB[0])) );
const RGBQUAD& rRGB = PalIndex2RGB[ colormixbuffer[i] ];
const UINT32 rgb = (((UINT32)rRGB.rgbRed)<<16) | (((UINT32)rRGB.rgbGreen)<<8) | ((UINT32)rRGB.rgbBlue);
*currptr = *(currptr+1) = rgb;
*currptr = rgb;
}
}
}
@ -618,6 +700,7 @@ void UpdateHiResCell (int x, int y, uint16_t addr, bgra_t *pVideoAddress)
{
CopyMixedSource(
x*7, y,
// SRCOFFS_HIRES2+COLOFFS+((x & 1) << 4), (((int)byteval2) << 1),
SRCOFFS_HIRES+COLOFFS+((x & 1) << 4), (((int)byteval2) << 1),
pVideoAddress
);
@ -786,6 +869,7 @@ static void V_CreateDIBSections(void)
ZeroMemory(g_pSourcePixels, SRCOFFS_TOTAL*MAX_SOURCE_Y); // 32 bytes/pixel * 16 colors = 512 bytes/row
V_CreateLookup_Lores();
// V_CreateLookup_Hires(); // For CopyMixedSource() / VS_COLOR_VERTICAL_BLEND, 280-pixel (from 1.25)
V_CreateLookup_HiResHalfPixel_Authentic(VT_COLOR_MONITOR_RGB);
V_CreateLookup_DoubleHires();