You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#131
Re: PVB Emulator & Fundraiser
Posted on: 3/28 22:11
VB Gamer
Joined 2018/5/21
USA
17 Posts
Long Time User (1 Year)
Finally got to play around with this last night. This is a GODSEND for VB devs. You're the bomb Guy.

Do you plan on getting this up on Github? I think that would be a great place to host builds/report issues/make pull requests.
Top

#132
Re: PVB Emulator & Fundraiser
Posted on: 3/29 17:10
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
Quote:

VmprHntrD wrote:
It's a nice try at an emulator definitely, guess it's just java being java perhaps holding things back some due to how it works.

Fortunately, I was thinking ahead when I wrote the Java implementation of the emulator core. I did it in such a way that converting it to C would require minimal modification, so for the most part it'll just be a copy/paste job and changing some data types... and turning all of the comments into /* C style */... I even plan to make functions with names like Integer_compareUnsigned() and Float_intBitsToFloat() just to keep the two code bases that much more parallel.

The JNI module that will expose the C implementation to the emulator application only needs to implement the methods declared in the VUE interface, which itself isn't a huge deal. It'll be a lot of busy work getting the ~236 KiB of Java source code moved over to C, but it's nothing that requires anything resembling expertise.

Plus, it'll give me a chance to review every line of code just in case I think of something along the way that could improve it.

Quote:

trailboss wrote:
Do you plan on getting this up on Github? I think that would be a great place to host builds/report issues/make pull requests.

My opinion of Github aside, I haven't been bothering with version control so far since I'm the only one working on the project. And even if one or two other people do get involved (which doesn't seem likely), I'll still probably not elect to set up a repository for it. And the source files are all in those .jar files, so it's not a matter of making them available.

In short, using version control at this time would just be giving myself more work without adding anything of value. (-:
Top

#133
Re: PVB Emulator & Fundraiser
Posted on: 3/29 17:43
VB Gamer
Joined 2018/5/21
USA
17 Posts
Long Time User (1 Year)
Quote:

Guy Perfect wrote:
I haven't been bothering with version control so far since I'm the only one working on the project.


Ha, I know how this story ends just from experience. Jokes aside, a place to formally submit bugs would be nice
Top

#134
Re: PVB Emulator & Fundraiser
Posted on: 3/29 18:09
Virtual Freak
Joined 1/27
USA
90 Posts
Good job on the forward thinking (Java to C ease of conversion, and not wasting your time either since the source is in the jars.)

I tried to figure this stuff out in college 20 years back and well I had such a horrible teacher I was assigned to that most the class failed and it turned me off it entirely. Never learn from an angry little asian guy who thinks there's only one way to code a result, his way, or you fail, as that's how that went. Only D I had since like elementary school. :P

If I could, I'd love to do the work. I think what you have there are some really solid bones and with the source in those JARs perhaps someone can take a crack at it. Mednafen SUCKS and their VB implementation is sketchy as it is all hidden behind the most anti-user friendly program out there. I think there would be interest as I said as people have been picking at it like with the VBjin project and others. You have the advantage of having a far better base to work from that does things correctly.

Perhaps put out some feelers, see if someone bites.
Top

#135
Re: PVB Emulator & Fundraiser
Posted on: 4/1 15:53
VB Gamer
Joined 2007/5/31
USA
44 Posts
Long Time User (12 Years)
How do I load this up in my 3DS?
Top

#136
Re: PVB Emulator & Fundraiser
Posted on: 4/1 17:39
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
Quote:

trailboss wrote:
Ha, I know how this story ends just from experience. Jokes aside, a place to formally submit bugs would be nice

Hasn't failed me yet. Just look at this great emulator we have already!

Bug reports go in this thread. Don't worry, I'll see them! You have bugs to report, don't you?

Quote:

Raverrevolution wrote:
How do I load this up in my 3DS?

You don't, just yet. The most recent development finished up the hardware functions in a Java implementation, which is designed to run on a workstation. The next phase (after filling out those greyed-out menus) is to port the implementation to C so it can be built as a native library, then use that on 3DS.

I'd have been working on 3DS before now, but Nintendo for some unknown reason refuses to let the silly thing die. I don't want to risk getting a homebrew solution set up just to have a firmware update blow it out of the water. And as of the time of this post, Nintendo released a game for 3DS (Kirby's Extra Epic Yarn) a mere 24 days ago, meaning they're not ready to take their eyes off of it just yet.

Let's hope Kirby is the end of 3DS. I'm really itching to sink my teeth in.
Top

#137
Re: PVB Emulator & Fundraiser
Posted on: 4/4 5:58
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
I spent the last week working on my Wario Land project, which has had a fantastic start, but this isn't the thread for that. The reason I'm posting right now is because tonight, out of curiosity, I decided to do a little research into the JNI to see what I would need to do in order to get the native emulation core set up. I figured it would be some involved process with headers and libraries every which way, but that's not the case. In fact, working with the JNI is easy. Really easy.

It's so easy, in fact, that I've decided to turn my immediate attention toward getting that native implementation set up posthaste. There's a little bit of added work in getting the code moved over from Java, but the vast majority is done as the Java implementation in and of itself, so it shouldn't take more than a handful of days. I'll keep you posted.
Top

#138
Re: PVB Emulator
Posted on: 4/6 23:21
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
Whoooo boy, that was... that was an experience.

I spent literally every waking hour the last two and a half days working on setting up the native module stuff, and it has been very successful. However, as you can see by the lack of anything to download attached to this post, it hasn't been "ready for prime time" successful. Very, very nearly, but not quite.

When I finally got everything put together and flipped the audio on... the exact same stuttering and slow-down occurred that was present in the Java implementation. This of course made me suspicious, as having identical performance in the native module is preposterous. But my earlier troubleshooting involved disabling audio rendering in the Java code in exchange for some supplied zeroes, and the speed went back up. I reasoned the audio processing itself was to blame...

After the curiosity with the native audio, I switched back over to the Java implementation and merely disabled sending the rendered audio to the speakers. That also ran full-speed. In fact, it stayed full-speed while logging audio to a file, despite being the Java code. So it's not the processing overhead at all! My best guess is that the earlier test "worked" because the initial contents of the buffer was zeroes and I was writing zeroes into it. Java may have found a way to make that work.

As far as what this means for getting good, full-speed audio output in Java, that one's got me a bit worried. VSU Workshop manages to run all six channels full-speed in the Java code, and the native implementation has more than enough muscle to get the job done, so exactly what Java is doing or how to make it do what I want is a mystery.

Truth be told, Java Sound isn't designed to be used as a timing source like the emulator requires. It doesn't actually provide any means to determine how much audio has finished playing or any mechanism for signalling the application when a buffer has finished. What I've been doing so far is a not-exactly-documented use of SourceDataLine.available(), and it's obviously causing problems. That was my best effort, though, and I'm inclined to think that perhaps Java Sound isn't going to be a good option.
__________

In other news, porting the Java code over to C was pretty much as smooth as I was expecting it to be, with two exceptions: the VIP rendering code and pretty much everything to do with breakpoints.

The VIP code is a couple of monstrous functions with many variables that were designed to produce the images as efficiently as possible, which they do rather well for the most part. Porting those to C proved to be a bit troublesome, as I did a lot of sign extensions with Java's shift operators (behavior that is guaranteed in Java but not necessarily in C) and a few other Java-centric design choices. After converting to C with the associated adjustments, there are some bugs in the rendering code that I'm not happy with. I'll either have to try again or write new rendering code to make sure it works in both languages.

The breakpoints library is another matter altogether. Unlike the emulation core, I didn't take care to design breakpoints in a way that would easily adapt to C. The native version of breakpoints that I came up with has some drastic differences and what code did make it over is ugly as heck after the needed modifications, and I'm overall disappointed with the whole thing. They function well enough to get games running (at full speed, naturally), but beyond that I want to toss them in the garbage.

There's a mounting pile of other considerations that would require extensive refactoring to incorporate new things I've learned along the way. At this point the prospect of a total project do-over seems very appealing, but I haven't decided what I want to do going forward.
Edited by Guy Perfect on 2019/4/8 17:00
Top

#139
Re: PVB Emulator
Posted on: 5/3 14:49
PVB Elite
Joined 2012/7/9
USA
833 Posts
Top10 PosterLong Time User (7 Years) 20+ Game Ratings
https://youtu.be/fEA5eaOqDVo

Nintendo officially discontinued the 3DS.
Top

#140
Re: PVB Emulator
Posted on: 5/3 17:09
VUE(xpert)
Joined 2012/12/4
417 Posts
CoderLong Time User (6 Years)
Thank the stars, that's music to my ears. tl;dw: Nintendo mentioned during an investors meeting that they have nothing coming down the pipe for 3DS in 2019. It's about frickin' time.
Top

 Top   Previous Topic   Next Topic


Register To Post