[Back to GRAPHICS SWAG index]  [Back to Main SWAG index]  [Original]

>> 1. Scrolling 256c fonts Fast and Smooth.
>> 2. Now to do it on top of graphics...
>> 3. 3D object engine - If someone can post me one or direct me
>> to build one.
>> 4. Shade Bobs/Whatever it called - Taking a shape and moving it
>> across the screen when it leaves trail.  Then, moving again
>> on the trail will couse a stronger color to appear. n' on...
>> 5. Moving floor that is NOT a couse of a palette rotetion.
>> 6. 2D Scale procedure.
>> 7. Centered Stars. And SMOOTH ones.
>> 8. Vector Balls

I don't want to give it all away, but I just made some Shaded-bobs (or
whatever). It realy isn't difficult. It worked right away. Now YOU make a nicer
sin-curve and palette. Here's some source:


program ShadingBobs;
  Gseg : word = $a000;
  Sofs = 75; Samp = 75; Slen = 255;
  SprPic : array[0..15,0..15] of byte = (
type SinArray = array[0..Slen] of word;
var Stab : SinArray;

procedure CalcSinus; var I : word; begin
  for I := 0 to Slen do Stab[I] := round(sin(I*4*pi/Slen)*Samp)+Sofs; end;

procedure SetGraphics(Mode : word); assembler; asm
  mov ax,Mode; int 10h end;

function keypressed : boolean; assembler; asm
  mov ah,0bh; int 21h; and al,0feh; end;

procedure DrawSprite(X,Y : integer; W,H : byte; Sprite : pointer); assembler;
  push ds
  lds si,[Sprite]
  mov es,Gseg
  mov ax,[Y]
  shl ax,6
  mov di,ax
  shl ax,2
  add di,ax
  add di,[X]
  mov bh,[H]
  mov cx,320
  sub cl,[W]
  sbb ch,0
  mov bl,[W]
  or al,al
  jz @S
  mov dl,[es:di]
  add dl,al
  mov [es:di],dl
  inc di
  dec bl
  jnz @L2
  add di,cx
  dec bh
  jnz @L
  pop ds

procedure Retrace; assembler; asm
  mov dx,3dah;
  @l1: in al,dx; test al,8; jnz @l1;
  @l2: in al,dx; test al,8; jz @l2; end;

procedure Setpalette;
var I : byte;
  for I := 0 to 255 do begin
    port[$3c8] := I;
    port[$3c9] := I div 3;
    port[$3c9] := I div 2;
    port[$3c9] := I;

procedure Bobs;
var X,Y : integer; I,J : byte;
  I := 0; J := 25;
    X := 2*Stab[I]; Y := Stab[J];
    inc(I); inc(J);
  until keypressed;

{  SetPalette;}

{ DrawSprite procedure taken from Sean Palmer (again).
  It contained some minor bugs: [X] was added to AX, should be DI, and
  jz @S was jnz @S, so the sprite wasn't drawn. Now it is...
  And of course it was changed to INCREASE the video-mem, not to poke it.

  If you get rid of the Retrace it goes a LOT faster. }

[Back to GRAPHICS SWAG index]  [Back to Main SWAG index]  [Original]