You are not logged in.
Lost Password?

All Posts (ElmerPCFX)




#1
Re: A newer GCC compiler.
Posted on: 2018/12/22 21:51
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
Quote:

jorgeche wrote:

I already compiled it on macOS Mojave, but I didn't really documented the process and it was kind of messy and hackish since I had to even modify one of the config.guess files, among other things.

Congrats! I hope that the changes that I made to get it compiling on linux, will make it easier for you to build it on OSX in the future.


Quote:

The hard part will be, first, to customize the memory handling since I don't have enough experience on the inners of C++'s compiler and linker so I don't know if it is possible to instruct it to allocate the virtual tables in specific memory regions or even if they can just be computed at compile time and placed in the ROM area (we load them in DRAM instead of WRAM because they amount to more than 10 KB and they are populated at runtime); and second, to handle the allocation of dynamic objects, although I guess we just have to override the new operator and just use our own MemoryPool to avoid the usage of the heap.

VTables are always constructed at compile-time. For speed on the VirtualBoy, you're going to want to have the linker put them in either the ZDA section, or the TDA section so that they can be addressed in a single instruction relative to the R0 or R5 registers.

Putting them in the R0 section would be best (IMHO), at the top of your mirrored ROM space so that they show up in the $FFFF8000-$FFFFFFFF region. But, IIRC, that would mean that you've have to do some fiddling about with your linker script.

Even then, I'm not sure that VTables are marked at register-relative by the compiler ... that may need another hack into the GCC source code.

The recent version of the patches has already started the process of making it possible to distinguish between the VirtualBoy and the PC-FX, so that I can take advantage of your system's ability to load unsigned bytes-and-words without masking off the high bits afterwards.
Top

Topic | Forum


#2
Re: A newer GCC compiler.
Posted on: 2018/12/18 20:35
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
Quote:

KR155E wrote:
I guess we now have a foot in the door for Linux (and possibly OSX) versions of VBDE. :-)

Yep, I had to change/fix a bunch of things to get the Linux compilation working again, and those should probably help the compilation on OSX.

I also fixed (or at-least tried to fix) a couple of bugs in GCC 4.7 that compiling on the latest GCC brought to light ... and generally cleaned-up the code to fix the warnings (or silence them if they couldn't be fixed).

I've found a site talking about how to compile GCC on OSX, and I may take a look at it myself if somebody doesn't beat me to it!

I really hope that you guys take a look at using the C++ support in VUEngine since you're already using an object-oriented design.

Using basic Embedded C++ language features should allow you to make your code a lot more readable/debuggable than using all of those cunning-but-fragile macros.
Top

Topic | Forum


#3
Re: VB debugging with Mednafen, but without the eyestrain.
Posted on: 2018/12/17 19:34
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
Quote:

HorvatM wrote:
You can already change the font size in the configuration file. I must be missing something.

Yes, you are.

Sure, you can change the disassembly font size in the Mednafen configuration file, but you can't change the register font, or watch font, or trace font, or the register alignment, or the memory editor font ... and you certainly can't make it use a larger debug display.


Quote:
But what I would really like is the ability to have a large debugger display without also having to stretch the game display. I have to stretch it 3 times vertically to fit the debugger with a 9×18 font, but then games are almost impossible to play/test.

You would have to change how Mednafen calculates the window size to use ... but that could possibly be done. If you really want it, then you have the option to dig into the source code and make it happen!


Quote:
And pressing Esc shouldn't quit the emulator when I'm in the debugger!

The same with this ... if you don't like it, then change it. Compiling Mednafen is really pretty easy, especially since I've provided a build script that you can change if you desire.
Top

Topic | Forum


#4
VB debugging with Mednafen, but without the eyestrain.
Posted on: 2018/12/15 21:53
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
The Mednafen emulator is (arguably) the best emulator to use for debugging your VirtualBoy homebrew game, because of its excellent compatibility and its wonderful built-in debugger.

Unfortunately, the debugger defaults to using low-resolution 5x7 pixel fonts that are poorly defined, and then it displays them on small pages that are 640x480 pixel-or-less in size.

This makes the debugging screens very hard to read, especially on modern high-resolution monitors.

In order to avoid eyestrain and annoyance, I've patched the Mednafen source to use slightly larger and better-defined fonts, and then to display them on larger 800x600 pixel pages.

The patches and a build script (for Windows and Linux) can be found on github here ... mednafen-happyeyes

Prebuilt Windows downloads are available in the following links for Win32 and Win64.

The prebuilt versions only support the PC Engine, PC-FX, VirtualBoy, PlayStation and WonderSwan, but you can compile your own version with other console platforms if you wish.


The result looks like this (using the PC Engine debugger as an example) ...

Open in new window



Rather than the headache-inducing original ...

Open in new window



P.S. You have to click on the pictures to view them full size to really see the difference.
Edited by ElmerPCFX on 2018/12/15 23:40
Edited by ElmerPCFX on 2018/12/15 23:42
Top

Topic | Forum


#5
Re: A newer GCC compiler.
Posted on: 2018/12/15 21:19
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
As folks here may know, VBDE and VUEngine have been using my GCC 4.7 toolchain for a couple of years now, and so I consider it stable-enough for a public release.

I've created a project on github for the patches and build script, and have confirmed that you can build the toolchain cleanly on both Windows and Linux.

You can find the project here ... v810-gcc


For the adventurous, you can now compile C++ code.

Limitations are that there is no STL, and exceptions are not supported ... but that isn't much of a practical problem on something like the VirtualBoy (where you would be well-advised to limit yourself to the Embedded C+++ language subset).

You need to do a couple of things in order to get compiled C++ source linking correctly, and there is an example of that in the "examples" directory of the "liberis" project for the NEC PC-FX console, also on my github.

Have fun!
Top

Topic | Forum


#6
Re: VB GamePaks with expanded RAM?
Posted on: 2018/12/8 20:48
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
This would only be for development/debugging usage, and not for actual cartridges.

It's questionable whether it's even needed on the VB, since you can just make the cartridge image bigger ... but it never hurts to have more ram for debug traces.

Putting it in the $04000000-$04FFFFFF region seems like it should be pretty safe.
Top

Topic | Forum


#7
Re: VB GamePaks with expanded RAM?
Posted on: 2018/12/7 20:32
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
OK, thanks! I guess that I'll find another way to increase the amount of the VB's RAM (in the mednafen emulator, for debugging during development).
Top

Topic | Forum


#8
VB GamePaks with expanded RAM?
Posted on: 2018/12/7 3:49
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
Nintendo's technical docs say that GamePaks can provide extra RAM in the $06000000-$06FFFFFF memory region.

So ... I'm wondering, did any shipped games actually use that memory region? Perhaps for battery-backed saves?
Top

Topic | Forum


#9
Re: GCCVB for Mac/Linux
Posted on: 2016/12/14 20:36
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
Quote:

syncophono wrote:

Thanks, I'll try it out! Where can I download your 4.7.4 patches so I can apply them to gcc?


I'm sorry, because I know that it's not the answer that you want ... but I'd rather not just give out the basic GCC patches right now, but would prefer to wait for jorgeche and KR155E to release the next version of the VBDE (which includes an updated GCCVB).

That's because jorgeche and I had to debug a few issues with GCCVB in order to get it to work with the new compiler.

I'm afraid that I don't have the time or patience to go through that whole process again in order to support a separate GCCVB build.

You might try going to the VBDE thread here and asking them how they're getting on with the new version.
Top

Topic | Forum


#10
Re: GCCVB for Mac/Linux
Posted on: 2016/9/28 18:18
VB Gamer
Joined 2016/3/13
42 Posts
Long Time User (3 Years)
Quote:

Guy Perfect wrote:

dasi put together a devkit for V810 that outputs Virtual Boy and PC-FX programs. I've been working with him to get certain things implemented, but as I don't really have much of a clue as to how GCC distributions work, it's becoming rather out of date and could stand to see a newer build.

Interesting! I look forward to seeing it.


Quote:
A proper release will include a PC-FX API in the same vein and fix all of the outstanding issues (such as the current incompatibility with the C runtime).

This obvious interests me the most ... although I'm not sure exactly what you're talking about.

If you're trying to retain compatability with Hudson's old 1990s PC-FXGA SDK, then I'm not sure of the value, since that means no homebrew without causing a copyright violation.

That's the point of my work to continue Alex Marshall's "liberis", which provides the foundations of a fully open-source PC-FX library.


Quote:
I'd love to get a committee together to weigh the pros and cons of combining the two devkit projects (GCCVB and devkitv810), but that would be stepping on dasi's toes.

You may want to take a look at the next release of VBDE when it is made.

VBDE builds upon GCCVB, and jorgeche/KR155E are taking advantage of some of the features in GCC 4.7.4, and fixing/improving some of the things in GCCVB to take advantage of them.
Top

Topic | Forum