So with the release yesterday Minus4j is actually in pretty reasonable shape. Sure it needs the source cleaned a little - theres loads of commented out crap in there, but on the whole not bad. So as I was adding another paramater to it (allowing you to specify the initial frame skip - since Xeo3 runs at 25Hz, you never NEED 50fps drawing), I suddenly realised that these days, Java probably provides image scaling as part of the API!
And sure enough.... there it is. So, I've now removed the software scale I was using and now use the API. This is of couse good for 2 reasons. One... being part of the API means it might be assembler optimised, and not just some tacky code I did, and second it reduces the code I've to maintain. Its all good.
Before I set it all aside again, I'm going to look into sound. I do this every 3 years or so to see how much effort it would be to add sound to Minus4j. When I started, you just couldn't, but there are now a few apps which do what I need to, so chances are its not too hard. All I really need is a buffer or two that plays music at a specific rate through a software buffer. I can then fill this up as I emulate things. This would let me plug in TED and SID music - not to mention samples that Minus4w can play. That would be cool - then all I'd need is some basic D64 support!
Oh... and while I won't release all these little bits, I will update both my blog and Plus4world to use all the latest stuff, then release it when theres enough to package it all up.
Sunday, November 09, 2008
Saturday, November 08, 2008
Speed UP! Slooooow down....
So, it turns out the Java compiler is fine (I think). My timing code (that makes the game run at a specific FPS) appears to be crippling things. But I have no idea how. If I take out my timing code and run the game unscaled it ticks along at 350fps - or 7 times the normal frame rate. It looks like thats correct too as everything is moving about 7x the speed, so I think the FPS counter is working.
So... whats wrong with my timing loop thats crippling it so much? I've tried to set and FPS of 200, but as soon as I do that, it tops out at 65fps. If I remove a couple of lines (the bit that makes it work), it jumps up to 350 again. So somethings rotten right in the state of Denmark... So, heres the timing loop, perhaps someone out there will spot it and save me staring at boring code for hours on end.....
And there you go... pretty simple. Oh, and the reason for the backwards check is because in the modern world of clock syncing (to time.com or something), your clock might briefly go backwards. If this happens timer loops break - had this happen twice! Once on mobile phones, and once on a PC. Took me AGES to figure out the Mobile phone one, but fortunately I remembered about it for the PC.
So... whats wrong with my timing loop thats crippling it so much? I've tried to set and FPS of 200, but as soon as I do that, it tops out at 65fps. If I remove a couple of lines (the bit that makes it work), it jumps up to 350 again. So somethings rotten right in the state of Denmark... So, heres the timing loop, perhaps someone out there will spot it and save me staring at boring code for hours on end.....
long tLastGameFrame = System.currentTimeMillis();
long tNextGameFrame = tLastGameFrame + FPSRate;
Last = tLastGameFrame;
while (true)
{
long tNow = System.currentTimeMillis();
// Quick check to see it timer has gone backwards!!
if( tNow < tLastGameFrame ){
tLastGameFrame= tNow;
}
// Check to see if system is stuttering due background OS stuff.
// if jumped ahead over 5 seconds, then just reset...
if( (tNow-tNextGameFrame) > 5000 ){
tNextGameFrame = tNow;
}
// Timer has gone backwards
if( tNow < tLastGameFrame ){
tLastGameFrame= tNow;
}
dTime = (int)(tNow - Last);
if (dTime >= 1000){
dTime -= 1000; // dont get 0 (1000/1001)
actualfps = CurrentFPSCount;
CurrentFPSCount=0;
Last = tNow;
}
// Now the main timing loop
if( tNextGameFrame >= tNow )
{
// do nothing...or yield/sleep
} else
{
while( tNow>tNextGameFrame){
tLastGameFrame = tNextGameFrame;
tNextGameFrame += FPSRate;
}
CurrentFPSCount++;
}
And there you go... pretty simple. Oh, and the reason for the backwards check is because in the modern world of clock syncing (to time.com or something), your clock might briefly go backwards. If this happens timer loops break - had this happen twice! Once on mobile phones, and once on a PC. Took me AGES to figure out the Mobile phone one, but fortunately I remembered about it for the PC.
New version of Minus4j released.
Well, I've decided to release what I've done so far so that Plus4world (and anyone else) can get the new bits.so head over to my MINUS4 site and get the latest one if you need it. Heres a list of the changes...
Updated rendering engine ported from Minus4w, should handle more cases.
Updated CPU processing ported from Minus4w. More games should run.
Fix a crash in the CPU processing.
Changed the colours to what Yape uses (much nicer)
Added FLASH attribute, so things now...flash. (Manic Miner keys, Monty pick-ups etc.)
Fixed the rendering frameskip - it was always skipping at least 1 frame *idiot*
Fixed the overflow flag (V) on the ADC instruction. Mercenary now works!
Added the new "joy" paramater
Fixed commando - added several undocumented NOP codes.
SOME vertical scrolling games work.
More Progress.
This is pretty neat as it means I can show new things as code rather than video. However the new version of Java appears to be a little sluggish for some reason, and frame rate has dropped a lot. In the past I used to get upto 450FPS but that has now dropped to around 70fps - without scaling...pooh. I hate Java...
Still, when all said and done - how cool is it to have xeo3 actually PLAYING in a web page!!
Life in the old dog yet....
I've managed to debug Minus4j using Eclipse. This is a JAVA based IDE and its pretty spiffy in places. Couse...being Java based, its a bit sluggish - even on my new monster PC. Oh well, at least I can single step my applet!
So, which one hurdle down, another begins... I've ported a lot of Minus4 back to Minus4j (its pretty cool that the code bases are virtually identical, coz I can cut and paste most changes), and the bug I had was simple that the mainloop on Minus4w had changed a bit, so a quick change on the java side, and we're all go!
Minus4j now has inverted characters, the flash attribute, and a proper hardware cursor (not that anyone really used it outside of basic of course... but still... I'm also trying to update the CPU module as well, as minus4j is prone to crashing, and doesn't run some games (like Mercenary). I'm having a little trouble getting Mercenary to work - oh it runs and all, but it doesn't get past the intro. I'm sure this was a BCD problem, but I've ported the BCD stuff back from Minus4w and its still fubar. Mmmm...
What would be nice is if Plus4world could just allow EVERY game to be played online. Sure some wouldn't work, but I think most would and it would be easier to exclude some, then include them all.
Anyway, back to work I guess. I need to try and fix this BCD issue (if I can find it), and then add an option for joyport swapping to the paramaters (another request). I would love to add sound, but I'll need to look into doing dynamic WAV's under java. I know the C64 emulator can do it, so I might disassemble that and have a peek.
So, which one hurdle down, another begins... I've ported a lot of Minus4 back to Minus4j (its pretty cool that the code bases are virtually identical, coz I can cut and paste most changes), and the bug I had was simple that the mainloop on Minus4w had changed a bit, so a quick change on the java side, and we're all go!
Minus4j now has inverted characters, the flash attribute, and a proper hardware cursor (not that anyone really used it outside of basic of course... but still... I'm also trying to update the CPU module as well, as minus4j is prone to crashing, and doesn't run some games (like Mercenary). I'm having a little trouble getting Mercenary to work - oh it runs and all, but it doesn't get past the intro. I'm sure this was a BCD problem, but I've ported the BCD stuff back from Minus4w and its still fubar. Mmmm...
What would be nice is if Plus4world could just allow EVERY game to be played online. Sure some wouldn't work, but I think most would and it would be easier to exclude some, then include them all.
Anyway, back to work I guess. I need to try and fix this BCD issue (if I can find it), and then add an option for joyport swapping to the paramaters (another request). I would love to add sound, but I'll need to look into doing dynamic WAV's under java. I know the C64 emulator can do it, so I might disassemble that and have a peek.
Tuesday, November 04, 2008
Intermission....
Albatross!! Albatross!!! Get yar Albatross here!
okay... Got slightly side tracked as a beta of Call of Duty 5 came out today so I had to have a blast at it... FAB game, got to be one of my fav all time games the COD series. Anyway... Aside from that I'm trying to update Minus4j for Plus4world so they can get more games on line, and so its well....better.
It does have some issues and I thought I'd port back some Minus4w stuff. This should be easy as the source for Minus4w originally came from Minus4j. So it was all going swimingly well, then BANG! It all fell apart. I have the drawing code ported back and as far as I can tell its now identical, except Minus4w works, and Minus4j jumps up and down like a rabbit on a pogo stick. So now I find myself in need of an applet debugger. Im sure it'll be obvious once I debug it, but until I do... I'm a bit stuck. Fek. I could undo it all and then just fix one issue at a time, but that seems silly as Minus4w is much bette over all.
*sigh*
okay... Got slightly side tracked as a beta of Call of Duty 5 came out today so I had to have a blast at it... FAB game, got to be one of my fav all time games the COD series. Anyway... Aside from that I'm trying to update Minus4j for Plus4world so they can get more games on line, and so its well....better.
It does have some issues and I thought I'd port back some Minus4w stuff. This should be easy as the source for Minus4w originally came from Minus4j. So it was all going swimingly well, then BANG! It all fell apart. I have the drawing code ported back and as far as I can tell its now identical, except Minus4w works, and Minus4j jumps up and down like a rabbit on a pogo stick. So now I find myself in need of an applet debugger. Im sure it'll be obvious once I debug it, but until I do... I'm a bit stuck. Fek. I could undo it all and then just fix one issue at a time, but that seems silly as Minus4w is much bette over all.
*sigh*
Saturday, November 01, 2008
Almost there....
I've just about got my PC setup again, althought theres always going to be apps I've forgotten about and will only rediscover later on. I thought I could get away with just installing the C# Express edition for all my needs, but alas no. I really need macro support and it doesn't have source control built in so I'll have to install the full Visual Studio again. I do hope to do some C# Express projects for the debugger to allow people to write plug-ins without having to buy the full visual studio though.
Speaking of source control... I've reinstalled Visual Source Safe so I can get access to my old repository but I'm thinking I want to install SubVersion. This would bring me upto date a little and allow others to check stuff in/out of my depo. Russell's been moaning at me for months to let him get access to the debugger and so he can keep upto date with the XeO3 source. I have come across a tool which converts VSS databases into subversion ones, so I'll have to give that a go - I like having all the history for them, but as long as I still have to old VSS repository I guess its not a huge issue.
The guys wanting to do a CPC+ version of XeO3 got in touch (again - I missed them 1st time around; my bad), so we'll have to have a chat and see if they meet the criteria for offical developers (Yes, I'm a picky bastard...).
I'm having a slight issue with my new install as it's a 64bit OS, my 32bit apps are struggling to talk to the parallel port. Still, once I get DevStudio installed, I'll see if I can fix all that. It should also mean I can release 32+64 bit versions, or I might take the opportunity to port them to C# and mono.
I've also downloaded a VMPlayer and will get a mono vm image so I can start doing Linux support. This will let me play with Linux without having to dedicate a machine to it, or even reboot into it. (I hope - depends on how the free vm player works.)
So with any luck... back to normal next week!
Speaking of source control... I've reinstalled Visual Source Safe so I can get access to my old repository but I'm thinking I want to install SubVersion. This would bring me upto date a little and allow others to check stuff in/out of my depo. Russell's been moaning at me for months to let him get access to the debugger and so he can keep upto date with the XeO3 source. I have come across a tool which converts VSS databases into subversion ones, so I'll have to give that a go - I like having all the history for them, but as long as I still have to old VSS repository I guess its not a huge issue.
The guys wanting to do a CPC+ version of XeO3 got in touch (again - I missed them 1st time around; my bad), so we'll have to have a chat and see if they meet the criteria for offical developers (Yes, I'm a picky bastard...).
I'm having a slight issue with my new install as it's a 64bit OS, my 32bit apps are struggling to talk to the parallel port. Still, once I get DevStudio installed, I'll see if I can fix all that. It should also mean I can release 32+64 bit versions, or I might take the opportunity to port them to C# and mono.
I've also downloaded a VMPlayer and will get a mono vm image so I can start doing Linux support. This will let me play with Linux without having to dedicate a machine to it, or even reboot into it. (I hope - depends on how the free vm player works.)
So with any luck... back to normal next week!
Friday, October 31, 2008
uniracers_credits
So someone was asking who was who... so here we go (hope I remember it right!) Clockwise fomr the top-left.
Robbie Graham - Artist
Malcom Scot Maxwell - Game coder and project leader
Dave Jones - Boss, Big cheese, and all round pest.
Andrew Innes - Front end, stats and general coding.
Martain Good - CG artist (did all the unicycles!)
Steve Hammond - Manual
Mike Dailly (Me!) - Level Editor, Uniracer compression, SNES framework and tools.
Colin Anderson - Music and effects.
Craig Arbuthnott - Head of testing
And I cant remember the last two. Testers I think....?
Head over to the staff pics on the Flickr account for better (all be it older!) pictures of some of us.
Robbie Graham - Artist
Malcom Scot Maxwell - Game coder and project leader
Dave Jones - Boss, Big cheese, and all round pest.
Andrew Innes - Front end, stats and general coding.
Martain Good - CG artist (did all the unicycles!)
Steve Hammond - Manual
Mike Dailly (Me!) - Level Editor, Uniracer compression, SNES framework and tools.
Colin Anderson - Music and effects.
Craig Arbuthnott - Head of testing
And I cant remember the last two. Testers I think....?
Head over to the staff pics on the Flickr account for better (all be it older!) pictures of some of us.
Demo coders....
There was a post on plus4 world about how to teach new people to code on the Plus4 and it got be thinking about some pet hates. Demo coders are renown for keeping sources to demos secret, never releasing anything but binarys in case someone steals their ideas. Others don't release code becasue, well... demos are usually hacks that are horrible bits of code and they don't want anyone to see just how much of a hack it is. Great Demos usually flow like works of art, but if you saw the internals, then its like being told how a magic trick was done, and the wonder falls away.
Still, I was thinking.... I never really code demos because, well... I'm not very good at them. Sure I can code things so they run quickly, and I can code things so that they're small. But I've never been good at prducing great demos folk really want to see. That said, I think theres a market (as it were) for demos that simply show how to do something. Kind of like online tutorials, simple demos that show off a simple effect and how to pull it off. This would allow others to use it and do what I can't, make great demos - or perhaps even use the effect in a game!
I was watching the demo posted here and was trying to think how they did the full screen scaling coz I think it would be cool in game. I think now I know but I also suspect that if the source was available I'd be much more interested in using/trying that I am now. Anyway, Csabo over at plus4 world is thinking about this too and I think its a great idea. If nothing else, it adds something valuable to the scene - which is what its all about now.
Still, I was thinking.... I never really code demos because, well... I'm not very good at them. Sure I can code things so they run quickly, and I can code things so that they're small. But I've never been good at prducing great demos folk really want to see. That said, I think theres a market (as it were) for demos that simply show how to do something. Kind of like online tutorials, simple demos that show off a simple effect and how to pull it off. This would allow others to use it and do what I can't, make great demos - or perhaps even use the effect in a game!
I was watching the demo posted here and was trying to think how they did the full screen scaling coz I think it would be cool in game. I think now I know but I also suspect that if the source was available I'd be much more interested in using/trying that I am now. Anyway, Csabo over at plus4 world is thinking about this too and I think its a great idea. If nothing else, it adds something valuable to the scene - which is what its all about now.
Wednesday, October 29, 2008
It's alive!!!!
I've rebuilt my PC, got a hold of a version of Vista64 and got it all up and running. I've also installed my new copy of office so my email is working fully again, which brings me to another point. If anyones been trying to get in touch and I haven't responded then feel free to ping me again as email should be back to normal.
I now have to reinstall all my normal software again, which will take a couple of evenings I guess, but I hope that by the weekend, I'll be back to normal - but with my fancy new quad core. I have also gotten two new terrabyte drives to try and get rid of all the little drives my PC was using, so with any luck... I shouldn't have to do this again for a long time!
I now have to reinstall all my normal software again, which will take a couple of evenings I guess, but I hope that by the weekend, I'll be back to normal - but with my fancy new quad core. I have also gotten two new terrabyte drives to try and get rid of all the little drives my PC was using, so with any luck... I shouldn't have to do this again for a long time!
Subscribe to:
Comments (Atom)