CPCWiki forum

General Category => Programming => Topic started by: Fabrizio Radica on 17:18, 03 August 16

Title: Basic Playroutine
Post by: Fabrizio Radica on 17:18, 03 August 16
HI  :)
i've a little question  ::)

We have a play-routine to play music in basic? For an intro game for example.
If yes, how i implement it in basic?

I learned how to load (and save like screenshots) .SCR in to ram, but i don't know how to play musics.
I would not want to use the sound command  :P

thanks in advance and long life to CPC :D
Title: Re: Basic Playroutine
Post by: SRS on 17:52, 03 August 16
Hi,

if you want to play
MIDI
:

simple ay playback example: pb on winape (http://www.cpcwiki.eu/forum/programming/simple-ay-playback-example-pb-on-winape/)
Title: Re: Basic Playroutine
Post by: Fabrizio Radica on 20:47, 03 August 16
Quote from: SRS on 17:52, 03 August 16
Hi,

if you want to play
MIDI
:

simple ay playback example: pb on winape (http://www.cpcwiki.eu/forum/programming/simple-ay-playback-example-pb-on-winape/)


uhm. i need to convert it in basic.  :doh:
Title: Re: Basic Playroutine
Post by: SRS on 21:09, 03 August 16
Ah, well.

Take i.e. "Dune" asm.

You assemble it in emulator to memory
then you can save it  from BASIC - SAVE"DUNE.BIN",B,&8000,&51E

In your BASIC-Game you set

MEMORY &7FFF

and

LOAD"dune.bin",&8000

and if you want the music to play: CALL &8000. now it plays "infinite" until you CALL &8003.
Title: Re: Basic Playroutine
Post by: Fabrizio Radica on 21:42, 03 August 16
Quote from: SRS on 21:09, 03 August 16
Ah, well.

Take i.e. "Dune" asm.

You assemble it in emulator to memory
then you can save it  from BASIC - SAVE"DUNE.BIN",B,&8000,&51E

In your BASIC-Game you set

MEMORY &7FFF

and

LOAD"dune.bin",&8000

and if you want the music to play: CALL &8000. now it plays "infinite" until you CALL &8003.


It seems like you do with the asm c64.

jsr 1000 ;init SID
jsr 1003 ;playSID

tnx, i try. :)
Title: Re: Basic Playroutine
Post by: Fabrizio Radica on 22:23, 03 August 16
Quote from: SRS on 21:09, 03 August 16
Ah, well.

Take i.e. "Dune" asm.

You assemble it in emulator to memory
then you can save it  from BASIC - SAVE"DUNE.BIN",B,&8000,&51E

In your BASIC-Game you set

MEMORY &7FFF

and

LOAD"dune.bin",&8000

and if you want the music to play: CALL &8000. now it plays "infinite" until you CALL &8003.


yeah, works fine :D
here a snapshot of the game, taken with JavaCPC (on OSX)

:)

Title: Re: Basic Playroutine
Post by: AMSDOS on 22:36, 03 August 16
Quote from: Fabrizio Radica on 20:47, 03 August 16

uhm. i need to convert it in basic.  :doh:

Earlier I found a BASIC game which allowed @Morri (http://www.cpcwiki.eu/forum/index.php?action=profile;u=95) to use in their Coolbox game I think.
Powered by SMFPacks Menu Editor Mod