zxspectrum 0.0.1 copy "zxspectrum: ^0.0.1" to clipboard
zxspectrum: ^0.0.1 copied to clipboard

Emulator for a Sinclair ZX Spectrum, a popular 8-bit home computer of the 1980s

example/zxspectrum_example.dart

import 'dart:io';

import 'package:zxspectrum/zxspectrum.dart';

// good breakpoint representing a time when the machine has booted
const breakpoint = 0x15e6;

void main() async {
  final rom = File('roms/48.rom').readAsBytesSync();
  final spectrum = Spectrum(rom);

  final stopwatch = Stopwatch()..start();
  final start = stopwatch.elapsedMicroseconds;

  while (spectrum.z80.pc != breakpoint) {
    spectrum.z80.executeNextInstruction();
  }

  final end = stopwatch.elapsedMicroseconds;

  print('Took ${(end - start) / 1000}ms to boot.');
}
1
likes
0
pub points
0%
popularity

Publisher

verified publisherslightfoot.dev

Emulator for a Sinclair ZX Spectrum, a popular 8-bit home computer of the 1980s

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, dart_z80

More

Packages that depend on zxspectrum