This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Note: optimized to rely on dst ptr to be 64-byte aligned (as sprites are) | |
clear_writer_sprite_row: { | |
+mov16($30, zp_sprite_dst) | |
ldx #num_writer_sprites | |
sprite_loop: | |
lda $31 | |
sta dstp0-1 | |
sta dstp1-1 | |
sta dstp2-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Node { | |
loc: SourceLoc; | |
} | |
export type Expr = any | Ident | Literal | |
export type Stmt = | |
StmtInsn | |
| StmtSetPC | |
| StmtAlign | |
| StmtData |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CW = 6; | |
const CH = 7; | |
function readSprites({readFileSync, resolveRelative}, filename) { | |
const buf = readFileSync(resolveRelative(filename.lit)); | |
const numSprites = buf.readUInt8(4); | |
const data = []; | |
for (let i = 0; i < numSprites; i++) { | |
const offs = i*64+9; | |
const bytes = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "c64jasm build & run", | |
"type": "shell", | |
"command": "c64jasm main.asm --out main.prg && x64 main.prg", | |
"problemMatcher": "$c64jasm" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FALSE=0 | |
TRUE=1 | |
irq0_line = 100 | |
irq1_line = 150 | |
!macro basic_start(addr) { | |
* = $801 | |
!byte $0c | |
!byte $08 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!macro basic_start(addr) { | |
* = $801 | |
!byte $0c | |
!byte $08 | |
!byte $00 | |
!byte $00 | |
!byte $9e | |
!if (addr >= 10000) { | |
!byte $30 + (addr/10000)%10 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.const zptmp0 = $60 | |
.const zptmp1 = $62 | |
.const zptmp2 = $64 | |
.const zptmp3 = $68 | |
.const zp_dstptr = zptmp0 | |
.const zp_srcptr = zptmp1 | |
.const zp_nlines = zptmp2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.var spdDataTemplate = "Magic=$0,Version=$3,NumSprites=$4,NumAnims=$5,Bg=$6,Multicol1=$7,Multicol2=$8" | |
.var iiro = LoadBinary("sprites/iiro.spd", spdDataTemplate) | |
.macro setupSprites(spd, data, dblw, dblh) { | |
.const numSprites = spd.getNumSprites()+1 | |
.const spriteMask = ((1 << numSprites)-1) | |
.var xScale = 1 | |
.var yScale = 1 | |
lda #spriteMask |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reverseBits = (b) => { | |
const b0 = (b & 1) >> 0 | |
const b1 = (b & 2) >> 1 | |
const b2 = (b & 4) >> 2 | |
const b3 = (b & 8) >> 3 | |
const b4 = (b & 16) >> 4 | |
const b5 = (b & 32) >> 5 | |
const b6 = (b & 64) >> 6 | |
const b7 = (b & 128) >> 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main(int argc, const char **argv) | |
{ | |
FILE* fpi = fopen(argv[1], "rb"); | |
FILE* fpo = fopen(argv[2], "wb"); |