28 April 2013, 13:44 | #1 |
Registered User
Join Date: Dec 2012
Location: Ferrol / A Coruna / Spain
Posts: 14
|
Blitz2 blit and block statements inside procedures
Hi!
As i keep on learning Blitz2 and try different things out, i have the following code Code:
; init code and img loading & shape adquiring... ; now the problematic code: statement paintmap{bitmapnum, startx, starty} shared map() use bitmap bitmapnum for y=0 to 15 for x=0 to 19 blit map.b(startx + x, starty + y), x asl 4, y asl 4 next next end statement blitz slice 0,44,320,256,$fff8,5,8,32,320,320 paintmap{0,mapx,mapy} show 0 use palette 0 mousewait end I managed to get the above example working replacing the procedure paintmap with a subroutine: .paintmap: all the same code as in the procedure return And now it runs ok... but i would preffer to use procedures instead of subroutines... Any ideas? :-) |
28 April 2013, 18:16 | #2 |
Registered User
Join Date: Oct 2011
Location: UK
Age: 47
Posts: 304
|
Just a shot in the dark, but is that a compile time error? Is it simply because blitz expects a Blit command after a BLITZ call in the program listing - even though it's in a statement?
|
29 April 2013, 00:50 | #3 |
Moderator
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 37
Posts: 11,167
|
It's a runtime error, I had the same thing recently. Basically though you're right - you'll need to ensure that the BLITZ command is before your statement code. It's a bit strange it works like that but that solved the problem for me.
|
29 April 2013, 02:19 | #4 |
Registered User
Join Date: Dec 2012
Location: Ferrol / A Coruna / Spain
Posts: 14
|
I see... the thing is that i was choosing to use procedures instead of subroutines to have a clear code, in a more organized way, but this way i would have procedures all over my code, before and after mode changes... this is ridiculous :-D
I'll keep using subroutines then |
29 April 2013, 08:36 | #5 |
Moderator
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 37
Posts: 11,167
|
Not necessarily. What might work is if you have certain routines that you use in Blitz mode, and some in Amiga mode, precede all the Blitz mode statements with the BLITZ command and then put all your Amiga mode statements under the AMIGA command. Preferably put them right at the top of your code.
I agree it is ridiculous, it surely must be a bug in Blitz. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blitz2: Hires laced | BippyM | Coders. Language | 25 | 06 February 2020 01:07 |
Blitz2 Newcommandset | BippyM | Coders. Language | 0 | 21 July 2012 23:59 |
Can amiblitz (blitz basic2) blit an image per bitplane? | Michael Parent | Coders. General | 7 | 29 October 2009 17:59 |
Blitz2 Manual | AlfaRomeo | Amiga scene | 18 | 01 May 2009 10:53 |
uninstall procedures? | Mojo2000 | New to Emulation or Amiga scene | 5 | 26 January 2003 21:01 |
|
|