129

(16 replies, posted in Sega)

Here is one that I've made for a project, it is very simple, <150 bytes of code. It plays only one channel of sound, allowing to place sample data without caring about bank boundaries (however, you can only put samples in first 512K of ROM). It always works at 16000hz. I've used it together with FM part on M68K side.

Check sound.c for example how to load and use - you need to stop Z80 before loading the driver, reset it after loading, and to play new sample you need to halt Z80, put address and size of a sample into certain place in Z80 RAM (0x1f00..0x1f06 in Z80 address space), and run Z80.

130

(16 replies, posted in Sega)

I don't know about BEX internals much, as far as I remember, the reason why BEX TFD player wasn't worked on the hardware is wrong memory access alignment BEX produced for POKE, you had to replace some pokes with assembly code that does the same but with proper alignment.

Regarding WAV player, the one there uses all the M68K time to play a sample, i.e. while sample plays, it can't do anything else. To make FM+samples without stopping main program, you need to move sample player to Z80 side, i.e. write or use a driver that works on Z80 and do the same. Such a driver in simplest form is very simple, there are many such drivers around.

Regarding SMPS, I doubt it is possible to convert music from VGM MM, because it is superior feature-wise. I recall someone worked on a SMPS tracker, i.e. a tracker that is specially designed to make music for SMPS.

131

(16 replies, posted in Sega)

This may work. i don't know why it or WAV player hangs, it could be just a bug in your or BEX code (BEX had a lot of bugs in the past).

However, FM music+effects is not that easy. In early games you can see that few FM channels were used for music only, and few other channels for effects only. That's because methods of mixing few sounds into one channel that works well for simple, PSG-like synths, won't work well with FM - you need to reload a lot of parameters, and you don't have solid control on envelopes. Typical situation where you will have problem: your music channel plays something with long slow attack, then you played a short BOOM sound on this channel, and now you just can't restore previous sound.

If I would need to make FM music+effects, I'd probably go that way: first four FM channels for music, two other for sound effects. For these two channels algorithms and ADSR is always the same, infinite sustain, and sound effects player only changes TLs and MULT - in this case mixing methods that works for PSGs should work well, but effects have to be designed with a custom tool.

132

(16 replies, posted in Sega)

Genesis/Megadrive has two CPUs: Motorola 68000 (often called M68K, 68K means 68000 for short) and Zilog Z80 (often called Z80). Z80 is auxilary CPU that is added to provide backwards support with Sega Master System, in Genesis/MD games it often used to run sound code and free main CPU (68K) for other things.

With BasiEgaXorz, simplest way to make sound is to have FM only music (no PSG and samples) and samples for sound effects (single channel). To do this, you need to use TFD player code I've posted somewhere on BEX forums, which not uses Z80, and also use any Z80 -based sample player. To make them work together you need to mod TFD player a bit. You can also use PSG for sound effects, but this would require some new code.

I can provide help with sound code when you will have completed game (without music/sound).

133

(16 replies, posted in Sega)

Of course, just write a sample player or reuse an existing one.It is easy, if it just plays samples and nothing more. It is difficult to make a driver that plays FM and samples using just Z80. Easiest way is to play FM and PSG on M68K side and samples on Z80 side, stopping Z80 when you need to write 2612 registers.

134

(16 replies, posted in Sega)

TFD format does not support PSG or samples, and never will - it was designed for other purposes and now is obsolete. Currently there are no players to use music made in VGM MM in games.

135

(174 replies, posted in Sega)

I don't recommend to use DAC channel for tuned sounds, as sample playing speed is not guaranteed and not stable. You will have problems with it.

Original Gens and many of its mods use 16-bit color depth only, and if other color depth is selected, it switches to 16-bit on start and back to the original color depth at exit. You can't do anything with that.

137

(23 replies, posted in Nintendo Consoles)

It is not a problem to get info how to control the device. But it is a mechanical device after all, you can't design and debug code for it having no device itself and no emulation of the device (need to have both).

138

(23 replies, posted in Nintendo Consoles)

I'm not able to make ROB games because I don't have ROB, never seen it in RL, I don't have NES, I don't have a flash cart, I don't even have NTSC TV set, I can't afford myself to buy all this, and I live in country where it is still not easy to receive anything from foreign countries.

139

(174 replies, posted in Sega)

It was answered just above your post. That's how hardware works.

140

(23 replies, posted in Nintendo Consoles)

ui, thanks for translation, added to the manual.

141

(23 replies, posted in Nintendo Consoles)

I'm glad to finally present to you my new NES game.

Download the game (392K) or watch a video (spoilers alert, it shows solution for few levels!).

The game is a logic platformer. You control a hero and his alter ego. You have to switch between them to clear a level. It is a bit similar to Binary Land.

This game is a port, or maybe a remake, of recent ZX Spectrum game of the same name. The original version created by Denis Grachev from RetroSouls, you can see video of it here and get it here. NES version got new graphics, original music by Kulor (composed for the game), and some other changes.

142

(35 replies, posted in Sega)

Yes, there is no hardware-defined sample rate, it can be any up to 50+ kHz. You can expect it to be 8000-16000 in games, not necessarily a 'standart' one.

143

(174 replies, posted in Sega)

1. SMD has no HW sample playing capabilities. I'm just lazy to support these effects, as it will add a new layer of complexity, bugs, etc. Maybe in future versions.

2. PSG bottom limit is one semitone below in VGM MM compared to Mod2PSG2, and it is already off a bit.

3. Don't really understand what you mean and lazy to search and play the game. If you talking about periodic noise that can be used as notes, it is supported, explained in the docs (example).

144

(174 replies, posted in Sega)

There is some problem with keyboard code in the program, but it happens very rarely and unpredictable, so I can't catch it to figure out what is wrong. For me it sometimes happens after holding Enter to play a pattern, it suddenly starts to enter a note, and every next key enter that note.