예제 #1
0
int
spec128_common_reset( int contention )
{
  size_t i;

  machine_current->ram.locked=0;
  machine_current->ram.last_byte = 0;

  machine_current->ram.current_page=0;
  machine_current->ram.current_rom=0;

  memory_current_screen = 5;
  memory_screen_mask = 0xffff;

  /* Odd pages contended on the 128K/+2; the loop is up to 16 to
     ensure all of the Scorpion's 256Kb RAM is not contended */
  for( i = 0; i < 16; i++ )
    memory_ram_set_16k_contention( i, i & 1 ? contention : 0 );

  /* 0x0000: ROM 0 */
  memory_map_16k( 0x0000, memory_map_rom, 0 );
  /* 0x4000: RAM 5 */
  memory_map_16k( 0x4000, memory_map_ram, 5 );
  /* 0x8000: RAM 2 */
  memory_map_16k( 0x8000, memory_map_ram, 2 );
  /* 0xc000: RAM 0 */
  memory_map_16k( 0xc000, memory_map_ram, 0 );

  return 0;
}
예제 #2
0
static int
spec16_reset( void )
{
  int error;

  error = machine_load_rom( 0, settings_current.rom_16, 
                            settings_default.rom_16, 0x4000 );
  if( error ) return error;

  ensure_empty_mapping();

  periph_clear();
  machines_periph_48();
  periph_update();

  /* The one RAM page is contended */
  memory_ram_set_16k_contention( 5, 1 );

  memory_map_16k( 0x0000, memory_map_rom, 0 );
  memory_map_16k( 0x4000, memory_map_ram, 5 );
  memory_map_16k( 0x8000, empty_mapping, 0 );
  memory_map_16k( 0xc000, empty_mapping, 0 );

  memory_current_screen = 5;
  memory_screen_mask = 0xffff;

  spec48_common_display_setup();

  return 0;
}
예제 #3
0
int
spec48_memory_map( void )
{
  memory_map_16k( 0x0000, memory_map_rom, 0 );
  memory_romcs_map();
  return 0;
}
예제 #4
0
int
spec48_common_reset( void )
{
  /* 0x0000: ROM 0 */
  memory_map_16k( 0x0000, memory_map_rom, 0 );
  /* 0x4000: RAM 5, contended */
  memory_ram_set_16k_contention( 5, 1 );
  memory_map_16k( 0x4000, memory_map_ram, 5 );
  /* 0x8000: RAM 2, not contended */
  memory_ram_set_16k_contention( 2, 0 );
  memory_map_16k( 0x8000, memory_map_ram, 2 );
  /* 0xc000: RAM 0, not contended */
  memory_ram_set_16k_contention( 0, 0 );
  memory_map_16k( 0xc000, memory_map_ram, 0 );

  return 0;
}
예제 #5
0
/* Map 16K of memory and record default mapping for dock */
void
scld_home_map_16k( libspectrum_word address, memory_page source[],
                   int page_num )
{
  int i;

  memory_map_16k( address, source, page_num );

  for( i = 0; i < MEMORY_PAGES_IN_16K; i++ ) {
    int page = ( address >> MEMORY_PAGE_SIZE_LOGARITHM ) + i;
    timex_home[ page ] = &source[ page_num * MEMORY_PAGES_IN_16K + i ];
  }
}
예제 #6
0
void
spec128_select_page( int page )
{
  memory_map_16k( 0xc000, memory_map_ram, page );
  machine_current->ram.current_page = page;
}
예제 #7
0
void
spec128_select_rom( int rom )
{
  memory_map_16k( 0x0000, memory_map_rom, rom );
  machine_current->ram.current_rom = rom;
}