mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-01-11 08:30:02 +00:00
nes: update presets, catch exceptions in advance(), #define NES_MIRRORING etc
This commit is contained in:
parent
566bbdca94
commit
764b230599
@ -95,7 +95,6 @@ TODO:
|
||||
- https://makecode.com/language?
|
||||
- show .map file in listings?
|
||||
- open ROM from URL?
|
||||
- #include can't have comment immediately on line before
|
||||
- NES: breakpoint on illegal instruction
|
||||
|
||||
|
||||
|
113
presets/nes/attributes.c
Normal file
113
presets/nes/attributes.c
Normal file
@ -0,0 +1,113 @@
|
||||
|
||||
#include "neslib.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// link the pattern table into PRG ROM
|
||||
// we'll write it into CHR RAM on startup
|
||||
|
||||
//#link "jroatch.c"
|
||||
extern unsigned char jroatch_chr[0x1000];
|
||||
#define PATTERN_TABLE jroatch_chr
|
||||
|
||||
// palette for balls, there are four sets for different ball colors
|
||||
const unsigned char bg_palette[16]={/*{pal:"nes",n:4,sets:4}*/
|
||||
0x0f,0x17,0x27,0x37,
|
||||
0x0f,0x11,0x21,0x31,
|
||||
0x0f,0x15,0x25,0x35,
|
||||
0x0f,0x19,0x29,0x39
|
||||
};
|
||||
|
||||
// convert nametable address to attribute address
|
||||
unsigned int nt2attraddr(unsigned int a) {
|
||||
return (a & 0x2c00) | 0x3c0 | (a & 0x0C00) |
|
||||
((a >> 4) & 0x38) | ((a >> 2) & 0x07);
|
||||
}
|
||||
|
||||
#define ATTRADR_A(x,y) (NAMETABLE_A|0x3c0|((((y)>>2)<<3)|((x)>>2)))
|
||||
|
||||
void put_pixel(unsigned char px, unsigned char py, char color) {
|
||||
int ntaddr, attraddr;
|
||||
char oldch, newch;
|
||||
char oldattr, newattr;
|
||||
// check bounds
|
||||
if (px >= 32*2 || py >= 30*2)
|
||||
return;
|
||||
// compute nametable address
|
||||
ntaddr = NTADR_A(px>>1, py>>1);
|
||||
// compute attribute address
|
||||
attraddr = nt2attraddr(ntaddr);
|
||||
//attraddr = ATTRADR_A(px>>1, py>>1);
|
||||
// compute new character mask
|
||||
newch = 0x80 | (px & 3) | ((py & 3) << 2);
|
||||
// compute new attribute mask
|
||||
newattr = color;
|
||||
if (px & 4) newattr <<= 2;
|
||||
if (py & 4) newattr <<= 4;
|
||||
// wait for vsync
|
||||
ppu_wait_frame();
|
||||
// read old character
|
||||
vram_adr(ntaddr);
|
||||
vram_read(&oldch, 1);
|
||||
vram_adr(attraddr);
|
||||
vram_read(&oldattr, 1);
|
||||
// write new character
|
||||
vram_adr(ntaddr);
|
||||
vram_put(oldch | newch);
|
||||
// write new attribute entry
|
||||
vram_adr(attraddr);
|
||||
vram_put(oldattr | newattr);
|
||||
}
|
||||
|
||||
void color_demo(void) {
|
||||
while (1) {
|
||||
char x = rand() & 0x3f;
|
||||
char y = rand() & 0x3f;
|
||||
put_pixel(x, y, 2);
|
||||
// reset scroll position
|
||||
vram_adr(0);
|
||||
}
|
||||
}
|
||||
|
||||
// draw letters
|
||||
void color_demo1(void) {
|
||||
char ch;
|
||||
unsigned int ntaddr,attraddr;
|
||||
while (1) {
|
||||
ch = rand8();
|
||||
// use rand() for betterness
|
||||
ntaddr = 0x2000 | (rand() & 0x1ff);
|
||||
attraddr = nt2attraddr(ntaddr);
|
||||
ppu_wait_frame();
|
||||
// put character into attrib table
|
||||
vram_adr(attraddr);
|
||||
vram_put(0x55);
|
||||
// put character into name table
|
||||
vram_adr(ntaddr);
|
||||
vram_inc(rand8() & 1);
|
||||
vram_put(ch);
|
||||
vram_put(ch);
|
||||
// reset scroll position
|
||||
vram_adr(0);
|
||||
}
|
||||
}
|
||||
|
||||
// main function, run after console reset
|
||||
void main(void) {
|
||||
// copy pattern table to PRG RAM
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)PATTERN_TABLE, sizeof(PATTERN_TABLE));
|
||||
|
||||
// clear name tables
|
||||
vram_adr(0x2000);
|
||||
vram_fill(0, 0x800);
|
||||
|
||||
// set palette colors
|
||||
pal_bg(bg_palette);
|
||||
|
||||
// enable PPU rendering (turn on screen)
|
||||
ppu_on_all();
|
||||
|
||||
// infinite loop
|
||||
color_demo();
|
||||
}
|
@ -16,11 +16,11 @@ typedef signed char sbyte;
|
||||
typedef unsigned short word;
|
||||
typedef enum { false, true } bool;
|
||||
|
||||
///// TILESET DATA
|
||||
///// PATTERN TABLE
|
||||
|
||||
//#link "jroatch.c"
|
||||
extern unsigned char jroatch_chr[0x1000];
|
||||
#define TILESET jroatch_chr
|
||||
#define PATTERN_TABLE jroatch_chr
|
||||
|
||||
///// DEFINES
|
||||
|
||||
@ -46,12 +46,35 @@ extern unsigned char jroatch_chr[0x1000];
|
||||
#define CH_ITEM 0xc4
|
||||
#define CH_BLANK 0x20
|
||||
|
||||
///// GLOBALS
|
||||
|
||||
// vertical scroll amount in pixels
|
||||
static int scroll_pixel_yy = 0;
|
||||
|
||||
// vertical scroll amount in tiles
|
||||
static byte scroll_tile_y = 0;
|
||||
|
||||
// last screen Y position of player sprite
|
||||
static byte player_screen_y = 0;
|
||||
|
||||
// score (BCD)
|
||||
static byte score = 0;
|
||||
|
||||
// random byte between (a ... b-1)
|
||||
// use rand() because rand8() has a cycle of 255
|
||||
byte rndint(byte a, byte b) {
|
||||
return (rand() % (b-a)) + a;
|
||||
}
|
||||
|
||||
byte bcdadd(byte a, byte b) {
|
||||
byte c = (a & 0xf) + (b & 0xf);
|
||||
if (c < 10) {
|
||||
return a + b;
|
||||
} else {
|
||||
return (c-10) + 0x10 + (a & 0xf0) + (b & 0xf0);
|
||||
}
|
||||
}
|
||||
|
||||
///// OAM buffer (for sprites)
|
||||
|
||||
#define OAMBUF ((unsigned char*) 0x200)
|
||||
@ -97,11 +120,6 @@ void cflushnow() {
|
||||
cendbuf();
|
||||
}
|
||||
|
||||
// delay <count> frames and flush buffer
|
||||
void vdelay(byte count) {
|
||||
while (count--) cflushnow();
|
||||
}
|
||||
|
||||
// add single character to update buffer
|
||||
void putchar(word addr, char ch) {
|
||||
if (updptr >= VBUFSIZE-4) cflushnow();
|
||||
@ -245,15 +263,6 @@ void make_floors() {
|
||||
floors[MAX_FLOORS-1].objtype = 0;
|
||||
}
|
||||
|
||||
// vertical scroll amount in pixels
|
||||
static int scroll_pixel_yy = 0;
|
||||
|
||||
// vertical scroll amount in tiles
|
||||
static byte scroll_tile_y = 0;
|
||||
|
||||
// last screen Y position of player sprite
|
||||
static byte player_screen_y = 0;
|
||||
|
||||
void create_actors_on_floor(byte i);
|
||||
|
||||
// draw a nsmetable line into the frame buffer at <screen_y>
|
||||
@ -481,12 +490,20 @@ byte draw_actor(byte oam_id, byte i) {
|
||||
return oam_id;
|
||||
}
|
||||
|
||||
void refresh_actors() {
|
||||
byte draw_scoreboard(byte oam_id) {
|
||||
oam_id = oam_spr(24+0, 24, '0'+(score >> 4), 2, oam_id);
|
||||
oam_id = oam_spr(24+8, 24, '0'+(score & 0xf), 2, oam_id);
|
||||
return oam_id;
|
||||
}
|
||||
|
||||
void refresh_sprites() {
|
||||
byte i;
|
||||
// draw all actors
|
||||
byte oam_id = 0;
|
||||
for (i=0; i<MAX_ACTORS; i++)
|
||||
oam_id = draw_actor(oam_id, i);
|
||||
// draw scoreboard
|
||||
oam_id = draw_scoreboard(oam_id);
|
||||
// hide rest of actors
|
||||
oam_hide_rest(oam_id);
|
||||
}
|
||||
@ -631,6 +648,8 @@ void pickup_object(Actor* actor) {
|
||||
// did we hit a mine?
|
||||
if (objtype == ITEM_MINE) {
|
||||
fall_down(actor);
|
||||
} else {
|
||||
score = bcdadd(score, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -676,7 +695,6 @@ void type_message(const char* charptr) {
|
||||
x = 2;
|
||||
y = ROWS*3 + 39 - scroll_tile_y; // TODO
|
||||
while ((ch = *charptr++)) {
|
||||
vdelay(5);
|
||||
while (y >= 60) y -= 60;
|
||||
if (ch == '\n') {
|
||||
x = 2;
|
||||
@ -685,6 +703,9 @@ void type_message(const char* charptr) {
|
||||
putchar(getntaddr(x, y), ch);
|
||||
x++;
|
||||
}
|
||||
// flush buffer and wait a few frames
|
||||
cflushnow();
|
||||
delay(5);
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,9 +713,10 @@ void rescue_scene() {
|
||||
// make player face to the left
|
||||
actors[0].dir = 1;
|
||||
actors[0].state = STANDING;
|
||||
refresh_actors();
|
||||
refresh_sprites();
|
||||
type_message(RESCUE_TEXT);
|
||||
vdelay(120);
|
||||
// wait 2 seconds
|
||||
delay(100);
|
||||
}
|
||||
|
||||
void play_scene() {
|
||||
@ -713,18 +735,15 @@ void play_scene() {
|
||||
while (actors[0].floor != MAX_FLOORS-1) {
|
||||
//set_scroll_pixel_yy(scroll_pixel_yy+1);
|
||||
cflushnow();
|
||||
refresh_actors();
|
||||
refresh_sprites();
|
||||
move_player();
|
||||
// move all the actors
|
||||
for (i=1; i<MAX_ACTORS; i++) {
|
||||
move_actor(&actors[i], rand8(), false);
|
||||
}
|
||||
// see if the player hit another actor
|
||||
// test sprite 0 collision flag
|
||||
if (PPU.status & 0x40) {
|
||||
if (check_collision(&actors[0])) {
|
||||
fall_down(&actors[0]);
|
||||
}
|
||||
if (check_collision(&actors[0])) {
|
||||
fall_down(&actors[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -741,7 +760,7 @@ const char PALETTE[32] = {
|
||||
|
||||
0x16,0x35,0x24, 0, // enemy sprites
|
||||
0x00,0x37,0x25, 0, // rescue person
|
||||
0x31,0x35,0x3c, 0,
|
||||
0x0d,0x2d,0x3a, 0,
|
||||
0x0d,0x27,0x2a // player sprites
|
||||
};
|
||||
|
||||
@ -749,7 +768,7 @@ void setup_graphics() {
|
||||
ppu_off();
|
||||
oam_hide_rest(0);
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)TILESET, sizeof(TILESET));
|
||||
vram_write((unsigned char*)PATTERN_TABLE, sizeof(PATTERN_TABLE));
|
||||
pal_all(PALETTE);
|
||||
vram_adr(0x2000);
|
||||
vram_fill(CH_BLANK, 0x1000);
|
||||
|
346
presets/nes/jroatch.s
Normal file
346
presets/nes/jroatch.s
Normal file
@ -0,0 +1,346 @@
|
||||
|
||||
.segment "CHARS"
|
||||
;;{w:8,h:8,bpp:1,count:256,brev:1,np:2,pofs:8,remap:[0,1,2,4,5,6,7,8,9,10,11,12]}*/
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $ff,$ff,$ff,$ff,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $ff,$ff,$ff,$ff,$55,$aa,$55,$aa,$55,$aa,$55,$aa
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$55,$aa,$55,$aa
|
||||
.byte $55,$aa,$55,$aa,$55,$aa,$55,$aa,$55,$aa,$55,$aa
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$55,$aa,$55,$aa
|
||||
.byte $55,$aa,$55,$aa,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $aa,$55,$aa,$55,$aa,$55,$aa,$55,$aa,$55,$aa,$55
|
||||
.byte $aa,$55,$aa,$55,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $aa,$55,$aa,$55,$aa,$55,$aa,$55,$55,$aa,$55,$aa
|
||||
.byte $55,$aa,$55,$aa,$33,$cc,$33,$cc,$33,$cc,$33,$cc
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$33,$cc,$33,$cc
|
||||
.byte $33,$cc,$33,$cc,$33,$cc,$33,$cc,$33,$cc,$33,$cc
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$33,$cc,$33,$cc
|
||||
.byte $33,$cc,$33,$cc,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $cc,$33,$cc,$33,$cc,$33,$cc,$33,$cc,$33,$cc,$33
|
||||
.byte $cc,$33,$cc,$33,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $cc,$33,$cc,$33,$cc,$33,$cc,$33,$33,$cc,$33,$cc
|
||||
.byte $33,$cc,$33,$cc,$3e,$7f,$7f,$7f,$7f,$7f,$7f,$3e
|
||||
.byte $3c,$42,$5a,$52,$5a,$42,$3c,$00,$fe,$ff,$7f,$7b
|
||||
.byte $7b,$00,$00,$00,$f4,$4a,$52,$52,$00,$00,$00,$00
|
||||
.byte $0f,$0f,$0f,$3f,$7e,$7e,$7e,$3c,$0e,$06,$0a,$38
|
||||
.byte $6c,$6c,$38,$00,$3c,$7e,$7e,$7e,$3c,$3c,$3c,$18
|
||||
.byte $38,$6c,$6c,$38,$10,$38,$10,$00,$18,$3c,$7e,$ff
|
||||
.byte $ff,$ff,$3c,$3c,$10,$38,$7c,$fe,$ee,$10,$38,$00
|
||||
.byte $7e,$ff,$ff,$ff,$ff,$7e,$3c,$18,$6c,$fe,$fe,$fe
|
||||
.byte $7c,$38,$10,$00,$18,$3c,$7e,$ff,$ff,$7e,$3c,$18
|
||||
.byte $10,$38,$7c,$fe,$7c,$38,$10,$00,$3c,$7e,$7e,$ff
|
||||
.byte $ff,$ff,$3c,$3c,$38,$7c,$38,$fe,$d6,$10,$38,$00
|
||||
.byte $18,$3c,$ff,$ff,$7e,$7e,$7e,$7e,$10,$38,$fe,$7c
|
||||
.byte $38,$7c,$6c,$00,$0f,$1f,$7f,$ff,$fc,$fc,$fc,$78
|
||||
.byte $0a,$14,$72,$f8,$f8,$f8,$70,$00,$00,$00,$ff,$ff
|
||||
.byte $f6,$f6,$f6,$f6,$00,$00,$ee,$84,$e4,$24,$e4,$00
|
||||
.byte $00,$00,$fc,$fc,$fc,$fc,$ff,$ff,$00,$00,$e8,$88
|
||||
.byte $e8,$28,$ee,$00,$18,$3c,$7e,$ff,$ff,$db,$18,$18
|
||||
.byte $10,$38,$7c,$d6,$92,$10,$10,$00,$18,$18,$db,$ff
|
||||
.byte $ff,$7e,$3c,$18,$10,$10,$92,$d6,$7c,$38,$10,$00
|
||||
.byte $1c,$3c,$78,$ff,$ff,$78,$3c,$1c,$18,$30,$60,$fe
|
||||
.byte $60,$30,$18,$00,$38,$3c,$1e,$ff,$ff,$1e,$3c,$38
|
||||
.byte $30,$18,$0c,$fe,$0c,$18,$30,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $3c,$3c,$3c,$38,$38,$38,$38,$38,$38,$38,$30,$30
|
||||
.byte $30,$00,$30,$00,$3c,$3c,$3c,$3c,$00,$00,$00,$00
|
||||
.byte $28,$28,$28,$00,$00,$00,$00,$00,$00,$3c,$7e,$7e
|
||||
.byte $7e,$7e,$3c,$00,$00,$28,$7c,$28,$7c,$28,$00,$00
|
||||
.byte $0c,$3f,$3f,$3e,$3e,$7e,$7e,$18,$08,$3e,$28,$3c
|
||||
.byte $14,$7c,$10,$00,$00,$76,$7e,$7c,$3e,$7e,$6e,$00
|
||||
.byte $00,$64,$48,$10,$24,$4c,$00,$00,$00,$38,$7c,$7c
|
||||
.byte $7e,$7e,$7e,$3e,$00,$30,$48,$30,$5c,$48,$34,$00
|
||||
.byte $30,$30,$70,$60,$00,$00,$00,$00,$20,$20,$40,$00
|
||||
.byte $00,$00,$00,$00,$0e,$1e,$3c,$38,$38,$3c,$1e,$0e
|
||||
.byte $0c,$18,$30,$30,$30,$18,$0c,$00,$70,$78,$3c,$1c
|
||||
.byte $1c,$3c,$78,$70,$60,$30,$18,$18,$18,$30,$60,$00
|
||||
.byte $00,$00,$3e,$3e,$3e,$3e,$00,$00,$00,$00,$3c,$18
|
||||
.byte $3c,$00,$00,$00,$00,$18,$18,$7e,$7e,$18,$18,$00
|
||||
.byte $00,$10,$10,$7c,$10,$10,$00,$00,$00,$00,$00,$00
|
||||
.byte $38,$38,$78,$70,$00,$00,$00,$00,$30,$30,$60,$00
|
||||
.byte $00,$00,$00,$3e,$3e,$00,$00,$00,$00,$00,$00,$3c
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$38,$38,$38
|
||||
.byte $00,$00,$00,$00,$00,$30,$30,$00,$06,$0e,$0e,$1c
|
||||
.byte $1c,$38,$38,$30,$04,$0c,$08,$18,$10,$30,$20,$00
|
||||
.byte $3c,$7e,$7e,$7e,$7e,$7e,$7e,$3c,$38,$6c,$6c,$6c
|
||||
.byte $6c,$6c,$38,$00,$1c,$3c,$3c,$1c,$1c,$1c,$1c,$1c
|
||||
.byte $18,$38,$18,$18,$18,$18,$18,$00,$3c,$7e,$7e,$3e
|
||||
.byte $7c,$7e,$7e,$7e,$38,$6c,$0c,$38,$60,$6c,$7c,$00
|
||||
.byte $3c,$7e,$7e,$3e,$3e,$7e,$7e,$3c,$38,$6c,$0c,$38
|
||||
.byte $0c,$6c,$38,$00,$7e,$7e,$7e,$7e,$7e,$0e,$0e,$0e
|
||||
.byte $6c,$6c,$6c,$7c,$0c,$0c,$0c,$00,$7e,$7e,$7e,$7c
|
||||
.byte $7e,$7e,$7e,$3c,$7c,$6c,$60,$78,$0c,$6c,$38,$00
|
||||
.byte $3c,$7e,$7e,$7c,$7e,$7e,$7e,$3c,$38,$6c,$60,$78
|
||||
.byte $6c,$6c,$38,$00,$7e,$7e,$7e,$7e,$0e,$0e,$0e,$0e
|
||||
.byte $7c,$6c,$6c,$0c,$0c,$0c,$0c,$00,$3c,$7e,$7e,$7e
|
||||
.byte $7e,$7e,$7e,$3c,$38,$6c,$6c,$38,$6c,$6c,$38,$00
|
||||
.byte $3c,$7e,$7e,$7e,$3e,$7e,$7e,$3c,$38,$6c,$6c,$3c
|
||||
.byte $0c,$6c,$38,$00,$00,$38,$38,$38,$38,$38,$38,$00
|
||||
.byte $00,$30,$30,$00,$30,$30,$00,$00,$00,$38,$38,$38
|
||||
.byte $38,$38,$78,$70,$00,$30,$30,$00,$30,$30,$60,$00
|
||||
.byte $0e,$1e,$3c,$78,$78,$3c,$1e,$0e,$0c,$18,$30,$60
|
||||
.byte $30,$18,$0c,$00,$00,$00,$3e,$3e,$3e,$3e,$00,$00
|
||||
.byte $00,$00,$3c,$00,$3c,$00,$00,$00,$70,$78,$3c,$1e
|
||||
.byte $1e,$3c,$78,$70,$60,$30,$18,$0c,$18,$30,$60,$00
|
||||
.byte $3c,$7e,$7e,$1e,$3c,$38,$38,$38,$38,$6c,$0c,$18
|
||||
.byte $30,$00,$30,$00,$3c,$7e,$7e,$7e,$7e,$7e,$7e,$3e
|
||||
.byte $38,$44,$5c,$54,$5c,$40,$3c,$00,$3e,$7f,$77,$7f
|
||||
.byte $7f,$77,$77,$77,$3c,$66,$66,$7e,$66,$66,$66,$00
|
||||
.byte $7e,$7f,$77,$7f,$7f,$77,$7f,$7e,$7c,$66,$66,$7c
|
||||
.byte $66,$66,$7c,$00,$3e,$7f,$77,$70,$70,$77,$7f,$3e
|
||||
.byte $3c,$66,$60,$60,$60,$66,$3c,$00,$7c,$7e,$7f,$77
|
||||
.byte $77,$7f,$7e,$7c,$78,$6c,$66,$66,$66,$6c,$78,$00
|
||||
.byte $7f,$7f,$70,$7f,$7f,$70,$7f,$7f,$7e,$60,$60,$7e
|
||||
.byte $60,$60,$7e,$00,$7f,$7f,$70,$7c,$7c,$70,$70,$70
|
||||
.byte $7e,$60,$60,$78,$60,$60,$60,$00,$3e,$7f,$77,$7f
|
||||
.byte $7f,$77,$7f,$3e,$3c,$66,$60,$6e,$66,$66,$3c,$00
|
||||
.byte $77,$77,$77,$7f,$7f,$77,$77,$77,$66,$66,$66,$7e
|
||||
.byte $66,$66,$66,$00,$7f,$7f,$1c,$1c,$1c,$1c,$7f,$7f
|
||||
.byte $7e,$18,$18,$18,$18,$18,$7e,$00,$07,$07,$07,$07
|
||||
.byte $77,$77,$7f,$3e,$06,$06,$06,$06,$66,$66,$3c,$00
|
||||
.byte $77,$7f,$7e,$7c,$7c,$7e,$7f,$77,$66,$6c,$78,$70
|
||||
.byte $78,$6c,$66,$00,$70,$70,$70,$70,$70,$70,$7f,$7f
|
||||
.byte $60,$60,$60,$60,$60,$60,$7e,$00,$fe,$ff,$ff,$ff
|
||||
.byte $ff,$e7,$e7,$e7,$ec,$fe,$d6,$d6,$c6,$c6,$c6,$00
|
||||
.byte $77,$7f,$7f,$7f,$7f,$7f,$77,$77,$66,$76,$7e,$7e
|
||||
.byte $6e,$66,$66,$00,$3e,$7f,$77,$77,$77,$77,$7f,$3e
|
||||
.byte $3c,$66,$66,$66,$66,$66,$3c,$00,$7e,$7f,$77,$7f
|
||||
.byte $7e,$70,$70,$70,$7c,$66,$66,$7c,$60,$60,$60,$00
|
||||
.byte $3e,$7f,$77,$77,$77,$7f,$7f,$3f,$3c,$66,$66,$66
|
||||
.byte $66,$6c,$3e,$00,$7e,$7f,$77,$7f,$7e,$7e,$7f,$77
|
||||
.byte $7c,$66,$66,$7c,$78,$6c,$66,$00,$3e,$7f,$77,$7e
|
||||
.byte $3f,$77,$7f,$3e,$3c,$66,$60,$3c,$06,$66,$3c,$00
|
||||
.byte $7f,$7f,$1c,$1c,$1c,$1c,$1c,$1c,$7e,$18,$18,$18
|
||||
.byte $18,$18,$18,$00,$77,$77,$77,$77,$77,$77,$7f,$3e
|
||||
.byte $66,$66,$66,$66,$66,$66,$3c,$00,$77,$77,$77,$77
|
||||
.byte $7f,$3e,$3e,$1c,$66,$66,$66,$66,$3c,$3c,$18,$00
|
||||
.byte $e7,$e7,$ff,$ff,$ff,$ff,$ff,$7e,$c6,$c6,$d6,$d6
|
||||
.byte $d6,$fe,$6c,$00,$77,$77,$7f,$3e,$3e,$7f,$77,$77
|
||||
.byte $66,$66,$3c,$18,$3c,$66,$66,$00,$77,$77,$77,$7f
|
||||
.byte $3e,$1c,$1c,$1c,$66,$66,$66,$3c,$18,$18,$18,$00
|
||||
.byte $7f,$7f,$0f,$1e,$3c,$78,$7f,$7f,$7e,$06,$0c,$18
|
||||
.byte $30,$60,$7e,$00,$1f,$1f,$1c,$1c,$1c,$1c,$1f,$1f
|
||||
.byte $1e,$18,$18,$18,$18,$18,$1e,$00,$30,$38,$38,$1c
|
||||
.byte $1c,$0e,$0e,$06,$20,$30,$10,$18,$08,$0c,$04,$00
|
||||
.byte $f8,$f8,$38,$38,$38,$38,$f8,$f8,$f0,$30,$30,$30
|
||||
.byte $30,$30,$f0,$00,$18,$3c,$7e,$7e,$00,$00,$00,$00
|
||||
.byte $10,$38,$6c,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$7f,$7f,$00,$00,$00,$00,$00,$00,$7e,$00
|
||||
.byte $30,$30,$38,$18,$00,$00,$00,$00,$20,$20,$10,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$3c,$3e,$3e,$7e,$7e,$3e
|
||||
.byte $00,$00,$38,$0c,$3c,$4c,$34,$00,$70,$70,$7c,$7e
|
||||
.byte $7e,$7e,$7e,$7c,$60,$60,$78,$6c,$6c,$6c,$78,$00
|
||||
.byte $00,$00,$3c,$7e,$7e,$7e,$7e,$3c,$00,$00,$38,$6c
|
||||
.byte $60,$6c,$38,$00,$0e,$0e,$3e,$7e,$7e,$7e,$7e,$3e
|
||||
.byte $0c,$0c,$3c,$6c,$6c,$6c,$3c,$00,$00,$00,$3c,$7e
|
||||
.byte $7e,$7e,$7e,$3e,$00,$00,$38,$64,$7c,$60,$3c,$00
|
||||
.byte $00,$3c,$7e,$7e,$7c,$7c,$70,$70,$00,$38,$6c,$60
|
||||
.byte $78,$60,$60,$00,$00,$00,$3e,$7e,$7e,$3e,$7e,$7c
|
||||
.byte $00,$00,$3c,$6c,$3c,$0c,$78,$00,$70,$70,$7c,$7e
|
||||
.byte $7e,$7e,$7e,$7e,$60,$60,$78,$6c,$6c,$6c,$6c,$00
|
||||
.byte $00,$1c,$1c,$1c,$1c,$1c,$1c,$1c,$00,$18,$00,$18
|
||||
.byte $18,$18,$18,$00,$00,$0e,$0e,$0e,$0e,$7e,$7e,$3c
|
||||
.byte $00,$0c,$00,$0c,$0c,$6c,$38,$00,$70,$70,$7e,$7e
|
||||
.byte $7c,$7c,$7e,$7e,$60,$60,$6c,$78,$70,$78,$6c,$00
|
||||
.byte $3c,$3c,$1c,$1c,$1c,$1c,$1c,$1c,$38,$18,$18,$18
|
||||
.byte $18,$18,$18,$00,$00,$00,$7e,$7f,$7f,$7f,$77,$77
|
||||
.byte $00,$00,$6c,$7e,$56,$66,$66,$00,$00,$00,$7c,$7e
|
||||
.byte $7e,$7e,$7e,$7e,$00,$00,$78,$6c,$6c,$6c,$6c,$00
|
||||
.byte $00,$00,$3c,$7e,$7e,$7e,$7e,$3c,$00,$00,$38,$6c
|
||||
.byte $6c,$6c,$38,$00,$00,$00,$7c,$7e,$7e,$7c,$70,$70
|
||||
.byte $00,$00,$78,$6c,$78,$60,$60,$00,$00,$00,$3e,$7e
|
||||
.byte $7e,$3e,$0e,$0e,$00,$00,$3c,$6c,$3c,$0c,$0c,$00
|
||||
.byte $00,$00,$7c,$7e,$7e,$70,$70,$70,$00,$00,$78,$6c
|
||||
.byte $60,$60,$60,$00,$00,$00,$3e,$7e,$7c,$3e,$7e,$7c
|
||||
.byte $00,$00,$3c,$60,$38,$0c,$78,$00,$00,$1c,$3e,$3e
|
||||
.byte $1c,$1c,$1e,$0e,$00,$18,$3c,$18,$18,$18,$0c,$00
|
||||
.byte $00,$00,$7e,$7e,$7e,$7e,$7e,$3e,$00,$00,$6c,$6c
|
||||
.byte $6c,$6c,$34,$00,$00,$00,$7e,$7e,$7e,$7e,$3e,$1c
|
||||
.byte $00,$00,$6c,$6c,$6c,$3c,$18,$00,$00,$00,$e7,$e7
|
||||
.byte $ff,$ff,$7e,$7e,$00,$00,$c6,$c6,$d6,$7c,$6c,$00
|
||||
.byte $00,$00,$7e,$7e,$3c,$3c,$7e,$7e,$00,$00,$6c,$38
|
||||
.byte $10,$38,$6c,$00,$00,$00,$7e,$7e,$7e,$3e,$7c,$78
|
||||
.byte $00,$00,$6c,$6c,$3c,$18,$70,$00,$00,$00,$7e,$7e
|
||||
.byte $3c,$78,$7e,$7e,$00,$00,$7c,$18,$30,$60,$7c,$00
|
||||
.byte $0e,$1e,$1c,$3c,$3c,$1c,$1e,$0e,$0c,$18,$18,$30
|
||||
.byte $18,$18,$0c,$00,$18,$18,$18,$18,$18,$18,$18,$18
|
||||
.byte $10,$10,$10,$10,$10,$10,$10,$00,$70,$78,$38,$3c
|
||||
.byte $3c,$38,$78,$70,$60,$30,$30,$18,$30,$30,$60,$00
|
||||
.byte $00,$00,$7f,$ff,$fe,$00,$00,$00,$00,$00,$76,$dc
|
||||
.byte $00,$00,$00,$00,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f
|
||||
.byte $7e,$7e,$7e,$7e,$7e,$7e,$7e,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$f0,$f0,$f0,$f0
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $0f,$0f,$0f,$0f,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$ff,$ff,$ff,$ff,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $f0,$f0,$f0,$f0,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$0f,$0f,$0f,$0f,$f0,$f0,$f0,$f0
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff
|
||||
.byte $f0,$f0,$f0,$f0,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$0f,$0f,$0f,$0f,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$f0,$f0,$f0,$f0,$0f,$0f,$0f,$0f
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$0f,$0f,$0f,$0f
|
||||
.byte $0f,$0f,$0f,$0f,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $ff,$ff,$ff,$ff,$0f,$0f,$0f,$0f,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$f0,$f0,$f0,$f0
|
||||
.byte $ff,$ff,$ff,$ff,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $0f,$0f,$0f,$0f,$ff,$ff,$ff,$ff,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$7f,$80,$80,$80,$80,$80,$80,$80
|
||||
.byte $ff,$00,$00,$00,$00,$00,$00,$00,$3f,$3f,$c0,$c0
|
||||
.byte $c0,$c0,$c0,$c0,$ff,$ff,$00,$00,$00,$00,$00,$00
|
||||
.byte $1f,$1f,$1f,$e0,$e0,$e0,$e0,$e0,$ff,$ff,$ff,$00
|
||||
.byte $00,$00,$00,$00,$0f,$0f,$0f,$0f,$f0,$f0,$f0,$f0
|
||||
.byte $ff,$ff,$ff,$ff,$00,$00,$00,$00,$07,$07,$07,$07
|
||||
.byte $07,$f8,$f8,$f8,$ff,$ff,$ff,$ff,$ff,$00,$00,$00
|
||||
.byte $03,$03,$03,$03,$03,$03,$fc,$fc,$ff,$ff,$ff,$ff
|
||||
.byte $ff,$ff,$00,$00,$01,$01,$01,$01,$01,$01,$01,$fe
|
||||
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $7f,$80,$80,$80,$80,$80,$80,$80,$00,$ff,$ff,$ff
|
||||
.byte $ff,$ff,$ff,$ff,$3f,$3f,$c0,$c0,$c0,$c0,$c0,$c0
|
||||
.byte $00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$1f,$1f,$1f,$e0
|
||||
.byte $e0,$e0,$e0,$e0,$00,$00,$00,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $0f,$0f,$0f,$0f,$f0,$f0,$f0,$f0,$00,$00,$00,$00
|
||||
.byte $ff,$ff,$ff,$ff,$07,$07,$07,$07,$07,$f8,$f8,$f8
|
||||
.byte $00,$00,$00,$00,$00,$ff,$ff,$ff,$03,$03,$03,$03
|
||||
.byte $03,$03,$fc,$fc,$00,$00,$00,$00,$00,$00,$ff,$ff
|
||||
.byte $01,$01,$01,$01,$01,$01,$01,$fe,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$ff,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ff
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$80,$80,$80,$80
|
||||
.byte $80,$80,$80,$80,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$03,$0c,$30,$c0
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$03,$0c,$30,$c0
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $c0,$30,$0c,$03,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$c0,$30,$0c,$03
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$10,$10,$20,$20
|
||||
.byte $40,$40,$80,$80,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $01,$01,$02,$02,$04,$04,$08,$08,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$80,$80,$40,$40,$20,$20,$10,$10
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$04,$04
|
||||
.byte $02,$02,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $01,$02,$04,$08,$10,$20,$40,$80,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$80,$40,$20,$10,$08,$04,$02,$01
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$00,$81,$42,$24,$18
|
||||
.byte $18,$24,$42,$81,$00,$00,$00,$00,$00,$00,$00,$00
|
||||
.byte $3c,$42,$81,$81,$81,$81,$42,$3c,$0c,$00,$10,$00
|
||||
.byte $00,$00,$04,$00,$0c,$00,$10,$3e,$2e,$2e,$2a,$2e
|
||||
.byte $00,$3c,$bc,$5a,$00,$20,$24,$7e,$18,$00,$80,$42
|
||||
.byte $18,$04,$00,$12,$00,$ff,$00,$ff,$00,$ff,$00,$ff
|
||||
.byte $55,$aa,$55,$aa,$55,$aa,$55,$aa,$24,$00,$5a,$00
|
||||
.byte $24,$00,$18,$00,$24,$00,$5a,$00,$24,$00,$18,$3c
|
||||
.byte $4d,$41,$00,$2e,$24,$24,$6a,$6e,$0c,$00,$10,$3e
|
||||
.byte $2e,$2e,$2a,$2e,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $e7,$c3,$c3,$e7,$e7,$db,$db,$93,$24,$24,$c3,$08
|
||||
.byte $18,$c3,$24,$24,$18,$66,$42,$91,$89,$42,$66,$18
|
||||
.byte $18,$24,$00,$24,$00,$18,$00,$00,$24,$00,$5a,$00
|
||||
.byte $24,$00,$18,$3c,$5a,$36,$00,$00,$6c,$3b,$76,$00
|
||||
.byte $24,$7e,$54,$45,$48,$7e,$3e,$00,$00,$08,$14,$2a
|
||||
.byte $55,$2a,$14,$08,$80,$49,$36,$3e,$5d,$3e,$36,$49
|
||||
.byte $0f,$1f,$3f,$3d,$38,$38,$3c,$16,$0f,$1f,$3f,$3f
|
||||
.byte $3f,$3f,$3f,$17,$f0,$f8,$bc,$14,$a0,$a0,$08,$1c
|
||||
.byte $f0,$f8,$fc,$fc,$58,$58,$f8,$fc,$f2,$f1,$e1,$0f
|
||||
.byte $1f,$3b,$11,$00,$0d,$0e,$0e,$00,$00,$04,$0e,$0f
|
||||
.byte $00,$e0,$f0,$f0,$f8,$dc,$88,$00,$c0,$00,$00,$00
|
||||
.byte $00,$20,$70,$78,$f2,$f1,$e1,$1f,$3f,$13,$03,$00
|
||||
.byte $0d,$0e,$0e,$00,$00,$2c,$3c,$20,$00,$e0,$f0,$f8
|
||||
.byte $e0,$c0,$00,$00,$c0,$00,$00,$04,$1c,$3c,$1c,$00
|
||||
.byte $ff,$2f,$7f,$ff,$ff,$f2,$f7,$ff,$00,$fe,$fc,$d0
|
||||
.byte $00,$ef,$cf,$0d,$ff,$ff,$df,$ff,$ff,$ff,$ff,$ff
|
||||
.byte $00,$7e,$7c,$7e,$74,$7c,$50,$00,$ff,$f9,$f9,$ff
|
||||
.byte $ff,$9f,$9f,$ff,$0f,$6f,$6f,$0f,$f0,$f6,$f6,$f0
|
||||
.byte $05,$67,$4f,$1f,$9d,$3d,$a9,$ff,$ff,$fe,$ff,$fe
|
||||
.byte $fe,$ff,$fe,$a4,$00,$0f,$3f,$3f,$7f,$00,$7f,$7f
|
||||
.byte $0f,$30,$4d,$6d,$ad,$ff,$80,$ad,$00,$f0,$fc,$fc
|
||||
.byte $fe,$00,$fe,$fe,$f0,$0c,$b2,$b6,$b7,$ff,$01,$b7
|
||||
.byte $7f,$7f,$7f,$00,$7f,$7f,$7f,$00,$ad,$ad,$ad,$ff
|
||||
.byte $80,$ad,$ad,$ff,$ea,$e2,$fe,$00,$fe,$fe,$fe,$00
|
||||
.byte $b5,$bd,$a1,$ff,$01,$b7,$b7,$ff,$00,$22,$4c,$1f
|
||||
.byte $36,$3f,$5f,$17,$01,$63,$3f,$20,$2d,$29,$60,$ec
|
||||
.byte $80,$c4,$f2,$fc,$dc,$fc,$fa,$d8,$00,$86,$dc,$04
|
||||
.byte $b0,$24,$06,$37,$ff,$7f,$36,$3f,$1f,$5c,$22,$00
|
||||
.byte $68,$20,$0d,$29,$20,$77,$43,$01,$ff,$fe,$dc,$fc
|
||||
.byte $fc,$fa,$c4,$80,$26,$04,$b0,$20,$04,$cc,$86,$00
|
||||
.byte $00,$00,$00,$1c,$26,$2f,$3f,$3f,$00,$00,$1c,$3e
|
||||
.byte $7f,$7f,$7f,$7f,$00,$00,$00,$38,$4c,$dc,$f4,$f4
|
||||
.byte $00,$00,$38,$74,$fa,$fa,$fa,$fa,$1f,$0f,$07,$03
|
||||
.byte $01,$00,$00,$00,$3f,$1f,$0f,$07,$02,$01,$00,$00
|
||||
.byte $e8,$d0,$a0,$40,$80,$00,$00,$00,$f4,$e8,$d0,$a0
|
||||
.byte $40,$80,$00,$00,$00,$03,$0f,$30,$73,$73,$73,$70
|
||||
.byte $03,$0f,$3f,$ff,$fc,$fd,$fd,$ff,$80,$20,$c8,$72
|
||||
.byte $3a,$3a,$3a,$7a,$00,$c0,$f0,$bc,$dc,$dc,$dc,$9c
|
||||
.byte $73,$73,$3f,$cf,$33,$0c,$03,$00,$fc,$fd,$f1,$3f
|
||||
.byte $0f,$03,$00,$00,$fa,$fa,$f2,$ce,$38,$e0,$80,$00
|
||||
.byte $3c,$fc,$fc,$f0,$c0,$00,$00,$00,$b0,$b0,$bf,$b0
|
||||
.byte $bf,$bf,$b0,$b0,$e0,$e0,$e0,$ff,$ef,$e0,$e0,$e0
|
||||
.byte $0b,$0b,$fb,$0b,$fb,$fb,$0b,$0b,$0e,$0e,$0e,$fe
|
||||
.byte $f6,$0e,$0e,$0e,$00,$00,$00,$0c,$3e,$3e,$7b,$fb
|
||||
.byte $00,$00,$00,$38,$7c,$7c,$fe,$fe,$7b,$f3,$f3,$66
|
||||
.byte $7e,$3c,$00,$00,$fe,$fe,$7c,$7c,$38,$00,$00,$00
|
||||
.byte $00,$17,$0f,$1f,$12,$30,$08,$18,$00,$00,$00,$00
|
||||
.byte $0d,$0f,$07,$07,$00,$c8,$f8,$f0,$40,$40,$00,$00
|
||||
.byte $00,$00,$00,$00,$a0,$b0,$e0,$c0,$0f,$1f,$1f,$13
|
||||
.byte $03,$0e,$0e,$0f,$0f,$1f,$1f,$1c,$0c,$00,$0e,$0f
|
||||
.byte $c0,$e0,$e0,$c0,$c0,$c0,$e0,$70,$c0,$e0,$e0,$20
|
||||
.byte $20,$00,$e0,$70,$00,$17,$0f,$1f,$12,$30,$08,$18
|
||||
.byte $00,$00,$00,$00,$0d,$0f,$07,$07,$00,$c8,$f8,$f0
|
||||
.byte $40,$40,$00,$00,$00,$00,$00,$00,$a0,$b0,$e0,$c0
|
||||
.byte $1f,$1f,$0f,$0f,$3f,$7c,$30,$18,$1f,$3f,$3f,$00
|
||||
.byte $00,$60,$30,$18,$c0,$f0,$f8,$e4,$fc,$fc,$7c,$00
|
||||
.byte $cc,$fc,$f8,$04,$0c,$0c,$0c,$00,$00,$17,$0f,$1f
|
||||
.byte $12,$30,$08,$18,$00,$00,$00,$00,$0d,$0f,$07,$07
|
||||
.byte $00,$c8,$f8,$f0,$40,$40,$00,$00,$00,$00,$00,$00
|
||||
.byte $a0,$b0,$e0,$c0,$0f,$1f,$1f,$13,$03,$0e,$0e,$0f
|
||||
.byte $0f,$1f,$1f,$1c,$0c,$00,$0e,$0f,$c0,$c0,$c0,$c0
|
||||
.byte $c0,$c0,$e0,$00,$c0,$c0,$e0,$20,$00,$c0,$e0,$00
|
||||
.byte $00,$00,$17,$0f,$1f,$12,$30,$08,$00,$00,$00,$00
|
||||
.byte $00,$0d,$0f,$07,$00,$00,$c8,$f8,$f0,$40,$40,$00
|
||||
.byte $00,$00,$00,$00,$00,$a0,$b0,$e0,$18,$1f,$0f,$0f
|
||||
.byte $3f,$7b,$43,$03,$07,$1f,$3f,$37,$20,$60,$43,$03
|
||||
.byte $00,$e0,$e0,$c0,$c0,$80,$80,$c0,$c0,$f8,$f8,$c0
|
||||
.byte $00,$00,$80,$c0,$00,$17,$0f,$1f,$12,$30,$08,$18
|
||||
.byte $00,$00,$00,$00,$0d,$0f,$07,$1f,$00,$c8,$f8,$f0
|
||||
.byte $40,$40,$00,$00,$00,$00,$00,$00,$a0,$b0,$e0,$cc
|
||||
.byte $3f,$3f,$0f,$7f,$7f,$7e,$40,$00,$3f,$7f,$6f,$60
|
||||
.byte $60,$60,$40,$00,$d0,$f8,$f0,$c4,$fc,$fc,$7c,$00
|
||||
.byte $dc,$f8,$f0,$04,$0c,$0c,$0c,$00,$00,$17,$0f,$1f
|
||||
.byte $1f,$3f,$0f,$7f,$00,$00,$00,$00,$00,$00,$30,$60
|
||||
.byte $00,$e0,$f0,$fc,$fc,$fc,$fc,$fc,$00,$18,$08,$04
|
||||
.byte $04,$00,$0c,$04,$7f,$3f,$1f,$0f,$0f,$0f,$0f,$0f
|
||||
.byte $7f,$3f,$1f,$00,$00,$06,$0f,$0f,$f8,$f8,$f8,$f8
|
||||
.byte $f0,$00,$00,$00,$f8,$f8,$c0,$00,$70,$00,$00,$00
|
||||
.byte $00,$17,$0f,$1f,$1a,$19,$0a,$7c,$00,$00,$00,$00
|
||||
.byte $05,$66,$65,$63,$00,$e8,$f0,$f8,$58,$9c,$50,$38
|
||||
.byte $00,$00,$00,$00,$a0,$60,$a0,$c3,$7f,$3f,$4f,$7f
|
||||
.byte $7f,$7e,$00,$00,$7f,$3f,$4f,$60,$60,$60,$00,$00
|
||||
.byte $fc,$fe,$f0,$e0,$f0,$f0,$e0,$70,$ff,$fe,$f0,$00
|
||||
.byte $00,$00,$e0,$70,$ff,$80,$80,$9f,$90,$97,$97,$97
|
||||
.byte $00,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$fe,$02,$06,$fe
|
||||
.byte $0e,$fe,$fe,$fe,$00,$fe,$fc,$f8,$f8,$e8,$e8,$e8
|
||||
.byte $97,$97,$97,$97,$9f,$bf,$ff,$00,$7f,$7f,$7f,$78
|
||||
.byte $7f,$60,$40,$00,$fe,$fe,$fe,$fe,$fe,$fe,$fe,$00
|
||||
.byte $e8,$e8,$e8,$08,$f8,$00,$00,$00,$00,$3f,$7f,$60
|
||||
.byte $6e,$72,$76,$76,$00,$00,$1f,$3f,$31,$2d,$29,$29
|
||||
.byte $00,$fc,$fe,$0e,$7e,$4e,$6e,$6e,$00,$00,$f8,$fc
|
||||
.byte $8c,$b4,$94,$94,$7e,$60,$60,$7f,$7c,$7e,$3f,$00
|
||||
.byte $21,$3f,$3f,$38,$1b,$01,$00,$00,$7e,$0e,$0e,$fe
|
||||
.byte $3e,$7e,$fc,$00,$84,$fc,$fc,$1c,$d8,$80,$00,$00
|
||||
.byte $00,$7f,$7f,$60,$7f,$7f,$77,$76,$00,$00,$3f,$3f
|
||||
.byte $00,$20,$29,$29,$00,$fe,$fe,$0e,$fe,$fe,$ee,$6e
|
||||
.byte $00,$00,$fc,$fc,$00,$04,$94,$94,$72,$6e,$60,$77
|
||||
.byte $7e,$3c,$1f,$00,$2d,$31,$3f,$3c,$19,$03,$00,$00
|
||||
.byte $4e,$7e,$0e,$ee,$7e,$3c,$f8,$00,$b4,$8c,$fc,$3c
|
||||
.byte $98,$c0,$00,$00
|
||||
;;
|
149
presets/nes/metacursor.c
Normal file
149
presets/nes/metacursor.c
Normal file
@ -0,0 +1,149 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// include NESLIB header
|
||||
|
||||
#include "neslib.h"
|
||||
|
||||
// include CC65 NES Header (PPU)
|
||||
|
||||
#include <nes.h>
|
||||
|
||||
///// PATTERN TABLE
|
||||
|
||||
//#link "jroatch.c"
|
||||
extern unsigned char jroatch_chr[0x1000];
|
||||
#define PATTERN_TABLE jroatch_chr
|
||||
|
||||
///// METASPRITES
|
||||
|
||||
// define a 2x2 metasprite
|
||||
#define DEF_METASPRITE_2x2(name,code,pal)\
|
||||
const unsigned char name[]={\
|
||||
0, 0, (code)+0, pal, \
|
||||
8, 0, (code)+1, pal, \
|
||||
0, 8, (code)+2, pal, \
|
||||
8, 8, (code)+3, pal, \
|
||||
128};
|
||||
|
||||
// define a 2x2 metasprite, flipped horizontally
|
||||
#define DEF_METASPRITE_2x2_FLIP(name,code,pal)\
|
||||
const unsigned char name[]={\
|
||||
8, 0, (code)+0, (pal)|OAM_FLIP_H, \
|
||||
0, 0, (code)+1, (pal)|OAM_FLIP_H, \
|
||||
8, 8, (code)+2, (pal)|OAM_FLIP_H, \
|
||||
0, 8, (code)+3, (pal)|OAM_FLIP_H, \
|
||||
128};
|
||||
|
||||
DEF_METASPRITE_2x2(playerRStand, 0xd8, 0);
|
||||
DEF_METASPRITE_2x2(playerRRun1, 0xdc, 0);
|
||||
DEF_METASPRITE_2x2(playerRRun2, 0xe0, 0);
|
||||
DEF_METASPRITE_2x2(playerRRun3, 0xe4, 0);
|
||||
DEF_METASPRITE_2x2(playerRJump, 0xe8, 0);
|
||||
DEF_METASPRITE_2x2(playerRClimb, 0xec, 0);
|
||||
DEF_METASPRITE_2x2(playerRSad, 0xf0, 0);
|
||||
|
||||
DEF_METASPRITE_2x2_FLIP(playerLStand, 0xd8, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLRun1, 0xdc, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLRun2, 0xe0, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLRun3, 0xe4, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLJump, 0xe8, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLClimb, 0xec, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLSad, 0xf0, 0);
|
||||
|
||||
DEF_METASPRITE_2x2(personToSave, 0xba, 1);
|
||||
|
||||
const unsigned char* const playerRunSeq[16] = {
|
||||
playerLRun1, playerLRun2, playerLRun3,
|
||||
playerLRun1, playerLRun2, playerLRun3,
|
||||
playerLRun1, playerLRun2,
|
||||
playerRRun1, playerRRun2, playerRRun3,
|
||||
playerRRun1, playerRRun2, playerRRun3,
|
||||
playerRRun1, playerRRun2,
|
||||
};
|
||||
|
||||
const char PALETTE[32] = {
|
||||
0x03, // background color
|
||||
|
||||
0x11,0x30,0x27, 0, // ladders and pickups
|
||||
0x1c,0x20,0x2c, 0, // floor blocks
|
||||
0x00,0x10,0x20, 0,
|
||||
0x06,0x16,0x26, 0,
|
||||
|
||||
0x16,0x35,0x24, 0, // enemy sprites
|
||||
0x00,0x37,0x25, 0, // rescue person
|
||||
0x0d,0x2d,0x3a, 0,
|
||||
0x0d,0x27,0x2a // player sprites
|
||||
};
|
||||
|
||||
// setup PPU and tables
|
||||
void setup_graphics() {
|
||||
// set pattern table
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)PATTERN_TABLE, sizeof(PATTERN_TABLE));
|
||||
// clear sprites
|
||||
oam_hide_rest(0);
|
||||
// set palette colors
|
||||
pal_all(PALETTE);
|
||||
// turn on PPU
|
||||
ppu_on_all();
|
||||
}
|
||||
|
||||
// number of actors (4 h/w sprites each)
|
||||
#define NUM_ACTORS 16
|
||||
|
||||
// actor x/y positions
|
||||
char actor_x[NUM_ACTORS];
|
||||
char actor_y[NUM_ACTORS];
|
||||
// actor x/y deltas per frame
|
||||
char actor_dx[NUM_ACTORS];
|
||||
char actor_dy[NUM_ACTORS];
|
||||
|
||||
// OAM buffer pointer, in case we want to manipulate directly
|
||||
#define OAMBUF ((unsigned char*) 0x200)
|
||||
|
||||
// main program
|
||||
void main() {
|
||||
char i;
|
||||
char oam_id;
|
||||
char pad; // controller flags
|
||||
|
||||
setup_graphics();
|
||||
// initialize actors with random values
|
||||
for (i=0; i<NUM_ACTORS; i++) {
|
||||
actor_x[i] = i*32+128;
|
||||
actor_y[i] = i*8+64;
|
||||
actor_dx[i] = 0;
|
||||
actor_dy[i] = 0;
|
||||
}
|
||||
// loop forever
|
||||
while (1) {
|
||||
// start with OAMid/sprite 0
|
||||
oam_id = 0;
|
||||
// set player 0/1 velocity based on controller
|
||||
for (i=0; i<2; i++) {
|
||||
// poll controller i (0-1)
|
||||
pad = pad_poll(i);
|
||||
// move actor[i] left/right
|
||||
if (pad&PAD_LEFT && actor_x[i]>0) actor_dx[i]=-2;
|
||||
else if (pad&PAD_RIGHT && actor_x[i]<232) actor_dx[i]=2;
|
||||
else actor_dx[i]=0;
|
||||
// move actor[i] up/down
|
||||
if (pad&PAD_UP && actor_y[i]>0) actor_dy[i]=-2;
|
||||
else if (pad&PAD_DOWN && actor_y[i]<212) actor_dy[i]=2;
|
||||
else actor_dy[i]=0;
|
||||
}
|
||||
// draw and move all actors
|
||||
for (i=0; i<NUM_ACTORS; i++) {
|
||||
oam_id = oam_meta_spr(actor_x[i], actor_y[i], oam_id, playerRunSeq[i]);
|
||||
actor_x[i] += actor_dx[i];
|
||||
actor_y[i] += actor_dy[i];
|
||||
}
|
||||
// hide rest of sprites
|
||||
// if we haven't wrapped oam_id around to 0
|
||||
if (oam_id!=0) oam_hide_rest(oam_id);
|
||||
// wait for next frame
|
||||
ppu_wait_frame();
|
||||
}
|
||||
}
|
135
presets/nes/metasprites.c
Normal file
135
presets/nes/metasprites.c
Normal file
@ -0,0 +1,135 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// include NESLIB header
|
||||
|
||||
#include "neslib.h"
|
||||
|
||||
// include CC65 NES Header (PPU)
|
||||
|
||||
#include <nes.h>
|
||||
|
||||
///// PATTERN TABLE
|
||||
|
||||
//#link "jroatch.c"
|
||||
extern unsigned char jroatch_chr[0x1000];
|
||||
#define PATTERN_TABLE jroatch_chr
|
||||
|
||||
///// METASPRITES
|
||||
|
||||
// define a 2x2 metasprite
|
||||
#define DEF_METASPRITE_2x2(name,code,pal)\
|
||||
const unsigned char name[]={\
|
||||
0, 0, (code)+0, pal, \
|
||||
8, 0, (code)+1, pal, \
|
||||
0, 8, (code)+2, pal, \
|
||||
8, 8, (code)+3, pal, \
|
||||
128};
|
||||
|
||||
// define a 2x2 metasprite, flipped horizontally
|
||||
#define DEF_METASPRITE_2x2_FLIP(name,code,pal)\
|
||||
const unsigned char name[]={\
|
||||
8, 0, (code)+0, (pal)|OAM_FLIP_H, \
|
||||
0, 0, (code)+1, (pal)|OAM_FLIP_H, \
|
||||
8, 8, (code)+2, (pal)|OAM_FLIP_H, \
|
||||
0, 8, (code)+3, (pal)|OAM_FLIP_H, \
|
||||
128};
|
||||
|
||||
DEF_METASPRITE_2x2(playerRStand, 0xd8, 0);
|
||||
DEF_METASPRITE_2x2(playerRRun1, 0xdc, 0);
|
||||
DEF_METASPRITE_2x2(playerRRun2, 0xe0, 0);
|
||||
DEF_METASPRITE_2x2(playerRRun3, 0xe4, 0);
|
||||
DEF_METASPRITE_2x2(playerRJump, 0xe8, 0);
|
||||
DEF_METASPRITE_2x2(playerRClimb, 0xec, 0);
|
||||
DEF_METASPRITE_2x2(playerRSad, 0xf0, 0);
|
||||
|
||||
DEF_METASPRITE_2x2_FLIP(playerLStand, 0xd8, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLRun1, 0xdc, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLRun2, 0xe0, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLRun3, 0xe4, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLJump, 0xe8, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLClimb, 0xec, 0);
|
||||
DEF_METASPRITE_2x2_FLIP(playerLSad, 0xf0, 0);
|
||||
|
||||
DEF_METASPRITE_2x2(personToSave, 0xba, 1);
|
||||
|
||||
const unsigned char* const playerRunSeq[16] = {
|
||||
playerLRun1, playerLRun2, playerLRun3,
|
||||
playerLRun1, playerLRun2, playerLRun3,
|
||||
playerLRun1, playerLRun2,
|
||||
playerRRun1, playerRRun2, playerRRun3,
|
||||
playerRRun1, playerRRun2, playerRRun3,
|
||||
playerRRun1, playerRRun2,
|
||||
};
|
||||
|
||||
const char PALETTE[32] = {
|
||||
0x03, // background color
|
||||
|
||||
0x11,0x30,0x27, 0, // ladders and pickups
|
||||
0x1c,0x20,0x2c, 0, // floor blocks
|
||||
0x00,0x10,0x20, 0,
|
||||
0x06,0x16,0x26, 0,
|
||||
|
||||
0x16,0x35,0x24, 0, // enemy sprites
|
||||
0x00,0x37,0x25, 0, // rescue person
|
||||
0x0d,0x2d,0x3a, 0,
|
||||
0x0d,0x27,0x2a // player sprites
|
||||
};
|
||||
|
||||
// setup PPU and tables
|
||||
void setup_graphics() {
|
||||
// set pattern table
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)PATTERN_TABLE, sizeof(PATTERN_TABLE));
|
||||
// clear sprites
|
||||
oam_clear();
|
||||
// set palette colors
|
||||
pal_all(PALETTE);
|
||||
// turn on PPU
|
||||
ppu_on_all();
|
||||
}
|
||||
|
||||
// number of actors (4 h/w sprites each)
|
||||
#define NUM_ACTORS 16
|
||||
|
||||
// actor x/y positions
|
||||
char actor_x[NUM_ACTORS];
|
||||
char actor_y[NUM_ACTORS];
|
||||
// actor x/y deltas per frame
|
||||
char actor_dx[NUM_ACTORS];
|
||||
char actor_dy[NUM_ACTORS];
|
||||
|
||||
// OAM buffer pointer, in case we want to manipulate directly
|
||||
#define OAMBUF ((unsigned char*) 0x200)
|
||||
|
||||
// main program
|
||||
void main() {
|
||||
char i;
|
||||
char oam_id;
|
||||
|
||||
setup_graphics();
|
||||
// initialize actors with random values
|
||||
for (i=0; i<NUM_ACTORS; i++) {
|
||||
actor_x[i] = rand();
|
||||
actor_y[i] = rand();
|
||||
actor_dx[i] = (rand() & 7) - 3;
|
||||
actor_dy[i] = (rand() & 7) - 3;
|
||||
}
|
||||
// loop forever
|
||||
while (1) {
|
||||
// start with OAMid/sprite 0
|
||||
oam_id = 0;
|
||||
// draw and move all actors
|
||||
for (i=0; i<NUM_ACTORS; i++) {
|
||||
oam_id = oam_meta_spr(actor_x[i], actor_y[i], oam_id, playerRunSeq[i]);
|
||||
actor_x[i] += actor_dx[i];
|
||||
actor_y[i] += actor_dy[i];
|
||||
}
|
||||
// hide rest of sprites
|
||||
// if we haven't wrapped oam_id around to 0
|
||||
if (oam_id!=0) oam_hide_rest(oam_id);
|
||||
// wait for next frame
|
||||
ppu_wait_frame();
|
||||
}
|
||||
}
|
@ -6,13 +6,6 @@
|
||||
|
||||
typedef unsigned char byte;
|
||||
|
||||
const unsigned char TILESET[8*128] = {/*{w:8,h:8,bpp:1,count:128,brev:1}*/
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x7c,0x7c,0x7c,0x38,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x6c,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0xfe,0x6c,0xfe,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xfe,0xd0,0xfe,0x16,0xfe,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xdc,0x38,0x76,0xe6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6c,0x7c,0xec,0xee,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x70,0x70,0x70,0x70,0x70,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x38,0x38,0x38,0x38,0x38,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x38,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0xfe,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x1e,0x3c,0x78,0xf0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x7c,0xee,0xee,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x78,0x38,0x38,0x38,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x0e,0x7c,0xe0,0xee,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x0e,0x3c,0x0e,0x0e,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x7e,0xee,0xee,0xfe,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xe0,0xfc,0x0e,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0xfc,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xee,0x1c,0x1c,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0x7c,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0x7e,0x0e,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x38,0x70,0x70,0x38,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x38,0x1c,0x1c,0x38,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0x1c,0x38,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x7c,0xee,0xee,0xee,0xe0,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0xee,0xfe,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xee,0xfc,0xee,0xee,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xe0,0xe0,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xec,0xee,0xee,0xee,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xe0,0xf0,0xe0,0xe0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xe0,0xf8,0xe0,0xe0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0xee,0xee,0xee,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xfe,0xee,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x38,0x38,0x38,0x38,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x0e,0x0e,0x0e,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xfc,0xf8,0xec,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0xe0,0xe0,0xee,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xee,0xfe,0xfe,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xee,0xfe,0xfe,0xee,0xe6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0xfc,0xee,0xee,0xee,0xfc,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0xee,0xec,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xee,0xee,0xee,0xfc,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0x7c,0x0e,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x38,0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0x6c,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xfe,0xfe,0xee,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0x7c,0x38,0x7c,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0x7c,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x1c,0x38,0x70,0xe0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
|
||||
//
|
||||
// MUSIC ROUTINES
|
||||
//
|
||||
@ -99,18 +92,6 @@ void start_music(const byte* music) {
|
||||
cur_duration = 0;
|
||||
}
|
||||
|
||||
//put a string into the nametable
|
||||
|
||||
void put_str(unsigned int adr,const char *str)
|
||||
{
|
||||
vram_adr(adr);
|
||||
while(1)
|
||||
{
|
||||
if(!*str) break;
|
||||
vram_put((*str++)-0x20);//-0x20 because ASCII code 0x20 is placed in tile 0 of the CHR
|
||||
}
|
||||
}
|
||||
|
||||
const byte APUINIT[0x13] = {
|
||||
0x30,0x08,0x00,0x00,
|
||||
0x30,0x08,0x00,0x00,
|
||||
@ -128,22 +109,7 @@ void init_apu() {
|
||||
|
||||
void main(void)
|
||||
{
|
||||
//copy tileset to RAM
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)TILESET, sizeof(TILESET));
|
||||
pal_col(1,0x30);//set while color
|
||||
put_str(NTADR_A(2,2),"HELLO, WORLD!");
|
||||
ppu_on_bg();//enable rendering
|
||||
|
||||
init_apu();
|
||||
/*
|
||||
APU.delta_mod.control = 0x1;
|
||||
//APU.delta_mod.output = 0x0;
|
||||
APU.delta_mod.address = 0xff;
|
||||
APU.delta_mod.length = 0xff;
|
||||
APU.status = 0x10;
|
||||
*/
|
||||
|
||||
init_apu();
|
||||
music_ptr = 0;
|
||||
while (1) {
|
||||
if (!music_ptr) start_music(music1);
|
||||
|
@ -1,53 +1,42 @@
|
||||
|
||||
//this example code shows how to put some text in nametable
|
||||
|
||||
#include "neslib.h"
|
||||
#include <string.h>
|
||||
|
||||
// link the pattern table into PRG ROM
|
||||
// we'll write it into CHR RAM on startup
|
||||
|
||||
//#link "jroatch.c"
|
||||
extern unsigned char jroatch_chr[0x1000];
|
||||
#define TILESET jroatch_chr
|
||||
#define PATTERN_TABLE jroatch_chr
|
||||
|
||||
//this macro is used remove need of calculation of the nametable address in runtime
|
||||
|
||||
#define NTADR(x,y) ((0x2000|((y)<<5)|x))
|
||||
|
||||
//put a string into the nametable
|
||||
|
||||
void put_str(unsigned int adr,const char *str)
|
||||
{
|
||||
vram_adr(adr);
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(!*str) break;
|
||||
vram_put((*str++));
|
||||
}
|
||||
// function to write a string into the name table
|
||||
// adr = start address in name table
|
||||
// str = pointer to string
|
||||
void put_str(unsigned int adr, const char *str) {
|
||||
vram_adr(adr); // set PPU read/write address
|
||||
vram_write(str, strlen(str)); // write bytes to PPU
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
//copy tileset to RAM
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)TILESET, sizeof(TILESET));
|
||||
|
||||
//rendering is disabled at the startup, and palette is all black
|
||||
pal_col(1,0x04);
|
||||
pal_col(2,0x20);
|
||||
pal_col(3,0x30);
|
||||
// main function, run after console reset
|
||||
void main(void) {
|
||||
// copy pattern table to PRG RAM
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)PATTERN_TABLE, sizeof(PATTERN_TABLE));
|
||||
|
||||
//you can't put data into vram through vram_put while rendering is enabled
|
||||
//so you have to disable rendering to put things like text or a level map
|
||||
//into the nametable
|
||||
// set palette colors
|
||||
pal_col(1,0x04);
|
||||
pal_col(2,0x20);
|
||||
pal_col(3,0x30);
|
||||
|
||||
//there is a way to update small number of nametable tiles while rendering
|
||||
//is enabled, using set_vram_update and an update list
|
||||
// write text to name table
|
||||
put_str(NTADR_A(2,2),"HELLO, WORLD!");
|
||||
put_str(NTADR_A(2,4),"THIS CODE PRINTS SOME TEXT");
|
||||
put_str(NTADR_A(2,5),"USING ASCII-ENCODED CHARACTER");
|
||||
put_str(NTADR_A(2,6),"SET WITH CAPITAL LETTERS ONLY");
|
||||
|
||||
put_str(NTADR(2,2),"HELLO, WORLD!");
|
||||
put_str(NTADR(2,4),"THIS CODE PRINTS SOME TEXT");
|
||||
put_str(NTADR(2,5),"USING ASCII-ENCODED CHARACTER");
|
||||
put_str(NTADR(2,6),"SET WITH CAPITAL LETTERS ONLY");
|
||||
// enable PPU rendering (turn on screen)
|
||||
ppu_on_all();
|
||||
|
||||
ppu_on_all();//enable rendering
|
||||
|
||||
while(1);//do nothing, infinite loop
|
||||
// infinite loop
|
||||
while (1) ;
|
||||
}
|
||||
|
63
presets/nes/scroll.c
Normal file
63
presets/nes/scroll.c
Normal file
@ -0,0 +1,63 @@
|
||||
|
||||
#include "neslib.h"
|
||||
#include <string.h>
|
||||
|
||||
// link the pattern table into PRG ROM
|
||||
// we'll write it into CHR RAM on startup
|
||||
|
||||
//#link "jroatch.c"
|
||||
extern unsigned char jroatch_chr[0x1000];
|
||||
#define PATTERN_TABLE jroatch_chr
|
||||
|
||||
// function to write a string into the name table
|
||||
// adr = start address in name table
|
||||
// str = pointer to string
|
||||
void put_str(unsigned int adr, const char *str) {
|
||||
vram_adr(adr); // set PPU read/write address
|
||||
vram_write(str, strlen(str)); // write bytes to PPU
|
||||
}
|
||||
|
||||
// function to scroll window up and down until end
|
||||
void scroll_demo() {
|
||||
int x = 0; // x scroll position
|
||||
int y = 0; // y scroll position
|
||||
int dy = 1; // y scroll direction
|
||||
// infinite loop
|
||||
while (1) {
|
||||
// wait for next frame
|
||||
ppu_wait_frame();
|
||||
// set scroll register
|
||||
scroll(x, y);
|
||||
// update y variable
|
||||
y += dy;
|
||||
// change direction when hitting either edge of scroll area
|
||||
if (y >= 479) dy = -1;
|
||||
if (y == 0) dy = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// main function, run after console reset
|
||||
void main(void) {
|
||||
// copy pattern table to PRG RAM
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)PATTERN_TABLE, sizeof(PATTERN_TABLE));
|
||||
|
||||
// set palette colors
|
||||
pal_col(1,0x04);
|
||||
pal_col(2,0x20);
|
||||
pal_col(3,0x30);
|
||||
|
||||
// write text to name table
|
||||
put_str(NTADR_A(2,0), "Nametable A, Line 0");
|
||||
put_str(NTADR_A(2,15), "Nametable A, Line 15");
|
||||
put_str(NTADR_A(2,29),"Nametable A, Line 29");
|
||||
put_str(NTADR_C(2,0), "Nametable C, Line 0");
|
||||
put_str(NTADR_C(2,15), "Nametable C, Line 15");
|
||||
put_str(NTADR_C(2,29),"Nametable C, Line 29");
|
||||
|
||||
// enable PPU rendering (turn on screen)
|
||||
ppu_on_all();
|
||||
|
||||
// scroll window back and forth
|
||||
scroll_demo();
|
||||
}
|
89
presets/nes/sprites.c
Normal file
89
presets/nes/sprites.c
Normal file
@ -0,0 +1,89 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// include NESLIB header
|
||||
|
||||
#include "neslib.h"
|
||||
|
||||
// include CC65 NES Header (PPU)
|
||||
|
||||
#include <nes.h>
|
||||
|
||||
///// PATTERN TABLE
|
||||
|
||||
//#link "jroatch.c"
|
||||
extern unsigned char jroatch_chr[0x1000];
|
||||
#define PATTERN_TABLE jroatch_chr
|
||||
|
||||
|
||||
const char PALETTE[32] = {
|
||||
0x03, // background color
|
||||
|
||||
0x11,0x30,0x27, 0, // ladders and pickups
|
||||
0x1c,0x20,0x2c, 0, // floor blocks
|
||||
0x00,0x10,0x20, 0,
|
||||
0x06,0x16,0x26, 0,
|
||||
|
||||
0x16,0x35,0x24, 0, // enemy sprites
|
||||
0x00,0x37,0x25, 0, // rescue person
|
||||
0x0d,0x2d,0x3a, 0,
|
||||
0x0d,0x27,0x2a // player sprites
|
||||
};
|
||||
|
||||
// setup PPU and tables
|
||||
void setup_graphics() {
|
||||
// set pattern table
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)PATTERN_TABLE, sizeof(PATTERN_TABLE));
|
||||
// clear sprites
|
||||
oam_clear();
|
||||
// set palette colors
|
||||
pal_all(PALETTE);
|
||||
// turn on PPU
|
||||
ppu_on_all();
|
||||
}
|
||||
|
||||
// number of actors
|
||||
#define NUM_ACTORS 64
|
||||
|
||||
// actor x/y positions
|
||||
char actor_x[NUM_ACTORS];
|
||||
char actor_y[NUM_ACTORS];
|
||||
// actor x/y deltas per frame
|
||||
char actor_dx[NUM_ACTORS];
|
||||
char actor_dy[NUM_ACTORS];
|
||||
|
||||
// OAM buffer pointer, in case we want to manipulate directly
|
||||
#define OAMBUF ((unsigned char*) 0x200)
|
||||
|
||||
// main program
|
||||
void main() {
|
||||
char i;
|
||||
char oam_id;
|
||||
|
||||
setup_graphics();
|
||||
// initialize actors with random values
|
||||
for (i=0; i<NUM_ACTORS; i++) {
|
||||
actor_x[i] = rand();
|
||||
actor_y[i] = rand();
|
||||
actor_dx[i] = (rand() & 7) - 3;
|
||||
actor_dy[i] = (rand() & 7) - 3;
|
||||
}
|
||||
// loop forever
|
||||
while (1) {
|
||||
// start with OAMid/sprite 0
|
||||
oam_id = 0;
|
||||
// draw and move all actors
|
||||
for (i=0; i<NUM_ACTORS; i++) {
|
||||
oam_id = oam_spr(actor_x[i], actor_y[i], i, i, oam_id);
|
||||
actor_x[i] += actor_dx[i];
|
||||
actor_y[i] += actor_dy[i];
|
||||
}
|
||||
// hide rest of sprites
|
||||
// if we haven't wrapped oam_id around to 0
|
||||
if (oam_id!=0) oam_hide_rest(oam_id);
|
||||
// wait for next frame
|
||||
ppu_wait_frame();
|
||||
}
|
||||
}
|
82
presets/nes/statusbar.c
Normal file
82
presets/nes/statusbar.c
Normal file
@ -0,0 +1,82 @@
|
||||
|
||||
#include "neslib.h"
|
||||
#include <string.h>
|
||||
|
||||
// vertical mirroring (horizontal scroling)
|
||||
#define NES_MIRRORING 1
|
||||
|
||||
// link the pattern table into PRG ROM
|
||||
// we'll write it into CHR RAM on startup
|
||||
|
||||
//#link "jroatch.c"
|
||||
extern unsigned char jroatch_chr[0x1000];
|
||||
#define PATTERN_TABLE jroatch_chr
|
||||
|
||||
// function to write a string into the name table
|
||||
// adr = start address in name table
|
||||
// str = pointer to string
|
||||
void put_str(unsigned int adr, const char *str) {
|
||||
vram_adr(adr); // set PPU read/write address
|
||||
vram_write(str, strlen(str)); // write bytes to PPU
|
||||
}
|
||||
|
||||
// function to scroll window up and down until end
|
||||
void scroll_demo() {
|
||||
int x = 0; // x scroll position
|
||||
int y = 0; // y scroll position
|
||||
int dx = 1; // y scroll direction
|
||||
// infinite loop
|
||||
while (1) {
|
||||
// set scroll register
|
||||
// waits for NMI, which means no frame-skip?
|
||||
split(x, 0);
|
||||
// update y variable
|
||||
x += dx;
|
||||
// change direction when hitting either edge of scroll area
|
||||
if (x >= 479) dx = -1;
|
||||
if (x == 0) dx = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// main function, run after console reset
|
||||
void main(void) {
|
||||
// copy pattern table to PRG RAM
|
||||
vram_adr(0x0);
|
||||
vram_write((unsigned char*)PATTERN_TABLE, sizeof(PATTERN_TABLE));
|
||||
|
||||
// set palette colors
|
||||
pal_col(0,0x00);
|
||||
pal_col(1,0x04);
|
||||
pal_col(2,0x20);
|
||||
pal_col(3,0x30);
|
||||
pal_col(5,0x14);
|
||||
pal_col(6,0x24);
|
||||
pal_col(7,0x34);
|
||||
|
||||
// write text to name table
|
||||
put_str(NTADR_A(7,0), "Nametable A, Line 0");
|
||||
put_str(NTADR_A(7,1), "Nametable A, Line 1");
|
||||
put_str(NTADR_A(7,2), "Nametable A, Line 2");
|
||||
vram_adr(NTADR_A(0,3));
|
||||
vram_fill(5, 32);
|
||||
put_str(NTADR_A(2,4), "Nametable A, Line 4");
|
||||
put_str(NTADR_A(2,15),"Nametable A, Line 15");
|
||||
put_str(NTADR_A(2,27),"Nametable A, Line 27");
|
||||
put_str(NTADR_B(2,4), "Nametable B, Line 4");
|
||||
put_str(NTADR_B(2,15),"Nametable B, Line 15");
|
||||
put_str(NTADR_B(2,27),"Nametable B, Line 27");
|
||||
|
||||
// set attributes
|
||||
vram_adr(0x23c0);
|
||||
vram_fill(0x55, 8);
|
||||
|
||||
// set sprite 0
|
||||
oam_clear();
|
||||
oam_spr(0, 30, 1, 1, 0);
|
||||
|
||||
// enable PPU rendering (turn on screen)
|
||||
ppu_on_all();
|
||||
|
||||
// scroll window back and forth
|
||||
scroll_demo();
|
||||
}
|
@ -15,16 +15,17 @@ const JSNES_PRESETS = [
|
||||
{id:'ex3.asm', name:'Sprite Demo (ASM)'},
|
||||
{id:'ex4.asm', name:'Controller Demo (ASM)'},
|
||||
{id:'neslib1.c', name:'Text'},
|
||||
{id:'neslib2.c', name:'Sprites'},
|
||||
{id:'neslib3.c', name:'Cursor'},
|
||||
{id:'neslib4.c', name:'Metasprites'},
|
||||
{id:'scroll.c', name:'Scrolling'},
|
||||
{id:'statusbar.c', name:'Status Bar'},
|
||||
{id:'sprites.c', name:'Sprites'},
|
||||
{id:'metasprites.c', name:'Metasprites'},
|
||||
{id:'metacursor.c', name:'Controllers'},
|
||||
{id:'neslib5.c', name:'RLE Unpack'},
|
||||
{id:'music.c', name:'Music Player'},
|
||||
{id:'siegegame.c', name:'Siege Game'},
|
||||
{id:'shoot2.c', name:'Solarian Game'},
|
||||
{id:'climber.c', name:'Platform Game'},
|
||||
{id:'scrollrt.asm', name:'Split Screen Scroll (ASM)'},
|
||||
{id:'road.asm', name:'3-D Road (ASM)'},
|
||||
{id:'musicdemo.asm', name:'Famitone Demo (ASM)'},
|
||||
];
|
||||
|
||||
@ -76,7 +77,6 @@ const _JSNESPlatform = function(mainElement) {
|
||||
var ntlastbuf;
|
||||
|
||||
class JSNESPlatform extends Base6502Platform implements Platform {
|
||||
debugPCDelta = 1;
|
||||
|
||||
getPresets() { return JSNES_PRESETS; }
|
||||
|
||||
@ -142,13 +142,21 @@ const _JSNESPlatform = function(mainElement) {
|
||||
}
|
||||
|
||||
advance(novideo : boolean) {
|
||||
nes.frame();
|
||||
try {
|
||||
nes.frame();
|
||||
} catch (e) {
|
||||
// TODO?
|
||||
alert(e);
|
||||
console.log(e);
|
||||
this.breakpointHit(this.debugClock);
|
||||
}
|
||||
}
|
||||
|
||||
updateDebugViews() {
|
||||
// don't update if view is hidden
|
||||
if (! $(ntvideo.canvas).is(":visible"))
|
||||
return;
|
||||
// TODO: doesn't work on scrolling example
|
||||
var a = 0;
|
||||
var attraddr = 0;
|
||||
var idata = ntvideo.getFrameData();
|
||||
|
@ -93,7 +93,7 @@ export class CodeProject {
|
||||
} else {
|
||||
// for .asm -- [.]include "file"
|
||||
// for .c -- #include "file"
|
||||
var re2 = /^\s+([.#]?include|incbin)\s+"(.+?)"/gmi;
|
||||
var re2 = /^\s*([.#]?include|incbin)\s+"(.+?)"/gmi;
|
||||
while (m = re2.exec(text)) {
|
||||
this.pushAllFiles(files, m[2]);
|
||||
}
|
||||
|
@ -903,6 +903,34 @@ function linkLD65(step:BuildStep) {
|
||||
}
|
||||
}
|
||||
|
||||
function fixParamsWithDefines(path:string, libargs:string[]){
|
||||
if (path && libargs) {
|
||||
var code = getWorkFileAsString(path);
|
||||
if (code) {
|
||||
var ident2index = {};
|
||||
// find all lib args "IDENT=VALUE"
|
||||
for (var i=0; i<libargs.length; i++) {
|
||||
var toks = libargs[i].split('=');
|
||||
if (toks.length == 2) {
|
||||
ident2index[toks[0]] = i;
|
||||
}
|
||||
}
|
||||
// find #defines and replace them
|
||||
var re = /^#define\s+(\w+)\s+(.+)/gmi;
|
||||
var m;
|
||||
while (m = re.exec(code)) {
|
||||
var ident = m[1];
|
||||
var value = m[2];
|
||||
var index = ident2index[ident];
|
||||
if (index >= 0) {
|
||||
libargs[index] = ident + "=" + value;
|
||||
console.log(index, libargs[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function compileCC65(step:BuildStep) {
|
||||
load("cc65");
|
||||
var params = step.params;
|
||||
@ -933,6 +961,7 @@ function compileCC65(step:BuildStep) {
|
||||
var FS = CC65['FS'];
|
||||
setupFS(FS, '65-'+step.platform.split('-')[0]);
|
||||
populateFiles(step, FS);
|
||||
fixParamsWithDefines(step.path, params.libargs);
|
||||
execMain(step, CC65, ['-T', '-g',
|
||||
'-Oirs',
|
||||
'-Cl', // static locals
|
||||
|
Loading…
x
Reference in New Issue
Block a user