Search found 16 matches

by gladius
Wed Dec 13, 2006 3:05 am
Forum: Development
Topic: Working with the SPC700
Replies: 2
Views: 5469

If you want to use a real SPC700, it has 4 general 8 bit input/output ports. It boots into a ROM that polls these ports basically, so that you can send your own program over to it. The SPC700 is really a two part chip, one for the 1Mhz CPU that processes the song commands, and the DSP chip which act...
by gladius
Thu Dec 07, 2006 8:26 am
Forum: Development
Topic: Porting zsnes to arm-based machines *not a request*
Replies: 22
Views: 23171

There already are cpu cores written for the DS/GBA in arm assembly. You'd have to rewrite the graphics routines as they make use of the tile hardware, but a huge chunk of your work is done. Check out http://snezzids.bountysource.com . Oh, and ARM assembly programmers aren't as rare a species as you ...
by gladius
Thu Jun 29, 2006 8:42 am
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

They are not exactly compatible grammar wise ;). Besides reverse polish notation is trivially implemented with a simple recursive function. No need for this recursive descent trickiness.
by gladius
Thu Jun 29, 2006 12:33 am
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

0 is (edit: not) correct. (edit: bogus example was used here)

Edit: You are correct, it should be level, not 0 (but not level+1, that would lose the right-to-left evaluation property).
by gladius
Wed Jun 28, 2006 11:53 pm
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

byuu: Looks mostly good, but the problem is ternary does not evaluate right-to-left now which is the C spec. Here is the fixed code (the unit tests actually caught this error! "9>5?95>?1:0:4*2" was evaluating incorrectly). Also a tiny bit of cleanup, you don't need to re-cache a and b #def...
by gladius
Wed Jun 28, 2006 9:42 pm
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

byuu: Oops, you are right, the way it's currently done a comparison is assumed to be a ternary expression. To fix that you can add specific handling for the ? operator, and just make it do the zero = false, non-zero = true in the same way C does it. Comparisons would evaluate to zero and one then. T...
by gladius
Wed Jun 28, 2006 6:22 pm
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

Without any kind of verification at all, how are you even terminating the groups? eg try : doeval("5 < 7 ? 2 + 3 : 1"); It looks like that will return 2 and not 5. But I didn't actually try that just yet. No compiler on this PC. This works correctly (it outputs 5). Basically what happens ...
by gladius
Wed Jun 28, 2006 8:05 am
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

Yes, the ? and : are syntatic sugar as far as this parser is concerned :). Adding error handling and output wouldn't be hard, at which point you could verifiy those types of things. http://www.difranco.net/cop2220/op-prec.htm is a good reference for the C operator precedence rules. < and > are in th...
by gladius
Wed Jun 28, 2006 6:51 am
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

Well, I thought it would be a bit tricker to do the right-to-left binding of ternary expressions, but it turned out to be pretty easy. It's even got some basic unit testing now ;). #include <cstdio> #include <string> using namespace std; const int maxLevel = 7; int fastEval(char *&s, int level) ...
by gladius
Wed Jun 28, 2006 4:32 am
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

Glad to hear it worked out well :).
by gladius
Wed Jun 28, 2006 12:45 am
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

Nach&byuu: Sure, this code is public domain, feel free to use it. byuu: Yes, there is some recursion for each seperate precedence level in the tree, but the elegance and speed (no extra memory needed, besides on the stack) makes up for it I think. For the single literal case there is a bit of ov...
by gladius
Tue Jun 27, 2006 6:38 pm
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

There were a few bugs in there, basically it wouldn't handle multiple operators at the same precedence level back to back (5+3+3 = 8 ). Here is the new (hopefully more bug free ;)) version. #include <cstdio> #include <cstdlib> #include <string> #include <cmath> #include <map> using namespace std; in...
by gladius
Tue Jun 27, 2006 6:44 am
Forum: Development
Topic: Parsegen can now run concurrently with itself, w00t
Replies: 38
Views: 29235

Some small (and completely error intolerant) parsing code that will handle those (x+y)*(z<<t) expressions. If you want to add variable support it's not too hard, just stick an isalpha check beside the isdigit check and add a map<string, int> or something to look up the values. Doing macro expansion ...
by gladius
Sat Apr 08, 2006 11:43 pm
Forum: Development
Topic: Hi there, i got some questions ;)
Replies: 37
Views: 24924

Mog123: This isn't a competition between the two, I was planning on integrating the changes into snesadvance as well.

Pagefault: Small things perhaps, but they probably would have taken me forever to find I bet :). Anyhow, no pressure, I was just interested in seeing what you had done.
by gladius
Sat Apr 08, 2006 5:59 am
Forum: Development
Topic: Hi there, i got some questions ;)
Replies: 37
Views: 24924

Pagefault: I would be very interested in those bugfixes, if you sent me some mail with them I'd spin up a new build of snesds (snesadvance's big brother with sound emulation on the ds) as well. I've been trying to work up the motivation to recode most of the ppu stuff to get hdma support in cleanly ...
by gladius
Mon Mar 13, 2006 8:08 am
Forum: Development
Topic: How to play an SPC from a ROM
Replies: 8
Views: 7234

To do an SPC player all that is neccesary is emulating the SPC chip, as others have suggested just directly copy the stuff from the SPC into internal emulator state and you can use a massively simplified loop that emulates 32 cycles of SPC700, one dsp tick, then spits out a sample, ad infinitum. Tha...