diff --git a/ApplewinExpress9.00.vcproj b/ApplewinExpress9.00.vcproj
index 5542a063..c46b645f 100644
--- a/ApplewinExpress9.00.vcproj
+++ b/ApplewinExpress9.00.vcproj
@@ -1078,6 +1078,10 @@
/>
+
+
@@ -1106,6 +1110,10 @@
RelativePath=".\resource\CHARSET8C.bmp"
>
+
+
diff --git a/resource/Applewin.rc b/resource/Applewin.rc
index 2ba7acc2..5260254e 100644
--- a/resource/Applewin.rc
+++ b/resource/Applewin.rc
@@ -69,7 +69,7 @@ LED_CAPSON_P8_BITMAP BITMAP "LED_CAPS_ON_P8.BMP"
LED_LATOFF_BITMAP BITMAP "LED_CAPS_OFF_LAT.BMP"
LED_LATON_BITMAP BITMAP "LED_CAPS_ON_LAT.BMP"
CHARSET82 BITMAP "CHARSET82.BMP"
-CHARSET8M BITMAP "CHARSET8C.BMP"
+CHARSET8M BITMAP "CHARSET8M.BMP"
CHARSET8C BITMAP "CHARSET8C.BMP"
HELP_BUTTON BITMAP "HELP.BMP"
DRIVESWAP_BUTTON BITMAP "DRIVESWAP.BMP"
diff --git a/resource/CHARSET82.bmp b/resource/CHARSET82.bmp
index 0396611b..808fc2e1 100644
Binary files a/resource/CHARSET82.bmp and b/resource/CHARSET82.bmp differ
diff --git a/resource/CHARSET8C.bmp b/resource/CHARSET8C.bmp
index 1dd12c12..a10c83bf 100644
Binary files a/resource/CHARSET8C.bmp and b/resource/CHARSET8C.bmp differ
diff --git a/resource/CHARSET8M.bmp b/resource/CHARSET8M.bmp
index 53efbb33..91dc9dec 100644
Binary files a/resource/CHARSET8M.bmp and b/resource/CHARSET8M.bmp differ
diff --git a/source/Applewin.cpp b/source/Applewin.cpp
index c49a6e0a..910560f3 100644
--- a/source/Applewin.cpp
+++ b/source/Applewin.cpp
@@ -391,13 +391,13 @@ void SetCharsetType(void)
{
switch ( GetApple2Type() )
{
- case A2TYPE_APPLE2: g_nCharsetType = 0; break;
- case A2TYPE_APPLE2PLUS: g_nCharsetType = 0; break;
- case A2TYPE_APPLE2E: g_nCharsetType = 0; break;
- case A2TYPE_APPLE2EENHANCED:g_nCharsetType = 0; break;
- case A2TYPE_PRAVETS82: g_nCharsetType = 1; break;
- case A2TYPE_PRAVETS8A: g_nCharsetType = 2; break;
- case A2TYPE_PRAVETS8M: g_nCharsetType = 3; break; //This charset has a very small difference with the PRAVETS82 one an probably has some misplaced characters. Still the Pravets82 charset is used, because setting charset to 3 results in some problems.
+ case A2TYPE_APPLE2: g_nCharsetType = 0; break;
+ case A2TYPE_APPLE2PLUS: g_nCharsetType = 0; break;
+ case A2TYPE_APPLE2E: g_nCharsetType = 0; break;
+ case A2TYPE_APPLE2EENHANCED:g_nCharsetType = 0; break;
+ case A2TYPE_PRAVETS82: g_nCharsetType = 1; break;
+ case A2TYPE_PRAVETS8M: g_nCharsetType = 2; break; //This charset has a very small difference with the PRAVETS82 one, and probably has some misplaced characters.
+ case A2TYPE_PRAVETS8A: g_nCharsetType = 3; break;
default:
_ASSERT(0);
g_nCharsetType = 0;
@@ -415,6 +415,10 @@ void LoadConfiguration(void)
if ((dwComputerType >= A2TYPE_MAX) || (dwComputerType >= A2TYPE_UNDEFINED && dwComputerType < A2TYPE_CLONE))
dwComputerType = A2TYPE_APPLE2EENHANCED;
+ // Remap the bad Pravets models (before AppleWin v1.26)
+ if (dwComputerType == A2TYPE_BAD_PRAVETS82) dwComputerType = A2TYPE_PRAVETS82;
+ if (dwComputerType == A2TYPE_BAD_PRAVETS8M) dwComputerType = A2TYPE_PRAVETS8M;
+
apple2Type = (eApple2Type) dwComputerType;
}
else // Support older AppleWin registry entries
diff --git a/source/Common.h b/source/Common.h
index 2bc2a071..d69a9647 100644
--- a/source/Common.h
+++ b/source/Common.h
@@ -166,7 +166,7 @@ enum eIRQSRC {IS_6522=0, IS_SPEECH, IS_SSC, IS_MOUSE};
#define IS_APPLE2C (g_Apple2Type & APPLE2C_MASK)
#define IS_CLONE() (g_Apple2Type & APPLECLONE_MASK)
-// NB. These get persisted to the Registry & save-state file, so don't change the values for these enums!
+// NB. These get persisted to the Registry, so don't change the values for these enums!
enum eApple2Type {
A2TYPE_APPLE2=0,
A2TYPE_APPLE2PLUS,
@@ -178,10 +178,12 @@ enum eApple2Type {
//
// Clones start here:
A2TYPE_CLONE=APPLECLONE_MASK,
- A2TYPE_PRAVETS=APPLECLONE_MASK|APPLE2E_MASK,
- A2TYPE_PRAVETS82=A2TYPE_PRAVETS,
- A2TYPE_PRAVETS8M,
- A2TYPE_PRAVETS8A,
+ A2TYPE_PRAVETS=APPLECLONE_MASK,
+ A2TYPE_PRAVETS82=A2TYPE_PRAVETS, // Apple ][ clone
+ A2TYPE_PRAVETS8M, // Apple ][ clone
+ A2TYPE_BAD_PRAVETS82=A2TYPE_PRAVETS|APPLE2E_MASK, // Wrongly tagged as Apple //e clone (< AppleWin 1.26)
+ A2TYPE_BAD_PRAVETS8M, // Wrongly tagged as Apple //e clone (< AppleWin 1.26)
+ A2TYPE_PRAVETS8A, // Apple //e clone
A2TYPE_MAX
};
diff --git a/source/NTSC.cpp b/source/NTSC.cpp
index b3c7d521..38f78394 100644
--- a/source/NTSC.cpp
+++ b/source/NTSC.cpp
@@ -379,6 +379,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
,{ 255, 255, 255 } // 15
};
+ static csbits_t csbits; // charset, optionally followed by alt charset
// Prototypes
// prototype from CPU.h
@@ -433,6 +434,22 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
static void updateScreenText40 ( long cycles6502 );
static void updateScreenText80 ( long cycles6502 );
+//===========================================================================
+static void set_csbits()
+{
+ // NB. For models that don't have an alt charset then set /g_nVideoCharSet/ to zero
+ switch ( GetApple2Type() )
+ {
+ case A2TYPE_APPLE2: csbits = &csbits_a2[0]; g_nVideoCharSet = 0; break;
+ case A2TYPE_APPLE2PLUS: csbits = &csbits_a2[0]; g_nVideoCharSet = 0; break;
+ case A2TYPE_APPLE2E: csbits = &csbits_2e[0]; break;
+ case A2TYPE_APPLE2EENHANCED:csbits = &csbits_enhanced2e[0]; break;
+ case A2TYPE_PRAVETS82: csbits = &csbits_pravets82[0]; g_nVideoCharSet = 0; break; // Apple ][ clone
+ case A2TYPE_PRAVETS8M: csbits = &csbits_pravets8M[0]; g_nVideoCharSet = 0; break; // Apple ][ clone
+ case A2TYPE_PRAVETS8A: csbits = &csbits_pravets8C[0]; break; // Apple //e clone
+ default: csbits = &csbits_enhanced2e[0]; break;
+ }
+}
//===========================================================================
inline float clampZeroOne( const float & x )
@@ -1685,13 +1702,15 @@ void NTSC_VideoReinitialize( DWORD cyclesThisFrame )
//===========================================================================
void NTSC_VideoInitAppleType ()
{
- int model = g_Apple2Type;
+ int model = GetApple2Type();
// anything other than low bit set means not II/II+ (TC: include Pravets machines too?)
if (model & 0xFFFE)
g_pHorzClockOffset = APPLE_IIE_HORZ_CLOCK_OFFSET;
else
g_pHorzClockOffset = APPLE_IIP_HORZ_CLOCK_OFFSET;
+
+ set_csbits();
}
//===========================================================================
diff --git a/source/NTSC_CharSet.cpp b/source/NTSC_CharSet.cpp
index 89201001..93a670f7 100644
--- a/source/NTSC_CharSet.cpp
+++ b/source/NTSC_CharSet.cpp
@@ -21,7 +21,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h"
#include "NTSC_CharSet.h"
-unsigned char csbits[2][256][8];
+unsigned char csbits_enhanced2e[2][256][8]; // Enhanced //e
+unsigned char csbits_2e[2][256][8]; // Original //e (no mousetext)
+unsigned char csbits_a2[1][256][8]; // ][ and ][+
+unsigned char csbits_pravets82[1][256][8]; // Pravets 82
+unsigned char csbits_pravets8M[1][256][8]; // Pravets 8M
+unsigned char csbits_pravets8C[2][256][8]; // Pravets 8A & 8C
#if 1
@@ -33,9 +38,8 @@ static const UINT charWidth = 16;
static const UINT charWidthBytes = 16/8;
static const UINT charHeight = 16;
-void get_csbits_xy (UINT charset, UINT ch, UINT cx, UINT cy, const BYTE* pBitmap)
+void get_csbits_xy (csbits_t csbits, UINT ch, UINT cx, UINT cy, const BYTE* pBitmap)
{
- _ASSERT(charset < 2);
_ASSERT(ch < 256);
_ASSERT((cx < bitmapWidth/charWidth) && (cy < bitmapHeight/charHeight));
@@ -53,56 +57,50 @@ void get_csbits_xy (UINT charset, UINT ch, UINT cx, UINT cy, const BYTE* pBitmap
n >>= 1;
}
- csbits[charset][ch][y] = n;
+ csbits[0][ch][y] = n;
pBitmap += bitmapWidthBytes*2;
}
}
-void make_csbits (void)
+void get_csbits (csbits_t csbits, const char* resourceName, const UINT cy0)
{
- HBITMAP hCharBitmap = LoadBitmap(g_hInstance, TEXT("CHARSET40"));
-
const UINT bufferSize = bitmapWidthBytes*bitmapHeight;
BYTE* pBuffer = new BYTE [bufferSize];
+
+ HBITMAP hCharBitmap = LoadBitmap(g_hInstance, resourceName);
GetBitmapBits(hCharBitmap, bufferSize, pBuffer);
- // Enhanced //e: Alt char set off
- for (UINT cy=0, ch=0; cy<16; cy++)
+ for (UINT cy=cy0, ch=0; cy