Added NTSC files to Solution

This commit is contained in:
michaelangel007 2014-12-31 14:53:55 -08:00
parent d8a0bd4ae2
commit e681c97c3b
5 changed files with 1463 additions and 0 deletions

View File

@ -212,6 +212,9 @@
<ClCompile Include="source\StdAfx.cpp">
<Filter>Source</Filter>
</ClCompile>
<ClCompile Include="source\NTSC.cpp">
<Filter>Source\Video</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\Applewin.h">
@ -451,6 +454,9 @@
<ClInclude Include="source\StdAfx.h">
<Filter>Source</Filter>
</ClInclude>
<ClInclude Include="source\NTSC.h">
<Filter>Source\Video</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="source\CPU\cpu_general.inl">

1185
source/NTSC.cpp Normal file

File diff suppressed because it is too large Load Diff

30
source/NTSC.h Normal file
View File

@ -0,0 +1,30 @@
#define VIDEO_SCANNER_6502_CYCLES 17030
// Globals (Public)
extern uint16_t g_nVideoClockVert;
extern uint16_t g_nVideoClockHorz;
extern uint8_t* g_NTSC_pLines[384];
extern void (* g_pNTSC_FuncVideoUpdate)(long);
// Prototypes (Public) ________________________________________________
extern void NTSC_SetVideoTextMode( int cols );
extern void NTSC_SetVideoMode( int flags );
extern void NTSC_SetVideoStyle();
extern void NTSC_UpdateVideoText40 (long cycles);
extern void NTSC_UpdateVideoText80 (long cyckes);
extern void NTSC_UpdateVideoLores40 (long cycles);
extern void NTSC_UpdateVideoDblLores40(long cycles);
extern void NTSC_UpdateVideoDblLores80(long cycles);
extern void NTSC_UpdateVideoHires40 (long cycles);
extern void NTSC_UpdateVideoDblHires40(long cycles);
extern void NTSC_UpdateVideoDblHires80(long cycles);
extern uint8_t NTSC_VideoByte(unsigned long);
extern void NTSC_VideoCreateDIBSection();
extern void NTSC_VideoInit( uint8_t *pFramebuffer );
extern void NTSC_VideoInitAppleType ();
extern int NTSC_VideoIsVbl();
extern void NTSC_VideoUpdateCycles( long cycles );

215
source/NTSC_CharSet.cpp Normal file
View File

@ -0,0 +1,215 @@
/*
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
*/
#include "StdAfx.h"
#include "NTSC_CharSet.h"
unsigned char csbits[2][256][8];
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;
}
}

27
source/NTSC_CharSet.h Normal file
View File

@ -0,0 +1,27 @@
/*
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
extern unsigned char csbits[2][256][8];
void make_csbits (void);
#endif