Documented #206 existing and new -memclear options with "In Development" in History.txt

-memclear 0 Initialize memory to zero
     -memclear 1 Initialize memory to random values
     -memclear 2 Initialize memory to 4 byte pattern: FF FF 00 00
     -memclear 3 Initialize memory to even pages FF, odd pages 00
     -memclear 4 Initialize memory to first half page 00, last half page FF
     -memclear 5 Initialize memory to first half page FF, last half page 00
     -memclear 6   Initialize memory to byte offset of page
                   (current memory address low byte)
     -memclear 7   Initialize memory to page address
                   (current memory address high byte)
This commit is contained in:
michaelangel007 2014-07-17 20:42:19 -07:00
parent f4b09e1f8f
commit a4bae75d2a
3 changed files with 53 additions and 5 deletions

View File

@ -13,6 +13,28 @@ Restrictions/bugs:
- SSI263 emulation is very basic: there is no attempt to emulate rate, inflection or filters.
- During Mockingboard playback, Speaker emulation isn't precise
In Development:
---------------
Changes:
. Added command line switch to specify the type of memory initialization pattern.
-memclear #
Where # ranges from 0 to 7.
i.e.
-memclear 0 Initialize memory to zero
-memclear 1 Initialize memory to random values
-memclear 2 Initialize memory to 4 byte pattern: FF FF 00 00
-memclear 3 Initialize memory to even pages FF, odd pages 00
-memclear 4 Initialize memory to first half page 00, last half page FF
-memclear 5 Initialize memory to first half page FF, last half page 00
-memclear 6 Initialize memory to byte offset of page
(current memory address low byte)
-memclear 7 Initialize memory to page address
(current memory address high byte)
Fixed:
. [Bug #206] Pooyan freezes due to RNDL/RNDH not initialized to non-zero values
Latest:
-------

View File

@ -1392,14 +1392,10 @@ void MemReset ()
// F2, Ctrl-F2, F7, HGR
DWORD clock = getRandomTime();
if ((g_nMemoryClearType >= 0) && (g_nMemoryClearType != MIP_RANDOM))
if (g_nMemoryClearType >= 0)
g_eMemoryInitPattern = static_cast<MemoryInitPattern_e>(g_nMemoryClearType);
else // random
{
g_eMemoryInitPattern = static_cast<MemoryInitPattern_e>( clock % NUM_MIP );
if (g_eMemoryInitPattern == MIP_RANDOM) // Twice Lucky! Force a choice.
g_eMemoryInitPattern = MIP_FF_FF_00_00;
}
switch( g_eMemoryInitPattern )
{
@ -1442,6 +1438,34 @@ void MemReset ()
for( iByte = 0x0000; iByte < 0xC000; iByte += 256 )
memset( &memmain[ iByte ], 0xFF, 128 );
break;
case MIP_RANDOM:
unsigned char random[ 256 + 4 ];
for( iByte = 0x0000; iByte < 0xC000; iByte += 256 )
{
for( int i = 0; i < 256; i++ )
{
clock = getRandomTime();
random[ i+0 ] ^= (clock >> 0) & 0xFF;
random[ i+1 ] ^= (clock >> 11) & 0xFF;
}
memcpy( &memmain[ iByte ], random, 256 );
}
break;
case MIP_PAGE_ADDRESS_LOW:
for( iByte = 0x0000; iByte < 0xC000; iByte++ )
memmain[ iByte ] = iByte & 0xFF;
break;
case MIP_PAGE_ADDRESS_HIGH:
for( iByte = 0x0000; iByte < 0xC000; iByte += 256 )
memset( &memmain[ iByte ], (iByte >> 8), 256 );
break;
default: // MIP_ZERO -- nothing to do
break;
}
// https://github.com/AppleWin/AppleWin/issues/206

View File

@ -20,6 +20,8 @@ enum MemoryInitPattern_e
, MIP_FF_00_FULL_PAGE
, MIP_00_FF_HALF_PAGE
, MIP_FF_00_HALF_PAGE
, MIP_PAGE_ADDRESS_LOW
, MIP_PAGE_ADDRESS_HIGH
, NUM_MIP
};
extern MemoryInitPattern_e g_eMemoryInitPattern;