Trying to get it working on Spectrum

What is Arkos Tracker? Forums Arkos Tracker forum General discussion Trying to get it working on Spectrum

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #30056
    WauloK
    Participant

    Hi

    I’ve made a game for Spectrum computers and a musician friend wrote a tune for my game.

    I’ve been trying to even just get the music to play in a simple file without the game, since I tried it with the game and couldn’t get any music to play.

    Code to start:

    	device zxspectrum48
    		org 32000-768
           
      jp start
      
    start:
      ld hl,COREY_START
      xor a
      call PLY_AKG_INIT
      
    Sync:
      ei
      nop
      halt
      di
      call PLY_AKG_PLAY
      jr Sync
    
    COREY_START
    PLY_AKG_OPCODE_ADD_HL_BC_MSB db 65
    PLY_AKG_FULL_INIT_CODE

    …etc…
    The game maker I program with uses sjasmplus so I used Disark to make my At2Files.asm and added this header to it.
    It compiles with no errors, but when I load up the testplay.tap file into a Spectrum emulator the screen goes black and a long, low note is continuously played.

    TIA

    WauloK

    #30057
    Targhan
    Keymaster

    Hi,

    Could you first try to make it work without using Disark, and with Rasm + one of the testers?

    #30058
    WauloK
    Participant

    I can try but how do I create a Spectrum tap file with that method to load in an emulator?

    #30061
    Targhan
    Keymaster

    My suggestion is to simply use the “makesna” tool to create sna from the binary. First make a test from the tester, then from the Disarked file. The binary should be the same!

    If both works, then it means the program lies in how you assemble the source you shown above.

    #30063
    Targhan
    Keymaster

    Hi,

    Did you manage to make it work? If not, please PM me your sources files and I’ll try to reproduce!

    #30064
    WauloK
    Participant

    Hi

    No, I’m trying a different tracker.

    Thanks!

    #30067
    Targhan
    Keymaster

    Oh, sorry to hear that. However, could you send me the files you are using (if they’re not too secret, I won’t share them anyway) so that I can try to reproduce the problem? contact at julien-nevo dot com.

    #30121
    garvalf
    Participant

    I’m trying as well to make a .tap file to load into my spectrum.

    I’ve exported a 2019-08-19.asm + 2019-08-19_playerconfig.asm files in akg format

    I’ve got the PlayerAkgTester_SPECTRUM.asm and PlayerAkg.asm from the arkos players folder.

    In playerakgtester_spectrum.asm I’ve called:

    
            include "2019-08-19_playerconfig.asm"
            include "PlayerAkg.asm"
    /.../
            include "2019-08-19.asm"

    I’ve generated a test.bin from this command line:

    
    ./rasm PlayerAkgTester_SPECTRUM.asm -o test
    
    Pre-processing [PlayerAkgTester_SPECTRUM.asm]
    Assembling
    Write binary file test.bin (18710 bytes)

    but now I don’t know what to do with this test.bin file! I can’t load it into emulator or hardware (I just want to play the music, not to use it in a game)

    #30122
    Targhan
    Keymaster

    If you have a tester compiled, then I assume there is a VSync loop, and a call to the player every frame.

    Being not a Spectrum guy, I don’t know/don’t remember how to create a TAP, but there must be some command line tool to add a binary inside a new TAP. What I do to test is create a SNA using makesna (https://sourceforge.net/projects/zxspectrumutils/):

    makesna player.sna 33155 test.bin 33153

    Just as explained in the tester. (33155 is #8181, which is I believe, the value of the ORG in the tester). (note: 18710 bytes is quite a lot, your music is veeeery long, right ?)

    Then simply drag’n’drop the SNA in UnrealSpeccy for example, it will play music!

    I can do more research on TAP if you want, but this should be exactly the same. If the link above, I see a “bin2tap” software. It must do exactly what you need!

    #30123
    garvalf
    Participant

    thanks, I’ve just tried this then, with makesna I only get a short low sound for 1 second and a blank screen. With bin2tap, there is nothing, just the “Bytes: test” message.
    I suppose a basic loader is needed, but I don’t know how to make it. With vortex tracker it can generate a .tap file with the music and the player, using those commands:

    
    zmakebas -a 10 -o loader.tap loader.bas
    pasmo --tap --name SCREEN LoadingScreen.asm LOADING_SCREEN.TAP 
    cat loader.tap LOADING_SCREEN.TAP   > test.tap

    zmakebas create a loader in tap format from a basic loader such as:

    
    010 BORDER NOT PI: PAPER NOT PI : INK NOT PI: CLS
    020 clear val "32767"
    
    026 LOAD ""CODE: LOAD ""CODE
    027 LOAD "" SCREEN$
    
    220 INK 7
    
    300 LET l=USR 49152
    310 PAUSE 1: LET l=USR 49157
    320 IF INKEY$ ="" THEN GO TO 310
    330 LET l=USR 49160 

    and pasmo is for adding a picture. It can also generate a tap file from ASM.
    Then I just need to concatenate all the tap files to get the final result.

    #30124
    garvalf
    Participant

    and I’ve used the default music adress at #4000 during exportation

    #30125
    Targhan
    Keymaster

    I’ve just tested, it works perfectly.

    Please follow these exact instructions (use the default package files):
    rasm PlayerAkgTester_SPECTRUM.asm -o test
    –> This generates test.bin

    makesna player.sna 33155 test.bin 33153
    –> This generates player.sna

    Drag’n’drop player.sna into UnrealSpeccy.

    It works. Then, switch with your own song in the tester. I suspect you made a mistake generating it. Did you well export into AKG source? Also, your output seems quite big (18k). The format is quite optimized, so such big file is unlikely (unless your song is very very long).

    Also, I don’t know Spectrum well enough, but since your file is >16k, does it matter if the player+music goes beyond #c000? If it some kind of reserved area or something? Just a wild guess.

    #30126
    garvalf
    Participant

    Thank you Targhan, I made it work! The problem was simple, during the export I didn’t unchecked the “encode to address”, and the resulting .asm file was not correct, it added a ” org 16384″ which prevented to get sound and generated a bigger binary.

    You can hear my WIP there: http://dl.free.fr/mon.pl?i=26687313&h=5RZzE9Vv

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.