--- M6502/Screen.pm 2007/08/03 12:21:47 110 +++ M6502/Screen.pm 2007/08/04 13:18:39 121 @@ -62,7 +62,6 @@ my $green = SDL::Color->new( -r => 0x00, -g => 0xff, -b => 0x00 ); my $blue = SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff ); -my $rect_screen = SDL::Rect->new( -x => 0, -y => 0, -width => 256, -height => 256 ); my $rect_mem = SDL::Rect->new( -x => 256, -y => 0, -width => 256, -height => 256 ); =head2 p @@ -175,12 +174,9 @@ return unless $self->booted; - die "this function isn't supported if scale isn't 1" unless $self->scale == 1; - confess "no data?" unless (@_); confess "screen size not 256*256/8 but ",($#_+1) unless (($#_+1) == (256*256/8)); - my $pixels = pack("C*", map { $flip[$_] } @_); my $vram = SDL::Surface->new( @@ -193,8 +189,19 @@ $vram->set_colors( 0, $black, $white, $red ); $vram->display_format; - my $rect = SDL::Rect->new( -x => 0, -y => 0, -width => 256, -height => 256 ); - $vram->blit( $rect, $app, $rect_screen ); + my $scale = $self->scale; + + my $rect = SDL::Rect->new( -x => 0, -y => 0, -width => 256 * $scale, -height => 256 * $scale ); + my $rect_screen = SDL::Rect->new( -x => 0, -y => 0, -width => 256 * $scale, -height => 256 * $scale ); + + if ( $scale > 1 ) { + use SDL::Tool::Graphic; + # last parametar is anti-alias + my $zoomed = SDL::Tool::Graphic->zoom( $vram, $self->scale, $self->scale, 1 ); + $zoomed->blit( $rect, $app, $rect_screen ); + } else { + $vram->blit( $rect, $app, $rect_screen ); + } $app->sync; }