New 32x game in development!

Importante releases or news for the communauty

Moderator: KanedaFr

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: New 32x game in development!

Post by Chilly Willy » Thu May 11, 2023 8:35 pm

If the release flags have -O1 for hardware files, that's probably what you want for real hardware. Not sure why you'd use something different for debug... :lol:

As to noise in the sound, that could be due to many issues:

Filling/playing the wrong buffer. If you look at my code, I tend to fill the first buffer with silence, then call the dma done callback function to simulate the dma being done on the previous buffer. That will start the callback function playing the filled buffer, then calling the sound update callback to fill the next buffer. If you have the wrong buffers being played vs filled, you're racing the sound by writing into the buffer that is being played rather than the one PREVIOUSLY filled and ready to play.

Filling too much/little of the buffer, or playing too much/little of the buffer. Either case winds up with noise due to missing samples.

Mixing samples incorrectly. Many different errors could be here. Maybe mixing too many samples... or too few... or looping incorrectly... or adding the sample to an old buffer without clearing it first... or mixing from the wrong place... or mixing in the wrong format...

matthewnimmo
Very interested
Posts: 87
Joined: Thu Jan 07, 2021 8:04 pm

Re: New 32x game in development!

Post by matthewnimmo » Fri May 12, 2023 3:21 am

Chilly Willy wrote:
Thu May 11, 2023 8:35 pm
If the release flags have -O1 for hardware files, that's probably what you want for real hardware. Not sure why you'd use something different for debug... :lol:

As to noise in the sound, that could be due to many issues:

Filling/playing the wrong buffer. If you look at my code, I tend to fill the first buffer with silence, then call the dma done callback function to simulate the dma being done on the previous buffer. That will start the callback function playing the filled buffer, then calling the sound update callback to fill the next buffer. If you have the wrong buffers being played vs filled, you're racing the sound by writing into the buffer that is being played rather than the one PREVIOUSLY filled and ready to play.

Filling too much/little of the buffer, or playing too much/little of the buffer. Either case winds up with noise due to missing samples.

Mixing samples incorrectly. Many different errors could be here. Maybe mixing too many samples... or too few... or looping incorrectly... or adding the sample to an old buffer without clearing it first... or mixing from the wrong place... or mixing in the wrong format...
Hey chilly! Thanks for the reply! I'm eyeballs deep trouble shooting this SFX issue. I sent you a private message with a link to the repo. If you have a moment (but zero pressure) i'd greatly appreciate more eyes on what i might be doing wrong here. Vic started looking at it as well. From the surface, it looks like the code seems fine but it maybe within the function S_StartSoundReal within marssound.c. Within there i'm not using any of the WAD functionality (due to my ignorance with it tbh) and simply assigning md_data to my wave files that are from the cart. I'm using a simple switch statement to determine which one I assign. We suspect that it "could" be there due to when Vic took one of my sample wave files and tried it in the D32xr code....the wave file played just fine (in Fusion...he hadn't tried realhardware, but from the sound of the wave file he suspected that it would).

Here's the crazy thing, as stated earlier. My waves work just fine within Fusion 3.64 (c) that i'm using currently. Well, i shouldn't say (just fine) if you listen closely there is a difference in the sound of them being played in the demo game vs just playing them on say windows media player. So, perhaps there's still something going on even with the emulator playing of the sound but somehow its just enough to play something?

As per Vic's request for me to test a certain area in the code to determine if my wave file is even being identified properly within the S_StartSoundReal function, I can testify it does through some print statements I put in that function (all done locally not checked into the repo).

Lastly, Vic mentioned that perhaps i should consider using WAD to solve this, going back to my ignorance, i thought WAD was only for DOOM and even if I knew anything about WAD file system I couldn't use it do to copyright (but Vic cleared that up with me saying that it is something i can use). So perhaps thats the answer but two issues with that i see:

1) I don't know where to start with WAD. I'm guessing there is some .c files that I can use that's part of D32xr? But then how do i compress my .wav files into a WAD format? And then how do i point my code to read from that? So many questions there.

2) The fact that md_data assignment to my wave file gets me through the S_StartSoundReal properly identified, makes me wonder if that shouldn't work and that my problem is somewhere else. perhaps like what you said earlier chilly, perhaps its "how/when" i'm calling the S_StartSound(NULL, sound); function throught my game?

EDIT: So this is crazy. Works one way on the emulator and another on realhardware according to my display messages
when ran in Fusion it can identify that it's a wave file and all its properties just fine and lands right in the PCM if statement of the S_StartSoundReal function. but when ran on real hardware it never passes the if (length == 0x52494646) { // RIFF

Any ideas?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: New 32x game in development!

Post by Chilly Willy » Fri May 12, 2023 9:14 pm

The ZDoom wiki is great for a lot of different info on Doom files and such. Here's their page on the WAD format:
https://zdoom.org/wiki/WAD

It's a really straightforward method of grouping data for a game and finding the data in the game. Knowing the wad format, it should be trivial to make your own code reading lumps from any wad file, but you could always look at the Doom wad functions to see how ID does it.

As for the sound, when things work on an emulator, but not on real hardware, the main culprit tends to be the sh2 cache. D32XR flushes parts of the cache for various routines depending on which processor will be using the data. I'll take a look at the sound code when I get a chance this weekend.

matthewnimmo
Very interested
Posts: 87
Joined: Thu Jan 07, 2021 8:04 pm

Re: New 32x game in development!

Post by matthewnimmo » Sat May 13, 2023 4:00 am

Chilly Willy wrote:
Fri May 12, 2023 9:14 pm
The ZDoom wiki is great for a lot of different info on Doom files and such. Here's their page on the WAD format:
https://zdoom.org/wiki/WAD

It's a really straightforward method of grouping data for a game and finding the data in the game. Knowing the wad format, it should be trivial to make your own code reading lumps from any wad file, but you could always look at the Doom wad functions to see how ID does it.

As for the sound, when things work on an emulator, but not on real hardware, the main culprit tends to be the sh2 cache. D32XR flushes parts of the cache for various routines depending on which processor will be using the data. I'll take a look at the sound code when I get a chance this weekend.
Hey chilly! So, the urgency to solve the SFX issue is over :) Vic was able to show me what was wrong and taught me the dark arts of using .align within my assembly files. I wasn't using it and apparently it needed to be used on each item i was bringing into the game instead of just at the top of the file.

So now i'm back to using the raw .wav files; However, I still will look into WAD in general as i wonder if that may help me down the road. Anyhow, I'm going through my code now that I have the the repo to fix my warnings (as Vic would put it. "I don't want to have to look through this dumpster fire in order to fix a bug" lol). Yes, i have been ignoring my warnings; so I think its time to fix them. There's also some doom specific stuff i'm wanting to remove within marssound.c file. When i have both of those items done then I believe I'll publicly announce this repo for people to enjoy!

I'll still keep updating it and I'm planning on giving you and vic contributor rights if you don't mind :) That way, if you get bored and want to expand or fix something dumb i did; you guys can freely do so haha.

AT the same time, i'm building out my game that I'll be demoing in June. So even when i publish the game kit repo I'll still be posting up here for quite a while.

Thanks for everything, and let me know if you're ok inviting you as a contributor (no pressure to do anything, i just trust you two the most with the code)

matthewnimmo
Very interested
Posts: 87
Joined: Thu Jan 07, 2021 8:04 pm

Re: New 32x game in development!

Post by matthewnimmo » Mon Jun 05, 2023 10:12 pm

NEWS:

So, this week i'll be sitting down for a twitch interview to go over my game demo. It's light in the demo for sure, but should show off a lot that i've been working on lately. I've added a ton more to the game lately (keeping it a surprise, hence why less postings here). June 9th 3-4pm EDT is when it should go live on Rewind! https://www.twitch.tv/awsgametech/

Hopefully I'll catch some of you there:) Enjoy

Vic
Interested
Posts: 27
Joined: Wed Nov 03, 2021 6:01 pm

Re: New 32x game in development!

Post by Vic » Sun Jun 11, 2023 6:50 pm

Some nice little discussion there! And thanks for the shout-out :)

matthewnimmo
Very interested
Posts: 87
Joined: Thu Jan 07, 2021 8:04 pm

Re: New 32x game in development!

Post by matthewnimmo » Thu Jul 20, 2023 6:06 pm

Hello everyone! Im still here. Just been busy with work but this is still active!:)

matthewnimmo
Very interested
Posts: 87
Joined: Thu Jan 07, 2021 8:04 pm

Re: New 32x game in development!

Post by matthewnimmo » Fri Sep 08, 2023 12:43 pm

Hello everyone! Just wanted to let everyone know this is still in the works. Just a slow go with life being a little bit busy this season. Some small progress but nothing substantial yet to really show off

matthewnimmo
Very interested
Posts: 87
Joined: Thu Jan 07, 2021 8:04 pm

Re: New 32x game in development!

Post by matthewnimmo » Thu Oct 26, 2023 3:43 pm

Still in the works! Slow go, but still happening. Wanted to let people know:)

AmateurSegaDev
Interested
Posts: 24
Joined: Sun Feb 27, 2022 3:27 am

Re: New 32x game in development!

Post by AmateurSegaDev » Wed Nov 01, 2023 4:48 am

Just wanted to say, it's great to see you continually post. Life can get messy at times, but we all must go at our own pace (my own project is quite slow going as well). Anyway, looking forward to seeing more updates!

By the way, which episode of AWSGameTech Rewind were you in?

matthewnimmo
Very interested
Posts: 87
Joined: Thu Jan 07, 2021 8:04 pm

Re: New 32x game in development!

Post by matthewnimmo » Sat Nov 04, 2023 2:42 am

AmateurSegaDev wrote:
Wed Nov 01, 2023 4:48 am
Just wanted to say, it's great to see you continually post. Life can get messy at times, but we all must go at our own pace (my own project is quite slow going as well). Anyway, looking forward to seeing more updates!

By the way, which episode of AWSGameTech Rewind were you in?
Thanks for the kind words!:). Yes. Seems like shortly after this interview life outside of this development effort got busy, but thats ok. Like my other games, this too will get completed it just may take a few dry spells to get there;). Below is my interview link. Hope you enjoy it!

https://www.youtube.com/live/cKGN5wiLnn ... tAqZ_wbfbg

matthewnimmo
Very interested
Posts: 87
Joined: Thu Jan 07, 2021 8:04 pm

Re: New 32x game in development!

Post by matthewnimmo » Sat Jan 27, 2024 11:13 pm

Coming back online for more progress after the holidays and moving my home office around. Hope to have an update for everything soon:)!

Post Reply