Jump to content
IGNORED

Atari 2600 BASIC compiler is here!


batari

Recommended Posts

Batari is it possible to remove the code from the generated .asm (or kernel) for the score counter because Im not using it in the game im making and I gues by removing it it will save some cycles. Now I just am giving the score the same color as the background to make it invisible :)

 

What code do I need to remove and how much cycles would It save?

 

greets.

Link to comment
Share on other sites

Just curious if you think that all I need to include is the input file to lex in the source, or if the generated lex.yy.c file should be in there too for those who don't have lex?  I.e. what's the "normal" thing to do?

899431[/snapback]

 

The normal thing would be to distribute the grammar file, but not the generated code. Nothing that can be generated needs to be distributed (or even more silly, put under version control. I've seen people do that before...)

Link to comment
Share on other sites

Batari is it possible to remove the code from the generated .asm (or kernel) for the score counter because Im not using it in the game im making and I gues by removing it it will save some cycles. Now I just am giving the score the same color as the background to make it invisible :)

 

What code do I need to remove and how much cycles would It save?

 

greets.

900878[/snapback]

You would remove everything from the comment ";6 digit score routine", down to, but not including "lda temp2"

 

You would then need to change the lda #43 just below to something larger to compensate for the removed scanlines. I'm not sure what it should be offhand, maybe lda #56 would suffice. This should give an additional 750 cycles for your bB code.

 

I think the above should work, but I haven't tested it.

Link to comment
Share on other sites

batari,

 

Please consider renaming the files for alpha 0.3 to 8.3 format...since it -is- a DOS program, it should be usable in pure DOS (without having to hex-edit the EXE :P:)

900413[/snapback]

I called it a DOS program because it must be run at the Windows Command Prompt. 8+3 is SO limiting and outdated, I don't think I should change the expanding set of files to conform to this. I think a better solution is to quit calling it a DOS program but instead call it a Win32 command-line program.

Link to comment
Share on other sites

I called it a DOS program because it must be run at the Windows Command Prompt.  8+3 is SO limiting and outdated, I don't think I should change the expanding set of files to conform to this.  I think a better solution is to quit calling it a DOS program but instead call it a Win32 command-line program.

 

...it is an actual DOS program at the moment though, and runs just fine under pure DOS (except for the part about trying to call the variable redef file, which has a long filename) :)

 

 

 

[EDIT] Annnnnd, never mind...I was thinking that it was packed along with the DOS port of DASM, but it's the Win32 console version...ignore! :P

Edited by JLsoft
Link to comment
Share on other sites

I'm wasting enough scanlines as it is :P

 

If you want to get into a scanline wasting war...

 

 rem row 1-1 - all bit reads except 6 and 7 are inverted
 if a(7) then pfhline 0 4 2 on
 if a(6) then pfhline 3 4 5 on
 if !a(5) then pfhline 6 4 8 on
 if !a(4) then pfhline 9 4 11 on
 if !a(3) then pfhline 12 4 14 on
 if !a(2) then pfhline 15 4 17 on
 if !a(1) then pfhline 18 4 20 on
 if !a(0) then pfhline 21 4 23 on
 rem row 1-2 - only 7-5 are used, 4-0 are ignored
 if !a(5) then pfhline 24 4 26 on
 if a(6) then pfhline 27 4 29 on
 if a(7) then pfhline 30 4 31 on

Link to comment
Share on other sites

Labels and Numbers

 

While trying to finish the first version of my personal help file, I noticed that it might be nice to know if a label must start with a letter of the alphabet. I think at least one BASIC I used said that a label must not start with a number. Numbers could be mixed in anywhere after the first character though. Is Batari BASIC the same in that area?

Link to comment
Share on other sites

Labels and Numbers

 

While trying to finish the first version of my personal help file, I noticed that it might be nice to know if a label must start with a letter of the alphabet. I think at least one BASIC I used said that a label must not start with a number. Numbers could be mixed in anywhere after the first character though. Is Batari BASIC the same in that area?

904284[/snapback]

There is no such limitation for labels in bB. A label can have any combination of letters or numbers, even as the first character. You can use underscores too. The only limitations I can think of is that a label must not match a known keyword or any labels internal to bB (like start, kernel, etc.) For example, you can't name a label "next" or "pfpixel"

 

A variable alias (i.e. with the dim statement), however, does need to start with a letter.

Link to comment
Share on other sites

There is no such limitation for labels in bB.  A label can have any combination of letters or numbers, even as the first character.  You can use underscores too.  The only limitations I can think of is that a label must not match a known keyword or any labels internal to bB (like start, kernel, etc.) For example, you can't name a label "next" or "pfpixel"

 

A variable alias (i.e. with the dim statement), however, does need to start with a letter.

904289[/snapback]

Thanks. That will make things even more clear.

Link to comment
Share on other sites

Indenting

 

To make sure I understand correctly, are labels, line numbers and end the only things that are not indented?

905519[/snapback]

I think so. Though eventually I may remove the requirement for "end" so it can be intended or not.

Link to comment
Share on other sites

Indenting

 

To make sure I understand correctly, are labels, line numbers and end the only things that are not indented?

905519[/snapback]

I think so. Though eventually I may remove the requirement for "end" so it can be intended or not.

905538[/snapback]

Thanks. That will be easy to remember.

Link to comment
Share on other sites

Perhaps its an ID to create a command to be placed in the beginning of the code which selects a kernel (like rem smartbranching on)

For example:

 

"rem kernel <default>" To select the default kernel

"rem kernel <hi_res>" To select the hi_res_2600basic.asm & hi_res_2600basicfooter.asm

 

Or something like that, this makes switching, using, trying out different kernels easier.

Link to comment
Share on other sites

I'd like to mention I'm not a big fan of sneaking in smartbranching via a comment; if it impacts the code, it deserves to be its own command, same (even more so) for kernals.

906942[/snapback]

 

I'll second that.

 

How about a general keyword for this kind of thing, followed by a list of arguments?

 

config

kernel <x>

smartbranching on

memorymodel 4k

end

 

That sort of fits with some other things in the language, cutting down on the number of different structures one has to know at least...

Link to comment
Share on other sites

I'd like to mention I'm not a big fan of sneaking in smartbranching via a comment; if it impacts the code, it deserves to be its own command, same (even more so) for kernals.

906942[/snapback]

 

I'll second that.

 

How about a general keyword for this kind of thing, followed by a list of arguments?

 

config

kernel <x>

smartbranching on

memorymodel 4k

end

 

That sort of fits with some other things in the language, cutting down on the number of different structures one has to know at least...

907319[/snapback]

I can see the logic in not using smartbranching in a rem, but I'm still thinking of the best way to do things.

 

Includes and some other compiler directives (like dim) do not affect the bB-to-asm compilation. smartbranching does affect the bB-to-asm, as will a future directive (a few revisions away) to specify optimization for speed or space, or to build an 8k bankswitched ROM (a few more revisions away).

 

I like the idea of dim and include on their own rather than in a config block, and the others above could be passed as command-line arguments or allowed to be defined as special settings. Maybe a "set" command could be used to define things, kind of like setting an envorinment variable:

 

set smartbranching off/on

set romsize 2k/4k/8k

set optimization size/speed

 

If it's done this way, you can actually turn these on and off on the fly. For instance, if you want some code optimized for speed and some for space, you could change the optimization several times.

Link to comment
Share on other sites

I'd like to mention I'm not a big fan of sneaking in smartbranching via a comment; if it impacts the code, it deserves to be its own command, same (even more so) for kernals.

906942[/snapback]

 

I'll second that.

 

How about a general keyword for this kind of thing, followed by a list of arguments?

 

config

kernel <x>

smartbranching on

memorymodel 4k

end

 

That sort of fits with some other things in the language, cutting down on the number of different structures one has to know at least...

907319[/snapback]

I can see the logic in not using smartbranching in a rem, but I'm still thinking of the best way to do things.

 

Includes and some other compiler directives (like dim) do not affect the bB-to-asm compilation. smartbranching does affect the bB-to-asm, as will a future directive (a few revisions away) to specify optimization for speed or space, or to build an 8k bankswitched ROM (a few more revisions away).

 

I like the idea of dim and include on their own rather than in a config block, and the others above could be passed as command-line arguments or allowed to be defined as special settings. Maybe a "set" command could be used to define things, kind of like setting an envorinment variable:

 

set smartbranching off/on

set romsize 2k/4k/8k

set optimization size/speed

 

If it's done this way, you can actually turn these on and off on the fly. For instance, if you want some code optimized for speed and some for space, you could change the optimization several times.

907401[/snapback]

 

 

I'm liking the set operator for all of these options. Being able to do things on the fly makes perfect sense where the 2600 is concerned. Games with different screens could use different kernels, for example. In this way bb might really make managing all of that quite easy actually.

 

For what it's worth, both syntax ideas allow for these things, but your use of the set operator is less overall parsing and typing / formatting for the developer. Better overall, IMHO.

 

Come to think of it, the overall concept of an environment is making a lot of sense actually. Set is familiar and easy. Why not? However it works, I would love to see everything necessary be part of the program source code file. Nice and self-documenting and easily packaged, etc...

Edited by potatohead
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...