45 |
-width => 256 * $self->scale + ( $self->show_mem ? 256 : 0 ), |
-width => 256 * $self->scale + ( $self->show_mem ? 256 : 0 ), |
46 |
-height => 256 * $self->scale, |
-height => 256 * $self->scale, |
47 |
-depth => 16, |
-depth => 16, |
48 |
|
-flags=>SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWACCEL, |
49 |
); |
); |
50 |
#$app->grab_input( SDL_GRAB_QUERY ); |
#$app->grab_input( SDL_GRAB_QUERY ); |
51 |
$app->grab_input( SDL_GRAB_OFF ); |
$app->grab_input( SDL_GRAB_OFF ); |
52 |
|
$app->title( ref($self) . ' ' . $self::VERSION ); |
53 |
|
|
54 |
$self->app( $app ); |
$self->app( $app ); |
55 |
|
|
66 |
my $green = SDL::Color->new( -r => 0x00, -g => 0xff, -b => 0x00 ); |
my $green = SDL::Color->new( -r => 0x00, -g => 0xff, -b => 0x00 ); |
67 |
my $blue = SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff ); |
my $blue = SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff ); |
68 |
|
|
|
my $rect_mem = SDL::Rect->new( -x => 256, -y => 0, -width => 256, -height => 256 ); |
|
|
|
|
69 |
=head2 mem_xy |
=head2 mem_xy |
70 |
|
|
71 |
Helper to return x and y coordinates in memory map |
Helper to return x and y coordinates in memory map |
154 |
|
|
155 |
my $scale = $self->scale || confess "no scale?"; |
my $scale = $self->scale || confess "no scale?"; |
156 |
|
|
157 |
my $rect = SDL::Rect->new( -x => 0, -y => 0, -width => 256 * $scale, -height => 256 * $scale ); |
my $rect = SDL::Rect->new( -x => 0, -y => 0, -width => 256 * $scale, -height => 256 * $scale ); |
158 |
my $rect_screen = 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 ); |
159 |
|
|
160 |
if ( $scale > 1 ) { |
if ( $scale > 1 ) { |
196 |
|
|
197 |
$vram->display_format; |
$vram->display_format; |
198 |
|
|
199 |
my $rect = SDL::Rect->new( -x => 0, -y => 0, -width => 256, -height => 256 ); |
my $rect = SDL::Rect->new( -x => 0, -y => 0, -width => 256, -height => 256 ); |
200 |
|
my $rect_mem = SDL::Rect->new( -x => 256 * $self->scale, -y => 0, -width => 256, -height => 256 ); |
201 |
|
|
202 |
$vram->blit( $rect, $app, $rect_mem ); |
$vram->blit( $rect, $app, $rect_mem ); |
203 |
|
|
204 |
$app->sync; |
$app->sync; |
263 |
undef $pending_key; |
undef $pending_key; |
264 |
} |
} |
265 |
|
|
266 |
warn "key_pressed = $pending_key\n" if $pending_key; |
if ( $pending_key ) { |
267 |
|
warn "key_pressed = $pending_key\n"; |
268 |
|
$self->record_session('key_pressed', $pending_key); |
269 |
|
} |
270 |
|
|
271 |
return $pending_key; |
return $pending_key; |
272 |
} |
} |
312 |
under the same terms as Perl itself. |
under the same terms as Perl itself. |
313 |
|
|
314 |
=cut |
=cut |
315 |
|
|
316 |
1; |
1; |