|
Post by kokovec on Apr 21, 2016 16:11:31 GMT -5
I just skimmed through the AY-3-8910 Datasheet. Very thorough! It even mentions interfacing with a PIC 1650. I had almost forgotten about that beast.
|
|
|
Post by gtoal on Oct 5, 2017 21:17:43 GMT -5
I ported vecsound to unix a decade ago so I have some notes on usage from when I did it, the command ym_vpack will create ASM for you to use in your programs. As for note by note programming on vectrex, you got me, jack. I realise I'm following up an old post, but it's still relevant as the source of this utility is still at Gauze's site: entropy.tmok.com/~gauze/vectrex/wip/vecsound4unix-as09.tar.gz (link is buried somewhere in entropy.tmok.com/~gauze/vectrex/wip/ ) Anyway - that code is written in a hybrid of proper C with a couple of C++ statements thrown in. If like me you don't want to drag in all that C++ environment just for a couple of printf's, here's the patch: diff -r vecsound-c/coder.c/main.c vecsound-cpp/coder.c/main.c 5c5 < //#include <fstream.h> --- > #include <fstream.h> 48c48 < printf("\nCalling "); --- > cout <<"\nCalling "; 50,51c50,51 < printf(" %s", argv[ii]); < printf("\n\n"); --- > cout <<" "<<argv[ii]; > cout << "\n\n"; 54,55c54,55 < printf("Usage: ym_vpack <infile> options... (-h for more help)\n"); < printf("ym_vpack = YM (Sound processor) to Vectrex PSG readable packer. \n"); --- > cout << "Usage: ym_vpack <infile> options... (-h for more help)\n"; > cout << "ym_vpack = YM (Sound processor) to Vectrex PSG readable packer. \n"; 181c181 < printf("A file error occured with %s!\n", argv[i]); --- > cout << "A file error occured with " << argv[i] << "!\n"; 196c196 < printf("No input file given...!\n"); --- > cout << "No input file given..."<< "!\n";
diff -r vecsound-c/decoder.c/decode.cpp vecsound-cpp/decoder.c/decode.cpp 8c8 < //#include <fstream.h> --- > #include <fstream.h> 78c78 < printf("\nCalling "); --- > cout <<" \nCalling "; 80,81c80,81 < printf(" %s", argv[ii]); < printf(" \n \n"); --- > cout <<" "<<argv[ii]; > cout << " \n \n"; 84c84 < printf("Usage: decode <infile> \n"); --- > cout << "Usage: decode <infile> \n"; 90c90 < printf("A file error occured with %s! \n", argv[1]);; --- > cout << "A file error occured with " << argv[1] << "! \n";
|
|
|
Post by gauze on Oct 5, 2017 22:21:14 GMT -5
|
|
|
Post by gauze on Apr 27, 2018 13:43:53 GMT -5
|
|
|
Post by Malban on Apr 27, 2018 14:37:43 GMT -5
I think since last October or November. Writing a player for the new format is on my todo list :-).
(but not at the top right now)
Malban
|
|
|
Post by gauze on Jun 13, 2018 22:32:32 GMT -5
Because I like making stuff more readable, and not duplicating the wheel, I am going to asking if anyone else has made up an include file with PSG registers as human readable names? "Someone" sent me some example code and when I got around to dissecting it I added symbolic names to make it easier to follow (I also like self-documenting code I guess) here's what I did on the fly:
; Sound Registers CH1FLO = 0 CH1FHI = 1 CH2FLO = 2 CH2FHI = 3 CH3FLO = 4 CH3FHI = 5 NOISE = 6 ONOFF = 7 CH1V = 8 CH2V = 9 CH3V = 10
NOTE: These are only useful if you are using BIOS routine "Sound_Byte_raw" ($F25B) I think.
maybe the names could be a bit friendlier and like the Fred Taft/Bruce Tomlin RUM Disassembly:
PSG_Ch1_Freq_High = 1 PSG_Ch1_Vol = 8
On this general note I have considered putting together some libraries of subroutines or macros in the spirit of BIOS stuff but optimized and add missing stuff like Draw_Line_d that uses a "pattern", some D register operations missing from opcodes, etc.
Just to make asm programming a little easier.
|
|
|
Post by Malban on Jun 14, 2018 2:49:16 GMT -5
Personally I like the more verbose stuff myself (like in your second example).
The first example always reminds me of DOS and its 8.3 filesnames. Also I hate these cryptig "C" notations where basically you leave out all vowels and think it to be optimzied and smart...
I never understood why it is easiy to write "cp" instead of "copy" - I am almost certain that a UNIX hacker can write 4 letters nearly as fast as 2...
But maybe the first *nix systems didn't have enough memory to keep all the keywords...
|
|
|
Post by gauze on Jun 14, 2018 22:42:10 GMT -5
haha yeah the short names remind me of the dot matrix print out of RUM source, which rather than filename length it's the limit of the assembler.
Speaking of, ITS the DEC-10 mainframe operating system had a filename limit of 6 characters, no suffix, uppercase letters and numbers only.
fyi "cp" came from Multics (and could have possibly have come from something before that I don't know). I'd rather not guess on why they did something as they did in 1969.
|
|
|
Post by gauze on Jul 3, 2018 10:20:08 GMT -5
just because I like to put any hard won knowledge out there, if for some reason you need to use arbitrary frequency sounds in your code ie not "exact" musical notes, the formula is: clock/16freq so vectrex clock is 1.5mhz so 1500000/(16*freq) to test: the NOTES table has A4 as 213 (this can be tested with Chris Binarystar's AY38910 sound test bin thing as well) as any musician knows: A=440hz 1500000/(16*440) = 213 I found this formula in that datasheet malban linked above f.rdw.se/AY-3-8910-datasheet.pdfsection 3.1
|
|