|
Post by zynaps2017 on Jun 27, 2017 10:58:43 GMT
The basic loader i used: 10 CLEAR 30449 20 LOAD "" CODE 30 LOAD "" CODE 40 LOAD "" CODE 50 LOAD "" CODE 60 RANDOMIZE USR 32000
I tried with this basic loader, but it's the same... 10 CLEAR 30449 20 LOAD "" CODE 30 LOAD "" CODE 59100 40 LOAD "" CODE 59200 50 LOAD "" CODE 61358 60 RANDOMIZE USR 32000
|
|
|
Post by alessandro on Jun 27, 2017 17:07:56 GMT
Hola, with that program your game will only run once. It should be modified as follows:
10 CLEAR 30449 20 FOR N=1 TO 4: LOAD "" CODE: NEXT N 30 RANDOMIZE USR 32000 40 PAUSE 50: GO TO 30 The problem is another: your game does not return to BASIC after it ends. You should check your Lost game and Completed game events.
|
|
|
Post by zynaps2017 on Jun 27, 2017 17:19:35 GMT
Gratias, Alessandro. Es lo mayor! First,i try using your basic loader. The game restarted well but without passing to the lost game screen. The problem was not the Lost game routine. The problem (stupid me) was i have two asm instructions (one in Game Initialization; one in Complete Game). I deleted the last one and the game works fine now. (i'm gonna adjust the game because this is my 3rd game. First, i have to lauch the 2nd game...) Attachments:xgame.tap (30.71 KB)
|
|
|
Post by picachu on Jul 8, 2018 16:35:38 GMT
Good family Well I tried your Alessandro code, and the truth is that I got the music to sound when the game starts, but, I have tried to insert a sound effect by loading the tap, and calling its memory address with asm. And the truth is that it works, but not quite perfect. Since when the sound effect sounds, the game stops for a second, and then continues. How can I improve this So that the effects of sounds loaded by tap go fast and fluid without cuts in the speed of the game? Greetings to all and many thanks for everything, of heart.
|
|
|
Post by picachu on Jul 8, 2018 16:40:25 GMT
Good zynaps, I've seen that in your game, both the background music and the sound effects sound. I have managed to get the background music to sound the wonderful lines written by Alessandro, but by loading the sound effects by tap. and call them with asm, these sound at the same time as the background music, but the game stops for a second, and then continues, for each time the effect sounds. How can i fix this??? Greetings and many thanks. Gratias, Alessandro. Es lo mayor! First,i try using your basic loader. The game restarted well but without passing to the lost game screen. The problem was not the Lost game routine. The problem (stupid me) was i have two asm instructions (one in Game Initialization; one in Complete Game). I deleted the last one and the game works fine now. (i'm gonna adjust the game because this is my 3rd game. First, i have to lauch the 2nd game...)
|
|
|
Post by lukebord1 on Jul 9, 2018 6:22:23 GMT
Since when the sound effect sounds, the game stops for a second, and then continues Beeper sound effects work like this, it's a task which needs to complete its cycle. A trick could be to use short effects, in order to make the stop imperceptible. Professional games which use beeper background music (like Jet Set Willy) have a particular sound engine to include "micro" beeper effects composing the music - AGD cannot get anywhere! Finally, you can choose the AY sound effects: the AY chip doesn't affect the main game cycle, but take in mind that it'll work only on 128K ZX Spectrum machines. Personally, I never use the AY, because I'm a 16/48K fan.
|
|
|
Post by alessandro on Jul 9, 2018 10:43:50 GMT
Picachu, it is possible to include non-AY custom sound effects in your games through the ASM 205 etc. commands. I did that in Lost In My Spectrum and Apulija-13.
However, as lukebord pointed out, you must care to avoid that they interfere with the game's code execution cycle. To do this you must ensure that:
1) the effects are reasonably short (hear those employed in the games I mentioned for examples); 2) the routines for the effects must be placed in non-contended memory, i.e. from address 32768 on, and since AGD game code usually starts around address 30000, this means you must store them after your game code block. Refer to the "Unused" address shown in the Miscellaneous section - this marks the beginning of the memory area you can use to store your custom effects. Just remember to avoid the last 768 bytes from 64768 to 65535 because they are used as a dummy collision map area to distinguish between different types of blocks: if you write code there, the game will crash.
|
|
|
Post by picachu on Jul 9, 2018 16:26:00 GMT
Thank you very much Alessandro. Everything you have told me I have considered before, it is still true that the sound is not very short. I'm going to try it with a shorter sound. Thank you again, I am very grateful for the advice
|
|
|
Post by picachu on Jul 9, 2018 19:27:24 GMT
Yeahhh !!!! Now if that works perfect !!!! It was just that, that I was using a memory address that created problems with the system and others. And I used a shorter sound. At last!!! It has been hard, but I have succeeded, thanks to your help and especially to Alessandro, who is a teacher and has hit the nail on the head. Well, I've already tried practically everything, or at least the most important concepts. I think I already feel quite ready to start my first game of this beloved computer that helped the computer grow and that we owe so much. Thank you, thank you very much, I know that I have become heavy, but it was the desire that I had to do something decent. Many thanks!!!!!
|
|
|
Post by picachu on Jul 31, 2018 22:34:33 GMT
Good family, again I'm around. I have correctly added music to the game following your instructions. But my next question is. How can I add more music? I use the same vtplayer ?? I have to create another call for the new song ?? And if I do not want it to be in Loop mode, but finish when finished? Well I hope you help me with your advice. Greetings and thanks!!!
|
|
WauloK
Wacky Amoebatron
Blue Bilby MPAGD dev
Posts: 41
|
Post by WauloK on May 17, 2020 1:46:48 GMT
Been trying to get this to work with MPAGD. Not sure if it's possible. Kees gave me a file user.asm to allow extra USER x commands.
I added this to the bottom of it:
; ========== Vortex player PLAYER EQU 52055 ; music player address (as exported from VT2)
ORG 51968 ; address of player calling code (must be inserted as ASM commands in the Game Initalisation event)
im2_enable: ; initializes interrupts di call PLAYER ; recalls music player ld hl,64512 ; creates interrupt table (256 bytes) at the specified address; must not exceed 64768 (AGD sprite buffer) ld a,h ld i,a im 2 dec a ld (hl),a inc l jr nz,$-2 inc h ld (hl),a ld l,a ; presets music playback ld h,a ld de,im2_proc ; loads execution part (im2_proc) ld (hl),195 inc l ld (hl),e inc l ld (hl),d ei ret
im2_disable: ; (ORG+33) disables music - point here in the Lost Game and Completed Game events di call PLAYER+8 ; AY chip is turned off ld a,63 ld i,a im 1 ei ret
im2_proc: ; start of interrupt routines di push af ; stores registers push hl push bc push de push ix push iy exx ex af,af' push af push hl push bc push de call PLAYER+5 ; music playback ld hl,23672 inc (hl) ; keyboard input is read pop de ; restores registers pop bc pop hl pop af ex af,af' exx pop iy pop ix pop de pop bc pop hl pop af ei reti INCHOB "Game_music.$c" I exported the player+music from Vortex tracker at 52055 as in the above example. I set up a music USER x command:
chk6 cp 6 jr nz,chk7 call im2_enable ret
In MPAGD I have USER 6
where I want the music to start playing. I get no audio at all but it compiles fine. I don't know how to find the length of my code with sjasm to see if this is overwritten by MPAGD code.
|
|
|
Post by Jonathan Cauldwell on May 17, 2020 15:01:25 GMT
Unfortunately the assembler doesn't pad out binaries when you use ORG. Try replacing ORG 51968 with BLOCK 51968-$,0
|
|
WauloK
Wacky Amoebatron
Blue Bilby MPAGD dev
Posts: 41
|
Post by WauloK on May 23, 2020 3:57:23 GMT
OK so with some experimenting I can get music from Vortex player to play if I just have a closed loop. This does mean my game does not play but the music is importing and playing correctly. If I bust out of the loop and RET back to MPAGD code the music is instead hissing static noise. I'm wondering if the Vortex player needs a register or two preserved between calls. At least I can have MPAGD game plus Vortex music compiled together successfully. Just getting it to play properly is my next goal.
|
|
|
Post by Jonathan Cauldwell on May 23, 2020 12:03:10 GMT
Looking at the interrupt code it looks like it has been written for AGD and is clashing with RAM that MPAGD uses. The screen address lookup table is located at 64256 and the particle buffer is located at 63926. Therefore the interrupt table needs to be at 63488, not 64512.
Incidentally, if you are playing AY music in a closed loop and want to stop it hissing when breaking out you usually just call the initialisation routine again
|
|
WauloK
Wacky Amoebatron
Blue Bilby MPAGD dev
Posts: 41
|
Post by WauloK on May 23, 2020 12:53:18 GMT
The hissing was fixed by moving the Music Play routine into the vsync code of the EngineZX.asm file.
I tried calling the initialisation code at the start of every level and that made it worse.
|
|