Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

PinwheelSystem/Pinwheel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Shelter

Pinwheel

🍭 An awesome little fantasy computer designed to be simple.

Pinwheel is an all new fantasy computer, developed in Go and designed for ease of use and simplicity, and highly customizable where applicable (and wanted..!).
It is currently in the VERY early alpha-ish stage, and isn't meant for normal, ordinary use yet.
Stay tuned though, I'm spending my entire holiday to work on this little thing as much I can.

Planned Features

  • Customizable Palette of 64 COLORS (by program and/or user)
  • Easily scriptable
  • Simplicity
  • Joypad, keyboard and mouse input

Install

Precompiled Binaries

soon:tm:

Compiling

Prerequisites

  1. Go
  2. Git (optional)
  3. SDL2 (follow these steps)
  • Currently only SDL2 itself is needed

Steps

  1. Download the repository
  1. Open a terminal, change to the downloaded repo and run: go build -o Pinwheel .
  • Windows users will have to add the .exe to Pinwheel
  1. Assuming there are no errors, you should be able to run ./Pinwheel.
    The first argument is the Lua source to run, for example to run a program: ./Pinwheel game.lua

Documentation

Functions

Expected to change A LOT during development.

  • Spin() - Called every CPU cycle

  • termprint(text) - Print text to the terminal

  • vpoke(address, value) - Write value to VRAM address

  • plot(x, y, color) - Place pixel at x, y with palette color number color

  • time() -> number - Gets the amount of time since boot

  • pchar(char, x, y) - Place character at x, y

  • vertline(x, color) - Draw a vertical line on the x axis

  • horizline(y, color) - Draw a horizontal line on the y axis

  • clear() - Clears the screen

  • print(text, x, y, color) - Print text starting at x, y in the color color

Events

Pinwheel, unlike most FCs, is event driven.
To handle any event, you use events:

events:On("eventName", function(arg1, arg2)
	-- Inside here is our callback function
	-- `arg1` and `arg2` are our callback arguments
end)

Events should be outside the Spin function.

mouseClick

Callback arguments:

  • x X coordinate of the location of the click
  • y Y coordinate of the location of the click

Emitted when a user clicks the mouse.

⚠ The x and y values must be divided by 4 to apply to Pinwheel's internal resolution!

mouseDrag

Callback arguments:

  • x X coordinate of the current cursor location
  • y Y coordinate of the current cursor location

Emitted when a user holds a mouse button and moves the mouse.

⚠ The x and y values must be divided by 4 to apply to Pinwheel's internal resolution!

mouseMove

Callback arguments:

  • x X coordinate of the location of the cursor
  • y Y coordinate of the location of the cursor

Emitted when a user moves the mouse.

⚠ The x and y values must be divided by 4 to apply to Pinwheel's internal resolution!

Thanks

License

BSD 3-Clause

About

🍭 An awesome little fantasy computer designed to be simple. ⛺

Resources

License

Stars

Watchers

Forks