WauloK
Wacky Amoebatron
Blue Bilby MPAGD dev
Posts: 41
|
Post by WauloK on May 26, 2020 23:39:50 GMT
I tried your BLOCK command above and get this:
agdcode.asm(5960): error: Negative BLOCK?
|
|
|
Post by Packobilly on Oct 7, 2020 4:39:25 GMT
Another example. This is the code which calls the music player for the first and third levels of Seto Taisho. 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
Hi all! I'm using this Alessandro’s routine to include a .pt3 music, previously exported with its .tap loader. It is currently heard within the game, but it sounds slightly dirty... I am exporting it in bank 60000 and the call routine in 59500. What am I doing wrong? Thanks and cheers!
|
|
|
Post by thelonemagpie on Oct 10, 2020 18:09:27 GMT
I'd really love a "How to" video explaining, in detail, how to add a tune to the game menu, including how to write Assembly for all us ASM n00bs. I feel like adding the tune to my game is a rather complicated thing to ask people to do for me, and I don't want to burden anyone with it.
|
|
|
Post by Packobilly on Oct 11, 2020 7:32:02 GMT
Another example. This is the code which calls the music player for the first and third levels of Seto Taisho. 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
Hi all! I'm using this Alessandro’s routine to include a .pt3 music, previously exported with its .tap loader. It is currently heard within the game, but it sounds slightly dirty... I am exporting it in bank 60000 and the call routine in 59500. What am I doing wrong? Thanks and cheers! Further of this, when i lose all my lives, the game crashes, instead of reverting to Basic. Need some help, please!! 😰
|
|
|
Post by alessandro on Oct 19, 2020 16:52:52 GMT
Hi Packobilly,
you should adapt the values at the start so that they reflect your use of memory.
First of all if you assemble the routine at 59500, you must modify the ORG directive as:
ORG 59500
Then the PLAYER address should be the same of the player block of your exported music. If you export it from Vortex Tracker II at 60000, then you must change the EQU value to:
PLAYER EQU 60000
Remember to insert the address of the player calling code (ORG) as ASM commands in the Game Initalisation event, e.g. in this case (ORG 59500) it would be:
ASM 205 (CALL instruction in the Spectrum implementation of Z80 Assembly) ASM 108 (i.e. 59500 - 256*232 = 59500 - 59392 = 108) ASM 232 (i.e. 59500/256, without the decimal part)
In addition to that, you must take care not to place your starter-player-music blocks too near the end of the AGD game block. Also take care not to write anything at address 64512 because the interrupt table for the AY chip will be written there.
Finally, at the time there was a small imprecision in the routine, but it seems not to have been affecting anything. The im2_disable part is located at ORG+32 address, not ORG+33. Therefore the address to call in order to stop the music from playing is 59532. In AGD terms it would be:
ASM 205 ASM 140 (108+32) ASM 232
Note: With MPAGD you can directly insert a CALL command to an external routine without splitting the address in two. CALL 59500 and CALL 59532 should do the job.
|
|
|
Post by Packobilly on Oct 24, 2020 8:16:30 GMT
Hi Alessandro. In the example of the code that I have exposed are the values as you wrote them in the beginning. In fact, the memory values of the player and the asm routine I specify them correctly. The game crashed at the end of lives because I did not put the call (+32) in the Kill event. Therefore, when the lives ended, the game was reset. Thank you very much for the clarification. In another vein, I can tell you that the music plays within the game without problems and everything is fine; what happens is that it does not sound crisp and clear as in Vortex II, but it is like "beeped", and no matter how much I compile in other directions it does not fix. In fact I have verified that the memory addresses are not stepped on (the one at the end of the game with the music, as well as those of the music with 64512). The truth is that I am a bit desperate, although I am hopeful that I can solve it. (At least I hope so ... Thank you for your involvement and for your support. It is always flattering to have people who are experts in these matters helping you. Greetings!
|
|