Page 1 of 1

SGDK and Visual Studio Code template

Posted: Sat Jan 21, 2017 5:24 pm
by elefas
Hello,

I have setup a small template to work with Visual Studio Code editor.
It includes configuration to detect the include files of SGDK and two tasks for building and cleaning the project. The only prerequisite (apart SGDK and VSCode itself along with the c/cpp extension) is the user to have setup the GDK environment variable.

Anyone interested can check it out here.

cheers,
elefas

Re: SGDK and Visual Studio Code template

Posted: Mon Jun 19, 2017 1:13 pm
by Staffan
Im on my way to getting this to work :)
But where is libres.h thats font.h refers?

Re: SGDK and Visual Studio Code template

Posted: Mon Jun 19, 2017 1:32 pm
by Stef
I fixed the SGDK 1.30 archive as it was missing ;) Still you can just rebuild the library itself to re generate it (using makelib.gen makefile)

Re: SGDK and Visual Studio Code template

Posted: Mon Jun 19, 2017 1:38 pm
by Staffan
where?
not here at least:
https://github.com/Stephane-D/SGDK/tree/master/inc

Im afraid the "rebuild myself" thing is above my head at the moment. :oops:

Re: SGDK and Visual Studio Code template

Posted: Mon Jun 19, 2017 3:41 pm
by Staffan
I commented out the include "libres.h" in font.h and it works.
Hope it doesnt do anything important!

Wow, I have Hello World on Megadrive :)

Thank you so much elefas! and thank you for trying Stef. :)

Re: SGDK and Visual Studio Code template

Posted: Mon Jun 19, 2017 4:21 pm
by Stef
If you take the whole archive from here :
https://github.com/Stephane-D/SGDK/rele ... sgdk130.7z

Anyway the .h is not important by itself as objects exists anyway ;)

@elafas> Great VS template thanks ! i'm not using it myself but i'm sure a lot of people does !

Re: SGDK and Visual Studio Code template

Posted: Wed Jun 21, 2017 11:06 am
by ronin68k
My friend found an solution about VS here...
https://github.com/Stephane-D/SGDK/pull/80

Re: SGDK and Visual Studio Code template

Posted: Sat Sep 16, 2017 8:22 am
by nekete
Hello Elefas,

First of all, thanks for your efforts. I'm trying to use the template in Windows VSCode but it doesn't work in my config.
After configuring everything as told in the readme.adoc I tried to do "make", but I got:

Code: Select all

cmd /C ${env.GDK}\bin\make -f ${env.GDK}\makefile.gen
The system cannot find the path specified.
I modified $tasks.json ${env.GDK} to %GDK% to try to fix it.
After this modifications I got:

Code: Select all

cmd /C %GDK%\bin\make -f %GDK%\makefile.gen
E:\SGDK/bin/mkdir -p src/boot
E:\SGDK/bin/mkdir -p out
E:\SGDK/bin/mkdir -p out/src
E:\SGDK/bin/mkdir -p out/res
E:\SGDK/bin/ld -T E:\SGDK/md.ld -nostdlib --oformat binary -o out/rom_head.bin out/rom_head.o
e:\SGDK\bin\ld.exe: cannot open linker script file E:SGDK/md.ld: No such file or directory
make: *** [out/rom_head.bin] Error 1
I'm really bad at tooling, can someone help me making it work?.

Thanks :(

Re: SGDK and Visual Studio Code template

Posted: Sat Sep 16, 2017 5:34 pm
by Grind
Notice how it shows E:SGDK/MD.ld. I'm guessing your GDK environment variable is E:\SGDK, but needs to be E:/SGDK. Some of these programs think a backslash is an escape character instead of a path separator.

Re: SGDK and Visual Studio Code template

Posted: Sun Sep 17, 2017 4:22 pm
by nekete
Thanks, its working now. Windows uses backslash as default :oops:

Re: SGDK and Visual Studio Code template

Posted: Wed Sep 20, 2017 8:05 am
by matteus
Does Vs studio do auto complete in conjunction with the SGDK? I may swap out codeblocks if this is the case.

Re: SGDK and Visual Studio Code template

Posted: Wed Sep 20, 2017 10:43 am
by Staffan
If you by this means that you can type for an example "VDP_" and get a list of all avaialable commands that starts that way, then yes! You can also right click on a command and choose "goto definition", where there is a little explanation of the function.

Re: SGDK and Visual Studio Code template

Posted: Thu Sep 21, 2017 8:21 am
by matteus
That's exactly what I was hoping for! Great work! definitely will look into implementing this

Re: SGDK and Visual Studio Code template

Posted: Fri Sep 22, 2017 7:38 pm
by Miquel
As long as you have a project with c/c++ files within, doesn't matter if it compiles or not. To compile select a ' Makefile' project and fill in the paths/exe's.