03-28-2011, 01:16 PM
There's no real 'source' as yet, because I sort of hacked it in there to prove a point. :-)
Basically I created a tune and 'compiled' it from Beepola, then saved it as a .TAP file with a start address of 64000. I then added a 'randomize usr 64000' call into my game at the required point and compiled it to a low-enough address that I knew the game wouldn't overwrite the music. Then I loaded both the game code and the music code before starting the game.
This seems a little fiddly, but it works.
You can get Beepola to output an .asm file instead (which I think would be easier in the long run), but I've not had time to finish playing around with that method yet - it seems a neater way of including the music so that you can build the whole thing in one go.
The ASM *almost* compiles just by wrapping it in an asm/end asm block, there just seems to be a very slight incompatibility with how ZXBasic handles EQU. Beepola outputs this:
But ZXBasic doesn't like the colons at the end of the label before the EQUs. Remove those and it compiles fine!
i.e.
Basically I created a tune and 'compiled' it from Beepola, then saved it as a .TAP file with a start address of 64000. I then added a 'randomize usr 64000' call into my game at the required point and compiled it to a low-enough address that I knew the game wouldn't overwrite the music. Then I loaded both the game code and the music code before starting the game.
This seems a little fiddly, but it works.
You can get Beepola to output an .asm file instead (which I think would be easier in the long run), but I've not had time to finish playing around with that method yet - it seems a neater way of including the music so that you can build the whole thing in one go.
The ASM *almost* compiles just by wrapping it in an asm/end asm block, there just seems to be a very slight incompatibility with how ZXBasic handles EQU. Beepola outputs this:
Code:
; *** DATA ***
VECTOR_TABLE_LOC: EQU $FE00
BORDER_CLR: EQU $0
But ZXBasic doesn't like the colons at the end of the label before the EQUs. Remove those and it compiles fine!
i.e.
Code:
; *** DATA ***
VECTOR_TABLE_LOC EQU $FE00
BORDER_CLR EQU $0