Skip to content

Commit

Permalink
Bugfix to CLEAR when start==end.
Browse files Browse the repository at this point in the history
Improved documentation in Makefile.inc.
Fixed DiscImage writes so that they are written to the correct DFS directory.
  • Loading branch information
richtw1 committed Feb 27, 2011
1 parent 7215c84 commit 0f10e18
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ PLATFORM_LIST += mingw-gcc4

ifndef PLATFORM
# Do checks with $(shell uname -s) and/or $(OSTYPE) here to try to automatically determine
# the appropriate platform type
# the appropriate platform type. Ultimately, the goal is to automatically set the make
# variable $(PLATFORM) to one of the values in PLATFORM_LIST, above.
endif


Expand Down
10 changes: 8 additions & 2 deletions src/discimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ DiscImage::~DiscImage()
/*************************************************************************************************/
void DiscImage::AddFile( const char* pName, const unsigned char* pAddr, int load, int exec, int len )
{
(void)pAddr;
char dirName = '$';

if ( strlen( pName ) > 2 && pName[ 1 ] == '.' )
{
dirName = pName[ 0 ];
pName += 2;
}

if ( strlen( pName ) > 7 )
{
Expand Down Expand Up @@ -256,7 +262,7 @@ void DiscImage::AddFile( const char* pName, const unsigned char* pAddr, int load

// Write directory name

m_aCatalog[ 15 ] = '$';
m_aCatalog[ 15 ] = dirName;

// Write load address

Expand Down
8 changes: 7 additions & 1 deletion src/objectcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,16 @@ void ObjectCode::SetGuard( int addr )
/*************************************************************************************************/
void ObjectCode::Clear( int start, int end, bool bAll )
{
assert( start < end );
assert( start <= end );
assert( start >= 0 && start < 0x10000 );
assert( end > 0 && end <= 0x10000 );

// Nothing to do if start == end
if ( start == end )
{
return;
}

if ( bAll )
{
// via CLEAR command
Expand Down

0 comments on commit 0f10e18

Please sign in to comment.