1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-23 03:29:39 +00:00

update nes presets, renamed .asm to .dasm

This commit is contained in:
Steven Hugg 2019-05-10 21:25:21 -04:00
parent 143cfa7153
commit 0f292a422f
18 changed files with 49 additions and 47 deletions

View File

@ -36,7 +36,7 @@ typedef enum { SND_START, SND_HIT, SND_COIN, SND_JUMP } SFXIndex;
#define COLS 30 // floor width in tiles
#define ROWS 60 // total nametable height in tiles
#define MAX_FLOORS 4 // total # of floors in a stage
#define MAX_FLOORS 24 // total # of floors in a stage
#define GAPSIZE 4 // gap size in tiles
#define BOTTOM_FLOOR_Y 2 // offset for bottommost floor

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; VARIABLES
@ -35,7 +35,7 @@ Start:
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; VARIABLES
@ -69,7 +69,7 @@ SetPalette: subroutine
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; VARIABLES
@ -70,7 +70,7 @@ SetPalette: subroutine
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; VARIABLES
@ -80,7 +80,7 @@ MoveSprites: subroutine
inx ; X = X + 1
bne .loop ; loop until X wraps
rts ; return to caller
; set palette colors
SetPalette: subroutine
PPU_SETADDR $3f00
@ -96,7 +96,7 @@ SetPalette: subroutine
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; VARIABLES
@ -64,7 +64,7 @@ SetPalette: subroutine
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -61,8 +61,7 @@ sbyte actor_dy[NUM_ACTORS];
// main program
void main() {
char i;
char oam_id;
byte i;
// setup graphics
setup_graphics();
@ -76,21 +75,24 @@ void main() {
// loop forever
while (1) {
// start with OAMid/sprite 0
oam_id = 0;
oam_off = 0;
// draw and move all actors
// (note we don't reset i each loop iteration)
while (oam_id < 256-4*4) {
// wrap around actor array
if (i >= NUM_ACTORS)
while (oam_off < 256-4*4) {
// advance and wrap around actor array
if (++i >= NUM_ACTORS)
i -= NUM_ACTORS;
oam_id = oam_meta_spr(actor_x[i], actor_y[i], oam_id, metasprite);
actor_x[i] += actor_dx[i];
actor_y[i] += actor_dy[i];
++i;
// draw and move actor
oam_meta_spr_pal(
actor_x[i] += actor_dx[i], // add x+dx and pass param
actor_y[i] += actor_dy[i], // add y+dy and pass param
i&3, // palette color
metasprite); // metasprites
}
// hide rest of sprites
oam_hide_rest(oam_id);
// wait for next frame
ppu_wait_frame();
oam_hide_rest(oam_off);
// wait for next NMI
// we don't want to skip frames b/c it makes flicker worse
ppu_wait_nmi();
}
}

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; ZERO-PAGE VARIABLES
@ -113,7 +113,7 @@ ASCII2Tile:
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; VARIABLES
@ -78,7 +78,7 @@ ShowTimeEnd:
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
include "famitone2.asm"

View File

@ -16,7 +16,7 @@ extern const byte climbr_title_rle[];
void fade_in() {
byte vb;
for (vb=0; vb<=4; vb++) {
// set virtual bright vaule
// set virtual bright value
pal_bright(vb);
// wait for 4/60 sec
ppu_wait_frame();

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; ZERO-PAGE VARIABLES
@ -291,7 +291,7 @@ SetSprite0: subroutine
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; ZERO-PAGE VARIABLES
@ -81,7 +81,7 @@ SetSprite0: subroutine
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; VARIABLES
@ -33,7 +33,7 @@ Start: subroutine
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -1,5 +1,5 @@
include "nesdefs.asm"
include "nesdefs.dasm"
;;;;; ZERO-PAGE VARIABLES
@ -79,7 +79,7 @@ SetSprite0: subroutine
;;;;; COMMON SUBROUTINES
include "nesppu.asm"
include "nesppu.dasm"
;;;;; INTERRUPT HANDLERS

View File

@ -29,15 +29,15 @@ const JSNES_PRESETS = [
{id:'fami.c', name:'Famitone Demo'},
{id:'bankswitch.c', name:'Bank Switching'},
{id:'irq.c', name:'IRQ Scanline Counter'},
{id:'ex0.asm', name:'Initialization (ASM)'},
{id:'ex1.asm', name:'Hello World (ASM)'},
{id:'ex2.asm', name:'Scrolling Demo (ASM)'},
{id:'ex3.asm', name:'Sprite Demo (ASM)'},
{id:'ex4.asm', name:'Controller Demo (ASM)'},
{id:'musicdemo.asm', name:'Famitone Demo (ASM)'},
{id:'xyscroll.asm', name:'XY Split Scrolling (ASM)'},
{id:'scrollrt.asm', name:'Line-by-line Scrolling (ASM)'},
{id:'road.asm', name:'3-D Road Demo (ASM)'},
{id:'ex0.dasm', name:'Initialization (ASM)'},
{id:'ex1.dasm', name:'Hello World (ASM)'},
{id:'ex2.dasm', name:'Scrolling Demo (ASM)'},
{id:'ex3.dasm', name:'Sprite Demo (ASM)'},
{id:'ex4.dasm', name:'Controller Demo (ASM)'},
{id:'musicdemo.dasm', name:'Famitone Demo (ASM)'},
{id:'xyscroll.dasm', name:'XY Split Scrolling (ASM)'},
{id:'scrollrt.dasm', name:'Line-by-line Scrolling (ASM)'},
{id:'road.dasm', name:'3-D Road Demo (ASM)'},
{id:'chase/game.c', name:'Shiru\'s Chase Game'},
];