Пример #1
0
int
tc2068_tc2048_common_reset( void )
{
    memory_current_screen = 5;
    memory_screen_mask = 0xdfff;

    scld_dec_write( 0x00ff, 0x00 );
    scld_hsr_write( 0x00f4, 0x00 );

    return spec48_common_reset();
}
Пример #2
0
void
tc2068_tc2048_common_reset( void )
{
  scld_set_exrom_dock_contention();

  memory_current_screen = 5;
  memory_screen_mask = 0xdfff;

  scld_dec_write( 0x00ff, 0x00 );
  scld_hsr_write( 0x00f4, 0x00 );

  tc2068_tc2048_common_display_setup();
}
Пример #3
0
static void
scld_from_snapshot( libspectrum_snap *snap )
{
  size_t i;
  int capabilities = machine_current->capabilities;

  if( capabilities & ( LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_MEMORY |
      LIBSPECTRUM_MACHINE_CAPABILITY_SE_MEMORY ) )
    scld_hsr_write( 0x00f4, libspectrum_snap_out_scld_hsr( snap ) );

  if( capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_VIDEO )
    scld_dec_write( 0x00ff, libspectrum_snap_out_scld_dec( snap ) );

  if( libspectrum_snap_dock_active( snap ) ) {

    dck_active = 1;

    for( i = 0; i < 8; i++ ) {

      if( libspectrum_snap_dock_cart( snap, i ) )
        scld_dock_exrom_from_snapshot( timex_dock, i,
          libspectrum_snap_dock_ram( snap, i ),
          libspectrum_snap_dock_cart( snap, i ) );

      if( libspectrum_snap_exrom_cart( snap, i ) )
        scld_dock_exrom_from_snapshot( timex_exrom, i,
          libspectrum_snap_exrom_ram( snap, i ),
          libspectrum_snap_exrom_cart( snap, i ) );

    }

    if( capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_DOCK )
      ui_menu_activate( UI_MENU_ITEM_MEDIA_CARTRIDGE_DOCK_EJECT, 1 );

    machine_current->memory_map();
  }

}
Пример #4
0
int
screenshot_scr_read( const char *filename )
{
  int error = 0;
  int i;
  utils_file screen;

  error =  utils_read_file( filename, &screen );
  if( error ) return error;

  switch( screen.length ) {
  case STANDARD_SCR_SIZE:
    memcpy( &RAM[ memory_current_screen ][display_get_addr(0,0)],
	    screen.buffer, screen.length );

    /* If it is a Timex and it is in hi colour or hires mode, switch out of
       hires or hicolour mode */
    if( scld_last_dec.name.b1 || scld_last_dec.name.hires )
      scld_dec_write( 0xff, scld_last_dec.byte & ~HIRES );
    break;

  case HICOLOUR_SCR_SIZE:
    /* If it is a Timex and it is not in hi colour mode, copy screen and switch
        mode if neccesary */
    /* If it is not a Timex copy the mono bitmap and raise an error */
    if( machine_current->timex ) {
      if( !scld_last_dec.name.b1 )
        scld_dec_write( 0xff, ( scld_last_dec.byte & ~HIRESATTR ) | EXTCOLOUR );
      memcpy( &RAM[ memory_current_screen ][display_get_addr(0,0) +
              ALTDFILE_OFFSET], screen.buffer + MONO_BITMAP_SIZE,
	      MONO_BITMAP_SIZE );
    } else
      ui_error( UI_ERROR_INFO,
            "The file contained a TC2048 high-colour screen, loaded as mono");

    memcpy( &RAM[ memory_current_screen ][display_get_addr(0,0)],
              screen.buffer, MONO_BITMAP_SIZE );
    break;

  case HIRES_SCR_SIZE:
    /* If it is a Timex and it is not in hi res mode, copy screen and switch
        mode if neccesary */
    /* If it is not a Timex scale the bitmap and raise an error */
    if( machine_current->timex ) {
      memcpy( &RAM[ memory_current_screen ][display_get_addr(0,0)],
                screen.buffer, MONO_BITMAP_SIZE );

      memcpy( &RAM[ memory_current_screen ][display_get_addr(0,0)] +
              ALTDFILE_OFFSET, screen.buffer + MONO_BITMAP_SIZE,
	      MONO_BITMAP_SIZE );
      if( !scld_last_dec.name.hires )
        scld_dec_write( 0xff,
            ( scld_last_dec.byte & ~( HIRESCOLMASK | HIRES ) ) |
            ( *(screen.buffer + HIRES_ATTR) & ( HIRESCOLMASK | HIRES ) ) );
    } else {
      libspectrum_byte attr = hires_convert_dec( *(screen.buffer + HIRES_ATTR) );

      for( i = 0; i < MONO_BITMAP_SIZE; i++ )
        RAM[ memory_current_screen ][display_get_addr(0,0) + i] =
          convert_hires_to_lores( *(screen.buffer + MONO_BITMAP_SIZE + i),
                                  *(screen.buffer + i) );

      /* set attributes based on hires attribute byte */
      for( i = 0; i < 768; i++ )
        RAM[ memory_current_screen ][display_get_addr(0,0) +
            MONO_BITMAP_SIZE + i] = attr;

      ui_error( UI_ERROR_INFO,
            "The file contained a TC2048 high-res screen, converted to lores");
    }
    break;

  default:
    ui_error( UI_ERROR_ERROR, "'%s' is not a valid scr file", filename );
    error = 1;
  }

  utils_close_file( &screen );

  display_refresh_all();

  return error;
}