swapd0 Posted September 29, 2019 Share Posted September 29, 2019 I've just updated to the latest version and it works, I'm using u235se-rel.bin file instead of the elf. By the way, I've realised that when I run the game in NTSC the samples sounds a bit faster, I think that they sound sound the same. This is my init code. _init_sound_system:: lea u235se,a0 move.w CONFIG,d0 btst #VIDTYPE,d0 bne.s .ntsc jsr 4(a0) ; pal bra.s .l0 .ntsc: jsr 2(a0) ; ntsc .l0: ; clear sample bank lea samples_bank,a0 lea end_samples_bank,a1 move.l a0,U235SE_ptr_sample_bank .loop: clr (a0)+ cmp.l a0,a1 bne.s .loop ; enable DSP move.w #$100,JOYSTICK ; enable sound move.w 4+2(sp),U235SE_playbackmode move.l #U235SE_24KHZ,U235SE_playback_rate move.l #U235SE_24KHZ_PERIOD,U235SE_playback_period move.l #D_RAM,D_PC ; Set up D_PC (DSP's program counter) move.l #RISCGO,D_CTRL ; Run DSP rts Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted September 29, 2019 Author Share Posted September 29, 2019 You have said that they sound faster but also that they sound the same? Sorry I am a bit confused by this. Do you mean they are of a higher pitch or the module plays faster? There should be no difference in pitch (assuming your code to detect PAL/NTSC is correct, and even then really slight). There is possibly a slight bugette in the modinit routine that only sets up the mod interval to 50Hz for one system type (PAL/NTSC do have slightly different physical clocks, but the difference should be very very slight), of course if you are just using a 50/60Hz switch on a jag this could cause timing errors in the modplayer as the system clock speed won't be changed, so things may sounds a little off, both Pitch and timing. Quote Link to comment Share on other sites More sharing options...
swapd0 Posted September 29, 2019 Share Posted September 29, 2019 (edited) For now I haven't tested with a module, but in NTSC when I play a sample it sounds sightly faster. Maybe it's because I've a 50/60Hz switch. Edited September 29, 2019 by swapd0 Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted September 29, 2019 Author Share Posted September 29, 2019 From that I guess you mean "Higher pitch" rather than "faster"? Try hard coding your code to init the jag in PAL mode instead (I guess it's an actual PAL jag you have set to 60Hz?). Internally a PAL jag will look like a PAL jag even if you flip the refresh to 60Hz I'd imagine. So your code will always detect it as a PAL jag. (I've not tested this so could be wrong, but I imagine that is what's happening) Quote Link to comment Share on other sites More sharing options...
swapd0 Posted September 29, 2019 Share Posted September 29, 2019 It sounds faster and with a higher pitch, but for me it's easier to spot a faster song (less time between each beat) than a higher pitch. Later I'll write a test program. Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted September 29, 2019 Author Share Posted September 29, 2019 If the sample playback rate is higher, the pitch will also sound higher and the sample will end sooner than with a lower playback rate. Quote Link to comment Share on other sites More sharing options...
swapd0 Posted December 2, 2019 Share Posted December 2, 2019 Where's the address of U235SE_modinitpos? I'm using the u235se-rel.inc file and it's not defined there, I'm trying to play a single mod file with different musics in it with no luck. Quote Link to comment Share on other sites More sharing options...
swapd0 Posted December 2, 2019 Share Posted December 2, 2019 A couple of questions: 1- It's safe to call several times to stop module or call it without a module playing? 2- After a stop module call, do I have to wait something before a module init call? Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted December 2, 2019 Author Share Posted December 2, 2019 Which version are you using? The latest version made some changes to how things are setup. There is included demo code for both the relocatable binary blob and also the static object versions. These both init a mod and start it. 1) Yes, stopping a module call just sets a flag to say to stop the module. 2) usually the 68K won't be fast enough to have an issue to init a new mod right after a stop. I have never added any waits in myself, but I have also never tried stopping and then starting a new mod immediately afterwards. If you are not already I would recommend grabbing the latest version of the engine and using that. There were various improvements in playback quality, performance and also stopping and starting modules. HTH Quote Link to comment Share on other sites More sharing options...
swapd0 Posted December 2, 2019 Share Posted December 2, 2019 (edited) Sorry I forgot to say that I'm using 0.24 version with u235se-rel.bin file, not the elf version. I've a label called u235se, and the binary file there. I call u235se to init the mod, to init the sound engine I call u235se+2 for NTSC and u235se+4 for PAL systems but I've tried to call u235se+6 to init a mod file with a starting position(in d0 register) but it doesn't work. Edited December 2, 2019 by swapd0 Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted December 2, 2019 Author Share Posted December 2, 2019 What happens? Quote Link to comment Share on other sites More sharing options...
swapd0 Posted December 2, 2019 Share Posted December 2, 2019 (edited) No music and no fx. It looks that I hang the sound engine, but the game runs. If I call to u235se I got the music, but I can't play the others musics. Maybe I can try to use the U235SE_modregdump values. Edited December 2, 2019 by swapd0 Quote Link to comment Share on other sites More sharing options...
swapd0 Posted December 2, 2019 Share Posted December 2, 2019 4 minutes ago, swapd0 said: Maybe I can try to use the U235SE_modregdump values. No, it doesn't work XD Quote Link to comment Share on other sites More sharing options...
swapd0 Posted December 2, 2019 Share Posted December 2, 2019 _init_module:: moveq #0,d0 lea U235SE_modregdump,a0 move.l d0,(a0)+ move.l d0,(a0)+ move.l d0,(a0)+ move.l d0,(a0)+ move.l 4(sp),a0 move.w 4+4+2(sp),d0 jsr u235se rts This is my init_module(void *module, int16_t position) routine, it always plays the module from the first position, if I call u235se+6 I've no sound and no fx. Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted December 2, 2019 Author Share Posted December 2, 2019 Just now, swapd0 said: No music and no fx. It looks that I hang the sound engine, but the game runs. If you don't init the mod does the FX work as expected? Just looked at the source and u235se+6 isn't correct for modinit. modinit would be u235se+0 that however will always start with position 0, you need to get to U235SE_modinitpos, which unfortunately I haven't setup a branch to! doh! Dirty hack for now if you modify the bra.s at the head of the binary blob to jump 1 word further it will go to modinitpos instead. The code in the bin is: start: moveq #0,d0 ; If modinit has been called the default song position will be 0 modinitpos:: U235SE_modinitpos:: movem.l d0-d7/a0-a6, -(sp) ; If we were called by modinitpos then d0 should hold the desired position to start playing the song from and.l #$ff,d0 start is the label where the modinit call normally jumps to, if you modify that bra.s to jump to the movem.l after it, it will be hitting modinitpos and d0 will behave as you want. I'll add this bug to the todo list for my next release. Sorry for the cockup 1 Quote Link to comment Share on other sites More sharing options...
swapd0 Posted December 2, 2019 Share Posted December 2, 2019 I've done the dirty hack and it works!!!1! Thanks! 2 Quote Link to comment Share on other sites More sharing options...
swapd0 Posted March 17, 2020 Share Posted March 17, 2020 (edited) I think that the module player has some bugs, If I remove the play module call it works, but with the module player it hangs but not always on the same place, it's weird, and I've run out of ideas to find the bug. Later I'll try with an older version. False alarm... now it also hangs without the music, f*ck! Edited March 17, 2020 by swapd0 Quote Link to comment Share on other sites More sharing options...
swapd0 Posted June 25, 2020 Share Posted June 25, 2020 There's a typo in the docs. The value should be 10010010 = $92, isn't it? Voice Status Register (U235SE_voice_status) Represents the current sample processing status of each voice. If a voice is currently processing a sample (even if that sample is silence), then its corresponding bit will be set. If the voice is idle and has no sample to play then the bit will be clear. For example, if there were samples playing on voices 1,4 and 7 only, then the voice status register would be $4a (binary 01001010 – remember voices start at 0) 1 Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted June 26, 2020 Author Share Posted June 26, 2020 19 hours ago, swapd0 said: There's a typo in the docs. The value should be 10010010 = $92, isn't it? Voice Status Register (U235SE_voice_status) Represents the current sample processing status of each voice. If a voice is currently processing a sample (even if that sample is silence), then its corresponding bit will be set. If the voice is idle and has no sample to play then the bit will be clear. For example, if there were samples playing on voices 1,4 and 7 only, then the voice status register would be $4a (binary 01001010 – remember voices start at 0) OOPS! Looks like I had a brain fart whilst I was writing that part :D Cheers for the heads up (fixed). Sorry not responding too quickly, very busy with work of late. RE Crashes, the mod player does have bugs, but these are mostly around effect playback and not lockups. Make sure the mod/samples are correctly aligned in your game, if the alignment is word and not long it can cause issues. Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted June 28, 2020 Author Share Posted June 28, 2020 (edited) On 3/17/2020 at 5:08 PM, swapd0 said: I think that the module player has some bugs, If I remove the play module call it works, but with the module player it hangs but not always on the same place, it's weird, and I've run out of ideas to find the bug. Later I'll try with an older version. False alarm... now it also hangs without the music, f*ck! Had a look in my backlog and there is an active bug in 0.24 that if there isn't a mod playing, the pad read/RNG doesn't run! This may be related to the "hang" you are experiencing. If you don't want to have music, a hacky work around would be to have a mod with a single blank pattern, no instruments and set this playing. Also if you start and immediately stop playing a module, this works too. (thanks for update CJ) I clearly need to update my testing to include situations where there is no music. I've not looked into this bug further, but it will be fixed in the next release (whenever that happens ) Edited June 28, 2020 by LinkoVitch Adding additional info 3 Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted July 20, 2020 Author Share Posted July 20, 2020 On 3/17/2020 at 5:08 PM, swapd0 said: I think that the module player has some bugs, If I remove the play module call it works, but with the module player it hangs but not always on the same place, it's weird, and I've run out of ideas to find the bug. Later I'll try with an older version. False alarm... now it also hangs without the music, f*ck! Quick update for you and anyone else hitting this bug. There is a patched version available now: https://www.u-235.co.uk/se/files/u235se-2020-07-20.zip This resolves the need to have a mod to use the pads/RNG 2 Quote Link to comment Share on other sites More sharing options...
matmook Posted September 26, 2020 Share Posted September 26, 2020 Yessss! Thanks for this patch LinkoVitch! ? 1 Quote Link to comment Share on other sites More sharing options...
matmook Posted November 28, 2020 Share Posted November 28, 2020 Hi LinkoVitch! I've got a strange behavior and I don't know why... maybe it just me... I can setup and play a module using those lines: jsr U235SE_initNTSC ; (or U235SE_initPAL) ; play some tunes lea title_mod,a0 jsr U235SE_modinit move.l #U235SE_PLAYSTEREO, U235SE_playmod It works great but I can't stop the replay with this line: move.l #U235SE_NOMOD,U235SE_playmod Is there something obvious I don't see? Thanks! Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted November 29, 2020 Share Posted November 29, 2020 You also have to send the silence channel commands: #$3, $13, $23, $33 Quote Link to comment Share on other sites More sharing options...
matmook Posted November 29, 2020 Share Posted November 29, 2020 Okay, I have found the bug, he's on my chair! ...building a new binary and testing another old one... ? Thansk CJ for the volume commands! 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.