Author Topic: BLIT command  (Read 4498 times)

Offline AMC

  • Mc. Print
  • *
  • Posts: 5
  • I bought it for my GP2x...
    • View Profile
BLIT command
« on: 2009-Jun-06 »
Hi, Could I possibly suggest the following command:

blit s1,x1,y1,x2,y2,s2,x,y,m

Where s1 is the source screen and x1,y1,x2,y2 is the part of the bitmap to be copied and s2 is the destination at x,y
(Mainly for the purposes of software scrolling!)
Also a color masking option would be nice like $000000 but $FF00FF seems to be popular these days. :-;

*AMC*

XOR AX,AX - A Fast Zero... (Those were the days...)

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1775
    • View Profile
    • Homepage
Re: BLIT command
« Reply #1 on: 2009-Jun-06 »
You can emulate this in GLBasic by using GRABSPRITE and DRAWSPRITE but I'm not sure how fast this would be :-)
I guess you could also use CREATESCREEN to draw all your grafics to a separate surface and then use DRAWSPRITE with this screen to draw it scrolling over the screen.
« Last Edit: 2009-Jun-06 by Moru »

Offline PeeJay

  • Mr. Polyvector
  • ***
  • Posts: 244
    • View Profile
    • PeeJays Remakes
Re: BLIT command
« Reply #2 on: 2009-Jun-06 »
It may also be worth looking at the POLYVECTOR command for drawing parts of a graphic ....
www.peejays-remakes.co.uk
For games, remakes, and GL Basic Tutorials
Artificial Intelligence is no match for Natural Stupidity

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1635
  • Particle Hawk
    • View Profile
Re: BLIT command
« Reply #3 on: 2009-Jun-06 »
Yes, POLYVECTOR handles an image with the texture coordinates, and color masking.

Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10713
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: BLIT command
« Reply #4 on: 2009-Jun-07 »
Or!
VIEWPORT x,y,w,h
DRAWSPRITE id, -x1, -y2
VIEWPORT 0,0,0,0

Offline AMC

  • Mc. Print
  • *
  • Posts: 5
  • I bought it for my GP2x...
    • View Profile
Re: BLIT command
« Reply #5 on: 2010-Aug-07 »
Thanks for all the help guys - sorted it!

BTW PeeJay, if you fancy a look at a remake of Boulderdash (Rock) goto www.amc.eclipse.co.uk - it is 15 years old and is coded 99% in assembler with a bit of Turbo Pascal to set up the memory model - also the sound doesn't work under XP, as we coded the SB16 directly. (69k download) but it is cool! - Wiki/Google the other (maybe main) coder - Leslie Benzies. R*

Any comments on a 15 year old bit of code would be quite interesting... (My brother & I are thinking of converting it to GLBasic).

*AMC*
XOR AX,AX - A Fast Zero... (Those were the days...)

Offline AMC

  • Mc. Print
  • *
  • Posts: 5
  • I bought it for my GP2x...
    • View Profile
Re: BLIT command
« Reply #6 on: 2010-Aug-21 »
Sorry Guys, I should have posted the reply I got from Gernot directly.
Here is his code...

CREATESCREEN 1,101,512,512 // make offscreen 1 512x512 and bind to sprite id 101
USESCREEN 1 // draw to sprite 101, offscreen 1
DRAWRECT 0,0,32,32,RGB(12,12,12) // draw
USESCREEN -1 // draw on back buffer
DRAWSPRITE 101, 55,55 // paste the rendered sprite
SHOWSCREEN
MOUSEWAIT

Hope my post helped others!

*AMC*
XOR AX,AX - A Fast Zero... (Those were the days...)