Coder Social home page Coder Social logo

zerasul / genesis-code Goto Github PK

View Code? Open in Web Editor NEW
42.0 3.0 9.0 43.92 MB

Visual Studio Code Genesis Development Extension

Home Page: https://marketplace.visualstudio.com/items?itemName=zerasul.genesis-code

License: MIT License

TypeScript 97.18% Batchfile 0.05% HTML 2.77%
sgdk retrodev sega sega-genesis gendev vscode-extension vscode genesis sega-megadrive hacktoberfest

genesis-code's Introduction

Genesis-code Extension

Build Status SGDK Compatible Maintainability Rating Security Rating Buy Me A Coffee donate button Visual Studio Marketplace Installs

Genesis-Code is a Visual Studio Code Extension for Sega Genesis/ Mega Drive development. This extension is created for use with the SGDK/GENDEV or MARSDEV projects for create homebrew games for the Sega 16 bits console.

For more information, see Genesis Code Documentation Web Page.

If you want to know how to develop Mega Drive Games; You can see the "16 Bits Homebrew Development" Book available on Amazon: Spanish Version, English Version.

Features

With this extension, you can use easily a few commands for help you create awesome games. This extension adds the following commands:

  • Compile command: compile the program and generate the Rom file.
  • Run command: You can use an emulator like Gens to run and test your game.
  • Clean command: Clean the programs build folder (calls makefile with clean).
  • Compile & Run command: first compile and later run the rom.bin file in an emulator.
  • Create project: Select a folder and create a Hello World project ready for compile and run.
  • Set Gens Command: Update the configuration and adds the command path to run Gens Emulator.
  • Compile For debug command: Compile the project with debug options.
  • SGDK Resource Files Code Completion.
  • Added remote debugging configuration for use with GDB.
  • Compatible with MarsDev Toolchain.
  • Import TMX file command: Uses a TMX file format for generate a C header file for your projects.
  • Import Json TMX file command: Uses a Tmx Json File Format for generate a C Header file for Your project.
  • Added configuration for use alternative MakeFile.
  • Added configuration for use alernative environment variables for GDK, GENDEV or MARSDEV.
  • Added Genesis Code: About for open more information about the extension.
  • Added BitmapViewer.
  • Added Status Bar Buttons for compile, compile & Run, Compile For debug and clean (Thanks to burmaraider).
  • Added Configuration for enable or disable status bar buttons.
  • Added Docker Support.

vscodegif

Requirements

To use this extension you need to install SGDK(windows)/GENDEV(linux) or MARSDEV projects on your system and configure the GDK, GENDEV or MARSDEV enviroment variables, or build a SGDK Docker Image.

Extension Settings

You can set the Gens Emulator command to call it directly from the Genesis Code Extension (Run Command).

You can set it via command , or using the settings configuration.

Genesiscodeconfiguration

NOTE: You can use another emulators like Blastem.

You can select the toolchain type for use with genesis code:

  • SGDK/GENDEV: the SGDK libs and GENDEV (On Linux) will be used with Genesis Code.
  • MARSDEV: The MARSDEV project will be used with Genesis Code.
  • DOCKER: Use a SGDK Docker container for compiling.

genesiscodeconfigtoolchain

You can set an alternative MakeFile on the configuration panel. When the compile or clean command is called the alternative Makefile will be used instead the default makefile.

genesiscodemakefile

Also, you can set an alternative value for the environment variables of GDK, GENDEV or MARSDEV.

envvariables

Now, you can define a custom docker image tag for generate a new container.

dockertag

NOTE: If you want to use Doragasu SGDK Docker Image, you can use the check in Configuration and you must add the current Docker Image Tag description (with the gitlab registry URL).

statusbarconfig

You can enable or disable status bar buttons for use some common commands.

Status Bar Buttons

Bitmap Viewer

Now you can use the Bitmap Viewer; with some information of the images. You can open as alternative viewer on VSCODE (right click and Reopen Editor... on tab).

bitmapviewer

Known Issues

  • In MacOs the compile & Run project command, the emulator is not running in background. We are working in this issue.
  • In Linux systems, you can't compile with debug options using SGDK/GENDEV toolchain.
  • In Linux Systems, when you create a new project there is no launch.json file for SGDK/GENDEV toolchain.
  • On MacOs Systems, for the SGDK/GENDEV ToolchainType you can't use custom Makefile or custom Environment variables; this is due to the use of Wine.
  • The C headers include settings don't work if you are using Docker containers; this is due the SGDK headers are inside the container and not available without using a volume. Follow this instructions for more information.

Release Notes

1.5.1

  • On Windows Systems, the new projects will be created using Command prompt console as default (no extra configuration needed) (Thanks to AIoriBranford).
  • Now, when a new project is created, the current GDK or GENDEV configuration will be used for C/C++ include configuration on .vscode/settings.json; if there is no configuration, the environment variable will be used.
  • Updated Dependencies.

1.5.0

  • Add "Status bar Button" configuration, to add status bar buttons for the more commons commands (no more command palette).
  • Added 4 Status Bar Buttons for compile, compile&Run, compile for Debug and clean.
  • Updating autocompletion and .res grammar for use with the new XGM2 Driver and SGDK 2.00.
  • Updating dependencies.

1.4.2

  • Updating grammar for use SGDK 1.80 with the last documentation.
  • Fix Bug when create on Windows a new project the settings are not properly point to SGDK include Folders.
  • Fix Multiple Instances of gens.code error.
  • Updated dependencies.

1.4.1

  • Added Support for Dogarasu SGDK Docker Image.
  • Added Configuration Flag for Dogarasu SGDK Docker Image.
  • Fix Gens.code Multiples Instances Error.
  • Updated Rescomp Context Help Information for the Last Version of SGDK (Supports 1.70).
  • Updated Dependencies.

1.4.0

  • Added Docker container Support.
  • Improved Code with a total Refactoring.
  • SGDK resource files now have regions
    • They start with #region / #pragma region
    • They end with #endregion / #pragma endregion
  • Fixed some syntax highlighting errors related with numbers

NOTE: Thanks to our contributors on the HacktoberFest 2021 and for the last contributors with the File resource Grammar improvements.

1.3.3

  • Added SGDK 1.65 Support.
  • Updating use of Wine for Wine64 (Only MacOs).
  • Added Bitmap Viewer for Bmp,Png and JPEG images.

1.3.2

  • Added Support for SGDK 1.60 Map resources in res files.
  • Changed default main.c generation for use the new functions for SGDK 1.60.
  • Added comment higthlingthing on res files.
  • Fixed a bug that the Run command dosen't works if the path have spaces characters.
  • Added Genesis Code: About command. This command shows information about Genesis Code extension.
  • Updated some dependencies.

1.3.1

  • Fixed a bug with some dependencies (Import TMX format ins't works).
  • Fixed some code smells reported by sonar.

1.3.0

  • Added import TMX file command; it generates a C Header File with the information of the TMX file. For more info about the TMX format, please see Tiled Documentation.
  • Added import Json Tmx File command; it generates a C Header File with the information of the json TMX file. For more info about the json Tmx Format, please see Tiled Documentation.
  • Added custom makefile configuration; now you can set an alternartive for the default makefile.
  • Added configuration for GDK, GENDEV or MARSDEV custom variables.
  • Updated some dependencies and improved code.

1.2.2

  • Updated for use with SGDK 1.51; added new features for SGDK Resource Files autocompletion (for use with the last version of rescomp tool).
  • Fixed some bugs and improved code.
  • Updated some dependencies and updating package-lock.json.

1.2.1

  • Updated for use with SGDK 1.50; added new features for SGDK Resource Files autocompletion (for use with the last version of rescomp tool).
  • Now when you create a new Project a settings.json file is created with the default include paths.
  • Added Debuggers category to Package.json.
  • Updated some dependencies and updating package-lock.json.

1.2.0

  • Added Marsdev toolchain compatibility. Now you can use the marsdev toolchain with genesis code. For more information please see Genesis code Documentation Web.
  • Added configuration for debugging. Now when you create a new project a launch.json is created. For more information please see Genesis code Documentation Web.
  • Now you can select your toolchain from the genesis code Settings; SGDK/GENDEV toolchain or MARSDEV toolchain.
  • Added Compile with Debug Options command.
  • Updated dependencies and improving code.

1.1.1

  • Added SGDK Resource Files Autocomplete feature. Now we have contextual help for the SGDK Resource Files, see Genesis code Documentation web for more information.
  • Fixed a typo error on the main.c autogenerated file when we create a new Project.
  • Updated depdendencies and improving tests.

1.1.0

  • Adding MACOs Support. Now you can use genesis code using wine. For more information please see Genesis code Documentation.
  • Added Syntax HighLingthing for SGDK Resource Files (.res).
  • Updated dependencies.

1.0.1

  • Fixed a bug with create new project that dosent show properly the readme.md file.
  • Fixed a bug with create new project that dosent include 'res' and 'inc' directories into git repository.
  • Updating dependencies of the extension.

1.0.0

Initial Release:

  • Added Compile command.
  • Added Run command.
  • Added Clean command.
  • Added Compile & Run command.
  • Added Create Project command.
  • Added Set Gens Emulator Command.

You can support this project using Buy Me a Coffee.

Enjoy!

genesis-code's People

Contributors

burmaraider avatar crisconru avatar crypto-cmd avatar dependabot-preview[bot] avatar dependabot[bot] avatar gerardgascon avatar ioribranford avatar juanjosalvador avatar michelvosje avatar zerasul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

genesis-code's Issues

add SGDK 1.60 support

after the release of SGDK 1.60, need to update the configuration and code of genesis code:

  • add autocomplete of the new MAP resource on res files
  • update default main.c template to replace the VDP_WaitVSync() to SYS_doVBlankProcess
  • update all the rescomp autocompletion with the new paramters.

Fix PullRequest Errors

Due to the lasts Pull Request, we need to upgrade the configuration for Azure Devops to use NodeJs 10.X.X or later.

Cannot resolve %GDK%

Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS D:\dev\genesis\megapong> set GDK=D:\dev\genesis\tools\sgdk
PS D:\dev\genesis\megapong> %GDK%\bin\make -f %GDK%\makefile.gen
%GDK%\bin\make : The module '%GDK%' could not be loaded. For more information, run 'Import-Module %GDK%'.
At line:1 char:1
+ %GDK%\bin\make -f %GDK%\makefile.gen
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (%GDK%\bin\make:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoLoadModule
 
PS D:\dev\genesis\megapong>

I have correctly setup SGDK and have correct GDK and GDK_WIN variables and infact if I run the following command everything works fine.

cmd /C %GDK%\bin\make -f %GDK%\makefile.gen

I am using the latest Windows 10 Pro x64 and VSCode, Genesis Code is 1.3.1

configure SGDK folder by workspace

Configure SGDK folder per each workspace. Now it uses a Enviroment Variable called GDK. Can be useful configure the GDK variable per each workspace in vscode.

example:

set GDK=<mySGDKfolder>
%GDK%/bin/make -f %GDK%/makefile.gen

TMXParser.js - Activating extension 'Zerasul.genesis-code' failed: Cannot find module 'fast-xml-parser'

I'm unable to load the Genesis Code extension. Version is 1.3.0 and my VSCode version details are:

Version: 1.50.0 (user setup)
Commit: 93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
Date: 2020-10-07T06:10:52.432Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

When attempting to run any Genesis Code command, I receive and error that the command isn't found. On startup, the dev console spits out this error and stack trace indicating a failure to activate the extension:

Activating extension 'Zerasul.genesis-code' failed: Cannot find module 'fast-xml-parser'
Require stack:
- c:\Users\mc\.vscode\extensions\zerasul.genesis-code-1.3.0\out\TmxParser.js
- c:\Users\mc\.vscode\extensions\zerasul.genesis-code-1.3.0\out\appModel.js
- c:\Users\mc\.vscode\extensions\zerasul.genesis-code-1.3.0\out\extension.js
- c:\Users\mc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\mc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\mc\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js.

I've tried uninstalling the extension, removing the installation files from my user directory .vscode/extensions folder, and reinstalling. Unfortunately it hasn't resolved the issue. So for some reason, the fast-xml-parser NPM package either isn't being installed or isn't being detected.

add bitmap viewer

Add a bitmap image viewer where you can see the image and the image used. This can be useful for create game resources for SGDK.

Error on compiling for debugg on Macos

On macos Systems if you use Compile For debuging for the first time and you aren't execute other command, it fail becase there is no a copy of build.bat file.

fix typo on main.c template

There is an typo error on the initial comment on main.c file when a new project is created.

Created With Genesis-Code for extension for Visual Studio Code change to
Created With Genesis-Code extension for Visual Studio Code

fix coverage report issue

Due to an error with the continuous integration engine, the sonarcloud status gateway show as failed. We need to create a new coverage report for use with sonarcloud.

Add run command

Add run command for run the current rom with a Genesis Emulator (gens by default).

Colorize comments on RES files

RES files also support comments, but Genesis Code doesn't colorize them. Would be nice if VSCode support this too!

Example

SPRITE ship_sprite "sprites.bmp" 6 8 FAST 6
# Background image
IMAGE background "background.bmp" FAST

add an about genesis code Dialog

add an about genesis code dialog with information about the extension and some useful links, like:

  • extension web page
  • how to contribute
  • version information
  • author information.

Add documentation

Add a documentation about the extension; can be a wiki or a GH Page...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.