Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

On the creation of AY or Beeper music, including the packages used to do so.
Post Reply
qaenoip
Berk
Posts: 4
Joined: Sun Mar 08, 2020 11:24 am

Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by qaenoip » Sun Mar 08, 2020 12:06 pm

Here's the problem: I've created a module in Vortex Tracker 2.5 and realized that i want to play it on my spectrum. How can you save modules in VT so they could be played on real hardware or an emulator?I tried saving in .tap but when I played it in an emulator for testing I was greeted with this:
Image
It just fills the entire central area and goes on and on.
0 x

User avatar
Alessandro
Manic Miner
Posts: 634
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by Alessandro » Sun Mar 08, 2020 1:28 pm

You cannot just save the player and the music data as a TAP file and expect it to work. You must activate the player so that it plays the music continuously or until a key is pressed. This is a simple starter code that will play the music exported from Vortex Tracker II as a TAP file with player and music data until a key is pressed. It assumes the player is exported at the default address, 49152:

Code: Select all

  PLAYER EQU 49152

  ORG 49120

  LD A,1
  LD (PLAYER+10),A
  CALL PLAYER
  EI
LOOP:
  HALT
  CALL PLAYER+5
  XOR A
  IN A,(#FE)
  CPL 
  AND #1F
  JR NZ,FINE
  LD A,(PLAYER+10)
  RLA
  JR NC,LOOP
FINE:
  CALL PLAYER+8
  RET
Assemble it as a TAP file with Pasmo (or another assembler) and use it with this BASIC program:

Code: Select all

10 CLEAR 49119
20 FOR n = 1 TO 3: LOAD "" CODE: NEXT n
30 PAUSE 1: RANDOMIZE USR 49120
The program must load the starter code, then the player, and finally the music data.

If you want to hear the music again enter GO TO 30.
0 x

qaenoip
Berk
Posts: 4
Joined: Sun Mar 08, 2020 11:24 am

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by qaenoip » Sun Mar 08, 2020 4:10 pm

I have troubles assembling to tap. It just opens the prompt for a split second. I'm unable to type the required comand in.
0 x

qaenoip
Berk
Posts: 4
Joined: Sun Mar 08, 2020 11:24 am

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by qaenoip » Sun Mar 08, 2020 5:00 pm

Wait. I got a bin file out of txt with your code. What next?
0 x

User avatar
R-Tape
Site Admin
Posts: 2915
Joined: Thu Nov 09, 2017 11:46 am

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by R-Tape » Sun Mar 08, 2020 5:29 pm

If you just want to hear it on a Speccy, then this is how I'd do it:

BY the looks of it, you already have your .TAP with the player and music. Insert this tape in the emulator. Assuming you have compiled your .TAP to the default 49152, type:

10 CLEAR 32768: LOAD ""CODE: LOAD""CODE
20 RANDOMIZE USR 49152
30 PAUSE 1:RANDOMIZE USR 49157:GOTO 30

Should work.
0 x

User avatar
Alessandro
Manic Miner
Posts: 634
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by Alessandro » Sun Mar 08, 2020 5:39 pm

Pasmo is a command-line assembler. You cannot use it by double-clicking on it. Also remember to use version 0.5.4.beta2; 0.6.0 is an experimental untested version and can give compiling errors.

Open a command prompt window in the folder where you have both PASMO.EXE and the .ASM file with the starter code and enter:

pasmo --tap filename.asm filename.tap

where filename of course is the name you gave to the .ASM file with the starter code. You now should have two TAP files: one with the starter code and another with the music player and data exported from Vortex Tracker II. Remember for now to export it at address 49152; you will be able to change it later if you wish, provided you also change the ORG and PLAYER values in the starter code as well. Now type the BASIC program on the emulated Spectrum and enter RUN. It will then start to load three pieces of code. Begin with the TAP file with the starter program, then insert the TAP file with the music player and data. Once all of three pieces have been loaded, the music will play until you press a key. Enter GO TO 30 to hear the music again if you wish.

You can also save your BASIC program with: SAVE "prog" LINE 0

@R-Tape : That works as well, but to exit that program you need to press BREAK and reset the AY chip by entering RANDOMIZE USR 49162, otherwise it will keep playing the last note on and on.
0 x

qaenoip
Berk
Posts: 4
Joined: Sun Mar 08, 2020 11:24 am

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by qaenoip » Sun Mar 08, 2020 7:01 pm

Thanks a lot! It really works!
0 x

User avatar
djnzx48
Manic Miner
Posts: 643
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by djnzx48 » Sun Mar 08, 2020 7:43 pm

Alessandro wrote:
Sun Mar 08, 2020 5:39 pm
@R-Tape : That works as well, but to exit that program you need to press BREAK and reset the AY chip by entering RANDOMIZE USR 49162, otherwise it will keep playing the last note on and on.
I think you mean USR 49152, not 49162.

@qaenoip: You may want to be aware that EmuZWin does not emulate the AY chip correctly, and in particular any use of the noise generator will produce wrong-sounding output.
0 x

User avatar
Alessandro
Manic Miner
Posts: 634
Joined: Wed Nov 15, 2017 11:10 am
Location: Messina, Italy
Contact:

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by Alessandro » Sun Mar 08, 2020 8:50 pm

djnzx48 wrote:
Sun Mar 08, 2020 7:43 pm
I think you mean USR 49152, not 49162.
Sorry, I meant 49160 in fact, i.e. the player's starting position plus 8, which is the beginning of the code for ending the playback, as in the starter code at FINE ("end" in Italian). Tested before posting :)
0 x

User avatar
djnzx48
Manic Miner
Posts: 643
Joined: Wed Dec 06, 2017 2:13 am
Location: New Zealand

Re: Playing ZX Spectrum modules(.vt,.tap,.asm,etc.) on real hardware or an emulator

Post by djnzx48 » Sun Mar 08, 2020 8:57 pm

Oh, you're right; I didn't read that bit properly. Although USR 49152 should still work for muting the song if you don't mind it restarting from the beginning.
0 x

Post Reply