/[VRac]/M6502/Screen.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/Screen.pm

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

revision 32 by dpavlin, Mon Jul 30 18:37:37 2007 UTC revision 33 by dpavlin, Mon Jul 30 21:00:36 2007 UTC
# Line 9  use SDL::App; Line 9  use SDL::App;
9  use SDL::Rect;  use SDL::Rect;
10  use SDL::Color;  use SDL::Color;
11    
12    use Carp qw/confess/;
13    
14  use base qw(Class::Accessor);  use base qw(Class::Accessor);
15  __PACKAGE__->mk_accessors(qw(debug scale show_mem run_for mem_dump trace));  __PACKAGE__->mk_accessors(qw(debug scale show_mem mem_dump trace app));
16    
17  =head2 open_screen  =head2 open_screen
18    
# Line 36  sub open_screen { Line 38  sub open_screen {
38          #$app->grab_input( 0 );          #$app->grab_input( 0 );
39    
40          warn "# created SDL::App\n";          warn "# created SDL::App\n";
41            $self->app( $app );
42  }  }
43    
44  my $white       = SDL::Color->new( -r => 0xff, -g => 0xff, -b => 0xff );  my $white       = SDL::Color->new( -r => 0xff, -g => 0xff, -b => 0xff );
# Line 122  my $_mem_stat; Line 125  my $_mem_stat;
125    
126  sub mmap_pixel {  sub mmap_pixel {
127          my ( $self, $addr, $r, $g, $b ) = @_;          my ( $self, $addr, $r, $g, $b ) = @_;
128            return unless $self->show_mem && $self->app;
129    
130          my ( $x, $y ) = mem_xy( $addr );          my ( $x, $y ) = $self->mem_xy( $addr );
131          warn sprintf "## mem %04x %02x %02x %02d*%02d\n", $addr, $r, $g, $x, $y if $self->trace;          warn sprintf "## mem %04x %02x %02x %02d*%02d\n", $addr, $r, $g, $x, $y if $self->trace;
132    
133          my $col = sdl::color->new( -r => $r, -g => $g, -b => $b );          my $col = SDL::Color->new( -r => $r, -g => $g, -b => $b );
134          $app->pixel( $x, $y, $col );          $self->app->pixel( $x, $y, $col );
135    
136          $_mem_stat++;          $_mem_stat++;
137          if ( $_mem_stat % 1000 == 0 ) {          if ( $_mem_stat % 1000 == 0 ) {
138                  $app->sync;                  $self->app->sync;
139          }          }
140  }  }
141    
142    
143    =head2 sync
144    
145      $self->sync;
146    
147    =cut
148    
149    sub sync {
150            $app->sync;
151    }
152    
153  1;  1;

Legend:
Removed from v.32  
changed lines
  Added in v.33

  ViewVC Help
Powered by ViewVC 1.1.26