Wednesday, 30 January 2013

Day 30 : First Release

I'm finally letting the game out into the wild.  You too can have hours of fun minutes of amazement that anyone would charge for such an awful piece of software.

The game is mimiced as closely as I can figure out from the screenshots and instructions.

You can download two extra files from the links on the right.

build.zip is a zip of the whole build tree (it is about 0.6Mb in total), all the source, all the code, the whole lot, you can see at first hand how erratic a programmer I am :)

release.zip is a much smaller archive which has the emulator (which requires Java 6 or better) and the game ROM, plus a couple of text files, i.e. just the bits you need to work.

The emulator has been updated again, but I've just removed the sound emulation because the game doesn't use any sound at all, and I don't know how well it copes on other machines, so I've just removed the code.

Given the minor detail that tomorrow is the last day in January it is unlikely that you will get the option to play these games on your TV. This is probably a blessing.




Monday, 28 January 2013

Day 29 : Read the instructions.

Woke up early so done some more testing and everything seems okay, so far.

Just realised I have made a minor error which I should have spotted ages ago. In the instructions it says when you "Double" in Blackjack you take one more card from the deck and that's it.

At the moment in my version if you double you play as normal except for the bet being doubled.

The rules do make sense, otherwise you just automatically double if you have a good hand ; there's no risk involved.

This fix should be fairly trivial though, but I will have to do it later on today.

Doesn't look like I'm going to have time to get the hardware version up and running. 

Day 28 : ROM Completion Day

I have some time to work on this today. So my aim is to complete the ROM image so that the Blackjack game will actually run. I hope to release a working game at the end of today.

Update 1 : So far : fixed a bug in the assembler (duplicate labels.... must've been asleep) and completed the gameplay core. Apart from testing, I only need the code for the special bets (doubling and insurance) and bet selection / player selection / bankroll selection / game selection code, all of which is hardcoded at present.

Update 2 : All the special bets are now coded and tested briefly. Just the selectors to do now.  The ROM size is 1724 bytes, comfortably within the 2k limit. Might even have space for a title page.

Update 3 : Now code complete. Chased down a couple of bugs (not fun without a proper debugger for the RISC Machine), so not yet releasable, want to test it a bit more yet. But it is complete at 2,026 bytes, just enough to fit into a 2k ROM.

Mind you the debug time is my own fault. I was calculating the offset in ROM as $1000 whereas it was actually $1200 so all the tracking was 512 out. 

Actually I could trim quite a few bytes. There are quite a few examples of code that ends something like,

bl someroutine
ret

which I could just shortcut into 'b someroutine' but I just don't like that sort of coding.  There are quite a few subroutines which are really broken down for clarity, things like that. I'm not using the Executive sound routines at all.

However, I will uploaded the latest Executive (1.3) and Blackjack (0.91) sources if anyone wants to have a look.

Friday, 25 January 2013

Day 25,26,27 : Nothing

I have done nothing this weekend. I hope to finish the Blackjack/Executive ROM image on Monday.

Thursday, 24 January 2013

Day 24 : Not much Game Development (cont)

Not much coding done today at all (had a tooth out at the Dentists), so for a picture this post I've created a diagram showing the 'stack' that is running.

At the bottom, the JVM. On top of this, a Java Unisonic Champion Emulator in Java.

The next level up is in CP1610 Assembler Code, assembled via the Intellivision SDK, and that is an emulator for the RISC VM that runs on the emulator.

The last two levels are the Executive ROM, containing standard routines, and finally on top of that the actual game code. Both of these are written in RISC Assembler and assembled using the Java program urmasm.jar.

Tomorrow, I hope to finish the game. In beta , anyway.

Wednesday, 23 January 2013

Day 23 : Game Development (cont.)

So, a little bit more development today. You can see I now have code dealing cards and counting their best totals, BlackJack style. Player 2 has gone bust, Player 2 has 21 through sheer dumb luck :)

Baccarat is really a simpler variant with just one round of 'hits' and a different scoring system, so tweaking the code for this is pretty simple.

At present the game, bankroll, #players and bet selection code are all dummies, though this is easy enough to write, as I've already written the menuing code and that works fine.

The bottom right white square is just a note to let me know the code has completed running. I don't have a debugger for this code, other than that in the CP1610 Emulator, so old style debugging methods are in use here.

The running is still slow - which is not unreasonable as it's a fairly slow processor (CP1610) which only runs when the vertical blank is on (25% of the time), and the processor itself is running a virtual machine emulator. It's fast enough for this sort of game. It would (like Chip 8 which on a 1802 system has all the same problems) struggle a bit with Space Invaders, but then that's near impossible on this system anyway.

I suppose I could have just written it in CP1610 machine code in the first place, but I do quite like coding in this RISC VM, and if I have time to port it to Arduino, which might be a bit of a stretch in the week remaining, it will make it much easier as I only have to port the VM, not the 1610 - this also solves problems such as an Arduino having seperate code and data and a 1610 not - the VM has ROM code and small RAM data so it's a pretty good match for an MCU.

I actually have got, somewhere, an Arduino screen display that does something like 24 x 20 with a 6 bit character set which would work fine so maybe the Arduino version wouldn't take long to code up, given that I already have a 'C' core.

Tuesday, 22 January 2013

Day 22 : Blackjack/Baccarat Development

Started today on developing the actual game that is part of the System ROM.

Lots of skeleton work and basic design work and starting the coding, not done a lot really, half an hour or so on it.

I think it will work but it will have that Chip-8 sort of feel where games sort of slide on slowly rather than just appear.