FAQ  •  Register  •  Login

BiFrost Multicolour engine.

<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Wed Jul 25, 2012 6:00 pm

Re: BiFrost Multicolour engine.

slenkar wrote:thanks

You are welcome!
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Wed Jul 25, 2012 6:55 pm

Re: BiFrost Multicolour engine.

ok I tried this code:
  Code:
#include "bifrost.bas"

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()
   BIFROSTresetTileImages(@MyUdgBlock)


While 1
LET a$=INKEY$
IF a<>"" THEN
BIFROSTsetTile(0, 0, 0)
BIFROSTsetTile(0, 1, 0)
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

MyUdgBlock:
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


but the jester sprite doesnt look any different
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Wed Jul 25, 2012 7:53 pm

Re: BiFrost Multicolour engine.

slenkar wrote:but the jester sprite doesnt look any different

Please download all BIFROST* files (and library) again. There was an error in BIFROSTresetTileImages that I fixed last night, this should solve your problem.
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Wed Jul 25, 2012 11:06 pm

Re: BiFrost Multicolour engine.

is it still randomize usr 32768?

the game doesnt start when I load the tape anymore
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Wed Jul 25, 2012 11:35 pm

Re: BiFrost Multicolour engine.

slenkar wrote:is it still randomize usr 32768?

Yes.

slenkar wrote:the game doesnt start when I load the tape anymore

I just compiled and executed your latest program above using all files from "BIFROSTENGINEV1.2L_BorielZXBasicInterface.zip" and it worked as expected. It shows weird images in the multicolor area, but it's just because the tile images data you declared are not a real image.

Then I repeated all this process using "BIFROSTENGINEV1.2H_BorielZXBasicInterface.zip" and the result was exactly the same.

Perhaps you are compiling your program with one version but trying to run it using another?
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Fri Jul 27, 2012 11:04 pm

Re: BiFrost Multicolour engine.

I still cant get it to work, did you upload the right files?

I attached the snapshot I made after I entered the code for the loader
Attachments
codesnap.sna
(48.03 KiB) Downloaded 273 times
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Fri Jul 27, 2012 11:15 pm

Re: BiFrost Multicolour engine.

slenkar wrote:I attached the snapshot I made after I entered the code for the loader

This snapshot doesn't have anything loaded on memory. Neither BIFROST*, tiles, or any ZX BASIC program. There's just the loader program, nothing else.

Try this: delete line 50 from the loader, then run it. It will load everything in memory without executing. Afterwards, take another snapshot and put it here, so I can analyze it and find out what's wrong.

Or perhaps you better describe exactly what you are doing, step by step, so I can identify what you are doing wrong.
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Fri Jul 27, 2012 11:46 pm

Re: BiFrost Multicolour engine.

ok I load the snapshot, then I press RUN
Then I insert the tape bifrost_l.tzx or bifrostdem.tzx (both have the same result)
then it loads tiles, bifrost engine and bifrostdem
then..nothing else happens
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sat Jul 28, 2012 12:18 am

Re: BiFrost Multicolour engine.

slenkar wrote:ok I load the snapshot, then I press RUN
Then I insert the tape bifrost_l.tzx or bifrostdem.tzx (both have the same result)
then it loads tiles, bifrost engine and bifrostdem
then..nothing else happens


Ah! Once I knew the exact problem you had, it was easy to solve it!

The problem is that you typed invalid (hidden) characters between T and * in the word "BIFROST*". Fix it and it will work.

BTW you are not supposed to have a file called "bifrostdem.tzx". The file inside package "BIFROSTENGINEV1.2L_BorielZXBasicInterface.zip" is called "bifrostdem_L.tzx". Are you sure you downloaded the latest version?
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Sat Jul 28, 2012 12:25 am

Re: BiFrost Multicolour engine.

Argh!
The problem is that you typed invalid (hidden) characters between T and * in the word "BIFROST*". Fix it and it will work.


thanks
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Sat Jul 28, 2012 1:21 am

Re: BiFrost Multicolour engine.

small problem:
When I change the position of the tiles to my UDG block the program says OK at the bottom like its finished and then when I press a button I am typing in basic commands,

  Code:

#include "bifrost.bas"

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()
   BIFROSTresetTileImages(@MyUdgBlock)


While 1
LET a$=INKEY$
IF a<>"" THEN
Dim iter as UInteger
for x=0 to 8
for y=0 to 8
BIFROSTsetTile(x, y, iter)
iter=iter+1
next
next

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

MyUdgBlock: REM a simple Label; @Label returns it's memory address
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


this doesnt happen when I do the POKE commands to make sprites




Trying to poke some values for a static sprite:
  Code:

#include "bifrost.bas"

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()
Dim pokepos as Uinteger
pokepos=48500+(BIFROSTSTATIC*64)
POKE pokepos,0
POKE pokepos+1,16
POKE pokepos+2,0
POKE pokepos+3,56
POKE pokepos+4,0
POKE pokepos+5,124
POKE pokepos+6,0
POKE pokepos+7,124
POKE pokepos+8,0
POKE pokepos+9,124
POKE pokepos+10,0
POKE pokepos+11,56
POKE pokepos+12,0
POKE pokepos+13,16
POKE pokepos+14,0
POKE pokepos+15,0
POKE pokepos+16,0
POKE pokepos+17,0
POKE pokepos+18,0
POKE pokepos+19,0
POKE pokepos+20,0
POKE pokepos+21,0
POKE pokepos+22,0
POKE pokepos+23,0
POKE pokepos+24,0
POKE pokepos+25,0
POKE pokepos+26,0
POKE pokepos+27,0
POKE pokepos+28,0
POKE pokepos+29,0
POKE pokepos+30,0
POKE pokepos+31,0

While 1
LET a$=INKEY$
IF a<>"" THEN
Dim iter as UInteger
iter=0
for x=0 to 8
for y=0 to 8
BIFROSTsetTile(x, y,BIFROSTSTATIC+ iter)
iter=iter+1
next
next

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




but none of the sprites look different

also how do you convert ink,paper,bright,flash into a byte?

so far im doing this...
ink value e.g. 011
plus paper value e.g.111
plus bright 1 or 0
plus flash 1 or 0

it doesnt seem to work

by binary to int function must be right because it works for the bitmaps
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sat Jul 28, 2012 10:33 pm

Re: BiFrost Multicolour engine.

I have no idea what you are trying to do in the first program. In particular, notice each tile image takes 64 bytes, but you only defined 24 bytes, thus everything else is filled with garbage.

In your second program, replace this line:
  Code:
pokepos=48500+(BIFROSTSTATIC*64)

with this:
  Code:
pokepos=48500
<<

einar

Posts: 84

Joined: Sun Apr 08, 2012 9:33 pm

Post Sat Jul 28, 2012 10:37 pm

Re: BiFrost Multicolour engine.

slenkar wrote:also how do you convert ink,paper,bright,flash into a byte?

This line below is a copy/paste from "bifrost.bas":
  Code:
'     attr: attribute value (0-255), INK+8*PAPER+64*BRIGHT+128*FLASH
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Sun Jul 29, 2012 12:17 am

Re: BiFrost Multicolour engine.

I have no idea what you are trying to do in the first program. In particular, notice each tile image takes 64 bytes, but you only defined 24 bytes, thus everything else is filled with garbage.



the program shouldnt end though should it?
No matter what bytes are beyond those first 24



einar wrote:In your second program, replace this line:
  Code:
pokepos=48500+(BIFROSTSTATIC*64)

with this:
  Code:
pokepos=48500



Im trying to poke some values into a static sprite,

pokepos=48500+(BIFROSTSTATIC*64)

was my attempt to work out what address to poke to for the first static sprite


64 (bytes per sprite) multiplied by where the static sprites start (128)
<<

slenkar

Posts: 282

Joined: Sun Feb 13, 2011 3:33 am

Location: Kentucky US, used to be Birmingham UK

Post Sun Jul 29, 2012 12:59 am

Re: BiFrost Multicolour engine.

thanks to you giving me the color algorithm I finished the editor
SPACE to save

http://slenkar.herobo.com/brofist/brofist.html

Image
PreviousNext

Return to ZX Basic Compiler

Who is online

Users browsing this forum: No registered users and 2 guests

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

phpBB SEO