--- M6502/Screen.pm 2007/07/31 15:03:23 56 +++ M6502/Screen.pm 2007/07/31 21:43:57 73 @@ -166,6 +166,38 @@ $app->sync; } +=head2 render + + $self->render( @video_memory ); + +=cut + +sub render { + my $self = shift; + + die "this function isn't supported if scale isn't 1" unless $self->scale == 1; + + $app->lock; + + my ( $x, $y ) = ( 0,0 ); + + foreach my $b ( @_ ) { + foreach my $p ( split(//, unpack("B8",pack("C",$b)) ) ) { + $app->pixel( $x, $y, $p ? $white : $black ); + $x++; + } + if ( $x == 256 ) { + $x = 0; + $y++; + } + } + + $app->unlock; + $app->sync; + + warn "Screen::render over\n"; +} + =head1 SEE ALSO L is sample implementation using this module