Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:
Always hacking

Remy Sharp remy

:electron:
Always hacking
View GitHub Profile
View pal-demo.bas.txt
#autoline 10
RUN AT 3
LAYER 2,1: CLS
LOAD "pal-test.spr" BANK 13: ; spritesheet
LOAD "pal-test.map" BANK 14: ; tile map
LOAD "pal-test.pal" BANK 15: ; palette
TILE BANK 13: ; point tilemap to spritesheet
TILE DIM 14,0,16,16: ; using tile bank 14, offset 0, tile 16 wide, tile size 16
TILE 16,12: ; print tile for 16x12
@remy
remy / sfx.bas
Created Jul 20, 2020
Example of using OUT with AY chips in NextBASIC - main setup code by Dave Clarke
View sfx.bas
#autoline 10
RUN AT 3
PROC sfxsetup()
%i=0
DIM S$(4,20)
S$(1)="cccBccccCB"
S$(2)="baBA"
S$(3)="aAaAbBbBbB"
View _README.md

Assuming you're using VS Code to generate the NextBASIC files, you'll need:

  • bank-demo.bas.txt: "Export to binary BAS"
  • b12.bas.txt: "Export to BANK"

bank-demo is expecting to find the file named "b12.bas" - but you can change it as you please, the name is purely asthetic.

I've use autoline just because I can't be bothered with line numbers, but the line numbers in b12.bas can be anything (from what I understand) between 1-9999 and can overlap with line numbers in other banked code or your main NextBASIC file.

@remy
remy / _README.md
Created Jun 1, 2020
See readme for usage
View _README.md

For use with: https://github.com/kounch/knloader

Written for the mac, though I'm sure it can be adjusted to work on linux and WSL.

Make sure to change SD_CARD and GAMES to the root of your SD Card and the games/rom folder on the card - this last variable GAMES is needed in the knloader.bdt database.

Then run as:

sh knloader-db-maker.sh > knloader.bdt
@remy
remy / keys.bas
Created Apr 11, 2020
keyboard press testing for NextBASIC
View keys.bas
10 ;
11 ; Keypress combination example
12 ; Note that I am using the bit shift to allow
13 ; the INVERSE command to work.
14 ; If you're testing for a single keypress, then use:
15 ; IF %(IN $FBFE & 0b0010)=0 THEN ...
16 ; See page 272 of NextBASIC manual for ports
17 ;
100 PRINT AT 0,0; INVERSE %( IN $fbfe >> 0 & 1 ^ 1);"q"
101 PRINT AT 0,1; INVERSE %( IN $fbfe >> 1 & 1 ^ 1);"w"
@remy
remy / README.md
Created Mar 28, 2020
A Karabiner-Elements key config to let me use the esc key with cspect.
View README.md

In breif, this config lets me use the escape key to bring up the ZX Spectrum Next menu when running under CSpect on the mac.

The escape key will send: F10, shift+1, F10.

Using any modifier key and escape will exit CSpect (sending a real esc key to CSpect).

This config is used with Karabiner-Elements

@remy
remy / help.md
Created Mar 19, 2020
Rusty Pixel TileEditor.nex help
View help.md

TileEditor

Common controls

CAPS+1 Map edit mode
CAPS+2 Block edit mode
CAPS+3 Palette edit mode
SYM+CAPS+L Load Set
@remy
remy / loader.bas
Created Mar 15, 2020
Loads screen$ and keeps it on screen (BASIC for ZX Spectrum)
View loader.bas
10 CLS
20 LOAD "" SCREEN$
30 PAUSE 0
View twitch-session-2019-08-14.js
/* eslint-env browser */
/* global jq: true */
const escaped = new Map([['<', '&lt;'], ['>', '&gt;']]);
const $$ = s => Array.from(document.querySelectorAll(s));
const $ = s => document.querySelector(s);
let jqLoaded = false;
const scrollPositions = [];
@remy
remy / README.md
Created Jul 31, 2019
Workshop directions
View README.md

This will configure your setup ready for the Next workshop:

  1. Create a working directory: mkdir next-workshop
  2. Go into the directory: cd next-workshop
  3. Save the package.json file (included in this gist) to the working directory and save it as "package.json"
  4. Assuming you've installed Node and also have npm, run npm install
You can’t perform that action at this time.