--- M6502/Orao.pm 2007/08/02 13:04:29 94 +++ M6502/Orao.pm 2007/08/02 13:58:26 96 @@ -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)); =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,26 @@ M6502::reset(); + $self->booted( 1 ); } +=head2 run + +Run interactive emulation loop + + $orao->run; + +=cut + +sub run { + my $self = shift; + + $self->boot if ( ! $self->booted ); + $self->loop; +}; + +=head1 Helper functions + =head2 load_rom called to init memory and load initial rom images @@ -417,6 +437,7 @@ sub cli { my $self = shift; my $a = $PC || confess "no pc?"; + my $run_for = 0; warn $self->dump_R() if $show_R; while ( my ($line, @v) = $self->prompt( $a, $last ) ) { my $c = shift @v; @@ -503,6 +524,7 @@ } } + return $run_for; } =head1 AUTHOR