Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2020-11-13 14:08:30

ssjason123
Member
Registered: 2017-03-21
Posts: 45

Native Visual Studio Support

I've been working on a project for a while to add SDCC toolchain support to Visual Studio and I am finally ready to share what I have:
https://github.com/ssjason123/SDCC_VS

The plugin allows you to use Visual Studio to configure/build/debug SDCC projects. My initial releases specifically focus on developing Gameboy support.

As I was about to send out the initial revision of this plugin I saw the post from toxa about source level debugging using Emulicious and VSCode. This led to the latest release which adds debugger support!

Usage:
The project readme has details on configuring the environment variables the plugin uses ("SDCC_HOME", "GBDK_HOME", "EmuliciousExecutable").

This plugin adds new project and item types. Using "New Project -> Visual C++ -> SDCC -> SDCC Project" will create a new SDCC project. It can create both binaries and libraries. From there it should feel like a standard Visual Studio C++ project. To add new source items right click the project, select "Add -> New Item -> Visual C++ -> SDCC". From there you can add C source, C headers or ASM files to the project.

All SDCC properties are available from the projects "Properties" menu. Additional properties are available at the source file "Properties" menu, for example the file's RAM/ROM bank settings.


NOTE: I've been developing this using Visual Studio 2017. I configured the plugin to allow installs on Visual Studio 2019 but I am not sure if it works. If you use this plugin with Visual Studio 2019, please let me know if it works for you.

Offline

 

#2 2020-11-13 15:19:26

Zalo
Member
From: Spain
Registered: 2016-07-26
Posts: 103
Website

Re: Native Visual Studio Support

Wow, This is really cool!!

Offline

 

#3 2020-11-16 13:27:35

ssjason123
Member
Registered: 2017-03-21
Posts: 45

Re: Native Visual Studio Support

I've created a new release v1.10 at https://github.com/ssjason123/SDCC_VS/releases/latest

I had some major issues with the initial release ranging from some local development paths to stability issues with the visx debug adapter install. Hopefully those are all fixed. Let me know if you see any issues with the latest.

Detailed changes:
    Fix adapter launch stability.
    Add support to specify the source paths in the emulicious debugger config.
    Update package interaction between the SDCC and emulicious package to fix cases where the adapter references an incorrect path.
    Remove hardcoded paths.
    Remove dependency on the Debug log path.
    Fix bug that would result in an error when creating a new empty project.
    Update default debug build behavior to generate debug files for non-library builds.


Working on an updated solution file for GBDK 2020 4.01 I found a new issue mapping the project source for emulicious. Which would fail if the visual studio project file was not in the same or a root folder of the source code. I've added a new option in the debug menu to map additional source paths for debugging. Under the project properties update "Debugging -> Debugger to Launch: Emulicious Debugger -> Source Folder Paths". I hope to have the solution for GBDK 2020 updated later today.

Offline

 

#4 2020-11-16 15:13:58

ssjason123
Member
Registered: 2017-03-21
Posts: 45

Re: Native Visual Studio Support

The solution for GBDK 2020 has been updated at:
https://github.com/ssjason123/GBDK-2020-VS

The VisualStudio folder drops into the full source release in the same folder as the Readme.md. Binaries are built to VisualStudio/Debug or VisualStudio/Release depending on the configuration.

Offline

 

#5 2020-11-21 00:57:15

andrewyang
New member
Registered: 2020-11-21
Posts: 1

Re: Native Visual Studio Support

This was helpful. Great Job.

I am using it in my project, I will create a github page for it.

Last edited by andrewyang (2020-11-21 00:58:11)

Offline

 

#6 2020-11-23 00:20:24

ssjason123
Member
Registered: 2017-03-21
Posts: 45

Re: Native Visual Studio Support

Awesome! I am excited to hear that people are starting to use it. Let me know if you run into any issues or have any suggestions to improve it. I look forward to seeing your project.

Offline

 

#7 2020-12-31 20:55:52

ssjason123
Member
Registered: 2017-03-21
Posts: 45

Re: Native Visual Studio Support

The plugin has been updated to v1.11 at https://github.com/ssjason123/SDCC_VS/releases/latest

Added changes to better support projects using libraries and a fix for post build events.

Detailed Changes:
   Updated support for libraries:
      Add support to build projects when a dependency library changes.
      Add Unix End of Line conversions for REL files to support building libraries with debug enabled.
      Add support to generate CDB files for libraries.
      Generate custom CDB file for binary including library dependency CDB files.
   Fix issue where postbuild events only ran on a rebuild.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson