Jump to content
IGNORED

Alpha 0.2 to 0.3+ code converter


batari

Recommended Posts

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
Link to comment
Share on other sites

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!

926582[/snapback]

 

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
Link to comment
Share on other sites

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!

926582[/snapback]

 

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!)

926631[/snapback]

 

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
Link to comment
Share on other sites

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!

926582[/snapback]

 

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
Link to comment
Share on other sites

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!

926582[/snapback]

 

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!)

926631[/snapback]

 

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.

926653[/snapback]

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
Link to comment
Share on other sites

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!

926582[/snapback]

 

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!)

926631[/snapback]

 

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.

926653[/snapback]

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.

926657[/snapback]

 

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.

Link to comment
Share on other sites

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!

926582[/snapback]

 

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.

926656[/snapback]

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.

Link to comment
Share on other sites

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!

926582[/snapback]

 

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.

926656[/snapback]

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.

926662[/snapback]

 

 

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.

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...