{"id":20418903,"url":"https://github.com/sehugg/bataribasic","last_synced_at":"2025-09-24T06:32:03.416Z","repository":{"id":139691625,"uuid":"158354648","full_name":"sehugg/batariBasic","owner":"sehugg","description":"batari Basic by Fred X. Quimby, with some fixes (only 1.0 works right now)","archived":false,"fork":false,"pushed_at":"2019-08-21T20:18:49.000Z","size":270,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T06:36:08.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sehugg.png","metadata":{"files":{"readme":"README.txt","changelog":"CHANGES.txt","contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-20T08:21:33.000Z","updated_at":"2023-12-20T05:29:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"b305dab4-681b-43a7-ab1f-33dd88e13ab5","html_url":"https://github.com/sehugg/batariBasic","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehugg%2FbatariBasic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehugg%2FbatariBasic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehugg%2FbatariBasic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sehugg%2FbatariBasic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sehugg","download_url":"https://codeload.github.com/sehugg/batariBasic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234048285,"owners_count":18771474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T06:35:18.410Z","updated_at":"2025-09-24T06:31:58.078Z","avatar_url":"https://github.com/sehugg.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Batari BASIC - a Basic Compiler for the Atari 2600\r\n \t      Version 1.0\r\n    Copyright 2005-2007 by Fred Quimby\r\n         email: c9r@hotmail.com\r\n__________________________________________\r\n\r\nbatari Basic is free of charge but is not in the public domain.  It may not be sold for profit, nor included in any product sold for profit, without the author's prior written consent.\r\n\r\nSee license.txt for more information.\r\n\r\nThe license does not apply to Atari 2600 games created with Batari BASIC.  You may license these games however you wish.  Some batari Basic games have been published and are available for sale on cartridge.  \r\n______________________________________\r\n\r\nWHAT IT IS:\r\n___________\r\n\r\nbatari Basic (bB) is a BASIC-like language for creating Atari 2600 games.  It is a compiled language that runs on a computer, and it creates a binary file that can be run on an Atari 2600 emulator or the binary file may be used to make a cartridge that will operate on a real Atari 2600.\r\n\r\nThis is version 1.0.  Although this version is expected to be much more reliable than the various alpha and beta builds were released since July, 2005, it likely contains bugs.  If you find any bugs, please report them to me by posting on the Atari 2600 Basic forum on Atariage, or by emailing me at c9r@hotmail.com.  If you send email, please include \"batari\" somewhere in the subject line.\r\n\r\nIf there are a great deal of nasty bugs, a maintenance version may be released soon, so periodically check the batari Basic website for updates.\r\n\r\nTo learn how to use Batari Basic, please refer to the tutorials, the command reference \r\n(commands.html) and the example programs, all included in this release.\r\n\r\n______________________________________________________________________________\r\n\r\nGETTING STARTED:\r\n________________\r\n\r\nExtract the contents of the zip file to a new directory.  The name of the directory doesn't matter, but for consistency with this guide and the tutorials, you may wish to use C:\\Atari2600\\bB.\r\n\r\nMS-DOS/Windows:\r_______________\r\n\rBefore you continue, you will need to move GNU sed from its subdirectory to your bB directory, e.g. C:\\Atari2600\\bB. Although bB will run without moving the program, sed will improve error reporting. sed is used to limit the amount of redundant warnings and bogus errors that the assembler tends to produce. sed was not placed in the same directory as bB to avoid confusion with their conflicting licensing terms.\r\rBatari Basic is a DOS/Windows command line program which must typically be run at the Windows command prompt. It will also run under pure DOS (i.e. without Windows running) with special considerations (see DOS compatibility in the help.html file.)\r\rThe quickest way to get started is to run batari Basic from the Windows command prompt by using the batch file (2600bas.bat.) This may be found in the \"bB\" folder in your installation directory.\r\rThis version of bB requires that an environment variable and path are set so that you can compile your source files no matter where they are located. So before you run bB, you need to set the \"bB\" environment variable and path to your bB folder. There are several ways to do this. The easiest way is to just type in the commands below. This will be active for the duration of your session, but only in the window where you define it. e.g.:\r\rset bB=c:\\Atari2600\\bB\rpath=%path%;c:\\Atari2600\\bB\r\rIf you want this set permanently every time you start DOS or the Windows command prompt, you may add the two above lines to the autoexec.nt (Windows NT/2k/XP) or autoexec.bat (DOS/Windows 95/98/Me) file. autoexec.nt is typically located either in C:\\WINNT\\SYSTEM32 or C:\\WINDOWS\\SYSTEM32, and autoexec.bat is in the root directory. If the files don't exist, create them.\r\rAlternatively, there is a way to change the path and environment variables in Windows without using autoexec. Since this procedure is quite involved, it is not covered here. Refer to the tutorials for complete instructions on how to do this.\r\rOnce the above is done, switch to a folder containing a bB source file and type:\r\r2600bas filename\r\rwhere filename is the name of the BASIC source file you wish to compile. The project folder can be any folder you create to store your files.\r\rTo test your installation, several sample programs are included in the \"Samples\" folder. Switch to this folder and type:\r\r2600bas sample.bas\r\rIf successful, a file called sample.bas.bin will be generated that you can run on an emulator. The sample program is not very interesting, but note how simple it was to write. Open sample.bas in a text editor and take a look at how it was written.\r\rWindows:\r________\r\n\rIf you prefer to use a fancy Windows-based interface, you can use one of the various IDE's (Integrated development environments) available that will work with bB. Please refer to Tutorial 3 for more information about how to use Crimson Editor with bB.\r\rAlternatively, Jacco Mintjes has written a Windows-based interface just for bB. 2600IDE is available at the batari BASIC homepage. Note that to use 2600IDE, you must use the included 2600baside.bat file and not the one that comes with 2600ide.\r\rPlease note that while we will try to ensure that bB works with the above IDE's, we can't guarantee this forever since we did not program the IDE's, there is no source and neither IDE is being actively developed.\r\rPlease see the tutorials for more detailed instructions about running the compiler.\r\rLinux and OS X:\r\n_______________\r\n\rMac OSX and statically-linked Linux binaries are also available for download, but these aren't covered in detail, so you will need to do some configuration yourself to get things working.\r\rThe binaries may be downloaded from the batari Basic website. Included with each download are four binaries (2600basic, preprocess, postprocess, and optimize) and a shell script (2600basic.sh) that you may use in place of the batch file to compile your bB programs. Copy the binaries and shell script to your main bB folder if you plan to use one of these builds.\r\rIn either case, you will need to set bB's path and environment variable. How you do this depends on what shell you are using. The environment variable and path should be set to the location of your bB binary files, for example:\r\rexport bB=$HOME/Atari2600/bB\rexport PATH=$PATH:$bB\r\rI'm sure there is a way to make the above permanent, but I don't know how to do that offhand. If you do, please let us know.\r\rAlso, Mac OSX, Linux and probably all UNIX-like operating systems will already have sed, so there is no need to download it.\r\rOther platforms:\r\n________________\r\n\rbB will work with some DOS/Windows emulators, namely DOSBox 0.65 or later. Some special considerations are needed here (see help.html under DOS compatibility.) Linux users might be able to use WINE to run bB, but I cannot verify that.\r\rIf none of the included binaries will work, you can get the source and compile it using a C compiler that supports makefiles. You will also need an appropriate lexical analyzer generator such as lex or GNU flex. If you have the appropriate tools, typing \"make\" will compile the software. It has been compiled successfully on many platforms without any issues. The source is available on the batari Basic website.\r\rIf you are building bB from source on a UNIX-like OS, you can probably still use the 2600basic.sh shell script, and so some of the section above regarding Linux and OSX may also apply. If you are building under some other platform not listed here, chances are you will need to write your own script to run bB. \r\n\r\nHOW IT WORKS:\r\n_____________\r\n\r\nNot unlike other compilers, batari BASIC uses a 4-step compilation process:\r\n\r\n1. Preprocess\r\n2. Compile\r\n3. Link\r\n4. Assemble\r\n\r\n1.  The preprocessor takes your Basic code, and reformats and tokenizes it so the compiler can understand it.  Certain errors can be caught at this stage.\r\n2. The compiler converts your Basic code into assembly language.  It will create a temporary file called bB.asm.  The Basic code is preserved as comments in this file so that those wishing to study assembly language can learn by studying how the Basic code was converted.\r\n3.  The linker splits the Basic code into sections if needed, then concatenates them, along with the kernel, modules and compilation directives into a composite assembly language file.\r\n(3a.) An optional stage is a peephole optimizer that looks for redundant and unnecessary code in the composite assembly file.\r\n4.  The assembler converts assembly language to a binary file that contains machine code that can run on an emulator or a real Atari 2600.\r\n\r\nRevision History\r\n________________\r\nNote: Lists of changes are not comprehensive.\r\n\r\n1.0: February 14, 2007\r\nOfficial release\r\nChanges:\r\nReinstated exotic illegal opcodes that were removed in version 0.3\r\npfread function for the multisprite kernel\r\nsequential data streams \u003e256 bytes\r\nSuperchip support\r\neliminated HMOVE line above score\r\nAdded score to multisprite kernel\r\nImproved flicker algorithm in multisprite kernel\r\nNo longer need module for multiplication by 16, 32, 64, or 128\r\nAbility to specify vertical resolution of playfield rows\r\nAbility to specify the overall height of the playfield rows\r\npfscore bars\r\nHUDs (minikernels)\r\n  6 lives\r\n  6 lives + status bar\r\nDisplay should now have 262 scanlines\r\nAdded ability to set reflection bit for sprites in multisprite kernel\r\nOptimized multisprite kernel for space\r\nreboot command: warm start of current ROM\r\npop command: pulls out of subroutine without needing a return\r\n7800 detection\r\nbatch file invokes sed to limit DASM's output to something more meaningful\r\nFixed bugs:\r\n  playfield: command in standard kernel now work in all banks rather than just the last\r\n  fixed point math assignments only worked when at the end of a line\r\n  blank lines in data statements now allowed\r\n  two parentheses at beginning of assignment no longer detected as function\r\n  one bit assigned to another now actually works\r\n  unary minus should work now\r\n  math modules now work with bankswtiched games\r\n\r\nBeta 0.99c: June 30, 2006\r\nUnreleased build\r\nChanges:\r\nKernel_options directive, which includes:\r\n  Paddle reading\r\n  Multicolored playfield\r\n  Multicolored players\r\n  ability to remove blank lines in playfield\r\n\r\nBeta 0.99b: March 2, 2006\r\nUnofficial, incomplete release\r\nChanges:\r\nFixed many nasty bugs with fixed point math\r\nvblank keyword\r\n16-bit random number generator\r\nbug with expression evaluator fixed\r\nAdded BSD-style license (see license.txt)\r\nImproved some modules\r\n\r\nBeta 0.99a: January 14, 2006\r\nUnofficial, incomplete release\r\nChanges:\r\nMultisprite kernel implemented\r\nBankswitching\r\nFull expression evaluation\r\ndebugging tools\r\nTV type setting\r\npfclear command\r\nplayfield: command\r\n\r\nAlpha 0.35: August 26, 2005\r\nMaintenance release to fix some particularly nasty bugs.\r\nChanges:\r\ninclude command now works\r\nbit operations now compile properly\r\n4.4 fixed point math didn't sign-extend when adding to 8.8\r\nFixed point math adds/subtracts by 1.xx no longer drop the .xx\r\nballheight or missileXheight of 0 or 1 no longer breaks the kernel\r\nFixed batch file to work with Windows 95/98/ME\r\nMore than one || per program now allowed\r\nMaybe more that I can't remember now\r\n\r\nAlpha 0.3: August 23, 2005\r\nMajor changes:\r\nstandard kernel now has the ball\r\n8.8 and 4.4 fixed point types\r\n- automatic conversion from one type to another in assignments\r\n- addition/subtraction routines do automatic conversion if multiple types are used\r\n- immediate decimal numbers allowed, either negative or positive\r\n- 8.8 types can be used wherever integers are used\r\n- 4.4 can't be used anywhere but can be added/subtracted/assigned to other types\r\ndata statement length keyword\r\nremove trailing commas from data statements\r\nset optimization for size/speed\r\nfull divide/multiply\r\n- optional: multiply can produce a 16-bit result or divide can produce remainder\r\nbit operations - assign one bit to another\r\nfor-next loop bug fixed (foward loops by step \u003e1 ended too soon)\r\n\"else\" allowed in if-thens\r\nAble to set the filename of variable alias file\r\nset ROM size to 2k or 4k\r\nsmartbranching now accessed via set instead of rem\r\nREFPX bug fixed\r\nuses includes file for spcifying kernels and organizing modules\r\ninclude additional modules with include command\r\npfread function (determine if pixel is off or on)\r\nfixed bug in decreasing for-next loops\r\nfunction declaration for user functions:\r\n- functions can be in bB or asm\r\n- optinally can be compiled separately and included as modules\r\nscore=score+ var now supports vars other than a-z\r\nfixed bugs in if-thens for bit reads\r\nlonger variable names allowed (50 chars max.)\r\nallow arrays as arguments in all functions (in user functions or built-in \r\nfns like pfpixel)\r\nimproved error handling/reporting:\r\n- more descriptive errors\r\n- line in file now echoed\r\nconst statement for defining constants\r\noptimized code\r\nfixed \u003c and \u003e comparisons, and added \u003c= and \u003e=\r\nfixed collision checks\r\nused lex to help with parsing/preprocessing\r\nscore=score-1 bug fixed\r\nfixed bogus gosub/return errors\r\non...goto now allows labels instead of just linenumbers\r\nallow negative numbers in code\r\n{whew!}\r\n\r\nAlpha 0.2: July 15, 2005\r\nMajor changes:\r\n\r\nscore calculation improved.\r\nslight kernel improvements\r\nalphanumeric labels allowed, and labels/linenumbers are now optional.\r\nblank lines allowed\r\nindexing (array-like feature) implemented\r\ndata statement implemented\r\nfixed bug in inline asm where it was impossible to add labels\r\none boolean now allowed in an if-then (\u0026\u0026,||)\r\nability to access individual bits\r\nfixed bug where return command wasn't recognized\r\nfor-next loops added\r\nvastly improved parser - not nearly as sensitive to spacing\r\ndim statement for alternate variable names\r\nUpon compilation, DASM shows bytes free in ROM\r\nremoved exotic illegal opcodes that would cause problems in some emulators, like PCAE\r\nIncluded files are now in cr/lf format to patch a limitation of DASM\r\nfixed various bugs in pfpixel and pfhline routines\r\non....goto added\r\nFixed problem where duplicate labels were created\r\n\r\nAlpha 0.1: July 7, 2005\r\nInitial release.\r\n\r\nThe batari Basic team:\r\n________________________________________________________________________\r\n\r\nI would like to thank those who have helped me develop bB.  Actually, lots of people have\r\nhelped, but some have helped a great deal.  This is not a complete list of contributors or \r\ncontributions!\r\n\r\nMichael Rideout: Wrote the tutorials, added Superchip support, reported countless bugs, made many helpful suggestions, and is instrumental with helping others learn the language.\r\nBob Montgomery: Rewrote the standard kernel and contributed the multisprite kernel.\r\nKirk Israel: Hosted the bB webpage, created various bB tools, and suggested many great improvements.\r\nDoug Dingus: Documentation of version 0.1, found numerous bugs and wrote the first playable game.\r\nDavid Galloway: Wrote the fixed-point math module.\r\nDuane Alan Hahn: Immensely improved the documentation (the commands.html file.)\r\nChris Read: Maintains bB game archive.\r\nAlbert Yarusso: For Atariage, without which, bB probably never would have been created!\r\n\r\nAcknowledgments: Thomas Jentzsch, John Payson, Zach Matley, Chris Walton, Glenn Saunders, Manuel Polik and Darrell Spice.\r\n\r\nI can't remember what some of the above people have done, but I'm sure they were helpful in some way.  Some people weren't mentioned because I don't know their real names.  If I've forgotten anyone, please let me know.\r\n\r\nHOW YOU CAN HELP:\r\n\r\nWe encourage support and code contributions to this project.  We do not need or want monetary support, however - this project is done as a hobby.  We enjoy the challenge of programming and we do it for free.  If you think you can help develop Batari BASIC, please let us know!\r\rWe'd especially like some experienced 2600 assembly programmers who are willing to write a new\rkernel or two.  We have some ideas for new kernels, but lack the time, and in some ways, the skill to\rwrite them.  Note that we cannot pay you to help us - but you will get credit for your work if it is\rincluded in a later release, and you get full bragging rights.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsehugg%2Fbataribasic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsehugg%2Fbataribasic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsehugg%2Fbataribasic/lists"}