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

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

revision 103 by dpavlin, Thu Aug 2 18:01:51 2007 UTC revision 106 by dpavlin, Fri Aug 3 08:44:45 2007 UTC
# Line 12  use SDL::Constants; Line 12  use SDL::Constants;
12    
13  use Carp qw/confess/;  use Carp qw/confess/;
14  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
15    use M6502 qw'@mem';
16    
17  use base qw(Class::Accessor Prefs);  use base qw(Class::Accessor Prefs);
18  __PACKAGE__->mk_accessors(qw(app event));  __PACKAGE__->mk_accessors(qw(app event));
# Line 117  Push byte to video memory and draw it Line 118  Push byte to video memory and draw it
118  my $_vram_counter;  my $_vram_counter;
119    
120  sub vram {  sub vram {
121    
122            return;
123    
124          my ( $self, $offset, $byte ) = @_;          my ( $self, $offset, $byte ) = @_;
125          my $x = ( $offset % 32 ) << 3;          my $x = ( $offset % 32 ) << 3;
126          my $y = $offset >> 5;          my $y = $offset >> 5;
# Line 187  Render one frame of video ram Line 191  Render one frame of video ram
191  sub render {  sub render {
192          my $self = shift;          my $self = shift;
193    
194            return unless $self->booted;
195    
196          die "this function isn't supported if scale isn't 1" unless $self->scale == 1;          die "this function isn't supported if scale isn't 1" unless $self->scale == 1;
197    
198            confess "no data?" unless (@_);
199            confess "screen size not 256*256/8 but ",($#_+1) unless (($#_+1) == (256*256/8));
200    
201          my $pixels = pack("C*", @_);          my $pixels = pack("C*", @_);
202    
203          my $vram = SDL::Surface->new(          my $vram = SDL::Surface->new(
# Line 318  sub loop { Line 327  sub loop {
327          while ( 1 ) {          while ( 1 ) {
328                  $self->key_pressed( 1 );                  $self->key_pressed( 1 );
329                  M6502::exec($run_for);                  M6502::exec($run_for);
330                    $self->render( @mem[ 0x6000 .. 0x7fff ] );
331          }          }
332  }  }
333    

Legend:
Removed from v.103  
changed lines
  Added in v.106

  ViewVC Help
Powered by ViewVC 1.1.26