Turbo Rascal - Vic Bitmap Mode

You need an actual VIC.

Moderator: Moderators

User avatar
AndyH
Vic 20 Afficionado
Posts: 364
Joined: Thu Jun 17, 2004 5:51 am
Website: https://www.hewco.uk
Location: UK
Occupation: Developer

Re: Turbo Rascal - Vic Bitmap Mode

Post by AndyH »

Working on the tutorial / example files now. It's a bit more interesting that all that test data I've been using during development.
Click to play animation
Click to play animation
--
AndyH
HEWCO | Vic 20 blog
DarwinNE
Vic 20 Devotee
Posts: 231
Joined: Tue Sep 04, 2018 2:40 am
Website: http://davbucci.chez-alice.fr
Location: Grenoble - France

Re: Turbo Rascal - Vic Bitmap Mode

Post by DarwinNE »

Really cool effect, AndyH, I really like it!
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: Turbo Rascal - Vic Bitmap Mode

Post by orion70 »

:shock: fast and fluid
User avatar
AndyH
Vic 20 Afficionado
Posts: 364
Joined: Thu Jun 17, 2004 5:51 am
Website: https://www.hewco.uk
Location: UK
Occupation: Developer

Re: Turbo Rascal - Vic Bitmap Mode

Post by AndyH »

It looks great running at a true 50Hz, the GIF animation is not quite as fluid but quite close.

Here's the next one. So many ideas for games from doing these tutorial example files.
Click to play animation
Click to play animation
--
AndyH
HEWCO | Vic 20 blog
User avatar
joshuadenmark
Big Mover
Posts: 1218
Joined: Sat Oct 23, 2010 11:32 am
Location: Fr-Havn, Denmark
Occupation: Service engineer

Re: Turbo Rascal - Vic Bitmap Mode

Post by joshuadenmark »

Wow 😮 that’s impressing.
Kind regards, Peter.
____________________________________________________
In need of a wiki logon - PM me
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Turbo Rascal - Vic Bitmap Mode

Post by funkheld »

Wonderful performance for the Vic20.

greeting
User avatar
AndyH
Vic 20 Afficionado
Posts: 364
Joined: Thu Jun 17, 2004 5:51 am
Website: https://www.hewco.uk
Location: UK
Occupation: Developer

Re: Turbo Rascal - Vic Bitmap Mode

Post by AndyH »

I'm still thinking up little example demo / tutorial files to include with Turbo Rascal to show some of the capabilities of the Vic 20 Bitmap Mode. This one is a bit scary, rated Vic 20.
Click to play the animation
Click to play the animation
It is silky smooth on the screen, my gif capture lags it a bit.
--
AndyH
HEWCO | Vic 20 blog
User avatar
AndyH
Vic 20 Afficionado
Posts: 364
Joined: Thu Jun 17, 2004 5:51 am
Website: https://www.hewco.uk
Location: UK
Occupation: Developer

Re: Turbo Rascal - Vic Bitmap Mode

Post by AndyH »

There is now a beta version available: Download zip

There is information in the help (F1) and some of the above demo files in the Vic 20 Tutorials folder. However, please be aware there will likely be bugs in this version. I am aware of an optimisation bug with ldx which you'll see some inline assembler in one of the files for example.
--
AndyH
HEWCO | Vic 20 blog
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Turbo Rascal - Vic Bitmap Mode

Post by funkheld »

Hello, good evening.

it's nice to see something like this in the vic20.
a wonderful job of yours.
stay tuned to vic20 with your updates.

Thank you.
greeting
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Turbo Rascal - Vic Bitmap Mode

Post by funkheld »

Hi good afternoon.
your trse with the sprite and the graphic
is super for the vic20.

I wrote a small sprite program here.

----------------------
load"vbmsprite1.p",8,1
sys 8192
---------------------

when the program is loaded and startet
you can load a picture with the "r" key

with the w/s/a/d buttons you can sprite move.

I found a little bug.
sometimes the sprite disappears
when moving and comes back when moving again.
this error occurs in several places,
but not always in the same place.
sometimes i don't believe the renewal of the sprite
comes with the movement and then bounces.

the picture is only loaded after address $a400 and
then moved to $1100.

Code: Select all

program sprite;

var  

i,a,b,x,y :byte;
name: string;

zpg1:pointer;
zpg2:pointer;

spr8 : array[] of byte = (
  %11111111,
  %10000001,
  %00111100,
  %00100100,
  %00100100,
  %00111100,
  %10000001,
  %11111111
  );
    
  spr8L0 : array[8] of integer; 
  spr8R0 : array[8] of integer; 
  

procedure load();
begin
	asm("
	lda b
	ldx #<name
	ldy #>name
	jsr $ffbd
	
	lda #0
	ldy #8
	ldx #8
	jsr $ffba
	 
	lda #0
	jsr $ffd5
  ");
end;  

procedure text();
begin
  poke(^36864,0,12);
  poke(^36866,0,22);
  poke(^36867,0,174);
  poke(^36869,0,192);
  ClearScreen(white, screen_col_loc);
  poke(^214,0,0);
  poke(^211,0,0);
  call(^58640);
end;

procedure schiebe();
begin
  zpg1:=4352;
  zpg2:=$a400;
	for b:=0 to 14 do
		begin
			for a:=0 to 255 do
			begin 	     
    		zpg1[a]:=zpg2[a];
    	end;
    	zpg1:=zpg1 + 255;
    	zpg2:=zpg2 + 255;
  	end;
  zpg1:=4352+255*14;
  zpg2:=$a400+255*14;	 
  for a:=0 to 25 do
	  begin 	     
      zpg1[a]:=zpg2[a];
    end;  	
end;

procedure laden();
begin
   text();
	 name:="VICBILD.BIN";
   b:=11;
   load();
end;

begin
	vbmSetDisplayMode( 0 );
	vbmClear(0);	
	vbmClearColor(blue);
	
 	vbmSpriteShiftR( spr8, ^$a000, 1, 8, spr8L0 ); 
	vbmSpriteShiftL( spr8, ^$a040, 1, 8, spr8R0 ); 

  x:=80;
  y:=90;
  
  while (true) offpage do
	begin
	
		i := getkey();	
		case i of 
			KEY_d: 
			begin
				x:=x+1;
				if (x>150) then x:=150;
			end;
			
			KEY_a: 
			begin
	      x:=x-1;
	      if (x<2) then x:=2;
			end;
			
			KEY_s: 
			begin
				y:=y+1;
				if (y>184) then y:=184;
			end;
			
			KEY_w: 
			begin
	     y:=y-1;	
	     if (y=255) then y:=0;	
			end;
		
      KEY_r: 
			begin
			  text();
			  laden();
        vbmSetDisplayMode( 0 );
	      vbmClear(0);	
	      vbmClearColor(blue);
      	schiebe();
			end;
		end;	
		
		vbmSetPosition1( x, y ); 
    vbmDrawSprite8e( spr8L0, spr8R0 ); 
    
    waitforraster( 0 ); 

    vbmSetPosition1( x, y ); 
    vbmDrawSprite8e( spr8L0, spr8R0 ); 
	end;
end.
Attachments
trsesprite.jpg
spritebug.jpg
spritebug.jpg (12.33 KiB) Viewed 2212 times
disk1.zip
(1.75 KiB) Downloaded 62 times
User avatar
AndyH
Vic 20 Afficionado
Posts: 364
Joined: Thu Jun 17, 2004 5:51 am
Website: https://www.hewco.uk
Location: UK
Occupation: Developer

Re: Turbo Rascal - Vic Bitmap Mode

Post by AndyH »

Great!

Are you able to replicate that sprite problem in a smaller example file with just the sprite?
--
AndyH
HEWCO | Vic 20 blog
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Turbo Rascal - Vic Bitmap Mode

Post by funkheld »

hello,
that will probably be because of the picture and
not on your sprite routine.

your trse is fine

greeting
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Turbo Rascal - Vic Bitmap Mode

Post by funkheld »

Hi good afternoon.

the fuel block only works on the left
when the whole sprite is on the ground.

the fuel block works correctly on the right up to the last point
of the ground.

how do I have to set this correctly on the left?

greeting

Code: Select all

program sprite;

var  

i,a,b,x,y :byte;
name: string;

zpg1:pointer;
zpg2:pointer;

spr8 : array[] of byte = (
  %11111111,
  %10000001,
  %00111100,
  %00100100,
  %00100100,
  %00111100,
  %10000001,
  %11111111
  );
    
  spr8L0 : array[8] of integer; 
  spr8R0 : array[8] of integer; 
  
begin
	vbmSetDisplayMode( 0 );
	vbmClear(0);	
	vbmClearColor(blue);
	
 	vbmSpriteShiftR( spr8, ^$a000, 1, 8, spr8L0 ); 
	vbmSpriteShiftL( spr8, ^$a040, 1, 8, spr8R0 ); 
	
	for b:=0 to 20 do
	begin
     vbmDrawblot( b,20 );
  end;
  
  for b:=50 to 80 do
	begin
     vbmDrawblot( b,60 );
  end;
  
  for b:=120 to 150 do
	begin
     vbmDrawblot( b,80 );
  end;
  
  for b:=0 to 80 do
	begin
     vbmDrawblot( b,100 );
  end;
  
  for b:=100 to 159 do
	begin
     vbmDrawblot( b,100 );
  end;
  
  for b:=0 to 159 do
	begin
     vbmDrawblot( b,180 );
  end;
  
  x:=50;
  y:=20;
  
  while (true) offpage do
	begin
	
		i := getkey();	
		case i of 
			KEY_d: 
			begin
				x:=x+1;
				if (x>152) then x:=152;
			end;
			
			KEY_a: 
			begin
	      x:=x-1;
	      if (x=255) then x:=0;
			end;
			
			KEY_s: 
			begin
				y:=y+1;
				if (y>184) then y:=184;
			end;
			
			KEY_w: 
			begin
	     y:=y-1;	
	     if (y=255) then y:=0;	
			end;
		
      KEY_r: 
			begin
			 
			end;
		end;	
		
		vbmSetPosition1( x, y ); 
    vbmDrawSprite8e( spr8L0, spr8R0 ); 
    
    waitforraster( 0 ); 

    vbmSetPosition1( x, y ); 
    vbmDrawSprite8e( spr8L0, spr8R0 ); 
    
    if (vbmTestPixel2( x, y+8 ) = 0) then
    begin
			y := y + 1;
			if (y>184) then y:=184;
    end;
    
    if (vbmTestPixel2( x, y-2 ) = 0) then
    begin
			y := y - 1;
			if (y=255) then y:=0;	
    end;
  end;
end.
Attachments
ok-right.jpg
ok-right.jpg (2.85 KiB) Viewed 2182 times
not-ok-left.jpg
not-ok-left.jpg (2.19 KiB) Viewed 2182 times
ok-left.jpg
ok-left.jpg (2.29 KiB) Viewed 2182 times
User avatar
AndyH
Vic 20 Afficionado
Posts: 364
Joined: Thu Jun 17, 2004 5:51 am
Website: https://www.hewco.uk
Location: UK
Occupation: Developer

Re: Turbo Rascal - Vic Bitmap Mode

Post by AndyH »

vbmDrawSprite8e Draws with an eor operation. It’s good because it won’t destroy other pixels on the bitmap. However, when it goes over pixels you will see that result.

You can use vbmDrawSprite8 and vbmClearSprite8 instead but this will erase the bitmap so you would need to restore the line after.
--
AndyH
HEWCO | Vic 20 blog
funkheld
Vic 20 Devotee
Posts: 241
Joined: Tue Sep 10, 2019 4:23 am

Re: Turbo Rascal - Vic Bitmap Mode

Post by funkheld »

Hello thanks for the information.

---------------------------------
asm(" ldx #152;keep");
vbmScreenShiftright( 50, 191 );
---------------------------------

why is : asm(" ldx #152;keep");

greeting
Post Reply