Wednesday, September 6, 2017

Panzer Dragoon MP4s

I'm [somewhat shamelessly] borrowing these from Driveclub on discord.  He recorded some interesting MP4s of Panzer Dragoon ORTA running in Cxbx-Reloaded that I'd like to share.

Keep in mind that it's not an accurate representation of the emulator's state (for the better looking ones).  Lucas tells me that there's hacks required.  Dunno what they are, I've been out of the loop for a while.






Some really neat stuff gets discussed in the discord chat.  If you haven't already, join it and see what the others are up to!

Shogun

Monday, June 12, 2017

Xbox One will support original Xbox titles.

http://kotaku.com/xbox-one-will-get-compatibility-with-original-xbox-game-1796002721

Just in case you haven't already heard, Microsoft is going to support original Xbox titles as well as original Xbox Live services as well.  Since I don't really follow e3, I came about a day late to the news.

Not much for me to say here, just looking forward to seeing a few of my favourite titles in HD.  Let's hope they emulate Azurik this time, as well as Gun Valkyrie and a few other underrated titles that get swept under the rug.

BTW, I'm doing okay (for those that ask from time to time).  Just started yet ANOTHER Microsoft position.  It's related to Scorpio, but I can't really say anything more than that due to the strict NDA.  Just hoping to get a perm position eventually, but tech companies seem to favour contracting over full time hires.  Oh well.

Later,

Shogun

Wednesday, May 3, 2017

Panzer Dragoon is Back!




Just thought I'd inform you all that Panzer Dragoon ORTA is working on Cxbx [Reloaded] again.  After going through the issues, I found out what was causing the game to hang in most places as well as why this game initially worked in Vista only (for those who remember me telling you guys about this with my old branch).  Looks pretty good, the broken geometry has been fixed and that's no longer an issue.

There was a "special" mutex that kept failing to be created, and without that mutex, then the game will not progress.  Since various driver level (and possibly kernel level) APIs were so lazily programmed in regards to error checking, invalid flags and arguments that would normally cause an API to fail simply would not invoke the failure.  This was true for Azurik also.  But by the time Microsoft released Windows 7, they caught the issues and they were fixed so it stopped running.  That was the biggest thing.  Only a few other things were needed to get it ingame again.

And before I forget, I wanted to mention that these are screens from the demo and retail game (respectively).  There's still a threading synchronization issue (at least that's what I assume at this point; don't quote me on that yet) that happens when the game tries to play an FMV.  This is also something that was rarely a problem on Vista, but I'm sure it's fixable once we know what it is.  So the demo goes into the first level, but the retail version won't let me do anything but go through the interactive tutorials at this point.

Of course, don't get your hopes up just yet (or at least, not too high) as several issues still persist from previous builds.  There's still an issue with the sound buffer cache filling up soon after getting ingame.  Also, something is causing the textures to break and a really weird stenciling effect that's almost the same as Turok's.  Since post processing effects are broken, the screen will go black when you try to use glide.  If you want to read some of StrikerX3's thoughts on it, take a look at this old thread on ngemu: http://ngemu.com/threads/svn-rev-159-vs-153-and-panzer-dragoon-orta.134298/

Just thought I'd give you all this quick update.  I sacrificed an entire day for this.  Enjoy.

Shogun.

Saturday, April 8, 2017

JSRF Ingame

First of all, sorry it's been a while since I've updated the blog.  Life hasn't exactly been fair as of late, so to speak.  But since I'm here, I'm going to share this bit of news that surfaced a few weeks ago, so some of you already know about this.


Go ahead and watch the video.  While it's buggy it's still impressive, considering that this is something I've never successfully done in my own lifetime.  I'm actually surprised the music works as well as it does.

Needless to say, SoullessSentinel is definitely better than I am.  He's done several things that I never thought to do and did it better than I could have.  So the torch rightfully belongs to him right now.

Cheers, to SoullessSentinel and Cxbx, the emulator that never says die!

Shogun.

Sunday, January 22, 2017

The macOS Experiment (Part 2)

Around the beginning of the new year, I mentioned what I titled "The macOS Experiment" and some of what I had planned for it.  Over the weekend, I wanted to put a bit of effort into it and see what would happen.  Did I get it working?  Well, almost.  And I'll get to that in a moment.  First, I'll share the git repo for those that want to see what I'm talking about:

https://github.com/blueshogun96/MacBox

There isn't much there but the bare minimum, and it was crappily written (no need to point out the obvious) because I just wanted to quickly see if I could get it up and running.

Basically what it does is this: It serves as a way to launch 32-bit code from the desired base address (for the sake of Xbox, 0x10000) by calling mmap to reserve that desired memory location and range as well as give us read, write and execute permissions on it, then injects the code to be run at the given base address (in this case, a .xbe file).  From there, we point to the .xbe file's main function (not the entry point, which is what Xeon did) with a function pointer and call it.  Actually before we call that function, we need to insert our wrapper functions to HLE the necessary functions in the .xbe.  For now, I just hard coded those to see if I could get a quick proof of concept going.

So to start off, I took the simplest .xbe to deal with, the first D3D tutorial in the XDK, CreateDevice.  All it does is create the D3D device, clear the screen to a random colour, then present it to us.  This is actually simpler than it sounds, considering that you don't have to literally create a D3D device.  All the D3D functions are C-based functions using the __stdcall calling convention.  The only parameter to even worry about there is D3DPRESENT_PARAMETERS anyway to initialize an OpenGL context that we want to match those parameters.  Clearing and swapping the screen are also very trivial things, but as you can see, I didn't literally add any of that code.  Why is that?  Because I needed to make sure that my hooked functions get called correctly, and this is where things got a bit tricky.

Let's take a look at this code where the "magic" begins (see macbox_xbe.cpp on the repo):

void macbox_install_wrapper( void* function_addr, void* wrapper_addr )
{
    uint8_t* func = (uint8_t*) function_addr;
    
    *(uint8_t*) &func[0] = 0xE9;    // JMP rel32 (quick and easy)
    *(uint32_t*)&func[1] = (uint32_t) wrapper_addr - (uint32_t) function_addr;
}

Just like Cxbx does, my code goes to the top of the function that we need to hook, and places a jmp rel32 instruction right there to immediately redirect it to our wrapper function.  Quite easy to do when you know how to encode x86 instructions.

So let's move on.  Next, let's hook some functions:

/* TODO: Move this elsewhere and don't hard code it either */
macbox_install_wrapper( reinterpret_cast(0x195B0), reinterpret_cast(Direct3D_CreateDevice) );
macbox_install_wrapper( reinterpret_cast(0x1A270), reinterpret_cast(D3DDevice_Clear) );
macbox_install_wrapper( reinterpret_cast(0x1ABC0), reinterpret_cast(D3DDevice_Swap) );

How did I get these offsets?  I loaded the .xbe up in IDA Pro using the flirt signatures to spot the D3D functions right away.  It really saved my arse and my sanity when working on Cxbx. 

After this, I was ready to go, or at least I thought I was.  When Direct3D_CreateDevice was first called, the parameters contained all gibberish.  On top of that, it crashed soon after the function returned.  I made sure that all the parameters were correct and the same as they were for Windows (at least, from a byte perspective).  But then I remembered that these functions have to use __stdcall in order to work on Windows for Cxbx.  So I had to find the equivalent for Mac.  This is what WINE used to define __stdcall (or also known as CALLBACK) for Mac:

#define CALLBACK __attribute__((__stdcall__)) __attribute__((__force_align_arg_pointer__))

Kinda long, isn't it?  So I used this, and it caused the immediate crash to go away.  The parameters are still gibberish for that particular function (Direct3D_CreateDevice) but with D3DDevice_Clear, the parameters were perfect!  Then after that function returned, something went wonky and the EIP ended up in a weird state resulting in another crash.  This brings me to the next issue.

From what I have read, the stack alignment in macOS is always 16-byte aligned, whereas with Xbox code it was 4-byte aligned.  This seems like it could be the issue.  I took a moment to get some assembly code screen shotted.

From IDA, this is the code that calls Direct3D_CreateDevice:



And this is the code that XCode generated...


Once more, IDA's output from whence D3DDevice_Clear was called:


And this is what XCode generated...


So the green line is actually where the breakpoint is placed at the beginning of the function.  So is the stack getting screwed up somewhere or what?  I'm quite sure there's a way around it considering that WINE was able to pull it off somehow.  Maybe I should ask them on their forum?  Well, I want to figure something out.

Since I didn't have all day to dedicate to this, I thought I'd at least share with you all what's going on.  The sooner I can fix this, the sooner I can move forward.  Frankly, I wouldn't be surprised if it was stupidly simple what I was missing.  If worse comes to worse, I guess I could do something super hacky to fix it, but I want to avoid that if I can.

So that's it for now.  Thanks for reading, and let me know what you think.

Shogun.

Monday, January 2, 2017

The macOS experiment (Part 1)

Lately, I haven't been doing much emulation wise.  Well, to be frank, I haven't done any serious emulation work in a long time (and just incase you're reading this JayFox, I'm not talking about xqemu, nor have I ~ever~ said I was doing any real work on it aside from a few work arounds here and there; hell I've even stated that I'm not an xqemu dev multiple times, so pleeeeeeeeeease spare me of your usual "3 lines of code" lecture because I'm really not in the mood, thanks and no disrespect), but since I'm in between jobs/paid projects yet again, I decided to pick up one of the previous experiments I started before out of curiosity.

What is this experiment?  Well, the goal of this little coding experiment was to claim the typical base address of 0x10000 that every .xbe uses.  For those who don't quite see what I'm getting at, let's take a look at how both Cxbx and Xeon, the first two Xbox emulators, worked from an internal perspective.  They both use HLE, yeah that's right sherlock, in order to run code natively on the host CPU, they both use a .exe to reserve the memory range beginning at 0x10000 and at least 64mb beyond that.  For Cxbx, the generated .exe from the .xbe has the base address set when the header is written.  For Xeon, the main .exe simply reserves that memory address range by forcing it to load at 0x10000 w/ a big global static array and it's overwritten with the .xbe contents.  The actual emulator code is run from a .dll that's loaded into memory well out of that range.  That's the only way they knew how to do it at the time (for windows at least).  Naturally, I started to wonder how would one do that on a Mac?

Since similar experiments for this have already been done on Linux, so I figured Mac could do it also with similar methods.  So I started a thread on ngemu a long while back, and asked for suggestions, hints and ideas.  At the time, I was quite new to Mac development, but at the time of writing this, I have grown to be quite experienced with it (although still not quite as knowledgeable of the lower level and kernel level aspects).  Instinctively, my first try was to use mmap() directly, or vm_allocate().  That didn't work.

Among one of the respondents to my thread back then was Ben Vanik, the author of Xenia.  He was running linux, and recommended this code:

#include 
#include 

namespace {
    void * const MEMORY_ADDRESS = reinterpret_cast(0x10000);
    size_t const MEMORY_SIZE = 1 << 20;
}

int main() {
    void * p = mmap(MEMORY_ADDRESS, MEMORY_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
    if (p != reinterpret_cast(-1)) {
        std::cout << "Memory allocated" << std::endl;
        munmap(p, MEMORY_SIZE);
    } else {
        std::cout << "Memory could not be allocated" << std::endl;
    }
}

It worked for him, but still didn't work for me on macOS (OSX), so I was still back where I started.  Keep in mind that all these flags were necessary.  I needed to be able to read, write and execute from this memory range.  It also needed to be at that exact address (hence the MAP_FIXED flag), and so forth.  Many were against that last bit, which I'll explain in a moment.

After that, I eventually forgot about it and moved on to other projects.  Mostly working on this indie game that I started less than 2 months of starting that thread.  I eventually did get it working, and the reason it wasn't working was actually quite a testament to my ignorance and stupidity... I forgot to switch the compiler setting from x86_64 to i386!  Duh, no wonder it wasn't working.  I wanted to slap myself afterwards.  IIRC, there's a flag called MAP_32BIT which allows 64-bit programs to access the 32-bit memory address space, but it appears to only be available in Linux, not macOS.  Oh well, no big loss for now.

Now, what I mean by "work" is that mmap() stop failing.  I would finally get that base address, but it would simply crash on a call to std::cout.  Even commenting this out, unmapping the pointer and letting it return from main also resulted in a crash.  I'm sure you could theorize why, but finding a solution was what I was interested in.

Since there weren't many Mac devs on your every day emulation/gaming forum (most of them are extremely anti-Mac; many for ignorant and uninformed reasons, and few for legitimate and well thought out reasons) so I ended up going to a forum that was dedicated to Mac related programming topics; macrumors.com.  While most of them did give me some sound advice, they didn't quite understand why I needed this exact functionality.  Many would suggest removing MAP_FIXED but that would give me a memory address out of the range I'm looking for and would essentially defeat the purpose.  I had to start two threads altogether, and only one person actually understood what I was trying to do, as he was also in the need to write a basic VM while lacking the proper resources to do it.  He tried this code in XCode, and it worked for him, but only after adding the following compiler flag in the "other linker flags" section:

-pagezero_size 0x10000000 -segprot __PAGEZERO rwx rwx

Frankly, I do not fully understand what this did, even though it generally looks pretty obvious.  A google search didn't yield much results either, but it worked.

Now, I understand that what I'm doing is considered "unsafe" and risky.  Even on Linux, it is considered the same to do so.  It's all part of some experiment I put a bit of free time into.  Was there any particular goal to it?  Well, for starters, I wanted to see at one point whether it were at all feasible or possible to bring Cxbx to Mac since using WINE wasn't enough to do it due to the memory map requirements (my assumption; it always crashed for me).  Another idea was to provide proof of concept that HLE and direct code execution was indeed possible on an Intel Mac without the need for a VM library or driver.  There's a VM framework for macOS now, but it requires a 2010 Mac with 10.10+ installed.  Since neither of my comps meet the former requirement, that wasn't an option for me.  Third, I've had the itch to implement just enough APIs in an attempt to run Azurik: Rize of Perathia on my Mac.  I am greatly intrigued by the possibility of playing this game in some hacked form of 1080p or 4k using certain Apple exclusive OpenGL extensions, but hesitant to re-live the pain of trying to get this game working on Cxbx.

So far, it appears to work without issues, but I'm sure there could be some hidden caveats somewhere.  What I'd like to do later on is experiment with a simple .xbe that simply creates a D3D device, and clears the screen and HLE that as proof of concept.  I don't really plan on going too much farther than that, but I am curious to find out if there's anything else that can evolve out of this, even if it doesn't mean emulating Xbox.  Who knows?  Maybe an HLE emulator of something else?  Like one of Sega's recent arcade hardware machines like Europa?  Hey, I just like to learn, and emulating Xbox even on an HLE level has helped me tremendously personally and in my professional career (which is part of the reason I have this job interview coming up; I'll blog about what I mean about this statement later).

I know it's late but happy new year, and happy coding.  It's late so I'm off to bed.

Shogun.

Tuesday, October 11, 2016

Cxbx-Reloaded Proof of Concept release

While I'm at it, I wanted to let you know that SoullessSentinel has uploaded a proof of concept release of Cxbx-Reloaded on his website and on github.  As it says, don't expect much at this point, as the next release will be vastly different as he plans to remove much of the HLE stuff.

Link: http://cxbx-reloaded.co.uk/

It's also highly encouraged that you contribute to the compatibility list.  The website gathers information on your game's .xbe, lets you choose the status of the game, and then saves the result, it's that easy.  So have at it.

As proof of concept from my end, I shared a few screens of Innocent Tears *almost* going ingame.  It would be awesome if it did considering that not only is this an Xbox exclusive title, but was almost never released to begin with AFAIK.




So have at it.  I'd try more, but I don't really have access to many games while I'm at work.  Looking forward to what else he's got planned.

Shogun.

Sunday, September 25, 2016

Cxbx-Reloaded continues

I wanted to make at least a brief mention of this at the very least.  SoullessSentinel is still working on Cxbx-Reloaded.  It's kind of surprising since I haven't talked to him in quite a while nor have I even kept up on his progress.  So far, it appears to be coming along somewhat.

After looking through the git repository, it looks like someone fixed a handful of things that I was either too lazy to implement properly or just completely forgot about.  One thing he fixed was my implementation of section loading; a proper solution was lacking and I lazily added what was necessary for a few games just to test it.  I looked through that code thinking "man, I sure hope somebody fixed that", and bam, it was there, lol.  They also did a way with alot of the previous FS stuff.  Interesting nonetheless.

If you want to take a look at the repro, click here: https://github.com/LukeUsher/Cxbx-Reloaded

And if you want to see screens, click here: http://imgur.com/a/Bzvti

Some of these titles I've never seen run before, so I guess that's some good progress in itself.  Best wishes for this branch.

Shogun.

Tuesday, May 17, 2016

Azurik: A hack worth a mention

This was the positive result of a hack done by JayFox some time ago, and I don't believe I've ever shared it here.  And the reason I'm sharing this is because it's screen footage of XQEMU running my favourite Xbox game, Azurik: Rize of Perathia!









There's a reason why I've always considered this game to be one of, if not the, hardest games to emulate on Xbox.  I couldn't fix it on Cxbx (and I tried for years), Microsoft couldn't do it, and even JayFox himself had quite a bit of trouble with it.  In order for this game to work, JayFox had to add a series of hacks.  I don't remember what he did, but getting it this far was quite a feat.  From what I remember, he tells me that the bug you see is an issue with floating point precision for vertex skinned meshes.  I ran into a similar issue on Cxbx, but it was much more severe as everything was greatly distorted.

The hacks used to get this far are not in his main branch, so I cannot replicate it.  Just wanting to share a bit of news that never seemed to get the mention it deserved.

Shogun.

Sunday, May 8, 2016

Oh no, is xqemu dead??

Heh, of course not!

Now, your concern about the xqemu project is greatly appreciated, however it's important to remember that JayFox and espes are two busy people.  Both of them last I checked are busy with University classes and what not, and espes has a job also.  So lately they've had their hands full.  Every once and a while progress on an emu will slow down due to IRL taking priority, that doesn't mean that it's dead because you haven't heard anything in a while or haven't seen any updates on github in a few months.  Trust me, it's not going anywhere; *Madara Uchiha voice* settle down!

So, for all of you SEGA fans out there, please enjoy this video of House of the Dead 3.  Runs quite nicely, no?


The speed of the video was increased by 8x roughly.  So considering how problematic this game was to emulate on Cxbx and xqemu at first, I'd say that xqemu is doing just fine.  The compatibility is pretty good in many cases, just a few things to sort out here and there.

Shogun.

Friday, September 4, 2015

More Sega Goodness



As you can see, two videos of some great (and yet underrated) Sega titles.  I didn't record the 2nd one obviously, but linked it instead of mine because pcmaker's vid was of the full retail game instead of the demo that appears to hang after the prologue.

I couldn't get these working on Cxbx to save my arse.  Just goes to show you how feasible LLE really is for those who are still in doubt.

Shogun.

Thursday, September 3, 2015

JSRF ingame






Ya see that?  Pretty darn awesome, isn't it?  Courtesy of espes, picture is worth a 1000 words so there's no need for me to say anything more about it!

See?  Espes and JayFox are doing just fine without my help :)

Shogun.

Sunday, August 30, 2015

Jet Set Radio Future


Do you see this?  This is a video of XQEMU running JSRF (courtesy of JayFoxRox).  Looks pretty darn nice, doesn't it?  I'll say.

I know you all want to play it, and so do I.  Now please, pllllllllllllleeeeeeasssssssssseeeeee...... STOP ASKING ME ABOUT IT!!!  lol

Shogun.

Tuesday, August 25, 2015

Please do not mistake me for the author or a dev of XQEMU

Okay, it seems that there's a bit of confusion about this here, and JayFoxRox pointed it out with a seemingly angry post on reddit today when I said I'm "semi-retired".  What I meant by that is that I occasionally stop what I'm doing to come back to the xbox emu scene to tinker with xqemu a bit, and interact with those who ask me questions.  There's no bad blood between us, I told him personally that I'm sorry and it wasn't my intention.  So because of that (and more), I feel it necessary to write this to avoid any further confusion.

My blog is by no means the official xqemu blog/site.  Nor have I claimed it to be. 

I do seem to get alot of people giving me credit for xqemu, but frankly, I haven't really done anything significant to thanked for.  To be perfectly honest, the most I've really done is add a missing texture or surface format and a quick and dirty fix here and there to get a few games up and running.  I gave him a little advice based on my experience in the beginning, but nothing he wasn't smart enough to figure out in the first place.

Although I've said it a few times before (but still, probably haven't said it enough), not only are espes and JayFoxRox the ones that deserve the majority of the respect, but they are also stronger/smarter devs than I am and have surpassed me a long time ago in skill.  I've had plenty of [undeserved] spotlight for a while now.  I think it's time they got a bit more where it's due.

Now, I'm not saying "don't ask me questions" or anything like that.  I can honestly say that espes and JayFoxRox are much more qualified to comment on it, since I haven't done anything as in depth as they have.  In fact, I get lots of questions about Xenia from time to time, and I have to tell everyone straight up that I haven't done a darn thing in that project since 360 is not and never was any area of expertise to me.  Heck, I never had a CPU that could run it up until yesterday! O_o

Once again, just writing this so everyone knows I have no intention or desire to steal any credit from this.  On top of that, I refused to take the full credit for Cxbx because caustik is still the author, and if it weren't for him, we wouldn't have ANY Xbox emulators at all!  All minds clear?  Good.  Thanks for reading.

Shogun.

Sunday, July 12, 2015

More XQEMU Progress!

Once again, I dare not take credit for most of these (nor would I take full credit for what I did fix), but I spent my Saturday afternoon fooling around with XQEMU, and this is what I managed to do/discover.  I noticed a missing/broken feature or two in the code today, so I went in there, and fixed 'em to the best of my ability.  What happened?  I ended up getting Namco Museum ingame, and Panzer Dragoon 1 is now playable.

I took a video of these two games in action.



JayFoxRox informed me that he fixed the flipping issue that's been going on in some games like Namco Museum.  Not 100% sure what the issue with Panzer Dragoon is, but for now, just enjoy the feeling of playing this game on acid!

Also, I've got to admit, this emulator is progressing much faster than Cxbx has, and the compat list is growing rather fast.  I tested and tinkered with a handful of other games, and I'll update my compat list later because it's 4am, and I'm tired.... and yes, I tried JSRF, it doesn't work yet.

Well, that was a weekend well spent.  Good night everyone.

Shogun.

Monday, July 6, 2015

A quick guide to building XQEMU

Now, this emulator is not easy to build, especially if you don't know what you're doing!  When I first started getting my hands dirty with this one, I had a rather tough time getting it to build due to dependency hell, missing tools, and missing source files.  Now that I have another Mac with better specs in general, I wanted to go about setting it up on this machine.  This time, it's going much smoother, but I think having a more detailed guide on how to set it up would be helpful.

A word of warning: so far, XQEMU appears to work best on MacOSX, which is the OS I will be using for this guide.  JayFoxRox successfully got this built on Linux before (I haven't tried this with espes' branch); but his branch has some files exclusive to him for legal purposes.  Windows?  I hear it's tough, but doable.  If you have any expectations of playing JSRF or Conker right out of the box, chances are you'll be disappointed (but don't let that stop you from trying).  Also, if you don't know how to use a Terminal, git, or even a command-line compiler, chances are you shouldn't be attempting this or even using this wip emulator to begin with.

Now, let's get started.  First things first, always take a look at the wiki: https://github.com/espes/xqemu/wiki/Getting-Started

Well, that Wiki hasn't been updated in almost 2 years though... O_o

If you haven't already, create a folder, navigate to that folder using the terminal, then do a 'git clone' to get the source code from the git.  Once you do that, you need to check two folders within the source folder, and those are:

- dtc
- pixman

If those folders are empty, then you need to clone those sources independently.  You can do so with the following commands while in the source directory:

git clone git://git.qemu-project.org/dtc
git clone git://anongit.freedesktop.org/pixman

So, if you were missing those before, you should have them now!  And now that you have all the source files needed to build XQEMU, and if you want, go ahead and enter this terminal command:

./configure --cc=clang --enable-opengl --disable-vnc --disable-user --disable-kvm --disable-xen --with-coroutine=sigaltstack --target-list=xbox-softmmu --enable-debug

Now, if you got the same problem I had, you will likely run into an error message like this one:

ERROR: pkg-config binary 'pkg-config' not found

There's multiple ways to fix this.  You can either use macports or homebrew.  I chose macports personally.  So I downloaded MacPorts for my OS of choice, and went from there.  To install pkgconfig using MacPorts, use the following command:

sudo port install pkgconfig

There's a possibility you got this error message here:

sudo: port: command not found

If you did, then you need to setup your path correctly.  Try using this command, it worked for me:

export PATH=$PATH:/opt/local/bin

Now, try the previous command again, and it should work.  Okay, now we have that annoyance out the way.  Optionally, you can also install the XCode command line tools if you want or haven't done so already.  To do so, type this:

`xcode-select --install'

It will take a minute or two, and will have a nice GUI pop up instead of terminal text.  At this point, go ahead and try configuring XQEMU again.  If you get this following error pertaining to glib:

ERROR: glib-2.12 required to compile QEMU

That means we need to install that too.  Once again, let's use MacPorts to get this out of the way, like so:

sudo port install glib2

Okay, that'll do it.  Try configuring XQEMU one more time, and it should do so successfully.  If not, then there's some other dependency you are missing.  On Yosemite, I haven't gotten any more errors pertaining to such missing dependencies like Cairo, pixman, etc.  If you do get those in particular (I did), make sure you have the pixman source in the appropriate folder as I mentioned towards the beginning of this article.  If it's something else, feel free to ask me, but I can't promise you a direct answer/solution, especially if you aren't trying this on MacOSX Yosemite.

The next thing you want to do is type make, and xqemu should start compiling.  While compiling, I got an error regarding autoreconf that looked like this:

/bin/sh: autoreconf: command not found

If you get that, let's fire up MacPorts again, like so:

sudo port install automake autoconf libtool

Bam, fixed.  Try compiling it again.  After this, I got a linker error pertaining to pixman, telling me that _prng_state is missing, and other stuff.  Click this link (http://lists.freedesktop.org/archives/pixman/2014-November/003461.html), and it will tell you how to edit the appropriate makefile in the pixman source folder in order to get passed this annoyance.

Okay, if you followed the instructions, then you should have a working build now.  If you are getting a linker error regarding SSE4.2, like the one below:

error in backend: Cannot select: intrinsic %llvm.x86.sse42.crc32.64.64

Then you'll have to comment out the code in nv2a.c that uses it. Search for the following function:

static uint64_t fast_hash(const uint8_t *data, size_t len, unsigned int samples)

Then uncomment the macros, and change the top macro from '#ifdef __SSE42__' to '#if 0'.  Type make again, and that should fix it.  Place the appropriate BIOS files in the right places and you're good to go (of course I'm not going to tell you where to download them here!), now fire up the emu from the terminal and see what you can come up with!

These are all the issues I encountered when building XQEMU the 2nd time around.  If you have different issues, feel free to ask questions below, but remember that I'm NOT going to hold your hand and cater to you personally.  These are things that I figured out for myself simply by googling until I found a solution, all in a few hours.  No offense, but if you can't figure some things out for yourself, then you shouldn't bother.

References:
- https://github.com/espes/xqemu/wiki/Getting-Started
- http://www.fantageek.com/318/install-pkg-config-for-mac-osx/
- http://mikelev.in/2012/10/qemu-mac-os-x-success/
- http://stackoverflow.com/questions/9575989/install-autoreconf-on-osx-lion
- http://lists.freedesktop.org/archives/pixman/2014-November/003461.html

Have at it,

Shogun.

Wednesday, July 1, 2015

Xenia Progress!

Well, some new videos featuring Ashe's 360 emu, Xenia, are popping up all over reddit.  Just in case you haven't been keeping up with the progress, I'll link the videos displaying the newly generated progress.




I haven't been able to try this emu for myself because when I try to build the git repo, I get errors due to missing files.  If you want to try it for yourself, go ahead and grab the source from github.  You'll need an x64 version of Windows and a core OpenGL 4 compliant GPU.  I don't have many 360 games, primarily because I don't really like the 360 as a console (XBLA aside), nor do I have Xbox Live, so by debug Xbox just sits on top of it.  I really wouldn't mind playing Bullet Soul on PC, I'll tell you that.

And just in case you are wondering, I haven't contributed to this emulator in any way, shape or form, nor do I think it's a feasible idea to rely on this emu for a means to emulate original titles.  I'd rather have a dedicated emulator with lower system requirements.  Plus, what about Chihiro?  I don't believe the emulator on 360 can emulate that!

Just thought I'd keep you all informed on what our friend Ashe is up to!

Shogun.

Tuesday, June 30, 2015

Someone is Stealing my Identity!

Okay, this is pretty outrageous.  Who the hell would go this far as to impersonate me on reddit?  Wtf?  Yes, you heard right, someone is pretending to be me, don't be fooled...

Thanks to yun-daddy, I caught wind of this yesterday (maybe he did it, lol).  I didn't get around to reading it before because I was busy (yes, I was actually working on Cxbx for a change), so I had initially assumed someone was making a post in my honour or wanted to inquire about my past work.  Turns out that was not the case.  I should have investigated before things snowballed into what it is now.

Link: http://www.reddit.com/r/emulation/comments/3bhisz/blueshogun96_here_author_of_the_original_xbox/

For those of you who want proof that this is fake, consider these.
  1. I haven't been going to school at all.  In fact, I haven't set foot in a university since 2007.
  2. I stated that I don't have a job earlier on my blog.  Btw, for those of you who were wondering how my interview with 343 went, I didn't get the job because they wanted a more experienced C# dev.
  3. When I make announcements or just want to speak my thoughts on Cxbx, I do it here first, then link it other places.  In fact, I've never had a reddit account in my life until today (and my nickname there is "real_blueshogun96").
  4. When did I EVER claim to be the author of Cxbx or XQEMU?  Never.... Not.  Even.  Once.  These were originally written by Caustik and espes, respectively.
  5. I never even stated that I would have a definite means of working on Cxbx.  My retro gaming PC which I mentioned yesterday isn't truly ideal to work on it.  XQEMU is another story though, but I'd like to work on getting the setup working on my Mac Pro aside my Macbook.
  6. His impersonation of me is terrible.  I sign my statements as "Shogun", I never refer to my favourite console as "OG Xbox" because there's nothing "Original Gangsta" about Xbox.  Lol, I had to make some fun out of this.
 Looking on the bright side, I must really be special if someone is going out of their way to impersonate me of all emu devs.  Besides, they say it pays to advertise!  But in the mean time, I'm going to start another reddit post regarding this imposter as well as link back to this blog post as proof.

So, now that you are aware of all this, don't be fooled.

Shogun.

Got Cxbx running on my retro gaming PC

This evening, I fired up my old Dell B1000r because I needed a 32-bit machine running Windows XP for a few tasks.  Then I thought to myself "I wonder if I can run Cxbx on this old thing...".  Surprisingly, it worked!  The specs: Pentium III 1Ghz, GeForce 5200 (AGP), and 384mb Ram.  Although I didn't have much on the hard drive, I did get to play around a little bit.


That's a screenshot of the intro video of Innocent Tears (Japan only; XDK 4627).  Now, I will be honest and say that I did alter this screenshot a bit.  The intro video only runs at half the normal size when the YUV overlay is converted to RGB via software.  Using hardware accelerated YUV overlays fixes the problem, but then you can't take screenshots of it because YUV surfaces can't be screen grabbed normally on XP, so I just stretched the image.  Btw, just in case you are wondering why I never gave updates on this game before, I had reached a blocking issue when trying to get this title ingame.  Honestly, I can't remember what it was either. For those who want to see the intro video in action, I've uploaded the video on Youtube (I'm surprised no one has done this before).



I didn't have any of the games I knew were playable on this machine, so I couldn't verify by playing Turok, Smashing Drive, Whacked, Robotech BattleCry, etc.  Next time, when it's not in use, I'll hook up my old Seagate HDD that contains most of my dumped games, see if Turok runs at playable speeds, lol.  I know Robotech won't since I had a hard time getting 20fps out of that game on more advanced hardware.

Although Cxbx runs on this ancient gaming PC that once cost $2700 usd, I dunno if I could actually use it to work on updates for it.  Doesn't hurt to try, of course.  If only that thing didn't generate so much heat though.  It's summer time, and my apartment doesn't have AC either :(

Just thought I'd give you all an update since I *might* have a means to work on this again.  Not a solid guarantee, but I'll investigate later.  Until next time.

Shogun.

Thursday, June 25, 2015

Uploading my Cxbx source branch to github...

Wow, has it really been almost a year since I've updated this blog?  Well, shame on me... O_o

Where have I been?  For the past two years, I've been working on building up my career.  Things are going good now and most of my financial troubles are over (minus a few bogus debts that ended up in my name due to identity theft and a lease I shouldn't have signed).  Although I was laid off one month ago, I'm getting a steady stream of interviews from multiple companies.  In fact, I have an interview with 343 Industries tomorrow morning *cross fingers*.

Recently, me and LoveMHz have been talking about the good old days of working on Cxbx (well, tbh the good old days were 10+ years ago) and shared a few thoughts.  A day or two before that, I finally got around to taking a look at Cxbx-Reloaded's support for x64 which run without the aid of the debug console which is essential for me.  For some people, it worked just fine.  For me, however, I couldn't get a single game to run (not even Smashing Drive or Turok).  I'm running Win8.1 x64 right now, and have been using a 64-bit OS for quite some time, so I haven't touched Cxbx in quite a while because of it.

Due to the nostalgia I had, I dug up my old source branch and uploaded it to github.  I realized that I had added months worth of work that never made it to the SVN (8 months worth of updates to be exact), and it didn't seem fair to just forget about it.  Did a bit of work to get it compilable under Visual Studio 2015, and if you have a 32-bit OS, you can go ahead and have at it.  Sorry, I never did get the 64-bit update working on my branch.

Link: https://github.com/blueshogun96/Cxbx

Feel free to check out anything else I've got on github (not much, besides a few experiments and this really bulky open source game engine I started writing).  Unfortunately, you may not see many updates to Cxbx because I don't have a 32-bit OS to work on atm.  I would use VMware, but atm my CPU surprisingly does not support Intel VTx (hardware virtualization).  It's an older Mac Pro with low end Xeon 5130.  When I get a chance, I'll upgrade to an x5650 for 8 cores at 3Ghz, plus VTx.

Take care,

Shogun.