lunoka
Gun-headed
Diving into retrodev
Posts: 55
Homebrew skills: art, music
Fave PCE Shooter: Burning angels
Fave PCE Platformer: Ninja Spirit
Fave PCE Game Overall: Valis 3
Fave PCE RPG: Neutopia
|
Post by lunoka on Sept 23, 2022 12:32:27 GMT
Hello/
Since I'm not able to work with MML as an usable music format, I would like to give a try to the CD-ROM stuff. It seems to be a huge subject when starting with C & pce so I would like to go step by step. First things first, I try play a simple music track with a minimum code:
#include <huc.h>
main() { disp_off(); set_screen_size(SCR_SIZE_32x32); disp_on(); cd_playtrk(1,CDPLAY_ENDOFDISC,CDPLAY_REPEAT);
for(;;) { vsync(); } } Cue :
FILE "cursed_prison.wav" WAVE
TRACK 01 AUDIO
INDEX 01 00:00:00
FILE "cd_test.iso" BINARY
TRACK 02 MODE1/2048
PREGAP 00:03:00 Using this, I got this error :
PC Engine Assembler (v 3.25-978acaa, 2022-02-22)
pass 1
pass 2
#[1] cd_test.s
01:B73D call _cd_playtrk.3
Undefined destination!
# 1 error(s)
make: *** [cd_test.iso] Error 1
Plus I don't understand how the makefile should be written, I've modified the one from the AC sample this but it's probably wrong:
all: cd_test.iso
include ../Make_ex.inc
SRC = cd_test.c
CFLAGS ?= -fno-recursive -msmall
cd_test.iso: $(SRC) $(CC) $(CFLAGS) $(SRC) $(LIBS) echo padding ISO track to $200000 bytes dd if=/dev/zero of=cd_test.iso bs=`printf %d 0x200000` seek=1 count=0
clean: rm -f *.pce *.lst *.sym *.s *.iso
Any advice to get me on the right tracks? Thank you o/
|
|
|
Post by audreyhepburn on Sept 23, 2022 13:17:24 GMT
Probably not the help you're looking for (I haven't messed with any of the CD stuff myself) but it may be worth looking into the overlay huc example. It has cd functions in it and I was able to compile it using the cd_playtrk function.
|
|
lunoka
Gun-headed
Diving into retrodev
Posts: 55
Homebrew skills: art, music
Fave PCE Shooter: Burning angels
Fave PCE Platformer: Ninja Spirit
Fave PCE Game Overall: Valis 3
Fave PCE RPG: Neutopia
|
Post by lunoka on Sept 23, 2022 13:20:49 GMT
Any help is appreciated o/ my HuC was a little bit outdated and the overlay sample was missing, I'm going to update and have a look, thank you!
|
|
lunoka
Gun-headed
Diving into retrodev
Posts: 55
Homebrew skills: art, music
Fave PCE Shooter: Burning angels
Fave PCE Platformer: Ninja Spirit
Fave PCE Game Overall: Valis 3
Fave PCE RPG: Neutopia
|
Post by lunoka on Sept 23, 2022 13:49:51 GMT
Awesome, now I have a track playing. The makefile from the overlay sample seems to be far easier than whith the Arcade card one.
Basically, I can add all the *.bin files needed for all the overlays in the DATA variable and it will be embedded in the iso without specifying any address, is it correct?
|
|
|
Post by elmer on Sept 23, 2022 15:57:54 GMT
Any help is appreciated o/ my HuC was a little bit outdated and the overlay sample was missing, I'm going to update and have a look, thank you! Yeah, you were still using an older HuC with Uli's terribly-broken ACD example and code. That got fixed earlier this year, and data file loading should work now. If you look at the ACD example again, the Makefile is much simpler now. Basically, I can add all the *.bin files needed for all the overlays in the DATA variable and it will be embedded in the iso without specifying any address, is it correct? Yes, ISOlink just puts all of the files into the ISO track in the order that you list them, and then writes a directory of the locations into you HuC overlay(s) so that you can just load/use the files by their index number, and not their absolute location on the CD. If you've modified your ".cue" file to add some CD-Audio tracks to the image (as WAV files), then you should be good to go, and create CDs with up to 100 data files/overlays, and as many CD-Audio tracks as you like. Once you start using the "wav2vox" tool for conversion, you'll be able to start adding ADPCM sound-effects and jingles to your project (if HuC exposes the System Card's ADPCM calls).
|
|
lunoka
Gun-headed
Diving into retrodev
Posts: 55
Homebrew skills: art, music
Fave PCE Shooter: Burning angels
Fave PCE Platformer: Ninja Spirit
Fave PCE Game Overall: Valis 3
Fave PCE RPG: Neutopia
|
Post by lunoka on Sept 23, 2022 16:44:59 GMT
Thank you for the feedback elmer. You mean 100 data files & 100 ovl files or 100 files data & ovl ? I've read about a 50 ovl limitation in the old doc. I was thinking about the options to play sfx during the game. I assume the extra ADPCM is monophonic so you can't playback several sfx at the same time. I was thinking about a pcm driver to use pcm on the 6 channels but I've looked at Husic for that and the author answered me his driver wasn't made to be used alone from Husic ( plus his solution is plugged to an old HuC fork ). Another option would be to use PSG sfx since I've tested it with some code from Jycet and it works. MooZ provided a vgm player too with sfx management but I shall make some tests to see if it can be embedded in an overlay, and probably in each overlay if I want to use it all game long.
|
|
|
Post by elmer on Sept 23, 2022 19:30:01 GMT
I've read about a 50 ovl limitation in the old doc. HuC overlays are treated the same as any other file, so it's a combined number. It used to be 50 files, then I changed how it was stored, and now it uses the same amount of memory, but it allows for 99 files (not 100). I was thinking about the options to play sfx during the game. I assume the extra ADPCM is monophonic so you can't playback several sfx at the same time. Yes, there's just the one ADPCM channel. Normally that's not to big a problem, because playing multiple sound-effects at the same time ususally just results in a horrible mess that doesn't sound very good anyway. Using the PSG as well is definitely another option, but as you already know, it's not something with a lot of publicly-available support at this time.
|
|
|
Post by audreyhepburn on Sept 23, 2022 20:07:13 GMT
lunoka Is any of that code shareable? I'm writing my own PSG code and would love to see what someone else has.
|
|
lunoka
Gun-headed
Diving into retrodev
Posts: 55
Homebrew skills: art, music
Fave PCE Shooter: Burning angels
Fave PCE Platformer: Ninja Spirit
Fave PCE Game Overall: Valis 3
Fave PCE RPG: Neutopia
|
Post by lunoka on Sept 23, 2022 20:52:54 GMT
You can find something here ( just scroll down a little bit ), there's only few french in the comments : www.zeograd.com/creation_download.php?lang=en&page=9And for the VGM player with sfx ( you can design your sfx with Deflemask or Furnace ) : github.com/BlockoS/vgm_driverI was able to make a rom but pay attention to the bank. There is some few code to add in the main.c with a target to a free bank available. What I do is to compile without the sound engine first to let HuC dispatch all the banks, and then I add the vgm player to set a free bank available for the driver. A tool must be used to strip the vgm files. I don't think MooZ will go on with the dev since VGM is not really a viable solution for a full game, the size of the data is too big but it does the job for demos.
|
|
|
Post by audreyhepburn on Sept 24, 2022 13:39:41 GMT
C'est parfait, merci beaucoup!
|
|