Page 2 of 3

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Wed Jan 08, 2020 3:20 pm
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

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Wed Jan 08, 2020 4:34 pm
by DarwinNE
Really cool effect, AndyH, I really like it!

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Thu Jan 09, 2020 12:13 am
by orion70
:shock: fast and fluid

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Thu Jan 09, 2020 4:49 am
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

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Thu Jan 09, 2020 7:18 am
by joshuadenmark
Wow 😮 that’s impressing.

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Fri Jan 10, 2020 7:18 am
by funkheld
Wonderful performance for the Vic20.

greeting

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Fri Jan 10, 2020 11:55 am
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.

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Fri Jan 10, 2020 3:29 pm
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.

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Fri Jan 10, 2020 4:17 pm
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

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Sat Jan 11, 2020 10:35 am
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.

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Sat Jan 11, 2020 11:41 am
by AndyH
Great!

Are you able to replicate that sprite problem in a smaller example file with just the sprite?

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Sat Jan 11, 2020 11:50 am
by funkheld
hello,
that will probably be because of the picture and
not on your sprite routine.

your trse is fine

greeting

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Sun Jan 12, 2020 2:56 am
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.

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Sun Jan 12, 2020 3:05 am
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.

Re: Turbo Rascal - Vic Bitmap Mode

Posted: Sun Jan 12, 2020 4:57 am
by funkheld
Hello thanks for the information.

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

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

greeting