Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BiFrost Multicolour engine.
#16
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?
Reply
#17
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!
Reply
#18
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/infoseeki...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/sh...post640647
Reply
#19
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/sh...stcount=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 Smile

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 Smile Smile Smile
Reply
#20
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
Reply
#21
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!
Reply
#22
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 Wink.
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 Smile Smile Smile
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!
Reply
#23
LCD Wrote:Even a better reason to introduce them to proper use Wink.
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 Smile
Reply
#24
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
Reply
#25
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.
Reply
#26
thanks that worked, do you know of a good speccy emulator that lets you insert a tape without resetting the spectrum?
Reply
#27
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.
Reply
#28
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: giY47.png]



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: O2Bgr.png]
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?
Reply
#29
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: O2Bgr.png]
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.
Reply
#30
thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)