Small tidy-up for NTSC_CharSet.cpp, and fix-up the VS2008/2013/2015 projects

This commit is contained in:
tomcw 2016-07-26 19:14:06 +01:00
parent 3cf54e6fa3
commit 94b8e76e3b
8 changed files with 32 additions and 228 deletions

View File

@ -75,6 +75,7 @@
<ClInclude Include="source\MouseInterface.h" />
<ClInclude Include="source\NoSlotClock.h" />
<ClInclude Include="source\NTSC.h" />
<ClInclude Include="source\NTSC_CharSet.h" />
<ClInclude Include="source\ParallelPrinter.h" />
<ClInclude Include="source\Pravets.h" />
<ClInclude Include="source\Registry.h" />
@ -130,6 +131,7 @@
<ClCompile Include="source\Configuration\PropertySheet.cpp" />
<ClCompile Include="source\Configuration\PropertySheetHelper.cpp" />
<ClCompile Include="source\CPU.cpp" />
<ClCompile Include="source\NTSC_CharSet.cpp" />
<ClCompile Include="source\SAM.cpp" />
<ClCompile Include="source\Debugger\Debug.cpp" />
<ClCompile Include="source\Debugger\Debugger_Assembler.cpp" />

View File

@ -181,6 +181,9 @@
<ClCompile Include="source\YamlHelper.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\NTSC_CharSet.cpp">
<Filter>Source Files\Video</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\Applewin.h">
@ -444,6 +447,9 @@
<ClInclude Include="source\SaveState_Structs_v1.h">
<Filter>Source Files\_Headers</Filter>
</ClInclude>
<ClInclude Include="source\NTSC_CharSet.h">
<Filter>Source Files\Video</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="resource\Applewin.bmp">

View File

@ -75,6 +75,7 @@
<ClInclude Include="source\MouseInterface.h" />
<ClInclude Include="source\NoSlotClock.h" />
<ClInclude Include="source\NTSC.h" />
<ClInclude Include="source\NTSC_CharSet.h" />
<ClInclude Include="source\ParallelPrinter.h" />
<ClInclude Include="source\Pravets.h" />
<ClInclude Include="source\Registry.h" />
@ -130,6 +131,7 @@
<ClCompile Include="source\Configuration\PropertySheet.cpp" />
<ClCompile Include="source\Configuration\PropertySheetHelper.cpp" />
<ClCompile Include="source\CPU.cpp" />
<ClCompile Include="source\NTSC_CharSet.cpp" />
<ClCompile Include="source\SAM.cpp" />
<ClCompile Include="source\Debugger\Debug.cpp" />
<ClCompile Include="source\Debugger\Debugger_Assembler.cpp" />
@ -459,4 +461,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -181,6 +181,9 @@
<ClCompile Include="source\YamlHelper.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\NTSC_CharSet.cpp">
<Filter>Source Files\Video</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\Applewin.h">
@ -444,6 +447,9 @@
<ClInclude Include="source\SaveState_Structs_v1.h">
<Filter>Source Files\_Headers</Filter>
</ClInclude>
<ClInclude Include="source\NTSC_CharSet.h">
<Filter>Source Files\Video</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="resource\Applewin.bmp">

View File

@ -878,6 +878,10 @@
RelativePath=".\source\NTSC.h"
>
</File>
<File
RelativePath=".\source\NTSC_CharSet.cpp"
>
</File>
<File
RelativePath=".\source\NTSC_CharSet.h"
>

View File

@ -2,7 +2,7 @@
AppleWin : An Apple //e emulator for Windows
Copyright (C) 2010-2011, William S Simms
Copyright (C) 2014-2015 Michael Pohoreski
Copyright (C) 2014-2016, Michael Pohoreski, Tom Charlesworth
AppleWin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Video.h" // g_pFramebufferbits
#include "NTSC.h"
#include "NTSC_CharSet.cpp"
#include "NTSC_CharSet.h"
#define NTSC_REMOVE_WHITE_RINGING 1 // 0 = theoritical dimmed white has chroma, 1 = pure white without chroma tinting
#define NTSC_REMOVE_BLACK_GHOSTING 1 // 1 = remove black smear/smudges carrying over

View File

@ -2,6 +2,7 @@
AppleWin : An Apple //e emulator for Windows
Copyright (C) 2010-2011, William S Simms
Copyright (C) 2016, Tom Charlesworth
AppleWin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -19,6 +20,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "AppleWin.h"
#include "NTSC_CharSet.h"
unsigned char csbits_enhanced2e[2][256][8]; // Enhanced //e
@ -28,7 +31,7 @@ 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
//
static const UINT bitmapWidth = 256;
static const UINT bitmapWidthBytes = bitmapWidth/8;
@ -38,7 +41,7 @@ static const UINT charWidth = 16;
static const UINT charWidthBytes = 16/8;
static const UINT charHeight = 16;
void get_csbits_xy (csbits_t csbits, UINT ch, UINT cx, UINT cy, const BYTE* pBitmap)
static void get_csbits_xy(csbits_t csbits, UINT ch, UINT cx, UINT cy, const BYTE* pBitmap)
{
_ASSERT(ch < 256);
_ASSERT((cx < bitmapWidth/charWidth) && (cy < bitmapHeight/charHeight));
@ -62,7 +65,7 @@ void get_csbits_xy (csbits_t csbits, UINT ch, UINT cx, UINT cy, const BYTE* pBit
}
}
void get_csbits (csbits_t csbits, const char* resourceName, const UINT cy0)
static void get_csbits(csbits_t csbits, const char* resourceName, const UINT cy0)
{
const UINT bufferSize = bitmapWidthBytes*bitmapHeight;
BYTE* pBuffer = new BYTE [bufferSize];
@ -83,7 +86,7 @@ void get_csbits (csbits_t csbits, const char* resourceName, const UINT cy0)
delete [] pBuffer;
}
void make_csbits (void)
void make_csbits(void)
{
get_csbits(&csbits_enhanced2e[0], TEXT("CHARSET40"), 0); // Enhanced //e: Alt char set off
get_csbits(&csbits_enhanced2e[1], TEXT("CHARSET40"), 16); // Enhanced //e: Alt char set on (mousetext)
@ -97,199 +100,3 @@ void make_csbits (void)
memcpy(csbits_2e, csbits_enhanced2e, sizeof(csbits_enhanced2e));
memcpy(&csbits_2e[1][64], &csbits_2e[0][64], 32*8);
}
#else
// NB. '(', ')' are 1 bit out of alignment
static const char *csstrs[] = {
" ### "," # "," #### "," ### "," #### "," ##### "," ##### "," #### ",
" # # "," # # "," # # "," # # "," # # "," # "," # "," # ",
" # # # "," # # "," # # "," # "," # # "," # "," # "," # ",
" # ### "," # # "," #### "," # "," # # "," #### "," #### "," # ",
" # ## "," ##### "," # # "," # "," # # "," # "," # "," # ## ",
" # "," # # "," # # "," # # "," # # "," # "," # "," # # ",
" #### "," # # "," #### "," ### "," #### "," ##### "," # "," #### ",
" "," "," "," "," "," "," "," ",
" # # "," ### "," # "," # # "," # "," # # "," # # "," ### ",
" # # "," # "," # "," # # "," # "," ## ## "," # # "," # # ",
" # # "," # "," # "," # # "," # "," # # # "," ## # "," # # ",
" ##### "," # "," # "," ## "," # "," # # # "," # # # "," # # ",
" # # "," # "," # "," # # "," # "," # # "," # ## "," # # ",
" # # "," # "," # # "," # # "," # "," # # "," # # "," # # ",
" # # "," ### "," ### "," # # "," ##### "," # # "," # # "," ### ",
" "," "," "," "," "," "," "," ",
" #### "," ### "," #### "," ### "," ##### "," # # "," # # "," # # ",
" # # "," # # "," # # "," # # "," # "," # # "," # # "," # # ",
" # # "," # # "," # # "," # "," # "," # # "," # # "," # # ",
" #### "," # # "," #### "," ### "," # "," # # "," # # "," # # # ",
" # "," # # # "," # # "," # "," # "," # # "," # # "," # # # ",
" # "," # # "," # # "," # # "," # "," # # "," # # "," ## ## ",
" # "," ## # "," # # "," ### "," # "," ### "," # "," # # ",
" "," "," "," "," "," "," "," ",
" # # "," # # "," ##### "," ##### "," "," ##### "," "," ",
" # # "," # # "," # "," ## "," # "," ## "," "," ",
" # # "," # # "," # "," ## "," # "," ## "," # "," ",
" # "," # "," # "," ## "," # "," ## "," # # "," ",
" # # "," # "," # "," ## "," # "," ## "," # # "," ",
" # # "," # "," # "," ## "," # "," ## "," "," ",
" # # "," # "," ##### "," ##### "," "," ##### "," "," ",
" "," "," "," "," "," "," "," #######",
" "," # "," # # "," # # "," # "," ## "," # "," # ",
" "," # "," # # "," # # "," #### "," ## # "," # # "," # ",
" "," # "," # # "," ##### "," # # "," # "," # # "," # ",
" "," # "," "," # # "," ### "," # "," # "," ",
" "," # "," "," ##### "," # # "," # "," # # # "," ",
" "," "," "," # # "," #### "," # ## "," # # "," ",
" "," # "," "," # # "," # "," ## "," ## # "," ",
" "," "," "," "," "," "," "," ",
" # "," # "," # "," "," "," "," "," ",
" # "," # "," # # # "," # "," "," "," "," # ",
" # "," # "," ### "," # "," "," "," "," # ",
" # "," # "," # "," ##### "," "," ##### "," "," # ",
" # "," # "," ### "," # "," # "," "," "," # ",
" # "," # "," # # # "," # "," # "," "," "," # ",
" # "," # "," # "," "," # "," "," # "," ",
" "," "," "," "," "," "," "," ",
" ### "," # "," ### "," ##### "," # "," ##### "," ### "," ##### ",
" # # "," ## "," # # "," # "," ## "," # "," # "," # ",
" # ## "," # "," # "," # "," # # "," #### "," # "," # ",
" # # # "," # "," ## "," ## "," # # "," # "," #### "," # ",
" ## # "," # "," # "," # "," ##### "," # "," # # "," # ",
" # # "," # "," # "," # # "," # "," # # "," # # "," # ",
" ### "," ### "," ##### "," ### "," # "," ### "," ### "," # ",
" "," "," "," "," "," "," "," ",
" ### "," ### "," "," "," # "," "," # "," ### ",
" # # "," # # "," "," "," # "," "," # "," # # ",
" # # "," # # "," # "," # "," # "," ##### "," # "," # ",
" ### "," #### "," "," "," # "," "," # "," # ",
" # # "," # "," # "," # "," # "," ##### "," # "," # ",
" # # "," # "," "," # "," # "," "," # "," ",
" ### "," ### "," "," # "," # "," "," # "," # ",
" "," "," "," "," "," "," "," ",
" # "," "," # "," "," # "," "," ## "," ",
" # "," "," # "," "," # "," "," # # "," ",
" # "," ### "," #### "," #### "," #### "," ### "," # "," #### ",
" "," # "," # # "," # "," # # "," # # "," #### "," # # ",
" "," #### "," # # "," # "," # # "," ##### "," # "," # # ",
" "," # # "," # # "," # "," # # "," # "," # "," #### ",
" "," #### "," #### "," #### "," #### "," #### "," # "," # ",
" "," "," "," "," "," "," "," ### ",
" # "," # "," # "," # "," ## "," "," "," ",
" # "," "," "," # "," # "," "," "," ",
" #### "," ## "," ## "," # # "," # "," ## ## "," #### "," ### ",
" # # "," # "," # "," # # "," # "," # # # "," # # "," # # ",
" # # "," # "," # "," ### "," # "," # # # "," # # "," # # ",
" # # "," # "," # "," # # "," # "," # # # "," # # "," # # ",
" # # "," ### "," # # "," # # "," ### "," # # "," # # "," ### ",
" "," "," ## "," "," "," "," "," ",
" "," "," "," "," # "," "," "," ",
" "," "," "," "," # "," "," "," ",
" #### "," #### "," # ### "," #### "," #### "," # # "," # # "," # # ",
" # # "," # # "," ## "," # "," # "," # # "," # # "," # # ",
" # # "," # # "," # "," ### "," # "," # # "," # # "," # # # ",
" #### "," #### "," # "," # "," # # "," # ## "," # # "," # # # ",
" # "," # "," # "," #### "," ## "," ## # "," # "," ## ## ",
" # "," # "," "," "," "," "," "," ",
" "," "," "," ### "," # "," ### "," ## # "," ",
" "," "," "," ## "," # "," ## "," # ## "," # # # ",
" # # "," # # "," ##### "," ## "," # "," ## "," "," # # ",
" # # "," # # "," # "," ## "," # "," ## "," "," # # # ",
" # "," # # "," # "," ## "," # "," ## "," "," # # ",
" # # "," #### "," # "," ## "," # "," ## "," "," # # # ",
" # # "," # "," ##### "," ### "," # "," ### "," "," ",
" "," ### "," "," "," # "," "," "," ",
" # "," # "," "," #######"," "," #######"," ###"," ",
" # "," # "," "," # # "," #"," ###### "," ##"," ## ",
" ## ## "," ## ## "," # "," # # "," # "," ##### #"," ######"," ### ",
" #######"," # #"," ## "," # "," # # "," ## ##"," # ## "," ",
" ###### "," # # "," ### "," # "," # # "," # # ###"," # ####"," ### ",
" ###### "," # # "," #### "," # # "," # "," ## ####"," ## "," ## ",
" ######"," # # #"," ## ## "," # # # "," # "," ## ####"," ###### "," # ",
" ## ## "," ## ## "," # #"," #######"," "," #######"," # "," ###",
" # "," "," # "," # "," #######"," #"," ###### "," ## # ",
" # "," "," # "," ### "," "," #"," ###### "," ## ",
" # "," "," # "," # # # "," "," # #"," ###### "," ### ",
" #######"," "," # "," # # #"," "," ## #"," ###### "," ######",
" # "," "," # # #"," # "," "," #######"," ###### "," ### ",
" # "," "," # # # "," # "," "," ## "," ###### "," ## ",
" # "," "," ### "," # "," "," # "," ###### "," # ",
" "," # # # "," # "," # "," "," "," ###### "," #### ##",
" # ##"," #"," #"," "," # "," # "," # # # "," # # # #",
" ## "," # #"," # #"," "," # "," # "," # # # #"," # # # ",
" ### "," # "," ### "," "," # "," # "," # # # "," # # # #",
" ###### "," #######"," ##### "," #######"," # "," #######"," # # # #"," # # # ",
" ### "," ##### "," #######"," "," # "," # "," # # # "," # # # #",
" ## "," ### "," # "," "," # "," # "," # # # #"," # # # ",
" # "," # #"," # #"," "," # "," # "," # # # "," # # # #",
" ## ####"," #"," #"," "," #######"," "," # # # #"," # # # ",
" "," "," #"," # "," #######"," # # "," #######"," # ",
" ##### "," "," #"," ### "," "," # # "," #"," # ",
" # #","####### "," #"," ##### "," "," ### ###"," #"," # ",
" # "," #"," #"," #######"," "," "," ## #"," # ",
" # "," #"," #"," ##### "," "," ### ###"," ## #"," # ",
" # "," #"," #"," ### "," "," # # "," #"," # ",
" #######","########"," #"," # "," "," # # "," #"," # ",
" "," "," #"," "," #######"," "," #######"," # ",
};
#define STRINGS_PER_CHAR 8
#define CHARS_PER_ROW 8
#define STRINGS_PER_CHAR_ROW (STRINGS_PER_CHAR * CHARS_PER_ROW)
void make_csbits (void) {
int i,j;
int szstrs = sizeof csstrs / sizeof csstrs[0];
int numchars = szstrs / STRINGS_PER_CHAR;
for (i = 0; i < numchars; ++i) {
int si = ((i / STRINGS_PER_CHAR) * STRINGS_PER_CHAR_ROW) + (i % CHARS_PER_ROW);
for (j = 0; j < STRINGS_PER_CHAR; ++j)
{
const char *sp = csstrs[si];
unsigned char cb = 0;
si += CHARS_PER_ROW;
while (*sp) {
if (*sp++ != ' ') cb |= 0x80;
cb >>= 1;
}
csbits[0][i][j] = cb;
}
}
/* move mousetext */
for (i = 96; i < 128; ++i)
for (j = 0; j < 8; ++j)
csbits[1][i-32][j] = csbits[0][i][j];
/* move lowercase */
for (i = 64; i < 96; ++i)
for (j = 0; j < 8; ++j)
csbits[1][i+32][j] = csbits[1][i+160][j] =
csbits[0][i+160][j] = csbits[0][i][j];
/* move numbers */
for (i = 32; i < 64; ++i)
for (j = 0; j < 8; ++j)
csbits[1][i][j] = csbits[1][i+128][j] =
csbits[0][i+64][j] = csbits[0][i+128][j] = csbits[0][i][j];
/* move uppercase */
for (i = 0; i < 32; ++i)
for (j = 0; j < 8; ++j)
csbits[1][i][j] = csbits[1][i+128][j] = csbits[1][i+192][j] =
csbits[0][i+64][j] = csbits[0][i+128][j] = csbits[0][i+192][j] = csbits[0][i][j];
/* invert (skip mousetext) */
for (i = 0; i < 128; ++i)
for (j = 0; j < 8; ++j)
{
csbits[0][i][j] ^= 0xFF;
if (i < 64 || i >= 96)
csbits[1][i][j] ^= 0xFF;
}
}
#endif

View File

@ -1,25 +1,4 @@
/*
AppleWin : An Apple //e emulator for Windows
Copyright (C) 2010-2011, William S Simms
AppleWin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
AppleWin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef INCLUDED_CS_H
#define INCLUDED_CS_H
#pragma once
typedef unsigned char (*csbits_t)[256][8];
@ -30,6 +9,4 @@ extern unsigned char csbits_pravets82[1][256][8]; // Pravets 82
extern unsigned char csbits_pravets8M[1][256][8]; // Pravets 8M
extern unsigned char csbits_pravets8C[2][256][8]; // Pravets 8A & 8C
void make_csbits (void);
#endif
void make_csbits(void);