FAQ  •  Register  •  Login

BiFrost Multicolour engine.

<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Wed Jul 18, 2012 7:44 pm

Re: BiFrost Multicolour engine.

it still has the same error

what language do you use to create BorIDE, does it allow you to ask for full admin rights on startup?
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Wed Jul 18, 2012 9:30 pm

Re: BiFrost Multicolour engine.

slenkar wrote:it still has the same error

what language do you use to create BorIDE, does it allow you to ask for full admin rights on startup?


Strange, I will check it further. Want anyway to add BiFrost Engine to binary library too.

I use PureBasic 4.61 with GoScintilla to create BorIDE.
No, it does not have the abiliity to ask for full admin rights. Click with right mouse button on BorIDE icon, select "Compatibility" and check "Execute as administrator".

I see a problem with the Include: it looks like some adresses can collide with heap (64995, 65012). Crash can occur if strings are used. Not very good style of coding in the demo: No labels but line numbers... GO SUB instead of GOSUB (This is not compatible with folding as SUB is a folding keyword. Must fix this
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Thu Jul 19, 2012 8:37 pm

Re: BiFrost Multicolour engine.

Hi,

I only noticed this thread now! I don't have much experience with BorIDE but let me see if I can help on everything else...

slenkar wrote:Also when I compile this with the command line

it says 'I FOR without NEXT' on the speccy

I could not reproduce this problem. Can you provide the complete error message?

Did you modify the demo code anyhow?

What version of ZX BASIC you are using?

Notice you must download file BIFROSTENGINEV1.2_BorielZXBasicInterface.zip from http://www.worldofspectrum.org/infoseekid.cgi?id=0027405, extract both BAS files to ZX BASIC "dist" folder, then compile it using the command line specified at the beginning of the BAS file:

zxb.exe bifrostdem.bas -T -B

slenkar wrote:it says I have to use this loader

' 10 CLEAR 32767
' 20 LOAD "bifrostdem"CODE
' 30 LOAD "TILES"CODE
' 40 LOAD "BIFROST*"CODE
' 50 RANDOMIZE USR 32768

how do I do this automatically with the emulator?

I suggest creating a snapshot with most code blocks already loaded in memory, except for your own code. I previously wrote about it here:

http://www.worldofspectrum.org/forums/showthread.php?p=640647#post640647
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Thu Jul 19, 2012 9:22 pm

Re: BiFrost Multicolour engine.

LCD wrote:I see a problem with the Include: it looks like some adresses can collide with heap (64995, 65012). Crash can occur if strings are used.

No, this is not a problem at all. This was previously discussed at http://www.worldofspectrum.org/forums/showpost.php?p=608597&postcount=59 .

Also notice that if a program crashes because it doesn't have enough free memory (heap space) to process strings, then simply changing the order of routines (such as if BIFROST* was placed at the beginning instead of end of memory) won't magically increase the amount of free memory left :)

LCD wrote:Not very good style of coding in the demo: No labels but line numbers... GO SUB instead of GOSUB

This is intentional. The demo is supposed to be easy to understand for ZX-Spectrum programmers that are familiar with Sinclair BASIC but not with ZX BASIC. So I wrote it as close to Sinclair BASIC as possible. This is also the reason the demo doesn't use sub-routines and such.

The interface library itself is a different matter obviously.

LCD wrote:(This is not compatible with folding as SUB is a folding keyword. Must fix this

Please do so. This syntax is perfectly valid in ZX BASIC, thus BorIDE is supposed to recognize it accordingly.

And I will resist making any jokes about problems with BorIDE not being a very good style of coding either :) :) :)
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Thu Jul 19, 2012 9:55 pm

Re: BiFrost Multicolour engine.

I got the error on the speccy because I didnt use the loader, I will try the snapshot idea next time im doing speccy coding, thanks for the help
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Thu Jul 19, 2012 10:31 pm

Re: BiFrost Multicolour engine.

slenkar wrote:I got the error on the speccy because I didnt use the loader, I will try the snapshot idea next time im doing speccy coding, thanks for the help

You are welcome!
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Thu Jul 19, 2012 11:20 pm

Re: BiFrost Multicolour engine.

einar wrote:
LCD wrote:Not very good style of coding in the demo: No labels but line numbers... GO SUB instead of GOSUB

This is intentional. The demo is supposed to be easy to understand for ZX-Spectrum programmers that are familiar with Sinclair BASIC but not with ZX BASIC. So I wrote it as close to Sinclair BASIC as possible. This is also the reason the demo doesn't use sub-routines and such.

Even a better reason to introduce them to proper use ;).
einar wrote:The interface library itself is a different matter obviously.

Already found it out. Excellent work!
einar wrote:
LCD wrote:(This is not compatible with folding as SUB is a folding keyword. Must fix this

Please do so. This syntax is perfectly valid in ZX BASIC, thus BorIDE is supposed to recognize it accordingly.

Okay, in the next version any SUB and FUNCTION that are folded must start from beginn of the line. No spaces or tabs in front of them are allowed, or it will be not recognised as foldable part. ASM will work as expected on the other side.
Also tried to make 8x1 Attributes mode for Painter for designing the Tiles. I hope, you will allow to include the binaries of BiFrost in the Binary Library for easier usage of the engine, when I'm done.
einar wrote:And I will resist making any jokes about problems with BorIDE not being a very good style of coding either :) :) :)

You can make this kind of jokes.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Fri Jul 20, 2012 1:27 am

Re: BiFrost Multicolour engine.

LCD wrote:Even a better reason to introduce them to proper use ;).

Another reason is that BIFROST* also provides exactly the same demo in Sinclair BASIC. I wanted to make it easier for people to compare both versions, to make it easier to recognize the (small) differences from Sinclair BASIC to ZX BASIC, somewhat as an incentive for programmers to try ZX BASIC.

LCD wrote:Already found it out. Excellent work!

Thank you!

LCD wrote:Okay, in the next version any SUB and FUNCTION that are folded must start from beginn of the line. No spaces or tabs in front of them are allowed, or it will be not recognised as foldable part. ASM will work as expected on the other side.

Seems like a good solution to this issue.

LCD wrote:Also tried to make 8x1 Attributes mode for Painter for designing the Tiles.

This is great, thank you!

LCD wrote:I hope, you will allow to include the binaries of BiFrost in the Binary Library for easier usage of the engine, when I'm done.

Sure, go ahead.

LCD wrote:You can make this kind of jokes.

But I will make no more jokes, I was just getting my revenge against your original comment :)
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Fri Jul 20, 2012 3:47 am

Re: BiFrost Multicolour engine.

when i type in 20 LOAD "TILES"CODE
into the speccy it shows a question mark, like I typed in the wrong thing

When I type in 10 CLEAR 32767 it accepts the code and prints it to the top of the screen as normal
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Fri Jul 20, 2012 3:06 pm

Re: BiFrost Multicolour engine.

slenkar wrote:when i type in 20 LOAD "TILES"CODE
into the speccy it shows a question mark, like I typed in the wrong thing

When I type in 10 CLEAR 32767 it accepts the code and prints it to the top of the screen as normal


It seems you are typing C-O-D-E as 4 different letters, instead of pressing Caps+Symbol then key "i" for the CODE keyword.
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Tue Jul 24, 2012 3:07 am

Re: BiFrost Multicolour engine.

thanks that worked, do you know of a good speccy emulator that lets you insert a tape without resetting the spectrum?
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Tue Jul 24, 2012 2:24 pm

Re: BiFrost Multicolour engine.

slenkar wrote:thanks that worked, do you know of a good speccy emulator that lets you insert a tape without resetting the spectrum?


All emulators allow you to do it, you just need to select the proper settings.
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Tue Jul 24, 2012 8:51 pm

Re: BiFrost Multicolour engine.

ok I used jSpeccy

I loaded the basic code into the emulator and it appeared on the screen
then I pressed 'run'
inserted the bifrost DEMO tape from world of spectrum
it loaded the tiles

it also loaded bifrost* which is the engine correct?

then
inserted the bifrostdem tape that I compiled from boriels zxbasic
press play on tape
and it runs! I inserted my name to make sure I was doing it right



Image



I decided to make a simple program so I can experiment poking values, to change the tiles,

here is my code:
  Code:
#include "bifrost.bas"
POKE Uinteger 48500, @MyUdgBlock
INK 5: PAPER 0: BORDER 0: CLS
PRINT INK 6;AT 4,22;"slenkars";AT 5,23;"ENGINE";AT 6,24;"DEMO"; INK 4; AT 10,24;"WITH";AT 11,23;"BORIEL";AT 12,22;"ZX-BASIC"
   BIFROSTstart()

While 1
LET a$=INKEY$
IF a<>"" THEN
BIFROSTsetTile(0, 0, 0)
BIFROSTsetTile(0, 1, 1)
BIFROSTsetTile(0, 2, 2)
BIFROSTsetTile(0, 3, 3)
BIFROSTsetTile(1, 0, 4)
BIFROSTsetTile(1, 1, 5)
BIFROSTsetTile(1, 2, 6)
BIFROSTsetTile(1, 3, 7)

PRINT INK 6;AT 4,22;"slenkars";AT 5,23;"you";AT 6,24;"pressed"; INK 4; AT 10,24;"a";AT 11,23;"Button";
END IF
Wend


 STOP : REM Avoid execution to enter this zone
MyUdgBlock: REM a simple Label; @Label returns it's memory address
'some bytes
ASM
defb 255,129,129,129,129,129,129,255
defb 231,231,165,231,189,231,165,255
defb 0,248,190,255,127,255,213,255
END ASM


it looks like this:
Image
which weird because I didnt put any tiles on the screen in my code

but anyway, when I press a key the tiles change correctly,
but they dont look any different,
it seems my POKE didnt make any difference


doing this seems to work:
  Code:
POKE Uinteger 48500,1
POKE Uinteger 48501,2
POKE Uinteger 48502,3
POKE Uinteger 48503,4
POKE Uinteger 48504,5
POKE Uinteger 48505,6
POKE Uinteger 48506,7
POKE Uinteger 48507,8
POKE Uinteger 48508,9
POKE Uinteger 48509,1
POKE Uinteger 48510,2
POKE Uinteger 48511,3
POKE Uinteger 48512,4
POKE Uinteger 48513,5
POKE Uinteger 48514,6
POKE Uinteger 48515,7
POKE Uinteger 48516,8
POKE Uinteger 48517,9


is there a better way of inputting the data?
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Wed Jul 25, 2012 3:43 pm

Re: BiFrost Multicolour engine.

slenkar wrote:it also loaded bifrost* which is the engine correct?

Correct.


slenkar wrote:
  Code:
POKE Uinteger 48500, @MyUdgBlock

This line is wrong. If you want to set the address of your tile images, try this:
  Code:
BIFROSTresetTileImages(@MyUdgBlock)


slenkar wrote:it looks like this:
Image
which weird because I didnt put any tiles on the screen in my code

But you didn't clear the tile map either, thus the engine is rendering whatever garbage was left there when your program starts.

slenkar wrote:but anyway, when I press a key the tiles change correctly,
but they dont look any different,
it seems my POKE didnt make any difference

It's due to your incorrect POKE I mentioned above.

slenkar wrote:doing this seems to work:
  Code:
POKE Uinteger 48500,1
POKE Uinteger 48501,2
POKE Uinteger 48502,3
POKE Uinteger 48503,4
POKE Uinteger 48504,5
POKE Uinteger 48505,6
POKE Uinteger 48506,7
POKE Uinteger 48507,8
POKE Uinteger 48508,9
POKE Uinteger 48509,1
POKE Uinteger 48510,2
POKE Uinteger 48511,3
POKE Uinteger 48512,4
POKE Uinteger 48513,5
POKE Uinteger 48514,6
POKE Uinteger 48515,7
POKE Uinteger 48516,8
POKE Uinteger 48517,9

You should not use Uinteger in this case, besides this is not a good way to do it anyway.


slenkar wrote:is there a better way of inputting the data?

Either use BIFROSTresetTileImages(@MyUdgBlock) as I mentioned above, or save the tiles separately on tape replacing the original "TILES" block.
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Wed Jul 25, 2012 4:44 pm

Re: BiFrost Multicolour engine.

thanks
PreviousNext

Return to ZX Basic Compiler

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO