├── .gitignore ├── .vscode ├── c_cpp_properties.json └── tasks.json ├── README.adoc └── src └── main.c /.gitignore: -------------------------------------------------------------------------------- 1 | /out 2 | /src/boot -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": ["${GDK}/inc"], 6 | "browse" : { 7 | "limitSymbolsToIncludedHeaders" : true, 8 | "databaseFilename" : "" 9 | } 10 | } 11 | ], 12 | "version": 4 13 | } 14 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "command": "cmd", 6 | "type": "shell", 7 | "args": ["/C"], 8 | "tasks": [ 9 | { 10 | "group": "build", 11 | "label": "make", 12 | "command": "${env:GDK}\\bin\\make", 13 | "args": [ 14 | "-f", 15 | "${env:GDK}\\makefile.gen" 16 | ], 17 | "presentation": { 18 | "echo": true, 19 | "reveal": "always", 20 | "focus": false, 21 | "panel": "shared", 22 | "showReuseMessage": false, 23 | "clear": true 24 | }, 25 | "problemMatcher": [] 26 | }, 27 | { 28 | "label": "clean", 29 | "command": "${env:GDK}\\bin\\make", 30 | "args": [ 31 | "clean", 32 | "-f", 33 | "${env:GDK}\\makefile.gen" 34 | ], 35 | "presentation": { 36 | "echo": true, 37 | "reveal": "always", 38 | "focus": false, 39 | "panel": "shared", 40 | "showReuseMessage": false, 41 | "clear": true 42 | }, 43 | "problemMatcher": [] 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | == Setting up SGDK with Visual Studio Code 2 | 3 | This small project will help to setup a working environment (tested in Windows) for Sega Mega Drive developing with SGDK toolchain and Visual Studio Code as prefered editor. Visual Studio Code will be setup with c/cpp code extension and tasks to build and clean the workspace. 4 | 5 | 6 | === Prerequisites 7 | 8 | . Download link:https://github.com/Stephane-D/SGDK[SGDK] 9 | . Download link:https://code.visualstudio.com/[Visual Studio Code] 10 | 11 | 12 | === Setup 13 | 14 | * Extract SGDK to a prefered directory. 15 | * Create an environment variable `GDK` pointing to the SGDK directory (e.g. "C:/dev/sgdk"). 16 | * Install Visual Studio Code. 17 | * Install the following extensions in vsCode: `C/C++ for Visual Studio Code` 18 | * Clone this github repo: `git clone https://github.com/pleft/SEGA_VSCode_Template.git`. 19 | 20 | === Usage 21 | 22 | * Open `VSCode` and `File->Open Folder...` and choose the folder of the checked out repository. 23 | * Folder `.vscode` contains two files: `c_cpp_properties.json` and `tasks.json` 24 | * In `c_cpp_properties.json` it is added the include folder of the `SGDK`: `"includePath": ["${GDK}/inc"]` 25 | * In `tasks.json` there are 2 tasks to help build and clean the project, `make` and `clean`. 26 | - To run `make` task press `Ctrl-Shift-B`. 27 | - To run `make` or `clean` press `Ctrl-P` then write `task make` or `task clean`. 28 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | VDP_drawText("Hello Sega World!", 10, 13); 6 | 7 | while(1) 8 | { 9 | VDP_waitVSync(); 10 | } 11 | return (0); 12 | } 13 | --------------------------------------------------------------------------------