Jump to content
IGNORED

basic compiler


rocky007

Recommended Posts

Yeah, I encountered a bug in the compiler but I had a true TI-BASIC program (no multistatement, no logic in THEN). The problem I found was it didn't properly alter something in CALL KEY. If you stick to BASIC rules, I found nothing else...

 

Since I won't be doing any more BASIC programming - I won't be using the compiler anymore.

 

If I ever get free time again, I'll probably be checking out MLC or GCC (when we get libraries).... I can't use anything that's not released to Public Domain... So Kull's is out of the question, as intriguing as it sounds.

 

-H

Link to comment
Share on other sites

Maybe its a bug in the compiler.

 

Try this as an experiment:

 

192 A=C(1):: IF A=31 THEN A=1:: C(1)=A

 

Repeat this for c(2) to c(5)

 

Let us know what happens.

 

I tried it, and it still locked as soon as the characters hit column 31. Another compiler that works with XB has been suggested, and this may be a way out. But in the long term, I think my syntax needs to be more Assembler friendly on the whole, I know nothing of Assembly, but I can imagine that it is maybe structured a little differently to XB and there's something I'm doing wrong.

 

TI Puck from Vorticon worked perfectly. I downloaded the TI Basic version and compiled it myself to check. The whole game runs no problem. I even added a "FOR DE=1 to 250::NEXT DE" just after the "CALL KEY" routine, to slow it down!

 

I just don't get it. It's baffling. Thankyou for you're feedback :)

Link to comment
Share on other sites

Yeah, I encountered a bug in the compiler but I had a true TI-BASIC program (no multistatement, no logic in THEN). The problem I found was it didn't properly alter something in CALL KEY. If you stick to BASIC rules, I found nothing else...

 

Since I won't be doing any more BASIC programming - I won't be using the compiler anymore.

 

If I ever get free time again, I'll probably be checking out MLC or GCC (when we get libraries).... I can't use anything that's not released to Public Domain... So Kull's is out of the question, as intriguing as it sounds.

 

-H

 

It certainly doesnt like anything with any complexity to it. I've yet to write a program that will work, that actually has more than just sped up print statements. I'll get there in the end. :)

Link to comment
Share on other sites

Man, great news!!! :) Yep-- the first successful assembly experience is cool. :) Can't wait to play your game. Tursi came up with a way to put these assembly EA5 programs from Wilhelm's compiler into cart form. :)

That made my ears prick up ..... sounds interesting , putting EA5 into cart. Please point me in the right direction of Tursi's thread on this? :)

Link to comment
Share on other sites

HA! XB Compilers... Pussies! :P

 

Real men do it in FORTH :D

 

FORGET X
23 VALUE X
1 VALUE C1
4 VALUE C2
8 VALUE C3
12 VALUE C4

35 CONSTANT FROG
36 CONSTANT CAR

: SETUP
 1 GMODE \ 32 COLUMN MODE
 17 4 DO I 15 1 COLOR LOOP \ SET COLORS
 HEX  DATA 4 1899 7E3C 3CBD FF5A  DECIMAL  FROG DCHAR
 HEX  DATA 4 66FF DBDB DBDB FF66  DECIMAL  CAR  DCHAR ;

: DRAW-FROG
 X 11 FROG 1 HCHAR ;
 
: MOVE-CARS
 12 C1 32 1 HCHAR  C1 1+ 32 MOD TO C1  12 C1 CAR 1 HCHAR
 14 C2 32 1 HCHAR  C2 1+ 32 MOD TO C2  14 C2 CAR 1 HCHAR
 16 C3 32 1 HCHAR  C3 1+ 32 MOD TO C3  16 C3 CAR 1 HCHAR
 18 C4 32 1 HCHAR  C4 1+ 32 MOD TO C4  18 C4 CAR 1 HCHAR ;
 
: MOVE-FROG
 KEY? 
 CASE
   69 OF 
     X 11 32 1 HCHAR
     -1 +TO X
   ENDOF
   88 OF
     X 11 32 1 HCHAR
     X 1+ DUP 24 = IF DROP 23 THEN TO X
   ENDOF
 ENDCASE ;
 
: FINISHED?
 X IF FALSE ELSE ." WELL DONE!" TRUE THEN ;
   
: DEAD?
 X 11 GCHAR
 CAR = IF
   ." YOU'RE DEAD!" TRUE 
 ELSE 
   FALSE
 THEN ;

: RUN
 SETUP  23 TO X
 BEGIN
   DRAW-FROG  
   MOVE-FROG  
   MOVE-CARS  
   DEAD?  FINISHED?  OR
 UNTIL CR ;

http://www.youtube.com/watch?v=W2UXBasc8jw

 

Don't be afraid to ask questions if you want to know how the code works!

 

Mark

  • Like 1
Link to comment
Share on other sites

HA! XB Compilers... Pussies! :P

 

Real men do it in FORTH :D

 

FORGET X
23 VALUE X
1 VALUE C1
4 VALUE C2
8 VALUE C3
12 VALUE C4

35 CONSTANT FROG
36 CONSTANT CAR

: SETUP
 1 GMODE \ 32 COLUMN MODE
 17 4 DO I 15 1 COLOR LOOP \ SET COLORS
 HEX  DATA 4 1899 7E3C 3CBD FF5A  DECIMAL  FROG DCHAR
 HEX  DATA 4 66FF DBDB DBDB FF66  DECIMAL  CAR  DCHAR ;

: DRAW-FROG
 X 11 FROG 1 HCHAR ;
 
: MOVE-CARS
 12 C1 32 1 HCHAR  C1 1+ 32 MOD TO C1  12 C1 CAR 1 HCHAR
 14 C2 32 1 HCHAR  C2 1+ 32 MOD TO C2  14 C2 CAR 1 HCHAR
 16 C3 32 1 HCHAR  C3 1+ 32 MOD TO C3  16 C3 CAR 1 HCHAR
 18 C4 32 1 HCHAR  C4 1+ 32 MOD TO C4  18 C4 CAR 1 HCHAR ;
 
: MOVE-FROG
 KEY? 
 CASE
   69 OF 
     X 11 32 1 HCHAR
     -1 +TO X
   ENDOF
   88 OF
     X 11 32 1 HCHAR
     X 1+ DUP 24 = IF DROP 23 THEN TO X
   ENDOF
 ENDCASE ;
 
: FINISHED?
 X IF FALSE ELSE ." WELL DONE!" TRUE THEN ;
   
: DEAD?
 X 11 GCHAR
 CAR = IF
   ." YOU'RE DEAD!" TRUE 
 ELSE 
   FALSE
 THEN ;

: RUN
 SETUP  23 TO X
 BEGIN
   DRAW-FROG  
   MOVE-FROG  
   MOVE-CARS  
   DEAD?  FINISHED?  OR
 UNTIL CR ;

http://www.youtube.com/watch?v=W2UXBasc8jw

 

Don't be afraid to ask questions if you want to know how the code works!

 

Mark

Willsy you truly are a legend! :cool:

Forth!!!!!!! Well, this is actually swinging me away from Assembler compilers ..... All I need is this sort of thing, you know,

Forth source, and you took my game and did this. Man , May The Forth by with you!

 

How would you slow down the game ... what is the Forth equivelant to "For A=1 to 50::next A" ? :)

Link to comment
Share on other sites

How would you slow down the game ... what is the Forth equivelant to "For A=1 to 50::next A" ? :)

 

50 FOR NEXT

 

But probably better to put it into it's own routine. A value of about 500 seems about right...

 

: DELAY 500 FOR NEXT ;

 

I also switched MOVE-FROG and DRAW-FROG around. Much better movement now... I didn't notice before as it was all a bit too fast...!

 

Mark :D

 

23 VALUE X
1 VALUE C1
4 VALUE C2
8 VALUE C3
12 VALUE C4

35 CONSTANT FROG
36 CONSTANT CAR

: SETUP
 1 GMODE \ 32 COLUMN MODE
 17 4 DO I 15 1 COLOR LOOP \ SET COLORS
 HEX  DATA 4 1899 7E3C 3CBD FF5A  DECIMAL  FROG DCHAR
 HEX  DATA 4 66FF DBDB DBDB FF66  DECIMAL  CAR  DCHAR ;

: DRAW-FROG
 X 11 FROG 1 HCHAR ;
 
: MOVE-CARS
 12 C1 32 1 HCHAR  C1 1+ 32 MOD TO C1  12 C1 CAR 1 HCHAR
 14 C2 32 1 HCHAR  C2 1+ 32 MOD TO C2  14 C2 CAR 1 HCHAR
 16 C3 32 1 HCHAR  C3 1+ 32 MOD TO C3  16 C3 CAR 1 HCHAR
 18 C4 32 1 HCHAR  C4 1+ 32 MOD TO C4  18 C4 CAR 1 HCHAR ;
 
: MOVE-FROG
 KEY? 
 CASE
   69 OF 
     X 11 32 1 HCHAR
     -1 +TO X
   ENDOF
   88 OF
     X 11 32 1 HCHAR
     X 1+ DUP 24 = IF DROP 23 THEN TO X
   ENDOF
 ENDCASE ;
 
: FINISHED?
 X IF FALSE ELSE ." WELL DONE!" TRUE THEN ;
   
: DEAD?
 X 11 GCHAR
 CAR = IF
   ." YOU'RE DEAD!" TRUE 
 ELSE 
   FALSE
 THEN ;
 
: DELAY
 500 FOR NEXT ;

: RUN
 SETUP  23 TO X
 BEGIN
   MOVE-FROG  
   DRAW-FROG  
   MOVE-CARS  
   DELAY
   DEAD?  FINISHED?  OR
 UNTIL CR ;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...