Sunday, May 21, 2006 - Posts

1UP's Post E3 Special Show

(I couldn't find their podcast or videocast on their site... once I find it I'll post it... -Auri)

Seven days, about ten hours of sleep, many dinners at Denny's, and one destroyed van door later the 1UP Show is back from the annual Electronic Entertainment Expo and we got lots to talk about--so let's cut the crap and get right to it:

Everyone is buzzing about the new Lost Planet demo on Xbox Live--it was the second most-downloaded item this week, just behind the mighty Halo 3 trailer; Ryan and Demian discuss why. And while we're talkin' 360, Mass Effect's behind-closed-doors showing almost won it 1UP's Game of the Show award -- we say what only the lucky few got to see.

Speaking of the lucky few, Mark and Bryan managed to avoid the crazy lines to play through the entire demo of Metroid Prime: Corruption on the Wii and left with some early opinions about what worked and what didn't. And let's not forget Nintendo's "other" system -- the DS had a fantastic show, epitomized by Shane and Jeremy's chat about Yoshi's Island 2 and the new Castlevania adventure, Portrait of Ruin. Even Boktai's spiritual successor Lunar Knights is looking good.

Finally, we finish up with two overlooked gems you probably never heard of: Metal Gear Solid 4 and Metal Gear Solid: Portable Ops for the PSP, including an interview with up-and-coming game creator Hideo Kojima. Take it from us, this guy is going places!

Source: 1Up

posted by Auri with 0 Comments

Update on Daedalus Nintendo 64 PSP Emulator Work-In-Progres

Source: MaxConsole

StrmnNrmn has given us a mega tech update on the progress of Daedalus 64 for the PSP - an N64 emulator port to the PSP. We're not gonna pretend we know what he's talking about here, so here is what he said...



quote:


DynaRec Status

Just a quick update on the dynarec status, as I know a lot of people are more interested in this than the grizly details of branch delay instructions :)

Last weekend (13/14 May) I managed to assemble the fragment buffers into native x86 code, and execute this dynamically. I spent some time debating whether to target MIPS or Intel initially, but I decided that it would be a lot easier for me to debug the code generation on the PC than it would be to debug code gen on the PSP.

In the end I'm glad I started with the PC as it allowed me to fix a number of hairy problems without going down the torturous path of debugging self modifying code on the PSP with just a few printf() statements to help track down any problems.

To start with on the x86 code generation, all I did was convert my fragment simulator loop directly into assembly. So the generated code for each instruction in the fragment looked something like this:

set current pc
set branch delay flag
get op code in ECX
call handler for specified op code (from R4300.cpp)
if ( exception set ) exit to exception handler
if ( branch instruction and branch taken ) exit to branch handler


So a fragment with 100 instructions in would have this block repeated 100 times (with different pc, delay flag constants etc).

This generated a lot of assembly (i.e. 200KB or so of N64 instructions would generate over 4MB of x86 assembly, i.e. an expansion of around 2000%). At this point I wasn't interested in performance though - I wanted to make sure that I was preserving the behaviour of the fragment simulator as much as possible. The exception and branch handlers mentioned in the pseudo code above warrant more detailed description, but I'll leave that for another post.

At this point I spent a few hours debugging, but generally everything was working pretty well. The emulator was currently running around the same speed with 'dynarec' enabled as with it disabled (I use quotes because there isn't really much 'dynamic' about this code yet).

I spent the rest of the weekend and the early part of last week trying to optimise the generated assembly and see what I could get away with removing. One of the first things to go was setting the program counter before executing each instruction. The only instructions that need to know this tend to be branching instructions (which are relative and need to know the current PC to work out their target address) and other instructions that can potentially fire exceptions. The vast majority of instructions don't need to know the current PC though (e.g. arithmetic ops, logical ops etc).

Next I had a look at reworking things so I only needed to explicitly set the branch delay flag if a branch delay slot was actually active. I made the precondition that the branch delay slot was always clear, and explicitly set/cleared it when I knew the state needed to change.

Finally I removed exception handling from all the instructions I knew to be safe. For instance, I know ANDI (and immediate) can never throw an exception. As I only perform counter updates at the end of the block, an exception can never be fired when executing this instruction.

After all these changes I had an instruction execution block which looked something like this:

if ( pc needed ) set current pc
if ( branch delay instruction )set branch delay flag
get op code in ECX
call handler for specified op code (from R4300.cpp)
if ( can throw exception and exception set ) exit to exception handler
if ( branch instruction and branch taken ) exit to branch handler

This meant that the vast majority of instructions looked as follows:

get op code in ECX
call handler for specified op code (from R4300.cpp)


So I had nice big fragments like this:

...
get op code in ECX
call handler for specified op code (from R4300.cpp)
get op code in ECX
call handler for specified op code (from R4300.cpp)
get op code in ECX
call handler for specified op code (from R4300.cpp)
get op code in ECX
call handler for specified op code (from R4300.cpp)
...

Essentially I removed the vast majority of the instruction fetch/decoding overhead from the emulation.

With this version of the dynarec, 200KB of N64 code was now generating just 2MB of x86 assembly (i.e. an expansion ratio of around 1000%). The PC version was running around 60% faster with dynarec enabled than with it disabled, which is a pretty significant speedup (although this is still very early in the process).

What's also important is that this is before I've done any real optimisation of the generated code. For each instruction I'm still calling the generic instruction handler which has the overhead of figuring out which source registers to use, which register is the destination etc. The *real* speedup comes from generating code to handle op codes explicitly, as you remove all this decoding overhead along with the overhead of jumping to another function. Once you've removed most of the generic instruction handling you can start looking at caching register values to minimise the amount of memory that's being moved around.

With the PC version up and running fairly successfully, I've spent this weekend getting the PSP code generation working. I don't want to go into too many details (as I want to go into more depth in future posts), but I know people are keen to hear some news about how this is going.

I got the basic code generation working on Saturday morning (thankfully I'd already resolved most of the tricky issues in developing the x86 version the previous weekend). I spent most of Saturday afternoon fixing some really horrible instruction cache related bugs. I'm still not 100% sure I've fixed them, but it seems very stable at the moment. At the moment I'm at the same stage with the PSP version of the dynarec that I was with the PC version last weekend - the code generation is running fine (and executing on the PSP without crashing more importantly :) but I've only just started looking at optimising things. It's still too early to speculate on numbers for the performance improvement it will give. Currently it's running around 10% faster with dynarec enabled, but it's still very early days.

More soon.

Branch delay instructions

Well it's been a little longer than I intended since my last post. I've been busy with work, and when I've had free time I've found it hard to drag myself away from the compiler for long enough to post an update :)

In my last post on the subject, I left saying that I was trying to iron out bugs in the fragment 'simulator' and was about to start work on native code generation. I want to pick up from that point, but first I wanted to talk about about branch delay instructions and how they effect the implementation of emulators and the new DynaRec work I've been doing.

The couple of bugs in the fragment simulator were indeed to do with exceptions and interrupts triggering in unexpected places. The problem occurred if an exception was triggered in the branch delay slot following a jump instruction.

In case you're not familiar with the MIPS architecture, after branch instruction has been executed (but before control arrives at the target instruction), the CPU executes the instruction immediately following the branch. So to give an example, this is a block of mips code that calls the function foo( 6, 3 ):


li a0, 6 # load the first argumentjal foo # call fooli a1, 3 # load the second argument# the result is returned in v0 here...foo:jr ra # returnadd v0, a0, a1 # add the arguments, store result in v0



If you've never read MIPS assembly before this will probably look a little strange.
When we call foo with 'jal foo' (Jump and Link), we don't set the second argument until after the jump to 'foo'! Notice also that we calculate the return value for foo after we return with the Jump Register (JR) instruction.

The reason this code works is because of the branch delay slots. When the call to foo is executed ('jal foo') the CPU keeps going for one more instruction and executes 'li a1, 3'. Control then jumps to the start of 'foo', where the CPU immediately executes 'jr ra', jumping back to where it just came from. Again, the CPU executes the following instruction, calculating the sum of the arguments and returning the result in v0.

Although this seems rather pointless and unnecessarily complicated, it serves a very good purpose. With most modern CPUs the instruction execution is pipelined, which means that the processor breaks down the work into discrete chunks (fetch instruction, decode instruction, execute, commit etc), and executes multiple instructions in parallel. Wikipedia (as always) explains this in a lot more detail.

With many architectures the CPU has to throw away the contents of the pipeline when a branch is executed, as the subsequent instructions may refer to data (register or memory contents) that is invalid until after the call has completed. With certain architectures (including MIPS), the engineers decided that it was wasteful to throw away all this work on every branch, and designed the processor to continue processing the pipeline until the subsequent instruction had completed.

What this means is that when writing code for MIPS processors, you have to be careful that your branch delay slot doesn't have any unintended side effects. For maximum efficiency you also have to be careful to try and do useful work in the branch delay slot (rather than just filling it with a NOP for instance). Normally this isn't an issue as the compiler generates all the code for you, but it's certainly an issue if you're writing assembly. It's also been a very important consideration when I've been writing the code generation for the new DynaRec (I'll cover this in a later post).

So, how do branch delay instructions effect emulators? Although they help pipelined CPUs to improve performance, they require emulators to do bit of extra bookeeping and this slows things down slightly and adds complexity. Every time daedalus interprets an instruction it has to check if a branch was taken, and if so set a flag to indicate that a branch delay instruction is due to be executed. When the branch delay instruction is executed, the flag is cleared and the emulator sets the program counter to the original target of the branch.

This is all fairly straight forward, but complications arise when exceptions fire as a branch delay slot is due to be executed. In the example above, what would happen if an interrupt fired immediately before the branch delay instruction 'li a1, 3' was executed? Normally once the interrupt has been handled, the operating system restores control by jumping to the instruction that was due to be executed, allowing the program to run from that point. If this happened in our example above, a1 would be loaded with the value of 3, but the jump to 'foo' that was originally delayed will never take place. The code would continue running without ever calling 'foo'!

In order to handle this situation, when an exception (or interrupt) is triggered, the CPU sets a flag in the 'cause' register. The operating system keeps track of this flag, along with the program counter where the exception fired and various other bits of information. When it's done handling the exception, the operating system uses this information to allow the CPU to correctly restore control to the code that was originally executing. In our example above, the CPU would see that the branch delay flag is set in the cause register, and restore control to the jal instruction immediately preceeding the instruction where the interrupt occured.

It should be fairly clear that there's quite a lot that must be taken care of by the emulator to make sure that the program executes as intended. This is all fairly simple to keep track of when processing instructions individually, but it becomes more complicated when you start to dynamically recompile the code.

The bugs that I mentioned at the start of this post were caused because I wasn't correctly setting the branch delay flag for instructions causing exceptions in branch delay slots. When I build fragments for the dynamic recompiler I avoid triggering certain types of interrupts (e.g. vertical blank and timer interrupts) in the middle of the fragment to reduce the overhead of having to add the code to handle these situations. Unfortunately there are many other types of exceptions that can occur in the middle of a fragment, such as page faults, I/O completion interrupts etc. It turns out these are very rare, but unfortunately not rare enough to save me from a full day of debugging :(

This was a little more detailed than I was originally planning. Branch delay instructions are quite a simple concept on the surface, but they can cause all sorts of complexities when it comes to dynamic recompilation. Fortunately I feel very confident that I've now fixed all the branch delay related bugs in the dynamic recompiler, so hopefully I shouldn't have to think too much about them again in the near future.

I'll follow up this post with a quick update on the state of the new dynarec engine.



Official Website: http://strmnnrmn.blogspot.com/
posted by Auri with 0 Comments

Herald Review: Handheld Releases a Mixed Bag

From the Herald Review:

It's vacation time again - which means time to get out your handheld systems for some fun on the road with new games.

Here's a look at what's out there.

"Capcom Classics Collection Remixed," by Capcom, Rated Teen, $39.99 - I've always felt handhelds are the perfect venue for retro collections such as this. Usually the control schemes work better, plus the games tend to be shorter, perfect for someone on the go. This collection is pretty well done, with games that perform and control nicely. A few of the 20 old-school games included in the package: "Street Fighter," "Bionic Commando," "1941," "Black Tiger," "Captain Commando." Obviously, some of the inclusions aren't that great (and some I'd never even heard of), but overall it's a nice collection for those longing for the old days. Grade: B


"Me & My Katamari," by Namco, Rated Everyone, $39.99 - This is the best example of why the PSP really needs two thumbsticks (see below for the other two examples). Game play is great and loyal to the console versions, but using the face buttons as a replacement for the second thumbstick just isn't as intuitive as it should be. Still, despite causing some major hand cramps, the game delivers as a portable version of the Katamari universe. After all, who doesn't want to roll up things in a ball while killing time at the doctor's office? Grade: B+

"Mega Man Powered Up," by Capcom, Rated Everyone, $29.99 - If I had to use one word to describe this game, it would be "cute." There are lots of bright colors and kiddie voices. Some people probably will dislike that, but I enjoyed it. The characters are fun, and the visuals great. It's a remake of the original "Mega Man," after all, and there's a reason that game went on to spawn many, many offspring. Plus, you can play it in both "New Style" and "Old Style," depending on your mood. There also is lots of bonus content to unlock, including the ability to play as the bosses you defeat. Grade: B+

"Splinter Cell Essentials," by Ubisoft, Rated Mature, $39.99 - First-person shooters really need that second thumbstick. It works best with one to control your movement and one to look around with. Developers have tried to work around that, and in this case, it hurts the game - you both move and look with the same thumbstick. And you hold down a button to make the thumbstick be the camera, making it impossible to move and look at the same time, something that has to happen in a stealth action game. Minus that problem, "Essentials" is a pretty faithful re-creation of "Splinter Cell" missions. Too bad the camera frustration kills any fun. Grade: B-

"Syphon Filter: Dark Mirror," by Sony, Rated Mature, $39.99 - This game handles the camera problem much better. While it's still annoying having to use the face buttons to look around, it's independent of your movement, and once you get the hang of it, it's no problem. Add to that excellent controls overall, great presentation and fun game play, and this is the first-person shooter you should buy for your PSP. Grade: A-

"Viewtiful Joe: Red Hot Rumble," by Capcom, Rated Teen, $29.99 - This is essentially a copy of the game that was released for the GameCube a while back. While it sparkles with great characters and personality, the game play is too chaotic and crazed. It's basically mini-game after mini-game, thrown at you at lightning speed, making it difficult at times to tell what you're doing and leaving little time to actually enjoy it. Grade: B-

Read the entire article here.

posted by Auri with 0 Comments

Datel Announce Max Media Dock for PSP & DS - Compact Flash Adapters

Datel have recently put up two new products on their on-line catalogue thus being the Max Media dock for PSP & DS (Lite compatible also) - essentially allowing you to use compact flash cards to store audio, video, homebrew and so forth on the PSP and DS. It looks as if each product is a small clip-on adapter respectively which is sold stand-alone as well as in 1gb and 2gb bundles with Datel branded compact flash cards. The stand-alone adapter docks come in at $39.99 each respectively.


The Datel Max Media Dock for DS looks identical to the Max Media Player but without a hard drive...so basically if this is used in conjunction with the Max Media Launcher and a CF card then it is a fully blown DS flash cart!

The Max Media Dock is sold stand-alone at $39.99, with a 1GB branded CF card at $79.00 and with a 2GB branded CF at $119.00. These appear ready to hit the market and the pricing is exactly the same as per above for the DS and PSP versions.

Datel Max Media Dock for DS

MAX Media Dock is an amazing new storage device for your DS and DS Lite console.



MAX Media Dock allows you to store and access content saved on any Compact Flash card, releasing the potential of your DS as a full media playback device!

MAX Media Dock is compatible with readily available Compact Flash cards which offer some of the best value flash memory around. Cards up to 8GB can simply be snapped into the MAX Media Dock providing access to huge storage potential on your DS.

MAX Media Dock includes the Max Media Player/Dock DS cartridge which allows you to navigate and run content stored on your MAX Media Dock’s Compact Flash card though an intuitive, stylus controlled browser interface.

To get all that content onto your MAX Media Dock use the built in High Speed USB 2.0 port to connect the Media Dock to your PC. Windows will automatically recognise your card allowing you to quickly and easily Drag and Drop content onto it.

With MAX Media Dock you will also be able to enjoy numerous games and applications developed by talented programmers in the DS’s thriving ‘Homebrew’ community as well as watch high quality video and listen to MP3s!

MAX Media Dock is also available with 1GB and 2GB Compact Flash cards included, see alternative items.

MAX Media Dock is perfect for Movies, Music, Games, Home Brew and more!

Max Media Dock for PSP

MAX Media Dock is an amazing new storage device for your SONY PSP handheld.



MAX Media Dock allows you to store and access content saved on any Compact Flash card from your PSP’s browser.

MAX Media Dock is compatible with readily available Compact Flash cards which offer some of the best value flash memory around. Cards up to 8GB can simply be snapped into the MAX Media Dock providing access to huge storage potential on your PSP.

To get all that content onto your MAX Media Dock, use the built in High Speed USB 2.0 port to connect the Media Dock to your PC. Windows will automatically recognise your card allowing you to quickly and easily Drag and Drop content onto it.

MAX Media Dock also includes the renowned MAX Media Manager software which allows you to automatically encode video, audio and images into PSP friendly formats, and even download game saves from the Internet!

MAX Media Dock is also available without a Compact Flash card or with a smaller capacity 1GB card included, see alternative items.

MAX Media Dock is perfect for Movies, Music, Games, Home Brew and more!

Source: MaxConsole
posted by Auri with 0 Comments

PSP Gets Some Hot Titles This Week - 21.5.06

While there’s finally some next-gen action to report, the big news this week really falls in the lap of one of the handheld consoles. The PSP is getting some serious action with several titles coming its way during the week of May 22, including FIFA World Cup 2006.

After a drought in new titles, the Xbox 360 will also see a few new ones this week with the release of Rockstar Game’s Table Tennis and Call of Duty 2. The PC is also getting the latest edition in the Heroes of Might and Magic series along with a few other releases. Teen Titans will make its way to several platforms this week, too.

The following are some of the titles expected for release the week of May 22:

PlayStation 2
  • Jaws, May 23
  • Puzzle Challenge: Crosswords & More, May 23
  • Rogue Trooper, May 23
  • Steambot Chronicles, May 23
  • Teen Titans, May 24
PlayStation Portable
  • FIFA World Cup 2006, May 22
  • Field Commander, May 23
  • Lemmings, May 23
  • Monster Hunter Freedom, May 23
  • Puzzle Challenge:Crosswords & More, May 23
Xbox 360
  • Rockstar Games Table Tennis, May 22
  • Call of Duty 2: Game of the Year Edition, May 25
Xbox
  • Jaws, May 23
  • Rogue Trooper, May 23
PC
  • Zoo Tycoon 2: African Adventure, May 22
  • Devil May Cry 3: Dante’s Awakening Special Edition, May 23
  • Heroes of Might and Magic V, May 23
  • Rogue Trooper, May 23
Nintendo GameCube
  • Teen Titans, May 24
Nintendo GameBoy Advance
  • Backyard Baseball 2007, May 22
Source: Igniq
posted by Auri with 0 Comments

Maxim Sizzles onto your PSP this summer!

Maxim Magazine is giving you three good reasons why you should bring your PSPs with you as you welcome the hot summer season: Veronica Varekova, Frankee, and Daniella Alonso. These sizzling babes will keep your summer days hot and the nights even hotter. Get more of the story in the June issue of Maxim for the PSP.

Finders, Keepers: Most 19-year-olds spend their days stocking shelves at Blockbuster, but at that age Veronica ditched her home for New York City. She intended to study at Parsons School for Design, but like any woman with a perfect physique in the Big Apple, took to modeling. This and much more in this issue of MAXIM for your PSP...

Thanks Chris for the heads up.

Download the June 2006 issue here.

Source: PSPMagazines and PSPUpdates

posted by Auri with 0 Comments