diff --git a/Makefile b/Makefile index e75dc72..cabad37 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ ROM_CONFIG = nrom.cfg CRT_OBJ = crt0.o GAME_OBJ = game.o -RUNTIME_LIB = runtime.lib - +RUNTIME_LIB = nes.lib +CC65_HOME = /usr/share/cc65 EXECUTABLE = splatood.nes -ASM = ca65 -CC = cc65 +ASM = ca65 -t nes +CC = cc65 -t nes -Oisr LD = ld65 @@ -15,13 +15,13 @@ all: $(EXECUTABLE) ${CRT_OBJ} crt0.o: *.s *.chr %.s: %.c *.h levels/*.h - $(CC) -Oi $< --add-source + CC65_HOME=$(CC65_HOME) $(CC) $< --add-source %.o: %.s - $(ASM) $< + CC65_HOME=$(CC65_HOME) $(ASM) $< -$(EXECUTABLE): $(GAME_OBJ) $(ROM_CONFIG) $(CRT_OBJ) $(RUNTIME_LIB) - $(LD) -C $(ROM_CONFIG) -o $(EXECUTABLE) $(CRT_OBJ) $(GAME_OBJ) $(RUNTIME_LIB) +$(EXECUTABLE): $(GAME_OBJ) $(ROM_CONFIG) $(CRT_OBJ) + CC65_HOME=$(CC65_HOME) $(LD) -C $(ROM_CONFIG) -o $(EXECUTABLE) $(CRT_OBJ) $(GAME_OBJ) $(RUNTIME_LIB) clean: rm -f game.s *.o *.nes diff --git a/TODO.md b/TODO.md index 966a534..2b92a01 100644 --- a/TODO.md +++ b/TODO.md @@ -2,31 +2,54 @@ ## 1.1 -- Spawn invincibility (to prevent spawn camping) +- ~~Spawn invincibility (to prevent spawn camping)~~ - Woomy +- ~~AI players~~ + - AI select - ~~Chargers~~ -- Charging indicator -- Weapon Balance -- ~~New SFX~~ + - variable range/dmg charging + - Charging indicator +- ~~improved audio library with volume adjustments~~ + - ~~positional SFX~~ + - ~~Reduced in-game music volume~~ + - selection for in-game music volume - ~~Better weapon select~~ - ~~Animated Sprites~~ - ~~Palettes to indicate selection~~ +- ~~Squid mode (on B)~~ +- Weapon Balance ## 1.2 +- More SFX +- Brushes +- Shooters + - Ammo + - semicoloured tiles +- Bubbler (Bubble enemies instead of killing them) +- health + - damage over time - Four Score 2v2 support -- Ammo -- Squid mode +- Bombs (using select button) +- Weapon Balance ## 1.3 -- AI players +- improved AI + - squid mode + - pathfinding + - improved mazing strategy + - player/map statistics + - states (evasive, defensive, aggressive) ## 2.0 - Campaign + - Scrolling Levels ## Misc -- cc65 2.15 compatibility +- ~~cc65 2.15 compatibility~~ - Cover art +- linux terminal/sdl port including network support + diff --git a/crt0.s b/crt0.s index 8002161..7903063 100644 --- a/crt0.s +++ b/crt0.s @@ -72,7 +72,7 @@ PPU_CTRL_VAR: .res 1 PPU_CTRL_VAR1: .res 1 PPU_MASK_VAR: .res 1 RAND_SEED: .res 2 -FT_TEMP: .res 3 +FT_TEMP: .res 4 TEMP: .res 11 diff --git a/famitone2.s b/famitone2.s index d642455..6d3d86a 100644 --- a/famitone2.s +++ b/famitone2.s @@ -1,11 +1,10 @@ -;FamiTone2 v1.11 - +;FamiTone2 v1.12 SVAV = Simon's Volume Adjust Version. ;settings, uncomment or put them into your main program; the latter makes possible updates easier ; FT_BASE_ADR = $0300 ;page in the RAM used for FT2 variables, should be $xx00 -; FT_TEMP = $00 ;3 bytes in zeropage used by the library as a scratchpad +; FT_TEMP = $00 ;4 bytes in zeropage used by the library as a scratchpad ; FT_DPCM_OFF = $c000 ;$c000..$ffc0, 64-byte steps ; FT_SFX_STREAMS = 4 ;number of sound effects played at once, 1..4 @@ -35,7 +34,8 @@ FT_TEMP_PTR = FT_TEMP ;word FT_TEMP_PTR_L = FT_TEMP_PTR+0 FT_TEMP_PTR_H = FT_TEMP_PTR+1 FT_TEMP_VAR1 = FT_TEMP+2 - +FT_TEMP_VAR2 = FT_TEMP+3 +FT_TEMP_SIZE = 4 ;envelope structure offsets, 5 bytes per envelope, grouped by variable type @@ -67,7 +67,9 @@ FT_CHN_DUTY = FT_BASE_ADR+8*FT_CHANNELS_ALL ;variables and aliases -FT_ENVELOPES = FT_BASE_ADR +FT_MUSIC_VOLUME = FT_BASE_ADR + +FT_ENVELOPES = FT_BASE_ADR+1 FT_CH1_ENVS = FT_ENVELOPES+0 FT_CH2_ENVS = FT_ENVELOPES+3 FT_CH3_ENVS = FT_ENVELOPES+6 @@ -134,20 +136,22 @@ FT_DPCM_EFFECT = FT_VARS+11 FT_OUT_BUF = FT_VARS+12 ;11 bytes -;sound effect stream variables, 2 bytes and 15 bytes per stream +;sound effect stream variables, 2 bytes and 16 bytes per stream ;when sound effects are disabled, this memory is not used FT_SFX_ADR_L = FT_VARS+23 FT_SFX_ADR_H = FT_VARS+24 FT_SFX_BASE_ADR = FT_VARS+25 -FT_SFX_STRUCT_SIZE = 15 -FT_SFX_REPEAT = FT_SFX_BASE_ADR+0 -FT_SFX_PTR_L = FT_SFX_BASE_ADR+1 -FT_SFX_PTR_H = FT_SFX_BASE_ADR+2 -FT_SFX_OFF = FT_SFX_BASE_ADR+3 -FT_SFX_BUF = FT_SFX_BASE_ADR+4 ;11 bytes +FT_SFX_STRUCT_SIZE = 16 +FT_SFX_VOLUME = FT_SFX_BASE_ADR+0 +FT_SFX_REPEAT = FT_SFX_BASE_ADR+1 +FT_SFX_PTR_L = FT_SFX_BASE_ADR+2 +FT_SFX_PTR_H = FT_SFX_BASE_ADR+3 +FT_SFX_OFF = FT_SFX_BASE_ADR+4 +FT_SFX_BUF = FT_SFX_BASE_ADR+5 ;11 bytes +FT_BASE_SIZE = FT_SFX_BUF+11-FT_BASE_ADR ;aliases for sound effect channels to use in user calls @@ -318,7 +322,7 @@ FamiToneMusicStop: bne @set_envelopes - rts + jmp FamiToneSampleStop ;------------------------------------------------------------------------------ @@ -409,7 +413,11 @@ FamiToneMusicPause: tax ;set SZ flags for A beq @unpause + @pause: + + jsr FamiToneSampleStop + lda #0 ;mute sound sta FT_CH1_VOLUME sta FT_CH2_VOLUME @@ -605,6 +613,16 @@ FamiToneUpdate: sta FT_MR_PULSE1_H @ch1prev: lda FT_CH1_VOLUME + pha + and #$f0 + sta +#include + /* Name tables */ #include "levels/splat_title.h" @@ -55,18 +62,28 @@ extern const unsigned char music_music_data[]; /* Weapons */ #define NUM_WPNS 2 -#define WPN_ROLLER 0 -#define WPN_CHARGER 1 +#define WPN_SQUID 0 +#define WPN_ROLLER 1 +#define WPN_CHARGER 2 +//#define WPN_AI2 + +#define MODE_NORMAL 0 +#define MODE_SQUID 1 /* Tuneable gameplay parameters */ #define RESPAWN_TIME 64 -#define PROJECTILE_WAIT_TIME_ROLLER 16 -#define PROJECTILE_WAIT_TIME_CHARGER 64 +#define PROJECTILE_WAIT_TIME_ROLLER 32 +#define PROJECTILE_WAIT_TIME_CHARGER 8 #define PROJECTILE_DISTANCE_ROLLER 4 #define PROJECTILE_DISTANCE_CHARGER 16 #define PROJECTILE_SPEED_ROLLER 8<>palette_shift_val; +} + +/** + * Set the palette value for a tile in the attribute table. */ void set_tile_palette(unsigned char x_idx, unsigned char y_idx, unsigned char value) { unsigned char palette_mask; @@ -552,6 +592,15 @@ void show_select_weapon(void) { anim_frame = 0; + //default aggressive ai for player 2 + ai_aggression[0]=1; + ai_aggression[1]=1; + player_ai[0]=0; + player_ai[1]=1; + + player_mode[0]=MODE_SQUID; + player_mode[1]=MODE_SQUID; + while (1) { next: @@ -583,12 +632,13 @@ void show_select_weapon(void) { i++; for (player_id = 0; player_id < 2; player_id++) { j = pad_trigger(player_id); + if((j!=0)&&(player_id==1)) player_ai[player_id]=0; //disable ai if player 2 presses any key at weapon select screen /* Start - Select weapon */ if (j & PAD_START) return; /* Up - move cursor up */ if (j & PAD_UP) { - if (player_wpn[player_id] == 0) { - player_wpn[player_id] = NUM_WPNS-1; + if (player_wpn[player_id] == 1) { + player_wpn[player_id] = NUM_WPNS; } else { player_wpn[player_id] -= 1; } @@ -598,7 +648,7 @@ void show_select_weapon(void) { /* Select or Down - move cursor down */ if (j & PAD_SELECT || j & PAD_LEFT || j & PAD_RIGHT) { player_wpn[player_id] += 1; - if (player_wpn[player_id] == NUM_WPNS) player_wpn[player_id] = 0; + if (player_wpn[player_id] > NUM_WPNS) player_wpn[player_id] = 1; goto next; } } @@ -620,7 +670,7 @@ void show_credits() { /* Write credits. */ i = 0; j = 0; - div = 0; + divvar = 0; /* Clear the scrolling nametables, A and C */ vram_adr(NAMETABLE_C); @@ -629,7 +679,7 @@ void show_credits() { sum = NAMETABLE_C; - while (i < 17) { /* 4 6 A C */ + while (i < 19) { /* 4 6 A C */ ppu_wait_nmi(); ppu_off(); vram_adr(sum); @@ -642,17 +692,17 @@ void show_credits() { ppu_on_all(); do { - scroll(0,div); + scroll(0,divvar); /* Judd as a sprite. */ - if (i == 0 && div < 0x62) { - oam_meta_spr(0x70,0x48-div,0,(char*)i16); + if (i == 0 && divvar < 0x62) { + oam_meta_spr(0x70,0x48-divvar,0,(char*)i16); } - div++; + divvar++; WAIT_WITH_SKIP(1); - } while (div % 240); - if (div == 480) div = 0; + } while (divvar % 240); + if (divvar == 480) divvar = 0; if (sum == NAMETABLE_A) sum = NAMETABLE_C; else sum = NAMETABLE_A; @@ -667,10 +717,10 @@ void show_credits() { vram_fill(0xa0,1024-64); ppu_on_all(); - while (div % 240 < 100) { + while (divvar % 240 < 100) { WAIT_WITH_SKIP(1); - scroll(0,div); - div++; + scroll(0,divvar); + divvar++; } _skip_title: @@ -711,19 +761,19 @@ void show_endgame(void) { sum = (player_score[0] + player_score[1]); /* Calculate percentage for player 1 */ - div = player_score[0] * 100; - div /= sum; - if (div == 100) div = 99; - if (div == 0) div = 1; - put_num(NAMETABLE_A+0x1EA,div,2); + divvar = player_score[0] * 100; + divvar /= sum; + if (divvar == 100) divvar = 99; + if (divvar == 0) divvar = 1; + put_num(NAMETABLE_A+0x1EA,divvar,2); /* Player 2 must be 100% - (player 1) */ - div = 100 - div; - put_num(NAMETABLE_A+0x1F4,div,2); + divvar = 100 - divvar; + put_num(NAMETABLE_A+0x1F4,divvar,2); /* Convert Player 2's percentage to a gauge width */ - div *= 9; - div /= 100; + divvar *= 9; + divvar /= 100; /* Print the victory message. */ if (player_score[0] > player_score[1]) { @@ -752,11 +802,11 @@ void show_endgame(void) { /* Set the gauge palettes. */ clear_update_list(); - for (i = 4; i < 12 - div; ++i) { + for (i = 4; i < 12 - divvar; ++i) { /* Player 1 on the left. */ set_tile_palette(i,8,1); } - for (i = 12 - div; i <= 11; ++i) { + for (i = 12 - divvar; i <= 11; ++i) { /* Player 2 on the right. */ set_tile_palette(i,8,2); @@ -773,7 +823,7 @@ void show_endgame(void) { } /* - * Move a projectile if the is no wall + * Move a projectile if there is no wall */ void projectile_move(unsigned char id) { unsigned char map_type = 0; @@ -829,20 +879,92 @@ void projectile_move(unsigned char id) { } +/** + * Calculate player distance + * + * Uses Manhattan metric + */ +unsigned int player_dist(unsigned char id1, unsigned char id2){ + int px2=player_x[id1]>>(TILE_SIZE_BIT+FP_BITS); + int py2=player_y[id1]>>(TILE_SIZE_BIT+FP_BITS); + int px=player_x[id2]>>(TILE_SIZE_BIT+FP_BITS); + int py=player_y[id2]>>(TILE_SIZE_BIT+FP_BITS); + return abs(px2-px)+abs(py2-py); +} + +/** + * Player movement test. + * + * Allows AI to test movement directions without actual movement. + */ +unsigned char player_move_test(unsigned char id,unsigned char dir_index) { + unsigned char map_type = 0; + unsigned char tile_palette; + unsigned char is_wall=0; + /*if (player_cooldown[id]) { + return 0; + }*/ + + px=player_x[id]>>(TILE_SIZE_BIT+FP_BITS); + py=player_y[id]>>(TILE_SIZE_BIT+FP_BITS); + + switch (dir_index%4) { + case 0: --px; break; + case 2: ++px; break; + case 1: --py; break; + case 3: ++py; break; + } + + + if (px > MAP_WDT-1) { + return 0; + } + + if (py > MAP_HGT-1) { + return 0; + } + + /* + * Wall tiles: + * 0x22~0x29 + * 0x32~0x39 + */ + map_type = map[MAP_ADR(px, py)]; + + //water + if(map_type == 0x2c || map_type == 0x2d || map_type == 0x3c || map_type == 0x3d) return 0; + + if((map_type >= 0x22 && map_type <= 0x29) || (map_type >= 0x32 && map_type <= 0x39)) is_wall=1; + + //inkable + if(can_ink(map_type)){ + + tile_palette=get_tile_palette(px,py); + + if(tile_palette==id+1) return 1-is_wall; //already inked + if(tile_palette==2-id) return 4; //enemy ink + else return 3-is_wall; //uninked + } + + return 0; +} + + /** * Player movement. * * Player movement is tile-by-tile with an animation between * tiles that we need to initialize. */ -void player_move(unsigned char id,unsigned char dir) { +void player_move(unsigned char id,unsigned char dir_index) { unsigned char map_type = 0; if (player_cooldown[id]) { return; } /* We always set direction so sprites update facing */ - player_dir[id]=dir; + player_dir_index[id]=dir_index; + player_dir[id]=dirs[dir_index]; /* A pad direction is being held, so animate */ player_anim_cnt[id] += 1; @@ -857,11 +979,11 @@ void player_move(unsigned char id,unsigned char dir) { px=player_x[id]>>(TILE_SIZE_BIT+FP_BITS); py=player_y[id]>>(TILE_SIZE_BIT+FP_BITS); - switch (dir) { - case DIR_LEFT: --px; break; - case DIR_RIGHT: ++px; break; - case DIR_UP: --py; break; - case DIR_DOWN: ++py; break; + switch (dir_index) { + case 0: --px; break; + case 2: ++px; break; + case 1: --py; break; + case 3: ++py; break; } @@ -880,17 +1002,19 @@ void player_move(unsigned char id,unsigned char dir) { */ map_type = map[MAP_ADR(px, py)]; - if (player_wpn[id] == WPN_ROLLER && can_ink(map_type)) { + if (player_mode[id]==MODE_NORMAL && player_wpn[id] == WPN_ROLLER && can_ink(map_type)) { set_tile_palette(px, py, id+1); } - if ((map_type >= 0x22 && map_type <= 0x29) || (map_type >= 0x32 && map_type <= 0x39)) { + if (((map_type >= 0x22 && map_type <= 0x29) || (map_type >= 0x32 && map_type <= 0x39)) && (player_mode[id]!=MODE_SQUID || get_tile_palette(px,py)!=id+1)) { return; } player_cnt[id]=TILE_SIZE<>1)); //positional audio for maximum player distance of 31 } /** @@ -930,11 +1054,56 @@ void player_die(unsigned char id) { player_anim_cnt[id]=0; player_diag_flip[id]=0; player_dir[id] = DIR_NONE; + player_mode[id]=MODE_SQUID; player_wait[id] = RESPAWN_TIME; sfx_play(SFX_DEATH,0); } +/** + * AI movement with aggressive weapon mode. + */ +unsigned char ai_move(unsigned char id){ + unsigned char diri,dirv,dirtest; + unsigned char px2,py2; + if(player_dir[id]==DIR_NONE) j=rand8()%4; //random start direction + else j=player_dir_index[id]; //prefer movements in the same direction + diri=255; dirv=0; + for(k=0;k<4;k++){ + dirtest=player_move_test(id,j+k); + if(dirtest>dirv){dirv=dirtest; diri=j+k; if(dirtest==4) break;} + else if((dirtest==dirv)&&(dirv==1)&&(rand8()<8)){dirv=dirtest; diri=j+k;} + } + if(dirv==0) j=PAD_A; //if no movement is possible just fire weapon + else j=dirs[diri%4]; + + if((player_cooldown[id]==0)&&(ai_aggression[id]>=1)&&(player_mode[1-id]!=MODE_SQUID)){ + px=player_x[id]>>(TILE_SIZE_BIT+FP_BITS); + py=player_y[id]>>(TILE_SIZE_BIT+FP_BITS); + px2=player_x[1-id]>>(TILE_SIZE_BIT+FP_BITS); + py2=player_y[1-id]>>(TILE_SIZE_BIT+FP_BITS); + if(px==px2){ + if(py>py2){ + if(py-py2<=3){ + if(player_dir[id]==DIR_UP){ j=PAD_A; } + else if(player_move_test(id,1)>0){ j=dirs[1]; } + }}else if((py2-py<=3)&&(py2-py>0)){ + if(player_dir[id]==DIR_DOWN){ j=PAD_A; } + else if(player_move_test(id,3)>0){ j=dirs[3]; } + }}else if(py==py2){ + if(px>px2){ + if(px-px2<=3){ + if(player_dir[id]==DIR_LEFT){ j=PAD_A; } + else if((player_move_test(id,0)>0)){ j=dirs[0]; } + }}else if((px2-px<=3)&&(px2-px>0)){ + if(player_dir[id]==DIR_RIGHT){ j=PAD_A; } + else if(player_move_test(id,2)>0){ j=dirs[2]; } + }} + } + + return j; +} + /** * Main gameplay loop. @@ -1059,14 +1228,13 @@ void game_loop(void) { switch (player_dir[i]) { case DIR_NONE: + case DIR_UP: spr_dir = SPR_UP; break; case DIR_DOWN: spr_dir = SPR_DOWN; break; case DIR_LEFT: spr_dir = SPR_LEFT; break; case DIR_RIGHT: spr_dir = SPR_RIGHT; break; - case DIR_UP: spr_dir = SPR_UP; break; } - oam_meta_spr( - px, py, spr, SprPlayers[i][player_wpn[i]][spr_dir][anim_frame], - ); + if(player_mode[i]==MODE_SQUID) oam_meta_spr(px, py, spr, SprPlayers[i][0][spr_dir][anim_frame]); + else oam_meta_spr(px, py, spr, SprPlayers[i][player_wpn[i]][spr_dir][anim_frame]); spr-=16; } @@ -1115,7 +1283,7 @@ void game_loop(void) { --wait; if (!wait) { - music_play(MUSIC_GAME); + music_play_gated(MUSIC_GAME,8); } } @@ -1135,13 +1303,16 @@ void game_loop(void) { sfx_play(SFX_RESPAWN1,0); } --player_wait[i]; - continue; - } + //continue; + }else{ if (wait) continue; /* Avoid processing input during initial spawn. */ /* This player is moving, so animate their movement. */ if (player_cnt[i]) { + if(player_mode[i]==MODE_SQUID) player_speed[i]=3<> (TILE_SIZE_BIT+FP_BITS)) == (projectile_x[j] >> (TILE_SIZE_BIT+FP_BITS)) && - (player_y[i] >> (TILE_SIZE_BIT+FP_BITS)) == (projectile_y[j] >> (TILE_SIZE_BIT+FP_BITS))) { + (player_x[i]&0xff00) == (projectile_x[j]&0xff00) && + (player_y[i]&0xff00) == (projectile_y[j]&0xff00)) { /* Player j kills player i using a projectile */ - player_die(i); + if(player_mode[i]==MODE_NORMAL) player_die(i); } if (projectile_dir[i] != DIR_NONE && - (player_x[j] >> (TILE_SIZE_BIT+FP_BITS)) == (projectile_x[i] >> (TILE_SIZE_BIT+FP_BITS)) && - (player_y[j] >> (TILE_SIZE_BIT+FP_BITS)) == (projectile_y[i] >> (TILE_SIZE_BIT+FP_BITS))) { + (player_x[j]&0xff00) == (projectile_x[i]&0xff00) && + (player_y[j]&0xff00) == (projectile_y[i]&0xff00)) { /* Player i kills player j using a projectile */ - player_die(j); + if(player_mode[j]==MODE_NORMAL) player_die(j); } } } diff --git a/metasprites.h b/metasprites.h index 2a79b62..1f8710e 100644 --- a/metasprites.h +++ b/metasprites.h @@ -4,6 +4,146 @@ * Player weapons are ordered ROLLER CHARGER (see WPN_ROLLER, etc in game.c) * Player directions need to be ordered DOWN RIGHT UP LEFT (see SPR_DOWN, etc in game.c) */ +const unsigned char SprPlayer1SquidUpFrame1[] = { + 0,-1,0x66,0, + 8,-1,0x67,0, + 0, 7,0x76,0, + 8, 7,0x77,0, + 128 +}; + +const unsigned char SprPlayer1SquidUpFrame2[] = { + 0,-1,0x66,0, + 8,-1,0x67,0, + 0, 7,0x77,0|OAM_FLIP_H, + 8, 7,0x76,0|OAM_FLIP_H, + 128 +}; + +const unsigned char SprPlayer1SquidRightFrame1[] = { + 0,-1,0x68,0, + 8,-1,0x69,0, + 0, 7,0x78,0, + 8, 7,0x79,0, + 128 +}; + +const unsigned char SprPlayer1SquidDownFrame1[] = { + 0,-1,0x76,0|OAM_FLIP_V, + 8,-1,0x77,0|OAM_FLIP_V, + 0, 7,0x66,0|OAM_FLIP_V, + 8, 7,0x67,0|OAM_FLIP_V, + 128 +}; + +const unsigned char SprPlayer1SquidLeftFrame1[] = { + 0,-1,0x69,0|OAM_FLIP_H, + 8,-1,0x68,0|OAM_FLIP_H, + 0, 7,0x79,0|OAM_FLIP_H, + 8, 7,0x78,0|OAM_FLIP_H, + 128 +}; + +const unsigned char SprPlayer1SquidRightFrame2[] = { + 0,-1,0x78,0|OAM_FLIP_V, + 8,-1,0x79,0|OAM_FLIP_V, + 0, 7,0x68,0|OAM_FLIP_V, + 8, 7,0x69,0|OAM_FLIP_V, + 128 +}; + +const unsigned char SprPlayer1SquidDownFrame2[] = { + 0,-1,0x77,0|OAM_FLIP_V|OAM_FLIP_H, + 8,-1,0x76,0|OAM_FLIP_V|OAM_FLIP_H, + 0, 7,0x67,0|OAM_FLIP_V|OAM_FLIP_H, + 8, 7,0x66,0|OAM_FLIP_V|OAM_FLIP_H, + 128 +}; + +const unsigned char SprPlayer1SquidLeftFrame2[] = { + 0,-1,0x79,0|OAM_FLIP_H|OAM_FLIP_V, + 8,-1,0x78,0|OAM_FLIP_H|OAM_FLIP_V, + 0, 7,0x69,0|OAM_FLIP_H|OAM_FLIP_V, + 8, 7,0x68,0|OAM_FLIP_H|OAM_FLIP_V, + 128 +}; + +const unsigned char* const SprPlayer1SquidDown[] = {SprPlayer1SquidDownFrame1, SprPlayer1SquidDownFrame2}; +const unsigned char* const SprPlayer1SquidRight[] = {SprPlayer1SquidRightFrame1, SprPlayer1SquidRightFrame2}; +const unsigned char* const SprPlayer1SquidUp[] = {SprPlayer1SquidUpFrame1, SprPlayer1SquidUpFrame2}; +const unsigned char* const SprPlayer1SquidLeft[] = {SprPlayer1SquidLeftFrame1, SprPlayer1SquidLeftFrame2}; +const unsigned char* const * const SprPlayer1Squid[] = {SprPlayer1SquidDown, SprPlayer1SquidRight, SprPlayer1SquidUp, SprPlayer1SquidLeft}; + +const unsigned char SprPlayer2SquidUpFrame2[] = { + 0,-1,0x66,1, + 8,-1,0x67,1, + 0, 7,0x76,1, + 8, 7,0x77,1, + 128 +}; + +const unsigned char SprPlayer2SquidUpFrame1[] = { + 0,-1,0x66,1, + 8,-1,0x67,1, + 0, 7,0x77,1|OAM_FLIP_H, + 8, 7,0x76,1|OAM_FLIP_H, + 128 +}; + +const unsigned char SprPlayer2SquidRightFrame2[] = { + 0,-1,0x68,1, + 8,-1,0x69,1, + 0, 7,0x78,1, + 8, 7,0x79,1, + 128 +}; + +const unsigned char SprPlayer2SquidDownFrame2[] = { + 0,-1,0x76,1|OAM_FLIP_V, + 8,-1,0x77,1|OAM_FLIP_V, + 0, 7,0x66,1|OAM_FLIP_V, + 8, 7,0x67,1|OAM_FLIP_V, + 128 +}; + +const unsigned char SprPlayer2SquidLeftFrame2[] = { + 0,-1,0x69,1|OAM_FLIP_H, + 8,-1,0x68,1|OAM_FLIP_H, + 0, 7,0x79,1|OAM_FLIP_H, + 8, 7,0x78,1|OAM_FLIP_H, + 128 +}; + +const unsigned char SprPlayer2SquidRightFrame1[] = { + 0,-1,0x78,1|OAM_FLIP_V, + 8,-1,0x79,1|OAM_FLIP_V, + 0, 7,0x68,1|OAM_FLIP_V, + 8, 7,0x69,1|OAM_FLIP_V, + 128 +}; + +const unsigned char SprPlayer2SquidDownFrame1[] = { + 0,-1,0x77,1|OAM_FLIP_V|OAM_FLIP_H, + 8,-1,0x76,1|OAM_FLIP_V|OAM_FLIP_H, + 0, 7,0x67,1|OAM_FLIP_V|OAM_FLIP_H, + 8, 7,0x66,1|OAM_FLIP_V|OAM_FLIP_H, + 128 +}; + +const unsigned char SprPlayer2SquidLeftFrame1[] = { + 0,-1,0x79,1|OAM_FLIP_H|OAM_FLIP_V, + 8,-1,0x78,1|OAM_FLIP_H|OAM_FLIP_V, + 0, 7,0x69,1|OAM_FLIP_H|OAM_FLIP_V, + 8, 7,0x68,1|OAM_FLIP_H|OAM_FLIP_V, + 128 +}; + +const unsigned char* const SprPlayer2SquidDown[] = {SprPlayer2SquidDownFrame1, SprPlayer2SquidDownFrame2}; +const unsigned char* const SprPlayer2SquidRight[] = {SprPlayer2SquidRightFrame1, SprPlayer2SquidRightFrame2}; +const unsigned char* const SprPlayer2SquidUp[] = {SprPlayer2SquidUpFrame1, SprPlayer2SquidUpFrame2}; +const unsigned char* const SprPlayer2SquidLeft[] = {SprPlayer2SquidLeftFrame1, SprPlayer2SquidLeftFrame2}; +const unsigned char* const * const SprPlayer2Squid[] = {SprPlayer2SquidDown, SprPlayer2SquidRight, SprPlayer2SquidUp, SprPlayer2SquidLeft}; + const unsigned char SprPlayer1RollerDownFrame1[] = { 0,-1,0x40,0, 8,-1,0x41,0, @@ -151,7 +291,7 @@ const unsigned char SprPlayer1ChargerLeftFrame2[] = { const unsigned char* const SprPlayer1ChargerLeft[] = {SprPlayer1ChargerLeftFrame1, SprPlayer1ChargerLeftFrame2}; const unsigned char* const * const SprPlayer1Charger[] = {SprPlayer1ChargerDown, SprPlayer1ChargerRight, SprPlayer1ChargerUp, SprPlayer1ChargerLeft}; -const unsigned char* const * const * const SprPlayer1[] = {SprPlayer1Roller, SprPlayer1Charger}; +const unsigned char* const * const * const SprPlayer1[] = {SprPlayer1Squid, SprPlayer1Roller, SprPlayer1Charger}; const unsigned char SprPlayer2RollerDownFrame1[] = { 0,-1,0x40,1, @@ -300,7 +440,7 @@ const unsigned char SprPlayer2ChargerLeftFrame2[] = { const unsigned char* const SprPlayer2ChargerLeft[] = {SprPlayer2ChargerLeftFrame1, SprPlayer2ChargerLeftFrame2}; const unsigned char* const * const SprPlayer2Charger[] = {SprPlayer2ChargerDown, SprPlayer2ChargerRight, SprPlayer2ChargerUp, SprPlayer2ChargerLeft}; -const unsigned char* const * const * const SprPlayer2[] = {SprPlayer2Roller, SprPlayer2Charger}; +const unsigned char* const * const * const SprPlayer2[] = {SprPlayer2Squid, SprPlayer2Roller, SprPlayer2Charger}; const unsigned char* const * const * const * const SprPlayers[] = {SprPlayer1, SprPlayer2}; diff --git a/music.s b/music.s index d301fbe..e8c8782 100644 --- a/music.s +++ b/music.s @@ -1,653 +1,653 @@ -;this file for FamiTone2 library generated by text2data tool - -music_music_data: - .byte 7 - .word @instruments - .word @samples-3 - .word @song0ch0,@song0ch1,@song0ch2,@song0ch3,@song0ch4,307,256 - .word @song1ch0,@song1ch1,@song1ch2,@song1ch3,@song1ch4,245,204 - .word @song2ch0,@song2ch1,@song2ch2,@song2ch3,@song2ch4,307,256 - .word @song3ch0,@song3ch1,@song3ch2,@song3ch3,@song3ch4,307,256 - .word @song4ch0,@song4ch1,@song4ch2,@song4ch3,@song4ch4,204,170 - .word @song5ch0,@song5ch1,@song5ch2,@song5ch3,@song5ch4,307,256 - .word @song6ch0,@song6ch1,@song6ch2,@song6ch3,@song6ch4,280,233 - -@instruments: - .byte $30 ;instrument $00 - .word @env1,@env0,@env0 - .byte $00 - .byte $30 ;instrument $01 - .word @env2,@env13,@env0 - .byte $00 - .byte $30 ;instrument $02 - .word @env3,@env14,@env0 - .byte $00 - .byte $30 ;instrument $03 - .word @env4,@env15,@env0 - .byte $00 - .byte $30 ;instrument $04 - .word @env5,@env16,@env0 - .byte $00 - .byte $70 ;instrument $05 - .word @env6,@env17,@env0 - .byte $00 - .byte $30 ;instrument $06 - .word @env7,@env18,@env24 - .byte $00 - .byte $30 ;instrument $07 - .word @env8,@env0,@env0 - .byte $00 - .byte $30 ;instrument $08 - .word @env9,@env0,@env0 - .byte $00 - .byte $30 ;instrument $09 - .word @env9,@env0,@env0 - .byte $00 - .byte $70 ;instrument $0a - .word @env9,@env0,@env0 - .byte $00 - .byte $b0 ;instrument $0b - .word @env9,@env0,@env0 - .byte $00 - .byte $b0 ;instrument $0c - .word @env9,@env0,@env0 - .byte $00 - .byte $30 ;instrument $0d - .word @env10,@env0,@env0 - .byte $00 - .byte $70 ;instrument $0e - .word @env10,@env0,@env0 - .byte $00 - .byte $70 ;instrument $0f - .word @env11,@env0,@env0 - .byte $00 - .byte $30 ;instrument $10 - .word @env1,@env19,@env25 - .byte $00 - .byte $30 ;instrument $11 - .word @env1,@env20,@env0 - .byte $00 - .byte $b0 ;instrument $12 - .word @env9,@env21,@env0 - .byte $00 - .byte $30 ;instrument $14 - .word @env12,@env22,@env0 - .byte $00 - .byte $70 ;instrument $15 - .word @env5,@env23,@env0 - .byte $00 - .byte $b0 ;instrument $16 - .word @env5,@env23,@env0 - .byte $00 - .byte $70 ;instrument $17 - .word @env5,@env23,@env0 - .byte $00 - -@samples: -@env0: - .byte $c0,$00,$00 -@env1: - .byte $cf,$00,$00 -@env2: - .byte $c7,$c1,$c2,$c3,$c4,$c5,$c6,$c6,$c5,$02,$c4,$02,$c3,$02,$c2,$02 - .byte $c1,$02,$c0,$00,$12 -@env3: - .byte $c7,$c4,$c2,$c1,$c1,$c0,$00,$05 -@env4: - .byte $c9,$c6,$c5,$c4,$c3,$c3,$c2,$02,$c1,$03,$c0,$00,$0a -@env5: - .byte $c6,$c5,$c5,$c4,$c4,$c3,$c4,$c6,$c5,$c4,$c3,$c3,$c2,$00,$0c -@env6: - .byte $cb,$cb,$c8,$c7,$c5,$c5,$c1,$04,$c0,$00,$08 -@env7: - .byte $cf,$06,$c0,$00,$02 -@env8: - .byte $cf,$c0,$00,$01 -@env9: - .byte $c4,$c7,$02,$c6,$c5,$00,$04 -@env10: - .byte $c8,$c6,$02,$c5,$00,$03 -@env11: - .byte $c4,$00,$00 -@env12: - .byte $c7,$c7,$ca,$02,$c9,$c7,$c6,$c4,$c2,$00,$08 -@env13: - .byte $c0,$c4,$00,$01 -@env14: - .byte $c0,$c2,$c4,$00,$02 -@env15: - .byte $c0,$c7,$c9,$cb,$00,$03 -@env16: - .byte $c0,$c2,$05,$c0,$c2,$c4,$00,$05 -@env17: - .byte $c0,$c4,$bc,$00,$02 -@env18: - .byte $ea,$e3,$dd,$da,$d6,$d4,$d1,$00,$06 -@env19: - .byte $c0,$bf,$be,$00,$02 -@env20: - .byte $c0,$c1,$c1,$c2,$c2,$c3,$c3,$c4,$c4,$c5,$c5,$c6,$c6,$c7,$c7,$c8 - .byte $c8,$c9,$c9,$ca,$ca,$cb,$cb,$cc,$cc,$00,$18 -@env21: - .byte $c0,$c0,$c7,$c7,$c0,$c0,$c7,$c7,$c0,$c0,$00,$09 -@env22: - .byte $c0,$c3,$c8,$00,$00 -@env23: - .byte $c0,$c0,$cc,$cc,$00,$00 -@env24: - .byte $ac,$00,$00 -@env25: - .byte $c0,$c0,$c1,$c2,$c4,$c7,$cc,$d1,$00,$07 - - -@song0ch0: - .byte $fb,$04 -@song0ch0loop: -@ref0: - .byte $a0,$4a,$83,$00,$4a,$83,$00,$ef - .byte $fd - .word @song0ch0loop - -@song0ch1: -@song0ch1loop: -@ref1: - .byte $f9,$85 - .byte $fd - .word @song0ch1loop - -@song0ch2: -@song0ch2loop: -@ref2: - .byte $f9,$85 - .byte $fd - .word @song0ch2loop - -@song0ch3: -@song0ch3loop: -@ref3: - .byte $f9,$85 - .byte $fd - .word @song0ch3loop - -@song0ch4: -@song0ch4loop: -@ref4: - .byte $f9,$85 - .byte $fd - .word @song0ch4loop - - -@song1ch0: - .byte $fb,$04 -@song1ch0loop: -@ref5: - .byte $9c,$2d,$33,$37,$2c,$8b,$00,$9a,$28,$85,$28,$85,$34,$8f,$00,$9c - .byte $2d,$33,$37,$2c,$8b,$00,$9a,$28,$85,$28,$85,$22,$91 - .byte $ff,$19 - .word @ref5 - .byte $ff,$19 - .word @ref5 - .byte $ff,$19 - .word @ref5 -@ref9: - .byte $90,$49,$96,$4f,$53,$98,$48,$8b,$00,$90,$44,$85,$98,$44,$85,$92 - .byte $50,$8f,$00,$90,$49,$4f,$94,$53,$90,$48,$8b,$00,$44,$85,$98,$44 - .byte $85,$92,$3e,$87,$00,$87 - .byte $ff,$1b - .word @ref9 - .byte $fd - .word @song1ch0loop - -@song1ch1: -@song1ch1loop: -@ref11: - .byte $81,$9a,$2d,$33,$37,$2c,$89,$00,$9c,$1e,$85,$1e,$85,$12,$8f,$01 - .byte $9a,$2d,$33,$37,$2c,$89,$00,$9c,$1e,$85,$1e,$85,$18,$91 - .byte $ff,$1a - .word @ref11 -@ref13: - .byte $9e,$61,$5d,$59,$52,$a7,$00,$4f,$53,$61,$5d,$59,$52,$87,$00,$4d - .byte $52,$93,$00,$a2,$60,$89 -@ref14: - .byte $9e,$79,$75,$71,$6a,$a5,$01,$67,$6b,$79,$75,$71,$6a,$89,$65,$6a - .byte $9f,$00 -@ref15: - .byte $90,$31,$96,$37,$3b,$98,$30,$8b,$00,$90,$2c,$85,$98,$2c,$85,$92 - .byte $38,$8f,$00,$90,$31,$37,$94,$3b,$90,$30,$8b,$00,$2c,$85,$98,$2c - .byte $85,$92,$26,$87,$00,$87 - .byte $ff,$1b - .word @ref15 - .byte $fd - .word @song1ch1loop - -@song1ch2: -@song1ch2loop: -@ref17: - .byte $00,$99,$80,$11,$01,$11,$01,$1c,$8f,$00,$9b,$11,$01,$11,$01,$0a - .byte $8b,$00,$83 -@ref18: - .byte $00,$99,$11,$01,$11,$01,$1c,$8f,$00,$9b,$11,$01,$11,$01,$0a,$8b - .byte $00,$83 -@ref19: - .byte $61,$5d,$59,$52,$a7,$00,$4f,$53,$61,$5d,$59,$52,$87,$00,$4d,$52 - .byte $93,$00,$a2,$52,$89 -@ref20: - .byte $80,$79,$75,$71,$6a,$a5,$01,$67,$6b,$9e,$79,$80,$75,$71,$6a,$89 - .byte $65,$6a,$9f,$00 -@ref21: - .byte $9e,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18 - .byte $00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14 - .byte $00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18 - .byte $00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14 - .byte $81 -@ref22: - .byte $18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00 - .byte $14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00 - .byte $18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00 - .byte $14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$81 - .byte $fd - .word @song1ch2loop - -@song1ch3: -@song1ch3loop: -@ref23: - .byte $82,$17,$84,$17,$8a,$0d,$84,$17,$82,$17,$84,$17,$8a,$0d,$84,$17 - .byte $82,$17,$84,$17,$8a,$0d,$84,$17,$82,$17,$84,$17,$8a,$0d,$84,$17 - .byte $82,$17,$84,$17,$8a,$0d,$84,$17,$82,$17,$84,$17,$8a,$0d,$84,$17 - .byte $82,$17,$84,$17,$8a,$0d,$84,$17,$82,$17,$84,$17,$8a,$0d,$8c,$16 - .byte $81 - .byte $ff,$21 - .word @ref23 - .byte $ff,$21 - .word @ref23 - .byte $ff,$21 - .word @ref23 - .byte $ff,$21 - .word @ref23 - .byte $ff,$21 - .word @ref23 - .byte $fd - .word @song1ch3loop - -@song1ch4: -@song1ch4loop: -@ref29: - .byte $f9,$85 -@ref30: - .byte $f9,$85 -@ref31: - .byte $f9,$85 -@ref32: - .byte $f9,$85 -@ref33: - .byte $f9,$85 -@ref34: - .byte $f9,$85 - .byte $fd - .word @song1ch4loop - - -@song2ch0: - .byte $fb,$06 -@song2ch0loop: -@ref35: - .byte $00,$f9,$83 - .byte $fd - .word @song2ch0loop - -@song2ch1: -@song2ch1loop: -@ref36: - .byte $00,$f9,$83 - .byte $fd - .word @song2ch1loop - -@song2ch2: -@song2ch2loop: -@ref37: - .byte $00,$f9,$83 - .byte $fd - .word @song2ch2loop - -@song2ch3: -@song2ch3loop: -@ref38: - .byte $00,$f9,$83 - .byte $fd - .word @song2ch3loop - -@song2ch4: -@song2ch4loop: -@ref39: - .byte $00,$f9,$83 - .byte $fd - .word @song2ch4loop - - -@song3ch0: - .byte $fb,$06 -@song3ch0loop: -@ref40: - .byte $00,$f9,$83 - .byte $fd - .word @song3ch0loop - -@song3ch1: -@song3ch1loop: -@ref41: - .byte $00,$f9,$83 - .byte $fd - .word @song3ch1loop - -@song3ch2: -@song3ch2loop: -@ref42: - .byte $00,$f9,$83 - .byte $fd - .word @song3ch2loop - -@song3ch3: -@song3ch3loop: -@ref43: - .byte $00,$f9,$83 - .byte $fd - .word @song3ch3loop - -@song3ch4: -@song3ch4loop: -@ref44: - .byte $00,$f9,$83 - .byte $fd - .word @song3ch4loop - - -@song4ch0: - .byte $fb,$04 -@song4ch0loop: -@ref45: - .byte $94,$4a,$85,$01,$8e,$45,$94,$45,$92,$47,$01,$90,$41,$00,$9d -@ref46: - .byte $98,$4a,$85,$01,$8e,$45,$94,$45,$47,$01,$92,$41,$00,$89,$94,$3d - .byte $92,$3d,$94,$41,$41,$00,$81 -@ref47: - .byte $4e,$85,$01,$8e,$49,$94,$49,$92,$4b,$01,$90,$45,$00,$9d -@ref48: - .byte $98,$4e,$85,$01,$8e,$49,$94,$49,$4b,$01,$92,$45,$00,$91,$94,$51 - .byte $4f,$4c,$81 - .byte $fd - .word @song4ch0loop - -@song4ch1: -@song4ch1loop: -@ref49: - .byte $96,$1a,$85,$01,$8e,$15,$96,$15,$17,$01,$11,$00,$9d -@ref50: - .byte $1a,$85,$01,$8e,$15,$96,$15,$17,$01,$11,$00,$89,$0d,$98,$0d,$96 - .byte $11,$11,$00,$81 -@ref51: - .byte $1e,$85,$01,$8e,$19,$96,$19,$1b,$01,$15,$00,$9d -@ref52: - .byte $1e,$85,$01,$8e,$19,$96,$19,$1b,$01,$15,$00,$91,$94,$39,$37,$34 - .byte $81 - .byte $fd - .word @song4ch1loop - -@song4ch2: -@song4ch2loop: -@ref53: - .byte $8c,$02,$85,$01,$8e,$2d,$8c,$03,$80,$2f,$01,$29,$8c,$02,$8d,$02 - .byte $8d -@ref54: - .byte $02,$85,$01,$8e,$2d,$8c,$03,$80,$2f,$01,$29,$8c,$02,$89,$80,$25 - .byte $8c,$03,$80,$29,$29,$00,$81 -@ref55: - .byte $8c,$02,$85,$01,$8e,$31,$8c,$03,$80,$33,$01,$2d,$8c,$02,$8d,$02 - .byte $8d -@ref56: - .byte $02,$85,$01,$8e,$31,$8c,$03,$80,$33,$01,$2d,$8c,$02,$8d,$03,$94 - .byte $39,$37,$34,$81 - .byte $fd - .word @song4ch2loop - -@song4ch3: -@song4ch3loop: -@ref57: - .byte $8e,$0c,$85,$8a,$15,$84,$17,$8e,$0d,$84,$17,$8a,$15,$84,$17,$8e - .byte $0c,$85,$8a,$15,$84,$17,$8e,$0d,$86,$19,$8a,$15,$84,$16,$81 - .byte $ff,$11 - .word @ref57 - .byte $ff,$11 - .word @ref57 - .byte $ff,$11 - .word @ref57 - .byte $fd - .word @song4ch3loop - -@song4ch4: -@song4ch4loop: -@ref61: - .byte $bf -@ref62: - .byte $bf -@ref63: - .byte $bf -@ref64: - .byte $bf - .byte $fd - .word @song4ch4loop - - -@song5ch0: - .byte $fb,$06 -@song5ch0loop: -@ref65: - .byte $96,$38,$85,$01,$92,$35,$90,$38,$85,$01,$94,$34,$81 -@ref66: - .byte $90,$38,$85,$01,$92,$35,$90,$39,$a4,$39,$94,$2f,$96,$34,$81 -@ref67: - .byte $90,$38,$85,$01,$92,$35,$96,$38,$85,$01,$92,$34,$81 -@ref68: - .byte $94,$39,$96,$3f,$43,$47,$38,$85,$01,$34,$81 -@ref69: - .byte $38,$85,$01,$35,$38,$85,$01,$34,$81 -@ref70: - .byte $38,$85,$01,$35,$39,$a4,$39,$96,$2f,$34,$81 -@ref71: - .byte $39,$01,$39,$35,$2f,$01,$2f,$34,$81 -@ref72: - .byte $39,$3f,$43,$47,$4d,$47,$43,$3e,$81 -@ref73: - .byte $92,$50,$4c,$46,$42,$46,$42,$3e,$38,$3e,$38,$34,$2e,$34,$2e,$2a - .byte $26 -@ref74: - .byte $50,$4c,$46,$42,$46,$42,$3e,$38,$3e,$38,$34,$2e,$34,$2e,$2a,$26 - .byte $ff,$10 - .word @ref74 - .byte $ff,$10 - .word @ref74 - .byte $fd - .word @song5ch0loop - -@song5ch1: -@song5ch1loop: -@ref77: - .byte $9e,$26,$8d,$2a,$8d -@ref78: - .byte $20,$9d -@ref79: - .byte $26,$8d,$2a,$8d -@ref80: - .byte $20,$8d,$1a,$8d -@ref81: - .byte $26,$8d,$2a,$8d -@ref82: - .byte $20,$9d -@ref83: - .byte $1a,$9d -@ref84: - .byte $18,$8d,$1c,$8d -@ref85: - .byte $9a,$20,$83,$26,$83,$2b,$2e,$83,$34,$83,$38,$81 -@ref86: - .byte $20,$83,$26,$83,$2b,$2e,$83,$34,$83,$38,$81 - .byte $ff,$0b - .word @ref86 -@ref88: - .byte $21,$21,$27,$2b,$2f,$2e,$34,$83,$38,$81 - .byte $fd - .word @song5ch1loop - -@song5ch2: -@song5ch2loop: -@ref89: - .byte $8c,$02,$9d -@ref90: - .byte $9b,$02,$81 -@ref91: - .byte $02,$9d -@ref92: - .byte $97,$02,$02,$02,$02 -@ref93: - .byte $02,$9d -@ref94: - .byte $9b,$02,$81 -@ref95: - .byte $02,$9d - .byte $ff,$05 - .word @ref92 -@ref97: - .byte $02,$85,$02,$85,$02,$85,$02,$85 - .byte $ff,$08 - .word @ref97 - .byte $ff,$08 - .word @ref97 - .byte $ff,$08 - .word @ref97 - .byte $fd - .word @song5ch2loop - -@song5ch3: -@song5ch3loop: -@ref101: - .byte $9f -@ref102: - .byte $9f -@ref103: - .byte $9f -@ref104: - .byte $9f -@ref105: - .byte $9f -@ref106: - .byte $9f -@ref107: - .byte $9f -@ref108: - .byte $9f -@ref109: - .byte $83,$86,$1e,$85,$1e,$85,$1e,$85,$1e,$81 -@ref110: - .byte $83,$1e,$85,$1e,$85,$1e,$85,$1e,$81 - .byte $ff,$09 - .word @ref110 - .byte $ff,$09 - .word @ref110 - .byte $fd - .word @song5ch3loop - -@song5ch4: -@song5ch4loop: -@ref113: - .byte $9f -@ref114: - .byte $9f -@ref115: - .byte $9f -@ref116: - .byte $9f -@ref117: - .byte $9f -@ref118: - .byte $9f -@ref119: - .byte $9f -@ref120: - .byte $9f -@ref121: - .byte $9f -@ref122: - .byte $9f -@ref123: - .byte $9f -@ref124: - .byte $9f - .byte $fd - .word @song5ch4loop - - -@song6ch0: - .byte $fb,$03 -@ref125: - .byte $af -@song6ch0loop: -@ref126: - .byte $8f,$a6,$32,$8b,$a8,$42,$83,$aa,$42,$8d,$a8,$3e,$87,$aa,$3e,$83 - .byte $a8,$3e,$89,$a6,$32,$bd,$2e,$91,$a8,$34,$87,$34,$83,$34,$87,$aa - .byte $34,$83,$a8,$3e,$89,$a6,$2e,$ad -@ref127: - .byte $8f,$32,$8b,$a8,$42,$83,$aa,$42,$8d,$a8,$3e,$87,$aa,$3e,$83,$a8 - .byte $3e,$89,$a6,$32,$bd,$2e,$91,$aa,$3e,$87,$3e,$83,$ac,$3e,$87,$a8 - .byte $42,$83,$46,$89,$a6,$2e,$ab - .byte $fd - .word @song6ch0loop - -@song6ch1: -@ref128: - .byte $af -@song6ch1loop: -@ref129: - .byte $8f,$a6,$32,$87,$a8,$42,$83,$aa,$42,$8d,$a8,$3e,$87,$aa,$3e,$83 - .byte $a8,$3e,$8d,$aa,$38,$ad,$00,$8d,$a6,$2e,$8d,$a8,$34,$87,$34,$83 - .byte $34,$87,$aa,$34,$83,$a8,$3e,$8d,$38,$ad -@ref130: - .byte $00,$8d,$a6,$32,$87,$a8,$42,$83,$42,$8d,$aa,$3e,$87,$a8,$3e,$83 - .byte $3e,$8d,$ac,$46,$ad,$00,$8d,$a6,$2e,$8d,$aa,$3e,$87,$3e,$83,$ac - .byte $3e,$87,$a8,$42,$83,$46,$8d,$aa,$42,$9d,$00,$8b - .byte $fd - .word @song6ch1loop - -@song6ch2: -@ref131: - .byte $97,$8c,$02,$85,$02,$85,$02,$85 -@song6ch2loop: -@ref132: - .byte $9f,$8c,$02,$bd,$02,$bd,$02,$bd,$02,$9d -@ref133: - .byte $9f,$02,$bd,$02,$bd,$02,$bd,$02,$9b - .byte $fd - .word @song6ch2loop - -@song6ch3: -@ref134: - .byte $8a,$18,$84,$14,$88,$18,$84,$14,$8a,$18,$84,$14,$88,$18,$84,$14 - .byte $8a,$18,$9d -@song6ch3loop: -@ref135: - .byte $82,$14,$8d,$84,$14,$9d,$14,$9d,$14,$9d,$14,$9d,$14,$9d,$14,$9d - .byte $14,$9d,$14,$87,$8a,$16,$16,$81 -@ref136: - .byte $16,$8d,$84,$14,$9d,$14,$9d,$14,$9d,$14,$9d,$14,$9d,$14,$10,$86 - .byte $15,$88,$11,$82,$14,$91,$84,$14,$9d,$14,$85,$8a,$16,$16,$81 - .byte $fd - .word @song6ch3loop - -@song6ch4: -@ref137: - .byte $af -@song6ch4loop: -@ref138: - .byte $f9,$f9,$8b -@ref139: - .byte $f9,$f9,$89 - .byte $fd - .word @song6ch4loop +;this file for FamiTone2 library generated by text2data tool + +music_music_data: + .byte 7 + .word @instruments + .word @samples-3 + .word @song0ch0,@song0ch1,@song0ch2,@song0ch3,@song0ch4,307,256 + .word @song1ch0,@song1ch1,@song1ch2,@song1ch3,@song1ch4,245,204 + .word @song2ch0,@song2ch1,@song2ch2,@song2ch3,@song2ch4,307,256 + .word @song3ch0,@song3ch1,@song3ch2,@song3ch3,@song3ch4,307,256 + .word @song4ch0,@song4ch1,@song4ch2,@song4ch3,@song4ch4,204,170 + .word @song5ch0,@song5ch1,@song5ch2,@song5ch3,@song5ch4,307,256 + .word @song6ch0,@song6ch1,@song6ch2,@song6ch3,@song6ch4,280,233 + +@instruments: + .byte $f0 ;instrument $00 + .word @env1,@env0,@env0 + .byte $00 + .byte $f0 ;instrument $01 + .word @env2,@env13,@env0 + .byte $00 + .byte $f0 ;instrument $02 + .word @env3,@env14,@env0 + .byte $00 + .byte $f0 ;instrument $03 + .word @env4,@env15,@env0 + .byte $00 + .byte $30 ;instrument $04 + .word @env5,@env16,@env0 + .byte $00 + .byte $70 ;instrument $05 + .word @env6,@env17,@env0 + .byte $00 + .byte $f0 ;instrument $06 + .word @env7,@env18,@env24 + .byte $00 + .byte $f0 ;instrument $07 + .word @env8,@env0,@env0 + .byte $00 + .byte $30 ;instrument $08 + .word @env9,@env0,@env0 + .byte $00 + .byte $30 ;instrument $09 + .word @env9,@env0,@env0 + .byte $00 + .byte $70 ;instrument $0a + .word @env9,@env0,@env0 + .byte $00 + .byte $b0 ;instrument $0b + .word @env9,@env0,@env0 + .byte $00 + .byte $b0 ;instrument $0c + .word @env9,@env0,@env0 + .byte $00 + .byte $30 ;instrument $0d + .word @env10,@env0,@env0 + .byte $00 + .byte $70 ;instrument $0e + .word @env10,@env0,@env0 + .byte $00 + .byte $70 ;instrument $0f + .word @env11,@env0,@env0 + .byte $00 + .byte $f0 ;instrument $10 + .word @env1,@env19,@env25 + .byte $00 + .byte $f0 ;instrument $11 + .word @env1,@env20,@env0 + .byte $00 + .byte $b0 ;instrument $12 + .word @env9,@env21,@env0 + .byte $00 + .byte $30 ;instrument $14 + .word @env12,@env22,@env0 + .byte $00 + .byte $70 ;instrument $15 + .word @env5,@env23,@env0 + .byte $00 + .byte $b0 ;instrument $16 + .word @env5,@env23,@env0 + .byte $00 + .byte $70 ;instrument $17 + .word @env5,@env23,@env0 + .byte $00 + +@samples: +@env0: + .byte $c0,$00,$00 +@env1: + .byte $cf,$00,$00 +@env2: + .byte $c7,$c1,$c2,$c3,$c4,$c5,$c6,$c6,$c5,$02,$c4,$02,$c3,$02,$c2,$02 + .byte $c1,$02,$c0,$00,$12 +@env3: + .byte $c7,$c4,$c2,$c1,$c1,$c0,$00,$05 +@env4: + .byte $c9,$c6,$c5,$c4,$c3,$c3,$c2,$02,$c1,$03,$c0,$00,$0a +@env5: + .byte $c6,$c5,$c5,$c4,$c4,$c3,$c4,$c6,$c5,$c4,$c3,$c3,$c2,$00,$0c +@env6: + .byte $cb,$cb,$c8,$c7,$c5,$c5,$c1,$04,$c0,$00,$08 +@env7: + .byte $cf,$06,$c0,$00,$02 +@env8: + .byte $cf,$c0,$00,$01 +@env9: + .byte $c4,$c7,$02,$c6,$c5,$00,$04 +@env10: + .byte $c8,$c6,$02,$c5,$00,$03 +@env11: + .byte $c4,$00,$00 +@env12: + .byte $c7,$c7,$ca,$02,$c9,$c7,$c6,$c4,$c2,$00,$08 +@env13: + .byte $c0,$c4,$00,$01 +@env14: + .byte $c0,$c2,$c4,$00,$02 +@env15: + .byte $c0,$c7,$c9,$cb,$00,$03 +@env16: + .byte $c0,$c2,$05,$c0,$c2,$c4,$00,$05 +@env17: + .byte $c0,$c4,$bc,$00,$02 +@env18: + .byte $ea,$e3,$dd,$da,$d6,$d4,$d1,$00,$06 +@env19: + .byte $c0,$bf,$be,$00,$02 +@env20: + .byte $c0,$c1,$c1,$c2,$c2,$c3,$c3,$c4,$c4,$c5,$c5,$c6,$c6,$c7,$c7,$c8 + .byte $c8,$c9,$c9,$ca,$ca,$cb,$cb,$cc,$cc,$00,$18 +@env21: + .byte $c0,$c0,$c7,$c7,$c0,$c0,$c7,$c7,$c0,$c0,$00,$09 +@env22: + .byte $c0,$c3,$c8,$00,$00 +@env23: + .byte $c0,$c0,$cc,$cc,$00,$00 +@env24: + .byte $ac,$00,$00 +@env25: + .byte $c0,$c0,$c1,$c2,$c4,$c7,$cc,$d1,$00,$07 + + +@song0ch0: + .byte $fb,$04 +@song0ch0loop: +@ref0: + .byte $a0,$4a,$83,$00,$4a,$83,$00,$ef + .byte $fd + .word @song0ch0loop + +@song0ch1: +@song0ch1loop: +@ref1: + .byte $f9,$85 + .byte $fd + .word @song0ch1loop + +@song0ch2: +@song0ch2loop: +@ref2: + .byte $f9,$85 + .byte $fd + .word @song0ch2loop + +@song0ch3: +@song0ch3loop: +@ref3: + .byte $f9,$85 + .byte $fd + .word @song0ch3loop + +@song0ch4: +@song0ch4loop: +@ref4: + .byte $f9,$85 + .byte $fd + .word @song0ch4loop + + +@song1ch0: + .byte $fb,$04 +@song1ch0loop: +@ref5: + .byte $9c,$2d,$33,$37,$2c,$8b,$00,$9a,$28,$85,$28,$85,$34,$8f,$00,$9c + .byte $2d,$33,$37,$2c,$8b,$00,$9a,$28,$85,$28,$85,$22,$91 + .byte $ff,$19 + .word @ref5 + .byte $ff,$19 + .word @ref5 + .byte $ff,$19 + .word @ref5 +@ref9: + .byte $90,$49,$96,$4f,$53,$98,$48,$8b,$00,$90,$44,$85,$98,$44,$85,$92 + .byte $50,$8f,$00,$90,$49,$4f,$94,$53,$90,$48,$8b,$00,$44,$85,$98,$44 + .byte $85,$92,$3e,$87,$00,$87 + .byte $ff,$1b + .word @ref9 + .byte $fd + .word @song1ch0loop + +@song1ch1: +@song1ch1loop: +@ref11: + .byte $81,$9a,$2d,$33,$37,$2c,$89,$00,$9c,$1e,$85,$1e,$85,$12,$8f,$01 + .byte $9a,$2d,$33,$37,$2c,$89,$00,$9c,$1e,$85,$1e,$85,$18,$91 + .byte $ff,$1a + .word @ref11 +@ref13: + .byte $9e,$61,$5d,$59,$52,$a7,$00,$4f,$53,$61,$5d,$59,$52,$87,$00,$4d + .byte $52,$93,$00,$a2,$60,$89 +@ref14: + .byte $9e,$79,$75,$71,$6a,$a5,$01,$67,$6b,$79,$75,$71,$6a,$89,$65,$6a + .byte $9f,$00 +@ref15: + .byte $90,$31,$96,$37,$3b,$98,$30,$8b,$00,$90,$2c,$85,$98,$2c,$85,$92 + .byte $38,$8f,$00,$90,$31,$37,$94,$3b,$90,$30,$8b,$00,$2c,$85,$98,$2c + .byte $85,$92,$26,$87,$00,$87 + .byte $ff,$1b + .word @ref15 + .byte $fd + .word @song1ch1loop + +@song1ch2: +@song1ch2loop: +@ref17: + .byte $00,$99,$80,$11,$01,$11,$01,$1c,$8f,$00,$9b,$11,$01,$11,$01,$0a + .byte $8b,$00,$83 +@ref18: + .byte $00,$99,$11,$01,$11,$01,$1c,$8f,$00,$9b,$11,$01,$11,$01,$0a,$8b + .byte $00,$83 +@ref19: + .byte $61,$5d,$59,$52,$a7,$00,$4f,$53,$61,$5d,$59,$52,$87,$00,$4d,$52 + .byte $93,$00,$a2,$52,$89 +@ref20: + .byte $80,$79,$75,$71,$6a,$a5,$01,$67,$6b,$9e,$79,$80,$75,$71,$6a,$89 + .byte $65,$6a,$9f,$00 +@ref21: + .byte $9e,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18 + .byte $00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14 + .byte $00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18 + .byte $00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14 + .byte $81 +@ref22: + .byte $18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00 + .byte $14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00 + .byte $18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00,$18,$00 + .byte $14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$00,$14,$81 + .byte $fd + .word @song1ch2loop + +@song1ch3: +@song1ch3loop: +@ref23: + .byte $82,$17,$84,$17,$8a,$0d,$84,$17,$82,$17,$84,$17,$8a,$0d,$84,$17 + .byte $82,$17,$84,$17,$8a,$0d,$84,$17,$82,$17,$84,$17,$8a,$0d,$84,$17 + .byte $82,$17,$84,$17,$8a,$0d,$84,$17,$82,$17,$84,$17,$8a,$0d,$84,$17 + .byte $82,$17,$84,$17,$8a,$0d,$84,$17,$82,$17,$84,$17,$8a,$0d,$8c,$16 + .byte $81 + .byte $ff,$21 + .word @ref23 + .byte $ff,$21 + .word @ref23 + .byte $ff,$21 + .word @ref23 + .byte $ff,$21 + .word @ref23 + .byte $ff,$21 + .word @ref23 + .byte $fd + .word @song1ch3loop + +@song1ch4: +@song1ch4loop: +@ref29: + .byte $f9,$85 +@ref30: + .byte $f9,$85 +@ref31: + .byte $f9,$85 +@ref32: + .byte $f9,$85 +@ref33: + .byte $f9,$85 +@ref34: + .byte $f9,$85 + .byte $fd + .word @song1ch4loop + + +@song2ch0: + .byte $fb,$06 +@song2ch0loop: +@ref35: + .byte $00,$f9,$83 + .byte $fd + .word @song2ch0loop + +@song2ch1: +@song2ch1loop: +@ref36: + .byte $00,$f9,$83 + .byte $fd + .word @song2ch1loop + +@song2ch2: +@song2ch2loop: +@ref37: + .byte $00,$f9,$83 + .byte $fd + .word @song2ch2loop + +@song2ch3: +@song2ch3loop: +@ref38: + .byte $00,$f9,$83 + .byte $fd + .word @song2ch3loop + +@song2ch4: +@song2ch4loop: +@ref39: + .byte $00,$f9,$83 + .byte $fd + .word @song2ch4loop + + +@song3ch0: + .byte $fb,$06 +@song3ch0loop: +@ref40: + .byte $f9,$85 + .byte $fd + .word @song3ch0loop + +@song3ch1: +@song3ch1loop: +@ref41: + .byte $f9,$85 + .byte $fd + .word @song3ch1loop + +@song3ch2: +@song3ch2loop: +@ref42: + .byte $f9,$85 + .byte $fd + .word @song3ch2loop + +@song3ch3: +@song3ch3loop: +@ref43: + .byte $f9,$85 + .byte $fd + .word @song3ch3loop + +@song3ch4: +@song3ch4loop: +@ref44: + .byte $f9,$85 + .byte $fd + .word @song3ch4loop + + +@song4ch0: + .byte $fb,$04 +@song4ch0loop: +@ref45: + .byte $94,$4a,$85,$01,$8e,$45,$94,$45,$92,$47,$01,$90,$41,$00,$9d +@ref46: + .byte $98,$4a,$85,$01,$8e,$45,$94,$45,$47,$01,$92,$41,$00,$89,$94,$3d + .byte $92,$3d,$94,$41,$41,$00,$81 +@ref47: + .byte $4e,$85,$01,$8e,$49,$94,$49,$92,$4b,$01,$90,$45,$00,$9d +@ref48: + .byte $98,$4e,$85,$01,$8e,$49,$94,$49,$4b,$01,$92,$45,$00,$91,$94,$51 + .byte $4f,$4c,$81 + .byte $fd + .word @song4ch0loop + +@song4ch1: +@song4ch1loop: +@ref49: + .byte $96,$1a,$85,$01,$8e,$15,$96,$15,$17,$01,$11,$00,$9d +@ref50: + .byte $1a,$85,$01,$8e,$15,$96,$15,$17,$01,$11,$00,$89,$0d,$98,$0d,$96 + .byte $11,$11,$00,$81 +@ref51: + .byte $1e,$85,$01,$8e,$19,$96,$19,$1b,$01,$15,$00,$9d +@ref52: + .byte $1e,$85,$01,$8e,$19,$96,$19,$1b,$01,$15,$00,$91,$94,$39,$37,$34 + .byte $81 + .byte $fd + .word @song4ch1loop + +@song4ch2: +@song4ch2loop: +@ref53: + .byte $8c,$02,$85,$01,$8e,$2d,$8c,$03,$80,$2f,$01,$29,$8c,$02,$8d,$02 + .byte $8d +@ref54: + .byte $02,$85,$01,$8e,$2d,$8c,$03,$80,$2f,$01,$29,$8c,$02,$89,$80,$25 + .byte $8c,$03,$80,$29,$29,$00,$81 +@ref55: + .byte $8c,$02,$85,$01,$8e,$31,$8c,$03,$80,$33,$01,$2d,$8c,$02,$8d,$02 + .byte $8d +@ref56: + .byte $02,$85,$01,$8e,$31,$8c,$03,$80,$33,$01,$2d,$8c,$02,$8d,$03,$94 + .byte $39,$37,$34,$81 + .byte $fd + .word @song4ch2loop + +@song4ch3: +@song4ch3loop: +@ref57: + .byte $8e,$0c,$85,$8a,$15,$84,$17,$8e,$0d,$84,$17,$8a,$15,$84,$17,$8e + .byte $0c,$85,$8a,$15,$84,$17,$8e,$0d,$86,$19,$8a,$15,$84,$16,$81 + .byte $ff,$11 + .word @ref57 + .byte $ff,$11 + .word @ref57 + .byte $ff,$11 + .word @ref57 + .byte $fd + .word @song4ch3loop + +@song4ch4: +@song4ch4loop: +@ref61: + .byte $bf +@ref62: + .byte $bf +@ref63: + .byte $bf +@ref64: + .byte $bf + .byte $fd + .word @song4ch4loop + + +@song5ch0: + .byte $fb,$06 +@song5ch0loop: +@ref65: + .byte $96,$38,$85,$01,$92,$35,$90,$38,$85,$01,$94,$34,$81 +@ref66: + .byte $90,$38,$85,$01,$92,$35,$90,$39,$a4,$39,$94,$2f,$96,$34,$81 +@ref67: + .byte $90,$38,$85,$01,$92,$35,$96,$38,$85,$01,$92,$34,$81 +@ref68: + .byte $94,$39,$96,$3f,$43,$47,$38,$85,$01,$34,$81 +@ref69: + .byte $38,$85,$01,$35,$38,$85,$01,$34,$81 +@ref70: + .byte $38,$85,$01,$35,$39,$a4,$39,$96,$2f,$34,$81 +@ref71: + .byte $39,$01,$39,$35,$2f,$01,$2f,$34,$81 +@ref72: + .byte $39,$3f,$43,$47,$4d,$47,$43,$3e,$81 +@ref73: + .byte $92,$50,$4c,$46,$42,$46,$42,$3e,$38,$3e,$38,$34,$2e,$34,$2e,$2a + .byte $26 +@ref74: + .byte $50,$4c,$46,$42,$46,$42,$3e,$38,$3e,$38,$34,$2e,$34,$2e,$2a,$26 + .byte $ff,$10 + .word @ref74 + .byte $ff,$10 + .word @ref74 + .byte $fd + .word @song5ch0loop + +@song5ch1: +@song5ch1loop: +@ref77: + .byte $9e,$26,$8d,$2a,$8d +@ref78: + .byte $20,$9d +@ref79: + .byte $26,$8d,$2a,$8d +@ref80: + .byte $20,$8d,$1a,$8d +@ref81: + .byte $26,$8d,$2a,$8d +@ref82: + .byte $20,$9d +@ref83: + .byte $1a,$9d +@ref84: + .byte $18,$8d,$1c,$8d +@ref85: + .byte $9a,$20,$83,$26,$83,$2b,$2e,$83,$34,$83,$38,$81 +@ref86: + .byte $20,$83,$26,$83,$2b,$2e,$83,$34,$83,$38,$81 + .byte $ff,$0b + .word @ref86 +@ref88: + .byte $21,$21,$27,$2b,$2f,$2e,$34,$83,$38,$81 + .byte $fd + .word @song5ch1loop + +@song5ch2: +@song5ch2loop: +@ref89: + .byte $8c,$02,$9d +@ref90: + .byte $9b,$02,$81 +@ref91: + .byte $02,$9d +@ref92: + .byte $97,$02,$02,$02,$02 +@ref93: + .byte $02,$9d +@ref94: + .byte $9b,$02,$81 +@ref95: + .byte $02,$9d + .byte $ff,$05 + .word @ref92 +@ref97: + .byte $02,$85,$02,$85,$02,$85,$02,$85 + .byte $ff,$08 + .word @ref97 + .byte $ff,$08 + .word @ref97 + .byte $ff,$08 + .word @ref97 + .byte $fd + .word @song5ch2loop + +@song5ch3: +@song5ch3loop: +@ref101: + .byte $9f +@ref102: + .byte $9f +@ref103: + .byte $9f +@ref104: + .byte $9f +@ref105: + .byte $9f +@ref106: + .byte $9f +@ref107: + .byte $9f +@ref108: + .byte $9f +@ref109: + .byte $83,$86,$1e,$85,$1e,$85,$1e,$85,$1e,$81 +@ref110: + .byte $83,$1e,$85,$1e,$85,$1e,$85,$1e,$81 + .byte $ff,$09 + .word @ref110 + .byte $ff,$09 + .word @ref110 + .byte $fd + .word @song5ch3loop + +@song5ch4: +@song5ch4loop: +@ref113: + .byte $9f +@ref114: + .byte $9f +@ref115: + .byte $9f +@ref116: + .byte $9f +@ref117: + .byte $9f +@ref118: + .byte $9f +@ref119: + .byte $9f +@ref120: + .byte $9f +@ref121: + .byte $9f +@ref122: + .byte $9f +@ref123: + .byte $9f +@ref124: + .byte $9f + .byte $fd + .word @song5ch4loop + + +@song6ch0: + .byte $fb,$03 +@ref125: + .byte $af +@song6ch0loop: +@ref126: + .byte $8f,$a6,$32,$8b,$a8,$42,$83,$aa,$42,$8d,$a8,$3e,$87,$aa,$3e,$83 + .byte $a8,$3e,$89,$a6,$32,$bd,$2e,$91,$a8,$34,$87,$34,$83,$34,$87,$aa + .byte $34,$83,$a8,$3e,$89,$a6,$2e,$ad +@ref127: + .byte $8f,$32,$8b,$a8,$42,$83,$aa,$42,$8d,$a8,$3e,$87,$aa,$3e,$83,$a8 + .byte $3e,$89,$a6,$32,$bd,$2e,$91,$aa,$3e,$87,$3e,$83,$ac,$3e,$87,$a8 + .byte $42,$83,$46,$89,$a6,$2e,$ab + .byte $fd + .word @song6ch0loop + +@song6ch1: +@ref128: + .byte $af +@song6ch1loop: +@ref129: + .byte $8f,$a6,$32,$87,$a8,$42,$83,$aa,$42,$8d,$a8,$3e,$87,$aa,$3e,$83 + .byte $a8,$3e,$8d,$aa,$38,$ad,$00,$8d,$a6,$2e,$8d,$a8,$34,$87,$34,$83 + .byte $34,$87,$aa,$34,$83,$a8,$3e,$8d,$38,$ad +@ref130: + .byte $00,$8d,$a6,$32,$87,$a8,$42,$83,$42,$8d,$aa,$3e,$87,$a8,$3e,$83 + .byte $3e,$8d,$ac,$46,$ad,$00,$8d,$a6,$2e,$8d,$aa,$3e,$87,$3e,$83,$ac + .byte $3e,$87,$a8,$42,$83,$46,$8d,$aa,$42,$9d,$00,$8b + .byte $fd + .word @song6ch1loop + +@song6ch2: +@ref131: + .byte $97,$8c,$02,$85,$02,$85,$02,$85 +@song6ch2loop: +@ref132: + .byte $9f,$8c,$02,$bd,$02,$bd,$02,$bd,$02,$9d +@ref133: + .byte $9f,$02,$bd,$02,$bd,$02,$bd,$02,$9b + .byte $fd + .word @song6ch2loop + +@song6ch3: +@ref134: + .byte $8a,$18,$84,$14,$88,$18,$84,$14,$8a,$18,$84,$14,$88,$18,$84,$14 + .byte $8a,$18,$9d +@song6ch3loop: +@ref135: + .byte $82,$14,$8d,$84,$14,$9d,$14,$9d,$14,$9d,$14,$9d,$14,$9d,$14,$9d + .byte $14,$9d,$14,$87,$8a,$16,$16,$81 +@ref136: + .byte $16,$8d,$84,$14,$9d,$14,$9d,$14,$9d,$14,$9d,$14,$9d,$14,$10,$86 + .byte $15,$88,$11,$82,$14,$91,$84,$14,$9d,$14,$85,$8a,$16,$16,$81 + .byte $fd + .word @song6ch3loop + +@song6ch4: +@ref137: + .byte $af +@song6ch4loop: +@ref138: + .byte $f9,$f9,$8b +@ref139: + .byte $f9,$f9,$89 + .byte $fd + .word @song6ch4loop diff --git a/neslib.h b/neslib.h index d71e07a..5f37b22 100644 --- a/neslib.h +++ b/neslib.h @@ -8,8 +8,8 @@ // unrle_vram renamed to vram_unrle, with adr argument removed // 060414 - many fixes and improvements, including sequental VRAM updates // previous versions were created since mid-2011, there were many updates - - +// 30012020 - implemented dampening by Simon 'the Sorcerer' Richter. +// 26052020 - removed memcpy as it is available in string.h already. @@ -30,7 +30,6 @@ void __fastcall__ pal_spr(const char *data); void __fastcall__ pal_col(unsigned char index,unsigned char color); //reset palette to $0f - void __fastcall__ pal_clear(void); //set virtual bright both for sprites and background, 0 is black, 4 is normal, 8 is white @@ -108,9 +107,13 @@ void __fastcall__ oam_hide_rest(unsigned char sprid); -//play a music in FamiTone format +//play a music in FamiTone format with gating 0..15 -void __fastcall__ music_play(unsigned char song); +void __fastcall__ music_play_gated(unsigned char song, unsigned char dampening); + +void music_play(unsigned char song){ + music_play_gated(song,15); +} //stop music @@ -124,6 +127,12 @@ void __fastcall__ music_pause(unsigned char pause); void __fastcall__ sfx_play(unsigned char sound,unsigned char channel); +// same as above but with dampening 0..15 + +void sfx_play_damped(unsigned char sound,unsigned char channel, unsigned char dampening){ + sfx_play(sound,channel|(dampening<<2)); +}; + //play a DPCM sample, 1..63 void __fastcall__ sample_play(unsigned char sample); @@ -235,16 +244,11 @@ void __fastcall__ vram_unrle(const unsigned char *data); -//like a normal memcpy, but does not return anything - -void __fastcall__ memcpy(void *dst,void *src,unsigned int len); //like memset, but does not return anything - void __fastcall__ memfill(void *dst,unsigned char value,unsigned int len); //delay for N frames - void __fastcall__ delay(unsigned char frames); @@ -267,8 +271,8 @@ void __fastcall__ delay(unsigned char frames); #define MASK_SPR 0x10 #define MASK_BG 0x08 -#define MASK_EDGE_SPR 0x04 -#define MASK_EDGE_BG 0x02 +#define MASK_EDGE_SPR 0x04 +#define MASK_EDGE_BG 0x02 #define NAMETABLE_A 0x2000 #define NAMETABLE_B 0x2400 diff --git a/neslib.s b/neslib.s index 1041dde..bceabc6 100644 --- a/neslib.s +++ b/neslib.s @@ -1,5 +1,5 @@ ;NES hardware-dependent functions by Shiru (shiru@mail.ru) -;with improvements by VEG +;with improvements by VEG and Simon 'the Sorcerer' Richter ;Feel free to do anything you want with this code, consider it Public Domain @@ -11,13 +11,13 @@ .export _scroll,_split .export _bank_spr,_bank_bg .export _vram_read,_vram_write - .export _music_play,_music_stop,_music_pause + .export _music_play_gated,_music_stop,_music_pause .export _sfx_play,_sample_play .export _pad_poll,_pad_trigger,_pad_state .export _rand8,_rand16,_set_rand .export _vram_adr,_vram_put,_vram_fill,_vram_inc,_vram_unrle .export _set_vram_update,_flush_vram_update - .export _memcpy,_memfill,_delay + .export _memfill,_delay @@ -758,10 +758,12 @@ _vram_write: -;void __fastcall__ music_play(unsigned char song); - -_music_play=FamiToneMusicPlay +;void __fastcall__ music_play_gated(unsigned char song, unsigned char dampening); +_music_play_gated: + sta FT_MUSIC_VOLUME + jsr popa + jmp FamiToneMusicPlay ;void __fastcall__ music_stop(void); @@ -779,11 +781,16 @@ _music_pause=FamiToneMusicPause ;void __fastcall__ sfx_play(unsigned char sound,unsigned char channel); _sfx_play: - + pha and #$03 tax lda @sfxPriority,x tax + pla + lsr + lsr + sta FT_SFX_VOLUME,x + jsr popa jmp FamiToneSfxPlay @@ -1098,54 +1105,6 @@ _vram_inc: -;void __fastcall__ memcpy(void *dst,void *src,unsigned int len); - -_memcpy: - - sta