Coder Social home page Coder Social logo

pocket-clicker's Introduction

Pocket Clicker

A Cookie Clicker clone for the Game Boy written in Nim! (plus my own crt0 and basic routines in ASM)

Unlike my last proof-of-concept, this time I try not to depend too much on GBDK (particularly the GB-specific part), but rather to try and compile everything from the C that Nim generates.

(Pokémon-theme hopefully temporary)

How to build

For best results, do this in a Unix-like environment.

Requirements

Steps

  1. Ensure the GBDK_ROOT environment variable points to your GBDK 2020 installation folder.
  2. Clone the repo:
git clone https://github.com/ZoomTen/pocket-clicker
  1. cd into the repo folder and run:
nim build
  1. To clean up the repo folder of generated files including the ROM:
nim clean
  1. To clean up the repo folder excluding the ROM and debug symbols:
nim cleanDist

pocket-clicker's People

Contributors

zoomten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pocket-clicker's Issues

Using macros as pragmas, which can be imported

Your project is very cool.

Looking at your code, I could see that you made this note:

# Since pragmas cannot be imported, here's a use case of `include`.

You can use macros as pragmas. See below:

import std/macros

macro homeProc*(node: untyped): untyped = # Macros can be marked as exportable
  if node.kind == nnkProcDef:
    addPragma(node,
      newTree(nnkExprColonExpr,
        newIdentNode("codegenDecl"), newLit("$# $#$# NONBANKED")))

  echo "--- AST generated by `homeProc` ---"
  echo astGenRepr(node) # Prints the AST generated by the `homeProc` macro

proc vblank*() {.exportc: "VBlank", homeProc.} =
    ## VBlank interrupt.
    discard

static:
  echo "-----------------------------------"
  echo "---         dumpAstGen          ---"

# Prints the AST of the Nim code below. It can be used to get an idea of how to generate the AST using macros.
dumpAstGen:
  proc vblank*() {.exportc: "VBlank", codegenDecl: "$# $#$# NONBANKED".} =
    ## VBlank interrupt.
    discard

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.