/[VRac]/M6502/Orao.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /M6502/Orao.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 50 by dpavlin, Tue Jul 31 11:14:19 2007 UTC revision 59 by dpavlin, Tue Jul 31 16:06:27 2007 UTC
# Line 3  package Orao; Line 3  package Orao;
3  use warnings;  use warnings;
4  use strict;  use strict;
5    
6  use Carp;  use Carp qw/confess/;
7  use lib './lib';  use lib './lib';
8  #use Time::HiRes qw(time);  #use Time::HiRes qw(time);
9  use File::Slurp;  use File::Slurp;
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
11  use M6502;  use M6502;
12    
13  use base qw(Class::Accessor M6502 Screen);  use base qw(Class::Accessor M6502 Screen Prefs);
14  __PACKAGE__->mk_accessors(qw(debug trace run_for mem_dump trace));  __PACKAGE__->mk_accessors(qw(run_for));
15    
16  =head1 NAME  =head1 NAME
17    
# Line 33  Emulator or Orao 8-bit 6502 machine popu Line 33  Emulator or Orao 8-bit 6502 machine popu
33    
34  =head2 init  =head2 init
35    
36  Start emulator  Start emulator, open L<Screen>, load initial ROM images, and render memory
37    
38  =cut  =cut
39    
# Line 46  sub init { Line 46  sub init {
46          warn "Orao calling upstream init\n";          warn "Orao calling upstream init\n";
47          $self->SUPER::init( $self, @_ );          $self->SUPER::init( $self, @_ );
48    
49          warn "staring Orao $Orao::VERSION emulation\n";          warn "Orao $Orao::VERSION emulation starting\n";
50    
51          $self->open_screen;          $self->open_screen;
52          $self->load_rom({          $self->load_rom({
# Line 282  sub write { Line 282  sub write {
282                  $self->vram( $addr - 0x6000 , $byte );                  $self->vram( $addr - 0x6000 , $byte );
283          }          }
284    
         if ( $addr > 0xafff ) {  
                 warn sprintf "access to %04x above affff aborting\n", $addr;  
                 return -1;  
         }  
285          if ( $addr == 0x8800 ) {          if ( $addr == 0x8800 ) {
286                  warn sprintf "sound ignored: %x\n", $byte;                  warn sprintf "sound ignored: %x\n", $byte;
287          }          }
288    
289            if ( $addr > 0xafff ) {
290                    confess sprintf "write access 0x%04x > 0xafff aborting\n", $addr;
291            }
292    
293          $self->mmap_pixel( $addr, $byte, 0, 0 );          $self->mmap_pixel( $addr, $byte, 0, 0 );
294    
295          $mem[$addr] = $byte;          $mem[$addr] = $byte;
# Line 361  __USAGE__ Line 361  __USAGE__
361                          $a = $v if defined($v);                          $a = $v if defined($v);
362                          my $to = shift @v;                          my $to = shift @v;
363                          $to = $a + 32 if ( ! $to || $to <= $a );                          $to = $a + 32 if ( ! $to || $to <= $a );
364                          my $lines = int( ($to - $a - 8) / 8 );                          my $lines = int( ($to - $a + 8) / 8 );
365                          printf "## m %04x %04x lines: %d\n", $a, $to, $lines;                          printf "## e %04x %04x (%d bytes) lines: %d\n", $a, $to, ($to-$a), $lines;
366                          while ( $lines ) {                          while ( --$lines ) {
367                                  print $self->hexdump( $a );                                  print $self->hexdump( $a );
368                                  $a += 8;                                  $a += 8;
                                 $lines--;  
369                          }                          }
370                          $last = '+';                          $last = '+';
371                  } elsif ( $c =~ m/^\+/ ) {                  } elsif ( $c =~ m/^\+/ ) {

Legend:
Removed from v.50  
changed lines
  Added in v.59

  ViewVC Help
Powered by ViewVC 1.1.26