JavaGear

Java Sega Master System & Game Gear Emulator






Monday, October 29, 2001
 
I rewrote a large portion of the graphics engine yesterday. While far from perfect, it made it easier to implement horizontal and vertical tile flips on the background tiles, which has fixed a lot of the corrupted graphics on startup screens. Satellite 7 is an example of this. Additionally, a certain amount of transparency between sprites and backgrounds is now working. Unfortunately, I've still got no reasonable in-game screenshots as there are some nasty bugs relating to sprites. I've still got a few other issues relating to background colours and transparency to work on.

I was also having trouble with Teddy Boy Blues which autostarted, and didn't wait at the title screen. I mirrored the joypad ports to 0xC0 and 0xC1 and this fixed the problem. Following that, I tried to solve some problems in other ROMs by rewriting some opcodes to be emulated more accurately. I have nothing really to show for this work yet.


I've got two main priorities at the moment: Fix the sprites so that they work fully, and build a debugger for the Z80 core so I can locate troublesome opcodes. Hopefully, I'll have something more exciting to report once the debugger is complete.


Friday, October 26, 2001
 
Today I emulated the Z80's Memory Refresh Register and emulated some more ED opcodes (about 20 documented opcodes remain). I was having trouble with Great Baseball, which was causing JavaGear to crash. The program counter became set to an invalid memory location. This was due to incorrectly setting the sign flag in the INC (HL) opcode. I fixed this, and the ROM no longer crashed. Currently, all the 32K ROMs I have run to some extent - they all reach the title screens, and some get further. However, I need to work on the VDP before any real visible progress will be evident.

Wednesday, October 24, 2001
 
Yesterday, I implemented some more ED opcodes that were preventing a selection of ROMs from running including NEG, RRD and RLD. There were still some graphical problems after doing this, so I tweaked the VDP code. I found a couple of bugs relating to background palette selection and priority. After fixing these a number of ROMs correctly displayed their title screens, including Hang On and Ghost House. Check out the screenshots section, for some new images.

Sega Hang OnGhost House

I also established the cause of some of the graphical corruption. I believe it's simply due to the fact that I haven't emulated the horizontal and vertical flips on the tiles yet. Working on the VDP yesterday made me realise one thing: It needs a rewrite. The code was originally a quick hack, which has been added to and is now pretty messy. I'll work on this at some point in the future, after concentrating on more Z80 issues. Still, loads of stuff is running a lot better than this time last week!

Monday, October 22, 2001
 
The documented DD/FD prefixed opcodes are now complete. This has resulted in a large number of commercial ROMs running. I've only been testing 32K ROMs as the memory paging registers aren't present at the moment. So far a large number reach the title screens, including Kung Fu Kid, Spy vs Spy, Great Baseball etc. The Sega Master System Bios also starts to run, and displays the Sega logo before crashing out due to unimplemented opcodes. The ED prefixed opcodes are the key area that I have left to address, as I have only emulated about 20 of these so far. They'll take a bit long than the DD/FD opcodes as they are unique, and not just variants of existing opcodes. Overall, today has been encouraging, and a large amount of new software is running.

 
The work on the Z80 core continues. The 255 CB prefixed opcodes are now complete, and a few other opcodes are emulated. Not a lot more to report in terms of compatibility, but the Happy Loser demo partially works, and the commercial ROM, Great Soccer reaches the title screen. I'm going to carry on with the Z80 emulation before addressing graphical issues. I'll post some screenshots when the graphical problems have been ironed out in a few weeks.

Thursday, October 18, 2001
 
I've been working on the Z80 CPU emulation. The main 255, 8080 compatible opcodes are now all emulated. Additionally, some DD and FD opcodes are now emulated (it will be very easy to emulate these, as I can reuse a lot of code). What are the results? Not a lot yet. However Tetris Version 4 works and Sega's Bank Panic shows the title screen (with a few graphical bugs, that I'm not going to worry about for now). Interestingly, Tetris Version 3 also runs but exhibits graphical errors. I'm not sure if these are CPU or VDP problems yet. I'm going carry on finishing the opcodes, and recoding various sections of the CPU emulation over the next couple of weeks.

Saturday, October 13, 2001
 
Well, I'm back from Thailand and have returned to university. This last week I've been working on the Project Specification, which you can find in the documents section in PDF format.