Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix turbommc nmi #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

/beebtrk backup1.6502
/beebtrk backup2.6502
compile.txt
26 changes: 13 additions & 13 deletions beebtrk.6502
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 ***
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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


\ ******************************************************************
Expand Down
Binary file modified beebtrk.ssd
Binary file not shown.
17 changes: 12 additions & 5 deletions beebtrk2.6502
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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


\ ******************************************************************
Expand Down
Binary file modified beebtrk2.ssd
Binary file not shown.
67 changes: 37 additions & 30 deletions beebtrk3.6502
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ INCLUDE "lib/beebtracker.h.6502"
\ * Start address to be saved
\ ******************************************************************

LARGEST_VGM_SIZE = 13249 - 266 ; less size of splash screen "loader_volume2.bin.exo"
LARGEST_VGM_SIZE = 13249 ; less size of splash screen "loader_volume3.bin.exo"
SPLASH_SCREEN_SIZE = 259

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

Expand Down Expand Up @@ -318,6 +319,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


\ ******************************************************************
Expand Down Expand Up @@ -388,34 +395,34 @@ EQUS "C.E", 13

.menu_entries
EQUS " 1. Title Screen "
EQUS " 3. Green Hill Zone "
EQUS " 4. Invincible "
EQUS " 5. Bridge Zone "
EQUS " 7. Jungle Zone "
EQUS " 8. Bonus Zone "
EQUS " 9. Labyrinth Zone "
EQUS "10. Act Complete "
EQUS "11. Scrap Brain Zone "
EQUS "12. Sky Base Zone "
EQUS "13. Boss Theme "
EQUS "14. Death "
EQUS "15. Ending "
EQUS "16. Marble Zone (Bonus) "

EQUS "17. Sonic Chaos Intro "
EQUS "18. Sonic Chaos Title Screen "
EQUS "19. Sonic Chaos Select Player "
EQUS "20. Sonic Chaos Turquoise Hill "
EQUS "21. Sonic Chaos Boss "
EQUS "22. Sonic Chaos Gigalopolis Zone"
EQUS "23. Sonic Chaos Sleeping Egg Zn "
EQUS "24. Sonic Chaos Special Stage "
EQUS "25. Sonic Chaos Mecha Green Hill"
EQUS "26. Sonic Chaos Aqua Planet Zone"
EQUS "27. Sonic Chaos Special Stage 2 "
EQUS "28. Sonic Chaos Electric Egg Zn "
EQUS "29. Sonic Chaos Final Boss "
EQUS "30. Sonic Chaos Ending "
EQUS " 2. Green Hill Zone "
EQUS " 3. Invincible "
EQUS " 4. Bridge Zone "
EQUS " 5. Jungle Zone "
EQUS " 6. Bonus Zone "
EQUS " 7. Labyrinth Zone "
EQUS " 8. Act Complete "
EQUS " 9. Scrap Brain Zone "
EQUS "10. Sky Base Zone "
EQUS "11. Boss Theme "
EQUS "12. Death "
EQUS "13. Ending "
EQUS "14. Marble Zone (Bonus) "

EQUS "15. Sonic Chaos Intro "
EQUS "16. Sonic Chaos Title Screen "
EQUS "17. Sonic Chaos Select Player "
EQUS "18. Sonic Chaos Turquoise Hill "
EQUS "19. Sonic Chaos Boss "
EQUS "20. Sonic Chaos Gigalopolis Zone"
EQUS "21. Sonic Chaos Sleeping Egg Zn "
EQUS "22. Sonic Chaos Special Stage "
EQUS "23. Sonic Chaos Mecha Green Hill"
EQUS "24. Sonic Chaos Aqua Planet Zone"
EQUS "25. Sonic Chaos Special Stage 2 "
EQUS "26. Sonic Chaos Electric Egg Zn "
EQUS "27. Sonic Chaos Final Boss "
EQUS "28. Sonic Chaos Ending "


IF COMPILE_OPTION_EXIT
Expand Down
Binary file modified beebtrk3.ssd
Binary file not shown.
7 changes: 4 additions & 3 deletions lib/exomiser.h.6502
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/exomiser.s.6502
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions lib/vgmplayer.s.6502
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -350,6 +352,19 @@ PSG_STROBE_CLI_INSN = psg_strobe + 25
LDA #SN_VOL_MAX
SBC vgm_player_reg_vals,Y
STA vgm_player_reg_vals,Y

\\ Trigger beat on volume
IF VGM_TRIGGER_BEAT_ON_VOLUME
TAX
TYA:LSR A:TAY ; channel is register / 2
TXA
CMP #9
BCC set_beat_vol
LDA #9
.set_beat_vol
STA vgm_chan_array, Y
ENDIF

JMP return

\\ Frequency / tone data
Expand Down
8 changes: 3 additions & 5 deletions make.bat
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion run.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"..\..\Tools\B-emV2.2Win\B-em.exe" beebtrk3.ssd
"..\..\Tools\B-emV2.2Win\B-em.exe" beebtrk.ssd