コード例 #1
0
libspectrum_byte
readbyte( libspectrum_word address )
{
  libspectrum_word bank;
  memory_page *mapping;

  bank = address >> MEMORY_PAGE_SIZE_LOGARITHM;
  mapping = &memory_map_read[ bank ];

  if( debugger_mode != DEBUGGER_MODE_INACTIVE )
    debugger_check( DEBUGGER_BREAKPOINT_TYPE_READ, address );

  if( mapping->contended ) tstates += ula_contention[ tstates ];
  tstates += 3;

  if( opus_active && address >= 0x2800 && address < 0x3800 )
    return opus_read( address );

  if( spectranet_paged ) {
    if( spectranet_w5100_paged_a && address >= 0x1000 && address < 0x2000 )
      return spectranet_w5100_read( mapping, address );
    if( spectranet_w5100_paged_b && address >= 0x2000 && address < 0x3000 )
      return spectranet_w5100_read( mapping, address );
  }

  return mapping->page[ address & MEMORY_PAGE_SIZE_MASK ];
}
コード例 #2
0
ファイル: memory.c プロジェクト: twinaphex/sdcell
libspectrum_byte
readbyte( libspectrum_word address )
{
  libspectrum_word bank;
  memory_page *mapping;

  bank = address >> 13;
  mapping = &memory_map_read[ bank ];

  if( debugger_mode != DEBUGGER_MODE_INACTIVE )
    debugger_check( DEBUGGER_BREAKPOINT_TYPE_READ, address );

  if( mapping->contended ) tstates += ula_contention[ tstates ];
  tstates += 3;

  if( opus_active && address >= 0x2800 && address < 0x3800 )
    return opus_read( address );

  return mapping->page[ address & 0x1fff ];
}