Skip to content

Commit

Permalink
Merge pull request #4 from GmEsoft/develop
Browse files Browse the repository at this point in the history
v0.0.6-alpha
  • Loading branch information
GmEsoft authored Oct 8, 2023
2 parents dbc25bd + 0b6e7ee commit 1835e39
Show file tree
Hide file tree
Showing 30 changed files with 698 additions and 113 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,4 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/
*.bak
2 changes: 1 addition & 1 deletion CTS256A-AL2/CPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CPU
// set PC
void setPC( uint pc )
{
pc_ = pc;
pc_ = ushort(pc);
}

// get PC
Expand Down
137 changes: 137 additions & 0 deletions CTS256A-AL2/CTS256A-AL2.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1E1CE4C7-A024-4278-A3B1-362FE36484C0}</ProjectGuid>
<RootNamespace>CTS256AAL2</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.28307.799</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="ConIOConsole.cpp" />
<ClCompile Include="ConsoleDebugger.cpp" />
<ClCompile Include="CTS256A_AL2.cpp" />
<ClCompile Include="disas7000.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="mem7000.cpp" />
<ClCompile Include="stdafx.cpp" />
<ClCompile Include="Symbols.cpp" />
<ClCompile Include="SystemConsole.cpp" />
<ClCompile Include="TMS7000CPU.cpp" />
<ClCompile Include="TMS7000DebugHelper.cpp" />
<ClCompile Include="TMS7000Disassembler.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Clock_I.h" />
<ClInclude Include="ConIOConsole.h" />
<ClInclude Include="ConsoleDebugger.h" />
<ClInclude Include="ConsoleProxy.h" />
<ClInclude Include="Console_I.h" />
<ClInclude Include="CPU.h" />
<ClInclude Include="CTS256A_AL2.h" />
<ClInclude Include="Debugger.h" />
<ClInclude Include="DebugHelper_I.h" />
<ClInclude Include="disas7000.h" />
<ClInclude Include="Disassembler.h" />
<ClInclude Include="InOut_I.h" />
<ClInclude Include="mem7000.h" />
<ClInclude Include="Memory_I.h" />
<ClInclude Include="Mode.h" />
<ClInclude Include="RAM.h" />
<ClInclude Include="ROM.h" />
<ClInclude Include="runtime.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="Symbols.h" />
<ClInclude Include="SystemConsole.h" />
<ClInclude Include="System_I.h" />
<ClInclude Include="TMS7000CPU.h" />
<ClInclude Include="TMS7000DebugHelper.h" />
<ClInclude Include="TMS7000Disassembler.h" />
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
135 changes: 135 additions & 0 deletions CTS256A-AL2/CTS256A-AL2.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ConIOConsole.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ConsoleDebugger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CTS256A_AL2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="disas7000.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="mem7000.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Symbols.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SystemConsole.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TMS7000CPU.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TMS7000DebugHelper.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TMS7000Disassembler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Clock_I.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ConIOConsole.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Console_I.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ConsoleDebugger.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ConsoleProxy.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CPU.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CTS256A_AL2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Debugger.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DebugHelper_I.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="disas7000.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Disassembler.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="InOut_I.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mem7000.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Memory_I.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Mode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RAM.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ROM.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="runtime.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Symbols.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="System_I.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SystemConsole.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TMS7000CPU.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TMS7000DebugHelper.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="TMS7000Disassembler.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
</Project>
30 changes: 24 additions & 6 deletions CTS256A-AL2/CTS256A_AL2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,24 @@ static const char * SP0256_labels[] =

uchar CTS256A_AL2_Data_InOut::read( ushort addr )
{
cpu_.trigIRQ( 0x02 ); // trig INT1
cpu_.trigIRQ( 0x02 ); // trig INT1 - output interrupt

if ( !eof_ )
{
if ( !initctr_ && ( bport_ & 0x01 ) )
cpu_.trigIRQ( 0x08 ); // trig INT3
if ( !initctr_ && ( bport_ & 0x01 ) ) {
//if ( !irq3ctr_-- ) {
if ( addr == 0xF105 || addr == 0xF11C ) {
// POLL/ENDPOL and output buffer empty
if ( cpu_.getdata(7) == cpu_.getdata(9) ) {
cpu_.trigIRQ( 0x08 ); // trig INT3 - input interrupt
if ( verbose_ )
cpu_.printf( " %04x 7:%d 9:%d TRIG\n", addr, cpu_.getdata(7), cpu_.getdata(9) );
} else {
if ( verbose_ )
cpu_.printf( " %04x 7:%d 9:%d NOTRIG\n", addr, cpu_.getdata(7), cpu_.getdata(9) );
}
}
}
if ( !--debugctr_ ) {
cpu_.setMode( MODE_STOP );
debugctr_ = DEBUG_CTR_RELOAD;
Expand All @@ -68,13 +80,20 @@ uchar CTS256A_AL2_Data_InOut::read( ushort addr )
}

// 0xF000-0xFFFF: CTS256A-AL2 ROM (in)
if ( addr == 0xF33E )
// patch output buffer high watermark
// to force output of each allophone
return 0;

if ( addr >= 0xF000 )
return CTS256A_AL2_ROM[addr&0x0FFF];

// 0x0200-0x0FFF: Parallel data (in)
if ( addr < 0x1000 )
{
uchar c = istr_.get();
if ( verbose_ )
cpu_.printf( " - avail %d:", istr_.rdbuf()->in_avail() );
uchar c = uchar( istr_.get() );
if ( eof_ || istr_.eof() )
{
eof_ = true;
Expand Down Expand Up @@ -146,6 +165,7 @@ uchar CTS256A_AL2_Data_InOut::write( ushort addr, uchar data )
ostr_ << " " << SP0256_labels[data];
else
ostr_.put( data | 0x40 );
ostr_.flush();
}

if ( initctr_ )
Expand Down Expand Up @@ -194,7 +214,6 @@ uchar CTS256A_AL2_Data_InOut::in( ushort addr )
default:
return 0xFF;
}
return 0xFF;
}

uchar CTS256A_AL2_Data_InOut::out( ushort addr, uchar data )
Expand Down Expand Up @@ -225,7 +244,6 @@ uchar CTS256A_AL2_Data_InOut::out( ushort addr, uchar data )
default:
return data;
}
return data;
}

void CTS256A_AL2_Data_InOut::setOption( uchar option, uint value )
Expand Down
4 changes: 3 additions & 1 deletion CTS256A-AL2/CTS256A_AL2.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ class CTS256A_AL2_Data_InOut
{
public:
CTS256A_AL2_Data_InOut( TMS7000CPU &cpu, std::istream &istr, std::ostream &ostr )
: cpu_( cpu ), istr_( istr ), ostr_( ostr ), bport_( 0 ), initctr_( 6 ), eof_( false )
: cpu_( cpu ), istr_( istr ), ostr_( ostr ), bport_( 0 ), initctr_( 6 ), irq3ctr_( 0 ), eof_( false )
, debug_( false ), verbose_( false ), echo_( false ), noOK_( false ), mode_( 'T' ), debugctr_( DEBUG_CTR_RELOAD )
{
memset( ram_, 0, 0x800 );
}

uchar read( ushort addr );
Expand Down Expand Up @@ -89,6 +90,7 @@ class CTS256A_AL2_Data_InOut
std::istream &istr_;
std::ostream &ostr_;
uchar initctr_;
ushort irq3ctr_;
uint debugctr_;
uint eofctr_;
bool eof_;
Expand Down
6 changes: 5 additions & 1 deletion CTS256A-AL2/ConIOConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
#include <signal.h>
#include <conio.h>

static void siginthandler (int s)
#if __cplusplus < 201103L
# define noexcept throw()
#endif

static void siginthandler (int) noexcept
{
signal(SIGINT,siginthandler); // reinstall signal handler
_ungetch( 3 );
Expand Down
Loading

0 comments on commit 1835e39

Please sign in to comment.