--- M6502/Orao.pm 2007/08/02 13:04:29 94 +++ M6502/Orao.pm 2007/08/02 13:19:19 95 @@ -12,7 +12,7 @@ use M6502; use base qw(Class::Accessor M6502 Screen Prefs); -__PACKAGE__->mk_accessors(qw(run_for)); +__PACKAGE__->mk_accessors(qw(booted run_for)); =head1 NAME @@ -20,11 +20,11 @@ =head1 VERSION -Version 0.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 SUMMARY @@ -39,6 +39,8 @@ 0x83FE,0x83FF, ); +=head1 FUNCTIONS + =head2 boot Start emulator, open L, load initial ROM images, and render memory @@ -124,8 +126,30 @@ M6502::reset(); + $self->booted( 1 ); } +=head2 run + +Run interactive emulation loop + + $orao->run; + +=cut + +sub run { + my $self = shift; + + $self->boot if ( ! $self->booted ); + + while ( 1 ) { + $self->cli; + M6502::exec($run_for); + } +}; + +=head1 Helper functions + =head2 load_rom called to init memory and load initial rom images