SGDK and Visual Studio Code template

SGDK only sub forum

Moderator: Stef

Post Reply
elefas
Newbie
Posts: 5
Joined: Sun Jan 30, 2011 11:28 am

SGDK and Visual Studio Code template

Post by elefas » Sat Jan 21, 2017 5:24 pm

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

Staffan
Very interested
Posts: 57
Joined: Wed Jun 14, 2017 2:33 pm

Re: SGDK and Visual Studio Code template

Post by Staffan » Mon Jun 19, 2017 1:13 pm

Im on my way to getting this to work :)
But where is libres.h thats font.h refers?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: SGDK and Visual Studio Code template

Post by Stef » Mon Jun 19, 2017 1:32 pm

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)

Staffan
Very interested
Posts: 57
Joined: Wed Jun 14, 2017 2:33 pm

Re: SGDK and Visual Studio Code template

Post by Staffan » Mon Jun 19, 2017 1:38 pm

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:

Staffan
Very interested
Posts: 57
Joined: Wed Jun 14, 2017 2:33 pm

Re: SGDK and Visual Studio Code template

Post by Staffan » Mon Jun 19, 2017 3:41 pm

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. :)

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: SGDK and Visual Studio Code template

Post by Stef » Mon Jun 19, 2017 4:21 pm

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 !

ronin68k
Interested
Posts: 29
Joined: Mon Nov 02, 2015 5:28 am
Location: Krasnodar, Russia

Re: SGDK and Visual Studio Code template

Post by ronin68k » Wed Jun 21, 2017 11:06 am

My friend found an solution about VS here...
https://github.com/Stephane-D/SGDK/pull/80

nekete
Newbie
Posts: 3
Joined: Mon Nov 07, 2016 5:52 pm

Re: SGDK and Visual Studio Code template

Post by nekete » Sat Sep 16, 2017 8:22 am

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 :(

Grind
Very interested
Posts: 69
Joined: Fri Jun 13, 2014 1:26 pm
Location: US
Contact:

Re: SGDK and Visual Studio Code template

Post by Grind » Sat Sep 16, 2017 5:34 pm

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.

nekete
Newbie
Posts: 3
Joined: Mon Nov 07, 2016 5:52 pm

Re: SGDK and Visual Studio Code template

Post by nekete » Sun Sep 17, 2017 4:22 pm

Thanks, its working now. Windows uses backslash as default :oops:

matteus
Very interested
Posts: 336
Joined: Mon Feb 04, 2008 1:41 pm

Re: SGDK and Visual Studio Code template

Post by matteus » Wed Sep 20, 2017 8:05 am

Does Vs studio do auto complete in conjunction with the SGDK? I may swap out codeblocks if this is the case.

Staffan
Very interested
Posts: 57
Joined: Wed Jun 14, 2017 2:33 pm

Re: SGDK and Visual Studio Code template

Post by Staffan » Wed Sep 20, 2017 10:43 am

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.

matteus
Very interested
Posts: 336
Joined: Mon Feb 04, 2008 1:41 pm

Re: SGDK and Visual Studio Code template

Post by matteus » Thu Sep 21, 2017 8:21 am

That's exactly what I was hoping for! Great work! definitely will look into implementing this

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

Re: SGDK and Visual Studio Code template

Post by Miquel » Fri Sep 22, 2017 7:38 pm

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.
HELP. Spanish TVs are brain washing people to be hostile to me.

Post Reply