/[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 36 by dpavlin, Mon Jul 30 22:06:13 2007 UTC revision 37 by dpavlin, Mon Jul 30 22:27:47 2007 UTC
# Line 98  Push byte to video memory and draw it Line 98  Push byte to video memory and draw it
98    
99  =cut  =cut
100    
101    my $_vram_counter;
102    
103  sub vram {  sub vram {
104          my ( $self, $offset, $byte ) = @_;          my ( $self, $offset, $byte ) = @_;
105          my $x = ( $offset % 32 ) << 3;          my $x = ( $offset % 32 ) << 3;
106          my $y = $offset >> 5;          my $y = $offset >> 5;
107          my $mask = 1;          my $mask = 1;
108            my $scale = $self->scale;
109    
110          printf "## vram %04x %02x*%02x %02x\n", $offset, $x, $y, $byte if $self->trace;  #       printf "## vram %04x %02x*%02x %02x\n", $offset, $x, $y, $byte if $self->trace;
111    
112          foreach ( 0 .. 7 ) {          foreach ( 0 .. 7 ) {
113                  $self->p($x + $_, $y, $byte & $mask );                  my $on = $byte & $mask;
114                    if ( $scale == 1 ) {
115                            $app->pixel( $x + $_, $y, $on ? $white : $black );
116                    } else {
117                            $self->p($x + $_, $y, $on );
118                    }
119                  $mask = $mask << 1;                  $mask = $mask << 1;
120          }          }
121    
122            $app->sync if ( $_vram_counter++ % 10 == 0 );
123  }  }
124    
125  =head2 mmap_pixel  =head2 mmap_pixel

Legend:
Removed from v.36  
changed lines
  Added in v.37

  ViewVC Help
Powered by ViewVC 1.1.26