English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 30 August 2013, 08:41   #21
diablothe2nd
Registered User
 
Join Date: Dec 2011
Location: Northamptonshire, UK
Age: 41
Posts: 1,236
start a new text file, and just put enough in to enter blitz mode and display "hello world" or whatever (ie setting up the bitplanes etc), then progressively add more and more of your code into that file until it breaks, then you know where the problems lie

remember also some Functions wont work in Blitz Mode and vice versa

if you can give us more info, like your source code, or a snippet of, we may be able to help further
diablothe2nd is offline  
Old 30 August 2013, 23:32   #22
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Some good news - got a blit to work. Hadn't realised I needed to create a slice as well as a bitmap.

But program crashes in Blitz mode and there seems no way out. Any suggestions on debugging Blitz mode. I have obviously remmed out procedures but they all worked in Amiga mode but crash in Blitz.
Havie is offline  
Old 31 August 2013, 00:56   #23
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
ok - making progress now. What have I learnt:

Print needs a BITMAPOUT command and edit$ needs BLITZKEYS on and BITMAPINPUT.

These commands then made my AMIGA mode game run in BLITZ as it was hanging on the print statements, keyboard presses and edit$ command (which really needs to be taken out).

Have now got my map dipslaying using BOBs instead of ASCII characters. Just need to sort out the conversion from 8*8 characters to 16*16 characters over a different screen size and it should start to come together altough I that instead of redrawing the screen each time (which must be a bit slow) I will draw a superbitmap at the beginning and scroll this around. This will also give me the advantage or smooth scrolling and clipping of BOBs.

More to follow...
Havie is offline  
Old 31 August 2013, 10:02   #24
diablothe2nd
Registered User
 
Join Date: Dec 2011
Location: Northamptonshire, UK
Age: 41
Posts: 1,236
ahh yes, you need to state and call those. sorry, i forgot about that


dont forget to use the backbuffer. you write to the backbuffer and flip it using a loop

Code:
while key 1=0 ;while escape key not pressed
  do stuff
  send to back buffer
  FLIP
wend

i forget the keyboard code and syntax for calling it, but you get the idea

this should then stop your bob tearing/clipping
diablothe2nd is offline  
Old 31 August 2013, 21:23   #25
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by diablothe2nd View Post
ahh yes, you need to state and call those. sorry, i forgot about that


dont forget to use the backbuffer. you write to the backbuffer and flip it using a loop

Code:
while key 1=0 ;while escape key not pressed
  do stuff
  send to back buffer
  FLIP
wend

i forget the keyboard code and syntax for calling it, but you get the idea

this should then stop your bob tearing/clipping
How is this different from using two screens and double buffering?
Havie is offline  
Old 31 August 2013, 21:28   #26
diablothe2nd
Registered User
 
Join Date: Dec 2011
Location: Northamptonshire, UK
Age: 41
Posts: 1,236
that is double buffering

http://www.blitzbasic.com/bpdocs/command.php?name=Flip

more here about the back buffer

http://www.blitzbasic.com/b3ddocs/co...ame=BackBuffer
diablothe2nd is offline  
Old 01 September 2013, 21:31   #27
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by diablothe2nd View Post
ahh yes, you need to state and call those. sorry, i forgot about that


dont forget to use the backbuffer. you write to the backbuffer and flip it using a loop

Code:
while key 1=0 ;while escape key not pressed
  do stuff
  send to back buffer
  FLIP
wend

i forget the keyboard code and syntax for calling it, but you get the idea

this should then stop your bob tearing/clipping
I think you are muddling BB2 and PC Blitz Basic? I don't think BB2 has a buffer hence the need to run double buffering code. Anyway, this set me thinking and I decided on a slight detour. I looked through my PC Blitz code and found a routine to convert to BB2. My criteria was that it had to be something simple and short! So attached is a 3D star routine ported from PC to Amiga Blitz (my first ever port). (Apologises for using zips - haven't set up lha yet). Both zips contain the Blitz code and a executable file).

Now there is a bit of difference between the routines - PC starts get lighter, are different sizes and there are 9950 more but the Amiga routine has been converted from the PC one. The Amiga seems to struggle with mor than 50 stars, I though using plot would be the quickest (compared to boxf) and I have made no effect to make the stars darker/lighter. I am surprised that by how slow the routine is but there doesn't seem to be a lot that I can change to speed it up (short of rewriting it and that wasn't the point). There are a few calcuations that could be precalculated but that's it as far as I can see (not that I'm the best coder in the world). I suppose you forget the difference between a 68020@16mhz (or even in my case a 68030@50mhz) and a cored2duo at 3ghz - must be an order of atleast 50000x quicker???

Anyway, give it a whirl...and I might be inspired to try and port a few of my PC Blitz games. Unfortunately my website is down at the moment but you can find some of my games here:

http://www.brothergames.com/pc/devel...avsoft-155033/

Any request?
Attached Files
File Type: zip 3d stars pc.zip (598.6 KB, 159 views)
File Type: zip 3d Stars Amiga.zip (22.8 KB, 167 views)

Last edited by Havie; 01 September 2013 at 21:48. Reason: Can't type for toffee!
Havie is offline  
Old 01 September 2013, 21:42   #28
diablothe2nd
Registered User
 
Join Date: Dec 2011
Location: Northamptonshire, UK
Age: 41
Posts: 1,236
oh darn, you're right. I code in both now and the amount of times i get the two mixed/confused is shocking !

there is, for sure, though a similar command to FLIP in Blitz 2.... i'll have to dig out my manual.
diablothe2nd is offline  
Old 01 September 2013, 21:54   #29
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Forgot to add the code to download - now added.

You don't FLIP - you USE BITMAP. This is the code that is equivalent to FLIP:

DISPLAYBITMAP db: db=1-db: USE BITMAP db

(Don't forget to set up 2 identical bitmaps 0 and 1).

Last edited by Havie; 01 September 2013 at 22:03. Reason: More muppet typing...
Havie is offline  
Old 01 September 2013, 22:05   #30
diablothe2nd
Registered User
 
Join Date: Dec 2011
Location: Northamptonshire, UK
Age: 41
Posts: 1,236
you're right.just double checked my blitz 2 manual

this is cool cos it's refreshing my memory too
diablothe2nd is offline  
Old 08 September 2013, 09:15   #31
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Being do a little more work on my game. I have just about got 8 way scrolling working from my map data. Need to experiment with screen size as presently I have a border round the screen to keep the scrolling smooth. I will try removing teh border and using a screen within screen technique.

Also, will tidy up the original code which runs on workbench using ASCII characters and upload when I get a chance.
Havie is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blitz Basic 2.1 + CD ROM musashi5150 MarketPlace 3 08 July 2009 08:53
Blitz Basic 1 & 2 Twiggy Coders. General 14 21 February 2009 15:29
blitz basic petza request.Apps 11 08 April 2007 01:49
Blitz Basic 2 anyone? jobro request.Apps 12 28 November 2005 18:15
Blitz Basic 2 LaundroMat Retrogaming General Discussion 5 24 July 2001 08:10

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:39.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11584 seconds with 16 queries