This file contains 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 pointer screen_out = $5c00 | |
const pointer chars_out = $6000 | |
const pointer sprites_out = $4000 | |
const pointer spritepointer = screen_out+$3f8 | |
byte timer | |
byte frameoffset | |
void main () { |
This file contains 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
; display a charpad data set | |
; 64tass.exe --cbm-prg autorun.s -o auto.prg | |
; note using ? doesn't take any room in the output | |
*=$10 | |
source .word ? | |
dest .word ? | |
tempx .byte ? | |
screenChars = $3400 ; the 40x25 buffer |
This file contains 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
//java -jar ..\..\millfork.jar pacman.mfk -s -g -o pacman -t pacman_machine | |
import random | |
byte watchdog @$50C0 | |
word stack_address @$4fee | |
byte irqen @$5000 | |
const pointer vidram = $4000 | |
const word colram = $4400 | |
const pointer sprtbase = $4ff0 |
This file contains 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
; flip byte horizontally . 1bit | |
; ldx bytetoflip | |
; lda hiresFLIP,x | |
; a = flipped | |
hiresFLIP: | |
db $00, $80, $40, $C0, $20, $A0, $60, $E0, $10, $90, $50, $D0 | |
db $30, $B0, $70, $F0, $08, $88, $48, $C8, $28, $A8, $68, $E8 | |
db $18, $98, $58, $D8, $38, $B8, $78, $F8, $04, $84, $44, $C4 |
This file contains 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
import random | |
const word verareg=$9f20 | |
byte verahi @verareg+0 | |
byte veramid @verareg+1 | |
byte veralo @verareg+2 | |
byte veradat @verareg+3 |
This file contains 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
word x16_irq_address @$0314 | |
volatile byte vsync | |
void irq() { | |
vsync = 0 | |
asm { | |
pla | |
tay | |
pla | |
tax |
This file contains 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 <string.h> | |
int encode_rle(unsigned char *src,int size,unsigned char *dst) | |
{ | |
int stat[256]; | |
int i,tag,sym,sym_prev,len,ptr; | |
// count how often each byte is used , to find an unused byte | |
memset(stat,0,sizeof(stat)); | |
for(i=0;i<size;++i) ++stat[src[i]]; |
This file contains 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
-- draw a mode7 style floor | |
scene = {x=10,y=10,z=140,hz=25,rot=0,spd=0} | |
-- fade table http://kometbomb.net/pico8/fadegen.html | |
local fadetable={ | |
{0,0,129,129,129,129,1}, | |
{1,1,1,1,1,1,1}, | |
{2,2,133,133,133,1,1}, |
This file contains 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
// build with | |
// millfork.exe -t c64 irq.mfk | |
import random | |
import c64_joy | |
import stdio | |
const byte VIC_25LINES = %00001000 | |
const byte VIC_DISPLAY_ENABLED = %00010000 | |
const byte VIC_BITMAP_ENABLED = %00100000 |
This file contains 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
/* useful macros ( from cc65 ) */ | |
#define POKE(addr,val) (*(unsigned char*) (addr) = (val)) | |
#define POKEW(addr,val) (*(unsigned*) (addr) = (val)) | |
#define PEEK(addr) (*(volatile unsigned char*) (addr)) | |
#define PEEKW(addr) (*(unsigned*) (addr)) | |
/* CIA1 */ | |
#define cia1_pra 0xDC00 |