BASINĒ Version 1.8 by Arda "ref" Erdikmen

This is not BASin. BasinC is a fork of highly successful Basin Project by Paul Dunn et al. 
BasinC is based on Basin's R14 source code and working parts of R15 source.


USAGE/INSTALLATION:

Automatic Installation via INNO Setup:
Just run the setup file and you are done.

Portable version:
No installer. Unzip all files whereever you want, and execute Basinc.exe. Exe file should have read/write permission to it's folder to save settings.


UPGRADING FROM AND OLDER INSTALLATION
If you are upgrading from pre-1.7 version it's recommended to start fresh. New basinc requires autoback folder and "basinC.bin" file to run properly.
if you are upgrading from pre-1.8 version and used snippets before, please backup your snippets file before installing the new basinc!

You may contact the author on ardarda@gmail.com - this project is unaffiliated with the SPIN team, and therefore the other members will be unable to help you a great deal.

Disclaimer: Z80 emulation may not be accurate for certain tasks. Files (saved with/loaded by)* BASinc may not be compatible with other emulators. BASin may format your hard drive.

* Delete as appropriate.


Recent // history & todo:

//1.84 "Nutcracker" - 08.03.2025
// Added: - Local AI option is added. Now the Quality of AI responses is your responsibility. ;)
//          Usable models, at least DeepSeekCoderV2 or Llama 3.1 (as of 2026 Jan)
// Added  - Stack Pointer last 10 values listing in CPU Monitor window. Can be toggled with "View" button at the top.
// Added  - "Select All" menu item is added. Also added keyboard shortcuts for copy listing and copy plain text, default behaviour is also changed to plain text.
// Added  - More toolbar TOGGLE buttons for Tools and Debug windows for easy access and getting rid of tools you don't use.
// Added  - OldSkool arrangable and draggable toolbar buttons are back. The toolbar was originally planned as customisable by Dunny, but never materailized until now.
// Added  - Tape editor can now show headerless blocks so you can grab the data within. They are still cannot be loaded though as ROM cannot load them from basic either.
// Added  - View > "Always On Top Tools" toggle option. This applies only to Vars, Sysvars, Profiling, Token, Udg, Paint, Tape, Snippets and Manager windows.
// Added  - "Sort" checkbox on Token Table Keywords list. So now it's easier to find a keyword.
// Added  - Base Snippets are moved to another file, preventing overwriting your own snippets while updating.
// Changed- Moved assembler to editors menu, ai chat to tools menu, debugging views has their own header now.
// Changed- Profile Results window is now in courier font like other tool windows.
// Fixed  - Major fix: 20 years of missing opcodes in Interrupt Mode 2 emulation, but possibly there are more (reported by Janko via Discord)
// Fixed  - BasinC was losing the last used folder when opening bas files. Now it properly remembers even between sessions (reported by PaddyC13 via Discord)
// Fixed  - While using Pasmo Assembler, org address was calculated incorrectly when code had more than one org specified.


//1.83 "Skynet"
// Fixed - Nasty bug on NEG opcode emulation caused all sort of problems in new delphi compiler. Sorted! (Uwe Geiken)
// Fixed - A renumber bug caused lines start with a : cause a crash in basinc    (briefer666)
// Fixed - A workaround implemented if you want to paste escape code characters into listing (mefjak)
// Fixed - (Hopefully) An edgecase bug after loading from a save - lines at the end of a program disappeared. (Johnny McGibbitts)
// Fixed - SimpleConV2 partial port decoding was causing zx printer emulation to feed the paper :)
// Added - Tape Trap Streaning Options now saved with the session
// Added - Tape block grab implementation
// Added - Tape block right button menu
// Tuned - Block properties window position is now item sensitive
// Added - Basic Program Minify Tool in Tools > Clean/Minify basic (Make your programs a bit faster)
// Added - Charset capture mode (Captures printed characters in 50fps to draw a windows compatible text mode output)
// Added - A much better screen listing image save function View > Save Listing as Image can now save full listing not just visible part on screen
// Added - Subroutine list can now show GO TO locations (view > Subs > auto detect goto's)
// Added - Subroutine list can also show jump origins in two different modes. (view > Subs > Show Origins)
// Added - Context Sensitive Right Click Popup menu enhancements: Find Line to follow target and Retrace Origins (if Auto-sub detection is enabled)
// Added - More flow control: Shift+Enter on a GOTO or GOSUB statement will jump to target line
// Added - Cpu Window has two more options: watch and break an 16 or 8 bit value at a specific address (to enable just enter address any other than 0)
// Changed - Not really usable yet but editing in indenting mode is getting better. Cursor works a bit better now in Indent mode (F2 key to toggle)
// Added - BasinC online help search filter box and some new styles to improve readability
// Added - BasinC online help new entries for Notes, Snippets, Manager, Bridge and Minify windows
// Added - AI API Calls. Ofcourse what did you expect?! :) Bring your own key style. Google Cloud only for now. see Options>External Tools/AI -- Nothing is exposed to internet unless you click SEND button
// Added - Snippets window now has a splitter in the middle to change the size of the panes
// Added - AutoBackup folder view button and interval setting in options > files tab.
// Changed - English, Spanish, Deutsch and Turkish translation is updated (Updated parts are AI translation over old manual translations)


// 1.82
// Added - ZX0 compression natively supported in basinC (you may find options on export menus or memory grabber etc.)
// Fixed - SysVars window would update incorrectly if it's sorted by name.
// Fixed - Snapshot saving in 48K was incorrectly pushing PC to the stack, now corrected
// Added - System Variables Window can now compare and show if a value changed and highlights in red color.
// Added - Tab key to accept code prediction (right arrow still works too)

// 1.81 -- first released in ZX Spectrum Discord Server  06.06.2025 -- Compiled with Delphi7  -- NEG bug started happenin here due to new compiler.
// Added - Sysvars now can be sorted by clicking on the column headers
// Added - Memory Grab/Binary Grab window can now send data direcly to tape as a block
// Added - Assembler can now use pasmo assembler if pasmo.exe exist in the basinc folder
// Added - Memory Viewer - Copy to Clipboard right button popup menu
// Added - Custom Token Entry tab for Token Table Window (if you know what you are doing).
// Added - Show Keywords in Rem option to preview known keywords in a rem line (use custom token entry or shift+click on tokens on token table to insert keywords)
// Added - Subroutine list now shows destination when your cursor is on a gosub command
// Fixed - No longer accidental UI jumps when subroutine list is open
// Fixed - DEF FN parsing. Loading from a BAS file (ProcessBASLine), process DEF FN was called for every line. This was causing problems. Disabled this behaviour as program listing will get retokenized properly while repaint.


// 1.8 "Soap" -- Bumped version number because of slight visual lift. :)
// Added: Sub-Routine listing. mark subs manually with REM #<sub name> or enable auto-detect subs to catch GO SUB <line no>'s
// Added: Online Help Option: Since Windows continuously marks the help file as unsafe, the Help File will be served online as an alternative.
// Fixed: Windows-XP archaic button panels are partly removed to provide more compatible graphics update.
// Changed: All internet update functionality is removed. Update Check just opens a browser now.

// 1.79.5 (internal testing-never released)
// Added - Simple exception handler. Hope it catches nasty ones.  build 94
// Added - Copy Bitmap to Clipboard option in Display Window > Edit menu. This copies whole screen including it's border in actual zoom level.
// Added - Insert Print At, Peek, Plot, Draw, Circle and Rectangle commands in Display Window Right-click Popup Menu -- These insert basic code to editor window
// Added - Font size selection for tool windows to make a little bit readable windows in hi-dpi screens. (requested by: lippmaje)
// Added - Refresh and Auto Refresh options in Memory Viewer tool window   (requested by: lippmaje)
// Added - "Delete All" button in Watches Window to clear all watches at once.
// Added - New 8 editable colors for editor. See Options > BasinC > Syntax Highlighting [Colors] button.
// Added - Status bar at the bottom of the display window(will give some info)
// Added - Update check help menu item
// Added - Attach display window to main editor option. View > Display Window > Attach...
// Added - "Always keep on top option" for display window
// Added - Display window now has a status bar with lots of information.
// Added - Smart Indenting option in View Menu as it works much better now. Note that there is still a known cursor visibility bug while editing the code, harmless though.
// Fixed - "Rem speed N" rem command is now working better. Disable auto skip, Do not use GDI, use eg. hq2x.
// Fixed - Speed selection in Options wasn't working properly due to sound emulation.
// Fixed - a very old bug, if you erase part of the edited line with DEL key, it would duplicate the line.  (reported by: Uwe Geiken & lippmaje)
// Fixed - Tracing execution now follows focus for double and  bigger editor fonts sucessfully
// Fixed - Importing a bas file or pasting a basic line with AT escape code was corrupting the color codes. (reported by: avlixa)
// Fixed - Data Array loading was failing when loading is performed from harddrive (reported by: ignacobo)
// Fixed - Sometimes Basin would lock up when the vars window was open (reported by: lippmaje)
// Changed - REM slow command now will reset cpu speed to default 3.5mhz.

// 1.79.4

// Added - UDG Editor Window, "Save" file option, CTRL+S, CTRL+O shortcuts, keeps track of open file and notify if there is a pixel modified as * in the title bar.
// Fixed - SimpleCON register couldn't be displayed as text because it was initialized as 0, now it is spaces.
// Changed-SimpleCON window was popping up in every character output. Now it only pops up when linefeed.


// 1.79.3
// Fixed - Profile window was showing wrong token in strings. (reported by: lippmaje)


// 1.79.2 (19.05.2022)
// Added - Basin Update Check (disabled by default, enable in Options)

// 1.79.1 (19.05.2022)
// Added - BasinC Snippets
// Changed - SimpleCon behaviour. Not port 1515 commands sets the byte *then* increment the index. Port 1259,0 feeds the line to the log instead of 255.

// 1.78 (24.10.2021)
// Fixed - IF x THEN REM couldn't parsed by basinc, now patched, but may present new issues, due it's just a workaround.
// Fixed - When you execute a direct command, basic was corrupted temporarily. It's fixed by removing a wild syntax cropper.

// 1.77 (14.10.2021)
// Added - UDG editor character setup option
// Added - UDG editor keyboard shortcuts
// Added - Add/Edit a note to Notes Window by right clicking on a statement in listing
//         This is a step to overlay comments over program listing in a future release
// Added - Auto Show Note option in BasinC Options window. Disabling this will prevent project window to popup, even if a BAS file does contain notes.
// Fixed - save as.. Does not modify project name. (A workaround rather than a fix. Needs a bit more time)
// Fixed - Undo/redo buttonts on Image Editor (former Screen Paintbox) wouldn't work at start.
// Changed-Some Ctrl+Alt+ keyboard shortcuts was clashing with AltGR+A..U graphics mode shortcut. So all of them changed. Sorry.
// Added - Hotkey Toggle Tools. You may open *and* close following tools with single keycombo:
//         Crtl-T Tokens, Ctrl+Alt+Z Notes, Ctrl+Alt+X Tapes, Ctrl+I Image Editor, Ctrl+U Udg Editor
// Changed-English tool names Graphics/Sprite Editor become UDG Editor, and Screen Paintbox become Image Editor for simplicity.


// 1.76 (11.10.2020)
// Added - Project Notes Window
// Fixed - tooltip variables not showing correctly (hopefully fixed)
// Added - More Basinc Test Basic Programs in the release package

//1.75 (22.05.2019)
// Fixed - Parser fix (reported by: James Davis)

//1.74
// Added - Save Display Window as BMP
// Added - basin now is on github! https://github.com/ref-xx/basinc


//1.73
// Fixed - Undocumented fixes

// 1.72
// Added: -dumptxt commandline parameter. Extracts and saves BASIC portion of a basinc compatible program (eg. BAS/SNA/TAP).
//                  Usage: basinc <filename> -dumptxt   
//                  Example: basinc oregon.tap -dumptxt   (will create oregon.tap_BASIC.txt in same folder)

// 1.71

// Added: 4x,5x,6x font sizes for hi-dpi non-zoomed screens.

// Fixed: variables with 90ish numbers like a91, b95 weren't properly tokenized.


// 1.7      20.11.2017

// Added new toolbar buttons
// Added toggle breakpoint navigation buttons (see view menu)
// Added auto backup feature. Basinc saves your work in the background every 3 minutes.
//                            it keeps 10 copies going back up to 30 minutes in /autoback folder.
//                            To turn this feature off, use: Options > Filing > Auto Backup
// Changed - Due to large changes in ini and bin files, basinc now requires basinC.bin and basinC.ini, but it still uses basin.chm as help file.

// 1.7a

//  Changed - Broken Undo/Redo behaviour. BETA - Save often to avoid data loss.

//  Fixed - Right button popup menu context operators should detect *declared* variables correctly now
//  Fixed - Green Ruler Mark at the bottom of the screen should work ok even when cursor in a string.
//  Fixed - Drag&Drop files to main window works again.
//  Fixed - Esc key no longer breaks the program if Basinc is not in focus
//  Fixed - Token table wasn't printing first keywords correctly (eg. RND/SPECTRUM).
//  Fixed - File dialogs won't stuck at search results anymore
//  Fixed - Cosmetic fixes of profiling window
//  Fixed - While using double and triple size fonts, find and replace was not showing the result in the editor

//  Added - Shift+Clicking token table inserts byte code rather than token itself
//  Added - Tape Browser now accept files via drag&drop
//  Added - When in full speed emulation, a small arrow is shown at the bottom right corner of display window
//  Added - Display window preset sizes: 300%,400%,600%
//  Added - German Translation (Uwe Geiken)
//  Added - External Utility menu item. This item sends basinc's memory snapshot to an external utility, such as an emulator.


// 1.697

//  Added - SimpleCon window warns user more if it's disabled in the options
//  Added - REM speed <x> command. x is 1-50 (an integer equivalent to Mhz). It may not perform accordingly with commands which perform screen update.


// 1.696
//  Added - single instance mode
//  Added - Command line option: give filename to load
//  Added - Profiling window New (clears profiling results and starts new profiling) and Refresh (shows immediate results) button.
//  fixed - token table was printing wrong keywords (again).
//  fixed - Force Break (Undo) will go back to earlier state than intended (thus overwriting your program).
