Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create and draw graphics
#16
which sprite editor should I use?
Reply
#17
I tried to put the bin import code into a program but it produces errors:
Code:
POKE Uinteger 23675, @MyUdgBlock

BORDER 7 : PAPER 7 : INK 0 : CLS
  PRINT AT 3,13 ; PAPER 1 ; INK 7 ; "BattleField"
  PRINT AT 5,9 ; PAPER 7 ; INK 0 ; "Q - Up"
  PRINT AT 6,9 ; PAPER 7 ; INK 0 ; "A - Down"
  PRINT AT 7,9 ; PAPER 7 ; INK 0 ; "O - Left"
  PRINT AT 8,9 ; PAPER 7 ; INK 0 ; "P - Right"
  PRINT AT 9,9 ; PAPER 7 ; INK 0 ; "M - Select"

  PRINT AT 10,3 ; PAPER 7 ; INK 0 ; "You have to select units"
  PRINT AT 11,3 ; PAPER 7 ; INK 0 ; "to fight the enemy units"
  PRINT AT 15,3 ; PAPER 7 ; INK 0 ; "Press any key to start"

60  LET j$ = INKEY$
  IF j$ = "" THEN GOTO 60: END IF

  Function byterndrange (first As uByte, last As uByte) As uByte
    return Rnd * (last - first) + first
End Function

cls

print at 4,4 ; CHR$(144)

STOP : REM Avoid execution to enter this zone
MyUdgBlock: REM a simple Label; @Label returns it's memory address
ASM      THIS IS LINE 44
#incbin "factory.BIN"
END ASM

Line 44 just says ASM and nothing else

the error is
Quote:snake.bas:44: Error: Syntax error. Unexpected end of line [NEWLINE]
Reply
#18
slenkar Wrote:I tried to put the bin import code into a program but it produces errors:
Code:
MyUdgBlock: REM a simple Label; @Label returns it's memory address
ASM      THIS IS LINE 44
#incbin "factory.BIN"
END ASM

Line 44 just says ASM and nothing else

the error is
Quote:snake.bas:44: Error: Syntax error. Unexpected end of line [NEWLINE]
Aggh! :x It's *another bug* related to the heavy changes I've introduced in version 1.2.7 (beta). Sad
I'm still fixing up your previous bug (you've discovered twice un a week, congratulations!).
I go somewhat slow fixing them 'cause my home computer is OS is partially broken (the Subversion is not working; I hope to fix it up today).

If you are very impatient, you can download and install 1.2.6 (Stable) and remove this one, but I beg you not to do so and wait. Discovering bugs (as you and others have done) is very important for the compiler stability.
Reply
#19
ok I can wait Big Grin

Its pretty fun coding for spectrum,
the fact that it runs on almost any platform is good too,
desktop,cell phone,Nintendo DS,webpage,
Reply
#20
slenkar Wrote:ok I can wait Big Grin

Its pretty fun coding for spectrum,
the fact that it runs on almost any platform is good too,
desktop,cell phone,Nintendo DS,webpage,
The compiler is aimed to be multiplatform. I'm desinging a version to compile into Javscript (Canvas HTML5), so ZX Basic programs could be used to run "on the web". But first thing first: Let's fix this.
Reply
#21
thats good news

But, I mean there is a spectrum emulator for all those platforms I mentioned...

example:
http://jsspeccy.zxdemo.org/
http://www.zophar.net/consoles/nds/sinclair.html
Reply
#22
Aggh, after struggling for hour it turned out the compiler was ok. The INCBIN is an assembler macro command, so it's NOT a preprocessor directive, and must not be preceded by # (sharp). The right syntax is:
Code:
...
Asm
INCBIN "factory.BIN"
End Asm
Anyway, the compiler should tell you that with a more readable error message (which is what I'm currently fixing!). 8)
Try the above and see if it works, please.

On the other hand, I think it would be more coherent to use #incbin "file" instead?? What do you think?

Update: Now the compiler will report "Invalid preprocessor directive" if you use an unknown #directive
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)