Code Monkey home page Code Monkey logo

gbdk-go-7's Introduction

gbdk-go

gbdk-go is a Go binding for GBDK. You can do GameBoy software development with Go.

Architecture

gbdk-go compiles Go source code and outputs C code.

The output C code is built into GB ROM by GBDK.

package main

import "github.com/Akatsuki-py/gbdk-go/api/stdio"

func main() {
	stdio.Printf("Hello World!")
	stdio.Printf("\n\nPress Start")
}

The above Go code is compiled into the following C code.

#include <stdio.h>
void main() {
    printf("Hello World!");
    printf("\n\nPress Start");
}

Install

You need to build binary from source.

Requirements:

  • Go 1.14
  • Make
$ git clone https://github.com/Akatsuki-py/gbdk-go.git
$ cd ./gbdk-go
$ make

Usage

Requirements:

  • gbdk-go/gbdkgo
  • gbdk-go/go2c
  • gbdk-go/gbdk2020

They must be in the same directory.

If you are doing the above Install step, there should be no problem.

$ gbdkgo [options] dir

Example

$ gbdkgo example/simple_shmup

API

gbdk-go API

The API is basically a GBDK binding.

Some are not yet implemented.

Project rules

  • ./main.go main file in project. ./main.c in gbdk.
  • ./**.go sub file in project. ./**.c in gbdk.
  • ./asset/**.go asset file in project. these file is converted into asset.h

You must create a Go directory project according to above format.

The directory structure also needs to be specific.

Linter

Although gbdk-go allows GB development with Go, there are some grammars such as defer and goroutine that cannot be used.

So I'm going to write a linter for gbdk-go.

Performance warning

gbdk-go outputs GB ROM with C in between.

When using C language, the performance is greatly inferior compared to the raw assembly.

You should read to_c_or_not_to_c.md.

gbdk-go-7's People

Contributors

akatsuki105 avatar

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.