Jump to content

Photo

Alpha 0.2 to 0.3+ code converter


8 replies to this topic

#1 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,680 posts
  • begin 644 contest

Posted Tue Sep 6, 2005 5:42 PM

To hopefully encourage some who are still using 0.2 to use 0.3+, I've whipped up a code converter that (hopefully) automatically converts your bB source code from 0.2 to 0.3. Bit accesses are changed from () to {} and > to >=, and also inverts collisions and bits where workarounds for 0.2 bugs were done (e.g. if a(4) becomes if !a{4} and a(4)=1 becomes a{4}=0)

To use, do this at the command line:

convert2-3<old.bas>new.bas

where old.bas is your "legacy" code and new.bas is the new code to generate.

Source and binary (.exe) included.

If you need to compile the source, do:

lex<convert2-3.lex
gcc -o convert2-3 lex.yy.c

I haven't tried it on everything, so let me know if it works as expected...

EDIT: oops - some bugs in first version I posted. Post with corrections below.

Edited by batari, Tue Sep 6, 2005 9:56 PM.


#2 batari OFFLINE  

batari

    )66]U('=I;B$*

  • Topic Starter
  • 6,680 posts
  • begin 644 contest

Posted Tue Sep 6, 2005 10:00 PM

THis is the corrected version. Tested with Ooze source, compiles and seems to work (except for the fact that 37 bytes needed to be trimmed first, did so by removing pf-scrolling module.) Enjoy!

Attached Files



#3 potatohead OFFLINE  

potatohead

    River Patroller

  • 4,404 posts
  • Location:Portland, Oregon

Posted Tue Sep 6, 2005 11:35 PM

THis is the corrected version.  Tested with Ooze source, compiles and seems to work (except for the fact that 37 bytes needed to be trimmed first, did so by removing pf-scrolling module.)  Enjoy!

View Post


Ok, I'll take the hint! --Thanks. I'll give this a whack soon.

Kind of dismayed about the reduced avaliable space though. I believe the game was floating around ~200 bytes free. Oh well, the functions, improved bit ops and proper gosub should free most of that back.

Need to finish current work project first though. (money first, games second!) Scratch that... I've finally let the drugs wear off. I'm not doing much of anything tomorrow morning. Time to rebuild Ooze.

Edited by potatohead, Wed Sep 7, 2005 1:08 AM.


#4 potatohead OFFLINE  

potatohead

    River Patroller

  • 4,404 posts
  • Location:Portland, Oregon

Posted Wed Sep 7, 2005 1:03 AM

THis is the corrected version.  Tested with Ooze source, compiles and seems to work (except for the fact that 37 bytes needed to be trimmed first, did so by removing pf-scrolling module.)  Enjoy!

View Post


Ok, I'll take the hint! --Thanks. I'll give this a whack soon.

Kind of dismayed about the reduced avaliable space though. I believe the game was floating around ~200 bytes free. Oh well, the functions, improved bit ops and proper gosub should free most of that back.

Need to finish current work project first though. (money first, games second!)

View Post


The compiler compiled on Linux, so that's a good sign. Haven't tried the code converter yet, but will soon. The little scripts I wrote to compile things didn't bring me much joy using the included sample.bas file. Which shipped with some bad lines in it... were those for testing?

This is what I was doing for version 0.2:

./2600bas<ooze.bas>sample.asm

cat 2600basic.asm sample.asm 2600basicfooter.asm > test.asm

./dasm test.asm -f3 -oooze.bin

stella ooze.bin

I made the filename change from 2600bas to 2600basic and let the rest go. Before I go posting a bunch of crap, can someone briefly summarize the compile steps? Something has changed and I should know what that is before I start the next version of Ooze in Bb0.35.


I just had some minor surgery that will keep me at home for the next day or two. Just the perfect time to futz with this!

Before I do too much, I'll be reading the help docs this late evening as well to catch up on the many changes discussed over the last few weeks. Man, you think you have a handle on it, but you just don't until the process of using it begins!

Edited by potatohead, Wed Sep 7, 2005 1:04 AM.


#5 potatohead OFFLINE  

potatohead

    River Patroller

  • 4,404 posts
  • Location:Portland, Oregon

Posted Wed Sep 7, 2005 1:11 AM

THis is the corrected version.  Tested with Ooze source, compiles and seems to work (except for the fact that 37 bytes needed to be trimmed first, did so by removing pf-scrolling module.)  Enjoy!

View Post


Sorry to ask, but can I get the source so that I can compile for Linux?

If it's messy or whatever, let me know and I'll run it in the win32 environment.

Nevermind... just understood what I was looking at!

Looks like it worked for me first time. I'll get the compile loop done in the morning and go from there! Thanks a bunch for this! I'm not sure how long you spent writing it, but I know I would have spent many hours converting the code manually. Well done and much appreciated.

Edited by potatohead, Wed Sep 7, 2005 1:18 AM.


#6 batari OFFLINE  

batari

    )66]U('=I;B$*

  • Topic Starter
  • 6,680 posts
  • begin 644 contest

Posted Wed Sep 7, 2005 1:15 AM

THis is the corrected version.  Tested with Ooze source, compiles and seems to work (except for the fact that 37 bytes needed to be trimmed first, did so by removing pf-scrolling module.)  Enjoy!

View Post


Ok, I'll take the hint! --Thanks. I'll give this a whack soon.

Kind of dismayed about the reduced avaliable space though. I believe the game was floating around ~200 bytes free. Oh well, the functions, improved bit ops and proper gosub should free most of that back.

Need to finish current work project first though. (money first, games second!)

View Post


The compiler compiled on Linux, so that's a good sign. Haven't tried the code converter yet, but will soon. The little scripts I wrote to compile things didn't bring me much joy using the included sample.bas file. Which shipped with some bad lines in it... were those for testing?

The new sample should compile as-is, the problem is there are more compile steps.

I made the filename change from 2600bas to 2600basic and let the rest go.  Before I go posting a bunch of crap, can someone briefly summarize the compile steps?  Something has changed and I should know what that is before I start the next version of Ooze in Bb0.35.

View Post

EDIT: I said "binary" when I meant "source"

In the source distribution, there is a shell script included that should do what you need, 2600basic.sh I think.

Edited by batari, Wed Sep 7, 2005 1:19 AM.


#7 potatohead OFFLINE  

potatohead

    River Patroller

  • 4,404 posts
  • Location:Portland, Oregon

Posted Wed Sep 7, 2005 1:31 AM

THis is the corrected version.  Tested with Ooze source, compiles and seems to work (except for the fact that 37 bytes needed to be trimmed first, did so by removing pf-scrolling module.)  Enjoy!

View Post


Ok, I'll take the hint! --Thanks. I'll give this a whack soon.

Kind of dismayed about the reduced avaliable space though. I believe the game was floating around ~200 bytes free. Oh well, the functions, improved bit ops and proper gosub should free most of that back.

Need to finish current work project first though. (money first, games second!)

View Post


The compiler compiled on Linux, so that's a good sign. Haven't tried the code converter yet, but will soon. The little scripts I wrote to compile things didn't bring me much joy using the included sample.bas file. Which shipped with some bad lines in it... were those for testing?

The new sample should compile as-is, the problem is there are more compile steps.

I made the filename change from 2600bas to 2600basic and let the rest go.  Before I go posting a bunch of crap, can someone briefly summarize the compile steps?  Something has changed and I should know what that is before I start the next version of Ooze in Bb0.35.

View Post

EDIT: I said "binary" when I meant "source"

In the source distribution, there is a shell script included that should do what you need, 2600basic.sh I think.

View Post


That did the trick. Ran the code converter. It made a coupla mistakes, but nothing major. Got some lines that looked like this p(s{3} = xx. Only two of them, easily fixed.

So it compiles, but is -89 bytes down from ~+154. Not too bad. I think the improved bit operators will help out quite a bit in this area as well as if-then-else will too. I missed those two the most, with a working gosub being a close third. The rest of 0.2 worked nicely for me, IMHO.

First things first though. I'll read the help and see what my options are and go from there.

#8 batari OFFLINE  

batari

    )66]U('=I;B$*

  • Topic Starter
  • 6,680 posts
  • begin 644 contest

Posted Wed Sep 7, 2005 1:33 AM

THis is the corrected version.  Tested with Ooze source, compiles and seems to work (except for the fact that 37 bytes needed to be trimmed first, did so by removing pf-scrolling module.)  Enjoy!

View Post


Sorry to ask, but can I get the source so that I can compile for Linux?

If it's messy or whatever, let me know and I'll run it in the win32 environment.

Nevermind... just understood what I was looking at!

Yeah, the "source" is actually just a lex grammar file...

Looks like it worked for me first time.  I'll get the compile loop done in the morning and go from there!  Thanks a bunch for this!  I'm not sure how long you spent writing it, but I know I would have spent many hours converting the code manually.  Well done and much appreciated.

View Post

Not long... I got a cup of coffee and started writing, and I was done before the coffee was cold (Though the last swig was a little tepid.) Probably less time and more accurate than doing Ooze by hand.

#9 potatohead OFFLINE  

potatohead

    River Patroller

  • 4,404 posts
  • Location:Portland, Oregon

Posted Wed Sep 7, 2005 11:13 AM

THis is the corrected version.  Tested with Ooze source, compiles and seems to work (except for the fact that 37 bytes needed to be trimmed first, did so by removing pf-scrolling module.)  Enjoy!

View Post


Sorry to ask, but can I get the source so that I can compile for Linux?

If it's messy or whatever, let me know and I'll run it in the win32 environment.

Nevermind... just understood what I was looking at!

Yeah, the "source" is actually just a lex grammar file...

Looks like it worked for me first time.  I'll get the compile loop done in the morning and go from there!  Thanks a bunch for this!  I'm not sure how long you spent writing it, but I know I would have spent many hours converting the code manually.  Well done and much appreciated.

View Post

Not long... I got a cup of coffee and started writing, and I was done before the coffee was cold (Though the last swig was a little tepid.) Probably less time and more accurate than doing Ooze by hand.

View Post



Well, that's exactly why I am not a programmer by trade. Takes too damn long! I bow before your Kung-Fu!

Feeling Ok this morning. I'll play a little and post what happens.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users