matanlurey / gba.dart-archived

A gameboy advanced emulator written in Dart
https://github.com/matanlurey/gba.dart
12 stars 4 forks source link

Investigate whether 'unused' memory areas can safely be ignored #77

Open kendalharland opened 7 years ago

kendalharland commented 7 years ago

We could forgo allocating 7 unused memory areas if this is the case. This would offer a slight speed up for our tests and slightly faster emulator startup.

The addresses would have to be mapped according to their true offsets to protect the rest of the emulator. e.g:

class MemoryMap {
    final ByteBuffer _buffer = new Uint8List(MEMORY_SIZE_WITHOUT_UNUSED_AREAS).buffer;
    ...
}

MemoryBlock internalWorkBlock(ByteBuffer b) => 
    new MemoryBlock(
        b,
        0x2000000 - SIZEOF_UNUSED_AREA_1,
        0x203ffff - SIZEOF_UNUSED_AREA_1
    ); 
    ... 

and so on. This may not be worth the trouble, or possible, but worth investigating sometime later.