From 82c697cf92ed8944ba48d24c10367dbbc472c8e8 Mon Sep 17 00:00:00 2001 From: kieranhj Date: Wed, 14 Dec 2016 09:57:52 +0000 Subject: [PATCH 1/3] Trigger beat bar on volume data Small change to set beat bar to value when volume data sent to SN Some tunes only set freq once and then just send volume commands, particularly for noise channel to implement percusion Makes the beat bar more responsive. Don't need the PHA:PLA actually, could just use X reg. --- lib/vgmplayer.s.6502 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/vgmplayer.s.6502 b/lib/vgmplayer.s.6502 index 7bbd991..18147c8 100644 --- a/lib/vgmplayer.s.6502 +++ b/lib/vgmplayer.s.6502 @@ -350,6 +350,18 @@ PSG_STROBE_CLI_INSN = psg_strobe + 25 LDA #SN_VOL_MAX SBC vgm_player_reg_vals,Y STA vgm_player_reg_vals,Y + + PHA + + \\ Trigger beat on volume + TYA:LSR A:TAY ; channel is register / 2 + + PLA + CMP #9 + BCC set_beat_vol + LDA #9 + .set_beat_vol + STA vgm_chan_array, Y JMP return \\ Frequency / tone data From eecc9c1691f9f3e85192cdf2af315740bc7e6ba9 Mon Sep 17 00:00:00 2001 From: kieranhj Date: Sun, 18 Dec 2016 19:14:00 +0000 Subject: [PATCH 2/3] Moved EXO scratch space out of NMI page Discovered that TurboMMC requires NMI page at &D00 Otherwise disk image resets to 0 after EXO initialisation Moved EXO scratch space to main memory but very tight (even for 156 bytes!) So easiest thing was to reduce size of the scrolltext Added defines for VGM & splash screen size to keep track of GUARD Also fixed numbering typo in disk 3 --- .gitignore | 1 + beebtrk.6502 | 26 ++++++++--------- beebtrk.ssd | Bin 187648 -> 187648 bytes beebtrk2.6502 | 17 +++++++---- beebtrk2.ssd | Bin 142848 -> 142848 bytes beebtrk3.6502 | 67 ++++++++++++++++++++++++-------------------- beebtrk3.ssd | Bin 110848 -> 111104 bytes lib/exomiser.h.6502 | 7 +++-- lib/exomiser.s.6502 | 2 +- make.bat | 8 ++---- run.bat | 2 +- 11 files changed, 72 insertions(+), 58 deletions(-) diff --git a/.gitignore b/.gitignore index b64b77c..1fa6408 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /beebtrk backup1.6502 /beebtrk backup2.6502 +compile.txt diff --git a/beebtrk.6502 b/beebtrk.6502 index 0d26ac8..3dec698 100644 --- a/beebtrk.6502 +++ b/beebtrk.6502 @@ -54,10 +54,11 @@ INCLUDE "lib/beebtracker.h.6502" \ * Start address to be saved \ ****************************************************************** -LARGEST_VGM_SIZE = 20837 - 256 ; minus size of title screen file "loader_volume1.bin.exo" +LARGEST_VGM_SIZE = 20837 ; minus size of title screen file "loader_volume1.bin.exo" +SPLASH_SCREEN_SIZE = 256 ORG CODE_ORIGIN ; code origin - assume standard BBC Micro -GUARD MODE7_base_addr-LARGEST_VGM_SIZE ; ensure code size plus size of largest VGM file doesn't hit start of screen memory +GUARD MODE7_base_addr-LARGEST_VGM_SIZE+SPLASH_SCREEN_SIZE ; ensure code size plus size of largest VGM file doesn't hit start of screen memory .start @@ -97,19 +98,13 @@ INCLUDE "lib/beebtracker.s.6502" JSR show_intro \\ Run the tracker demo - JSR tracker_main + JMP tracker_main \\ ***** Exit app entirely ***** \\ \\ Credits / Outro screen goes here \\ - \\ Exit cleanly - tidy up anything else here! - LDA #12: JSR oswrch - \\ Would be nice to clear escape state and issue BASIC NEW to avoid "Bad Program" error - - .return - RTS } \\ *** Show loading screen *** @@ -127,7 +122,6 @@ INCLUDE "lib/beebtracker.s.6502" LDY #&7c JSR exo_unpack - \\ wait for keypress within 2 secs LDA#&81:LDX#200:LDY#0:JSR osbyte RTS @@ -160,9 +154,9 @@ SET_TELETEXT_FONT_CHAR_MAP ;EQUB 0 \\ Long text blows out the 200KB disk size - removed one tune -EQUS " Welcome to the Bitshifters Battle of the Bits BeebTracker Demo... Showcasing 26 awesome VGM chiptune music files converted from other 8 bit platforms to work on your BBC Micro. They have been retuned to 4Mhz and resampled at 50Hz" -EQUS " so can be played back on your SN76489 sound chip. You have never heard chiptunes like this before on the Beeb and not an ENVELOPE in sight! Press Escape to bring up the menu. Use the up and down arrow keys and return to select a new track." -EQUS " Released at the ABUG South Meet Up in Cambridge on 27 August 2016. This production was brought to you by Kieran and Henley. Find the full source to this demo and more at bitshifters.github.io. Come join the Collective...! " +EQUS " Welcome to the Bitshifters Battle of the Bits BeebTracker Demo.. Showcasing 26 awesome VGM chiptunes converted from other 8 bit platforms to work on your BBC Micro. Retuned to 4Mhz and resampled at 50Hz" +EQUS " for your SN76489 sound chip. You have never heard music like this before on the Beeb and not an ENVELOPE in sight! Press Escape to toggle the menu. Up and down arrow keys and return to select a new track." +EQUS " Released 27 August 2016 at the ABUG South Meet Up in Cambridge. This prod was brought to you by Kieran and Henley. Full source at bitshifters.github.io. Come join the Collective..!" EQUB 0 .load_message @@ -176,6 +170,12 @@ EQUS "Loading... ", 0 RESET_MAPCHAR +\\ ** MOVED EXO SCRATCH SPACE HERE TO AVOID NMI AT PAGE &D00 ** \\ +.exo_tabl_bi +PRINT "Spare bytes=",(MODE7_base_addr-LARGEST_VGM_SIZE)-exo_tabl_bi +SKIP EXO_TABL_SIZE +exo_tabl_lo = exo_tabl_bi + 52 +exo_tabl_hi = exo_tabl_bi + 104 \ ****************************************************************** diff --git a/beebtrk.ssd b/beebtrk.ssd index e50e0f7a08cac1eebb1efb17e59f38d072d31ae8..b58b26655b58e3400741612e77e95a4240eb3f53 100644 GIT binary patch delta 321 zcmZqJ#oe%rd&3(>#wnBEGNy`aYpq(!UKy`7GeN6srjFJk76mDxnLjiqXEG_eLujebhIWgKVz3j+L&*5!;sK#2w73ctmcCbq^dO=^u>G-dKZwgrsc zlattWfG+E2zrr|qa|#ES0DG~z&r4yTbhSj*wZu&NL;Zj|m}ZvFwu-q|JB_F(`#Fa!CdXA3b{X<8;BhjB__( N$+pQdE|X7>4^@F8;~cuY?O;@}GnrXJbmObW4_QSqpM-km=-1>JL#|1cz)vIEOB^ z{L^hQB#m(@oH$4k6%HIbbnaLXwD8TPw13iXdwHMl;q6~8_AeK|JOFg%BW#!Ics6Fe z9gKJJL)^fj?$~CWLD|(--fE~qua1#EN22Vvg^_-(A8Uimm1)kpCG+$uGp8DOocYPh z+xZ9-yo<@5wyqW9VJ+G^YEPd!zy3O3t!XfPmE^J$FjX-qIlry(Ruqie(dMu#Zx#md zNw(Q*wd^DN4sr56XB4nkbMA|CL8zdE@{asbeqm5mgq%@Y?mPb diff --git a/beebtrk2.6502 b/beebtrk2.6502 index e1a8939..74a9e54 100644 --- a/beebtrk2.6502 +++ b/beebtrk2.6502 @@ -55,10 +55,11 @@ INCLUDE "lib/beebtracker.h.6502" \ * Start address to be saved \ ****************************************************************** -LARGEST_VGM_SIZE = 20560 - 266 ; less size of splash screen "loader_volume2.bin.exo" +LARGEST_VGM_SIZE = 20560 ; less size of splash screen "loader_volume2.bin.exo" +SPLASH_SCREEN_SIZE = 266 ORG CODE_ORIGIN ; code origin - assume standard BBC Micro -GUARD MODE7_base_addr-LARGEST_VGM_SIZE ; ensure code size plus size of largest VGM file doesn't hit start of screen memory +GUARD MODE7_base_addr-LARGEST_VGM_SIZE+SPLASH_SCREEN_SIZE ; ensure code size plus size of largest VGM file doesn't hit start of screen memory .start @@ -296,9 +297,9 @@ SET_TELETEXT_FONT_CHAR_MAP .scrolltext_start .demo_message -EQUS " Welcome to the Bitshifters Ninja Gaiden BeebTracker Demo... 17 awesome VGM chiptune music files ported from Sega Master System to your BBC Micro. They have been retuned to 4Mhz and resampled at 50Hz" -EQUS " so can be played back on your SN76489 sound chip. Enjoy the soundtrack! Press Escape to bring up the menu. Use the up and down arrow keys and return to select a new track." -EQUS " Released at the ABUG South Meet Up in Cambridge on 27 August 2016. This production was brought to you by Kieran and Henley. Find the full source to this demo and more at bitshifters.github.io. Come join the Collective...! " +EQUS " Welcome to the Bitshifters Ninja Gaiden BeebTracker Demo... 17 awesome VGM chiptunes ported from the Sega Master System to your BBC Micro. Retuned to 4Mhz and resampled at 50Hz" +EQUS " to play back on your SN76489 sound chip. Enjoy the soundtrack! Press Escape to bring up the menu. Use the up and down arrow keys and return to select a new track." +EQUS " Released at the ABUG South Meet Up in Cambridge on 27 August 2016. This production was brought to you by Kieran and Henley. Find the full source to this demo and more at bitshifters.github.io. Come join the Collective...!" EQUB 0 .load_message @@ -312,6 +313,12 @@ EQUS "Loading... ", 0 RESET_MAPCHAR +\\ ** MOVED EXO SCRATCH SPACE HERE TO AVOID NMI AT PAGE &D00 ** \\ +.exo_tabl_bi +PRINT "Spare bytes=",(MODE7_base_addr-LARGEST_VGM_SIZE)-exo_tabl_bi +SKIP EXO_TABL_SIZE +exo_tabl_lo = exo_tabl_bi + 52 +exo_tabl_hi = exo_tabl_bi + 104 \ ****************************************************************** diff --git a/beebtrk2.ssd b/beebtrk2.ssd index 2a8fe6fa4a82f7460fd07288bee9cfb8e4a3176d..367a943a684934042cfd54f6b726e33433806061 100644 GIT binary patch delta 213 zcmZp;!_jbuW5XIomc`NxOcOT-OkxTWH_%?Sl)W-VduFP3*Gxn0MJx(ZLNotrP0nOe zw)vw4W12vnS^ zz4-)_Efe#{MOvFVSa&co&YXOZ?JVQW&He1kfnFsvncZ zcqeN~sZUOjQe#gJ`53OmShRVXR3#%1gHi}1mt>&u(W6H{PBxUCyIDadov}%-O^$Jy H9FqV5m(4|l delta 248 zcmZp;!_jbuW5XIo7A>mXrm3R|AhKIx^ z^KyL@hz(JltSqI@mn_Cx^ihm4llLPFFK^&vPbqbQgpiNyjDbM@$8aUaB3`b|BXr0*b_!05HP~UMq-SKg2s!9F(D-K2N;7_k9yL1TgA3Im(R|=H}AdgcV_CdYwC+D zQ^BPkBeveQa|W=jl2d>+Ra`&tk-(h=uKKtmz;Pev1zvD*rN9*d{Q$le&{yF60rU|l zR-#wHco}*MEa%ZWaG(O+2Tqru8Q`2Jg{I+S$boJGOL>$8*7C>%UKP+NaE(LPfteyS z0^F)XLEu9-IuE?&LLI<82WkfjrKlPB%!!&%F)IG%M1CX;Hhb!k<6fC?$0J}}$awDl zv^P~(V7k0(l3(Mj%j}LkmsA#EdItYvZ5x#zAU#c7Tu?}{7m9p9bKlEoJ5o$EtUNxFBfWy5m&1^Bh`yzZsb z@&+Dk(E54KnmRN#-!RuIOSsPZ3QZxFWmbg>GU11aV=o2xG zn8d>Vs@720P-3jHqSAkk1llAV8c*VGCH{LT#qT@Zt;gedI7%i86v0pdCcBp?W|S$a zwK9I*6{KS-jj(Nvwe9Cq1B$`)W;-3V$3M2OEO3go)2SN9JyAuEGk;7&-;c85OmS{} zST$KGCID=P=1hNXJVZ3YVE!ie))fkPstbRnc(BRM@p+EVEaU+hBl%qe{*@ zlGz){jdx8Z6wpVBXx4RVK&$si{pPkA{%az!ND$TuR{LN4tgpOKx7 zQ7t-6Vs&C=vy^#*r(?bq~3O zeA`4ukPm!h0D0LL0>_GzLiwX>o9FfA&f*8}Cy!njS?eqpeeEK?D!*uZ#h3m2 zm$;?&#jfrUjGC0{a7NWMm@;$TRjdS4(CU|%gor+)>Twpf z*faH0FZ0YC{QC;$Ke diff --git a/lib/exomiser.h.6502 b/lib/exomiser.h.6502 index ec03ec3..f056bae 100644 --- a/lib/exomiser.h.6502 +++ b/lib/exomiser.h.6502 @@ -31,9 +31,10 @@ EXO_buffer_end = EXO_buffer_start + EXO_buffer_len ; ------------------------------------------------------------------- EXO_TABL_SIZE = 156 -exo_tabl_bi = &0d9f - EXO_TABL_SIZE -exo_tabl_lo = exo_tabl_bi + 52 -exo_tabl_hi = exo_tabl_bi + 104 +; can't use NMI workspace with TurboMMC :S +;exo_tabl_bi = &0d9f - EXO_TABL_SIZE +;exo_tabl_lo = exo_tabl_bi + 52 +;exo_tabl_hi = exo_tabl_bi + 104 \\ Declare ZP vars diff --git a/lib/exomiser.s.6502 b/lib/exomiser.s.6502 index c95de80..fdf1440 100644 --- a/lib/exomiser.s.6502 +++ b/lib/exomiser.s.6502 @@ -89,7 +89,7 @@ EXO_crunch_byte_hi = exo_get_crunched_byte + 2 inx tya and #$0f - beq _init_shortcut ; starta på ny sekvens + beq _init_shortcut ; starta p� ny sekvens txa ; this clears reg a lsr a ; and sets the carry flag diff --git a/make.bat b/make.bat index 9773ce7..ebdf47f 100644 --- a/make.bat +++ b/make.bat @@ -1,6 +1,4 @@ @echo off -..\..\Bin\beebasm.exe -i beebtrk.6502 -do beebtrk.ssd -opt 2 -v -pause -..\..\Bin\beebasm.exe -i beebtrk2.6502 -do beebtrk2.ssd -opt 2 -v -pause -..\..\Bin\beebasm.exe -i beebtrk3.6502 -do beebtrk3.ssd -opt 2 -v +..\..\Bin\beebasm.exe -i beebtrk.6502 -do beebtrk.ssd -opt 2 -v > compile.txt +..\..\Bin\beebasm.exe -i beebtrk2.6502 -do beebtrk2.ssd -opt 2 -v >> compile.txt +..\..\Bin\beebasm.exe -i beebtrk3.6502 -do beebtrk3.ssd -opt 2 -v >> compile.txt diff --git a/run.bat b/run.bat index a6b2e79..6e5686b 100644 --- a/run.bat +++ b/run.bat @@ -1 +1 @@ -"..\..\Tools\B-emV2.2Win\B-em.exe" beebtrk3.ssd +"..\..\Tools\B-emV2.2Win\B-em.exe" beebtrk.ssd From 39c394f0c1d9bfd3fbc4b09aa716c65b4d2b2a73 Mon Sep 17 00:00:00 2001 From: kieranhj Date: Sun, 18 Dec 2016 19:44:57 +0000 Subject: [PATCH 3/3] Disable beat on volume feature Currently too tight on memory to afford the code changes!! --- lib/vgmplayer.s.6502 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/vgmplayer.s.6502 b/lib/vgmplayer.s.6502 index 18147c8..03845ed 100644 --- a/lib/vgmplayer.s.6502 +++ b/lib/vgmplayer.s.6502 @@ -5,6 +5,8 @@ VGM_PLAYER_ORG = * +VGM_TRIGGER_BEAT_ON_VOLUME = FALSE ; currently incompatible with memory changes (it's that tight!) + ORG &0380 GUARD &03E0 @@ -351,17 +353,18 @@ PSG_STROBE_CLI_INSN = psg_strobe + 25 SBC vgm_player_reg_vals,Y STA vgm_player_reg_vals,Y - PHA - \\ Trigger beat on volume + IF VGM_TRIGGER_BEAT_ON_VOLUME + TAX TYA:LSR A:TAY ; channel is register / 2 - - PLA + TXA CMP #9 BCC set_beat_vol LDA #9 .set_beat_vol STA vgm_chan_array, Y + ENDIF + JMP return \\ Frequency / tone data