Jump to content

Photo

Visual Studio Code Extension for batari Basic

batari Basic Compiler Syntax Highlighting

30 replies to this topic

#1 mksmith OFFLINE  

mksmith

    Star Raider

  • 68 posts
  • Location:Melbourne, Australia

Posted Sat Jan 19, 2019 6:46 AM

Over the past few days I've been working on a Visual Studio Code extension for editing and compiling batari Basic code.  The basic syntax highlighting is done (both .bas and .asm files) and it also includes the ability to compile and launch Stella (by default) to test your game. I've included both bB and Stella into it by default but it has a few options to override that and provide your own as required. The other great benefit is it's built-in git control (which I'm using for saving my source). 

 

I've sort of reached my limit with Visual bB due to the size of my code and the way it constantly jumps around when you paste  :mad:  Otherwise I was happy with it with all the little extra stuff so will go back to it occasionally when needed.  I'd previously built an IDE for Bliz3d/BlitzMax a long time ago but I don't want to do that again so this was my best bet - just about finished the necessary stuff in 2 days  :-D  :-D

 

I do intend to maintain it and enhance it as I go (might look to add on-the-go compiling for issues if I can work that out) and may look at if I can adjust the code completion lists to be more targeted to the code your editing).

 

Is this something others might be interested in? if so let me know below and I'll provide a copy (soon) for you to test before I put it into the VS Code Marketplace.

 

[Update] added in a dasm compiler as well to help with development  ;-) 

Attached Thumbnails

  • vscode-dasm.png
  • vscode-bb.png
  • vscode-settings.png

Edited by mksmith, Tue Jan 22, 2019 8:04 AM.


#2 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 28,867 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Jan 19, 2019 9:39 AM

Can you put in similar tools that VbB has?

#3 Albert OFFLINE  

Albert

    Quadrunner

  • 35,187 posts

Posted Sat Jan 19, 2019 10:35 AM

That's awesome, great job on that!  And Visual Studio Code is cross-platform, so it can be used in Windows, macOS and Linux.  Microsoft did a nice job with this editor.  Are you going to charge for your extension? 

 

 ..Al



#4 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Sat Jan 19, 2019 2:51 PM

@Random Terrain - I'll see what I can add within the confines of what is cross-platform - there are some handy tools in there for sure! I want to add something to the activity bar if I can (the bar down the left side) so things are easily available (just need to look at how)

 

@Albert - No I don't intend to as it should be a community tool :-D Yes definitely can look at cross-platform compilation as it should just be the case of verifying the OS and adjusting the paths according (I'm on Windows ATM so setup for that currently).


Edited by mksmith, Sat Jan 19, 2019 2:53 PM.


#5 Albert OFFLINE  

Albert

    Quadrunner

  • 35,187 posts

Posted Sat Jan 19, 2019 3:10 PM

@Albert - No I don't intend to as it should be a community tool :-D Yes definitely can look at cross-platform compilation as it should just be the case of verifying the OS and adjusting the paths according (I'm on Windows ATM so setup for that currently).

 

Excellent.  :)



#6 RevEng OFFLINE  

RevEng

    Bit Player

  • 5,105 posts
  • Location:bottom of the stack

Posted Sat Jan 19, 2019 4:07 PM

Very cool, especially the cross-platform nature of it. Well done!

#7 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Mon Jan 21, 2019 6:53 AM

Added some extra stuff in the past day or so including:

  • the ability to open the forums via the command bar
  • snippets (DPC+ kernel template, and the NTSC and PAL60 color tables).
  • cleaned up a couple of existing processes
  • trapped an additional compilation error

There doesn't appear to be a lot of additional stuff that can be added via the Activity Bar ATM. There is some sort of webview you can add to show in a tab (local only) so may need to resort to seeing what can be done there.

 

Did some programming tonight for Tower of Rubble in it and its looking and working nicely.  Still reaching for F5 out of habit (VS Code debugger) - you need to go via the command bar (Ctrl+Shift+P) to access features but once there in the list they are very accessible.


Edited by mksmith, Mon Jan 21, 2019 6:57 AM.


#8 Muddyfunster OFFLINE  

Muddyfunster

    Moonsweeper

  • 285 posts

Posted Mon Jan 21, 2019 7:06 AM

I'd be happy to test / assist if you can walk me through the setup.

 

VbB is great but as others have noted, it becomes really fidgetty when your code gets above a certain size, i find my self using Notepad++ then copying and pasting, hardly ideal!

 

Either Way, I hope this works out as an alternative, look forward to seeing your progress!



#9 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,308 posts

Posted Mon Jan 21, 2019 7:31 AM

Definitely interested!  Does this also support compiling and running the emulator from the IDE?

 

Those two mentioned features are very important to me.  I am constantly hitting compile and test :)

 

If this had syntax highlighting for 7800bas and IntyBASIC it would be a %100 percent buy.



#10 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Mon Jan 21, 2019 7:39 AM

Definitely interested!  Does this also support compiling and running the emulator from the IDE?

 

Those two mentioned features are very important to me.  I am constantly hitting compile and test :)

 

If this had syntax highlighting for 7800bas and IntyBASIC it would be a %100 percent buy.

 

@Gemintronic - yes you can compile and run if you choose (or just compile). I haven't every looked at 7800bas or IntyBASIC - would need to check those out at some stage.



#11 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Mon Jan 21, 2019 7:41 AM

I'd be happy to test / assist if you can walk me through the setup.

 

VbB is great but as others have noted, it becomes really fidgetty when your code gets above a certain size, i find my self using Notepad++ then copying and pasting, hardly ideal!

 

Either Way, I hope this works out as an alternative, look forward to seeing your progress!

 

Great - will PM you soon with the details - still working through a few things! Are you on Windows??



#12 Muddyfunster OFFLINE  

Muddyfunster

    Moonsweeper

  • 285 posts

Posted Mon Jan 21, 2019 8:16 AM

Yes, i'm running with Windows 10.



#13 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,308 posts

Posted Mon Jan 21, 2019 8:19 AM

 

@Gemintronic - yes you can compile and run if you choose (or just compile). I haven't every looked at 7800bas or IntyBASIC - would need to check those out at some stage.

 

Those two BASIC compilers are actively maintained with no dedicated IDE for an active user base.  You could massively expand your audience.  Thank you for even thinking about checking them out ^_^



#14 Mr SQL OFFLINE  

Mr SQL

    River Patroller

  • 2,068 posts

Posted Mon Jan 21, 2019 12:05 PM

Nice work! :)

 

You cited limitations with the Visual bB IDE as the imeteus for creating your visual studio extension; how do you plan to handle sprite and playfield GUI's, will you create a colorful integrated GUI for this like Visual bB or use the WYSIWYG ACII art editors already present in bB?

 

I wrapped the PowerShell ISE simiarly as an IDE for Atari Flashback and SuperCharger BASIC and decided to keep it simple and use the similar ASCII art designers already present in the language.

 

imo the most important feature is pressing Play to compile and launch the BASIC program in the emulator with one click, which I think you already have.

 

What other features will you add or change in your IDE compared to visual bB?

 

 



#15 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Mon Jan 21, 2019 7:05 PM

@Muddyfunster
Great! I need to look at manual distribution as sometimes when I copy it over to the extension folder it doesn't always run first up.

@Gemintronic
7800basic and IntyBASIC look to be very similar (I guess how they all work generally) so some sort of extensions would be do-able certainly. All that is required is a syntax definition and a process to call the compiler (and emulator to test) which I have a basic structure for now. Still I would like to get cross-platform compatibility done before starting other ones. One of the difficulties of building IDEs is always the cross platform nature as people enjoy using their own OSes which thankfully VS Code has the basis to provide the very key features.
 
@Mr SQL
VS Code appears to be limited for GUI development currently due to it's cross-platform nature.  There is a webview component with which you can access html locally in the tab so that may be able to do something there but have yet to check that out. I'm hoping to maybe one day add a language server to compile as you code for syntax checking and also maybe make the intellisense a little more specific but it's got the main stuff required (apart from cross-platform use which would be high on the list).

Edited by mksmith, Mon Jan 21, 2019 7:08 PM.


#16 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Tue Jan 22, 2019 7:55 AM

Added a dasm compiler into the process as they probably can go hand in hand with developing for the 2600.  Re-org'd the code to provide a base compiler class I can override.

 

Back to Tower of Rubble to test the extension!



#17 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 28,867 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue Jan 22, 2019 12:22 PM

If you end up recreating some of the things in VbB, please don't copy the style of the TIA Color Chart where the color strips are vertical (I didn't know what I was doing back then). It should look more like this with color strips that are horizontal:

 

randomterrain.com/atari-2600-memories-tia-color-charts.html#ntsc_color_tool



#18 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Tue Jan 22, 2019 10:28 PM

If you end up recreating some of the things in VbB, please don't copy the style of the TIA Color Chart where the color strips are vertical (I didn't know what I was doing back then). It should look more like this with color strips that are horizontal:
 
randomterrain.com/atari-2600-memories-tia-color-charts.html#ntsc_color_tool


No probs @RandomTerrain - would like to add the charts if a I can as that little tool does come in handy! Might be in a webview document tab if I can get that going.

#19 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Fri Feb 15, 2019 12:24 AM

Getting very close to a release. Have a few things to finalise but should be very soon.

#20 Tony The 2600 ONLINE  

Tony The 2600

    Moonsweeper

  • 424 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Fri Feb 15, 2019 1:38 AM

Can't wait! we are in need of an updated IDE for bB. VbB is brilliant but like others have said there is some issues. Also like mentioned above im interested in 7800BASIC support. It would be great to have an IDE that can support both the 2600 and 7800. :thumbsup:



#21 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 28,867 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Feb 15, 2019 2:26 AM

Can't wait! we are in need of an updated IDE for bB. VbB is brilliant but like others have said there is some issues. Also like mentioned above im interested in 7800BASIC support. It would be great to have an IDE that can support both the 2600 and 7800. :thumbsup:


Yeah, I won't even try to make anything for the Atari 7800 until I have an IDE.

#22 EvoMikeUK OFFLINE  

EvoMikeUK

    Star Raider

  • 85 posts

Posted Fri Feb 15, 2019 5:12 AM

This is a really exciting project. I am a full time software developer that uses Visual Studio all day. This would be a great move for the community.



#23 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 28,867 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Feb 15, 2019 5:21 AM

I couldn't make anything without an IDE, so it's been nice having VbB, but one thing that always irritated me about VbB is that it randomly forgets undo/redo. Thank God I use Save As a lot.



#24 mksmith OFFLINE  

mksmith

    Star Raider

  • Topic Starter
  • 68 posts
  • Location:Melbourne, Australia

Posted Sat Feb 16, 2019 1:04 AM

Once this is complete I'll certainly do a 7800 version as it should be an easy process now to replace the compiler. Ill need to take a closer look in regards to either having one extension or two - certainly all together might be a great way to go.

#25 KevKelley OFFLINE  

KevKelley

    Chopper Commander

  • 150 posts
  • Lots of hobbies, little time, loads of fun.
  • Location:Orlando

Posted Sat Feb 16, 2019 6:02 AM

I am unfamiliar with Visual Studio. I will definitely have to check this out. I really like vbB and I don't think I would ever have been able to make anything even resembling a game without it.





Also tagged with one or more of these keywords: batari Basic, Compiler, Syntax Highlighting

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users