Victoly Programming Log

9/26/2000

I've may not have been updating, but I've been working on this project like a madman all this month and last. I made a huge number of fixes detailed in the readme file, but most importantly, I have beat the the benchmark of 60fps on my own development machine! The sweet taste of victoly is mine! I also shipped Alpha 4 out to testers and finally, the first beta version is now available to one and all.

I am still working hard on finding and fixing memory trashing bugs and emulation mistakes. Please do write to me about any problems you may be having, I am keeping a list of such issues and working to repair them all. Next up on my list of things to do is add in color support and hopefully, sound. Sound is very very hard so it will be quite a while before I release anything with sound enabled.

 


8/2/2000

I've been on vacation on Lana'i these last couple weeks. I also got a new job, a new car, and I'm moving into my dorms shortly. Yeah I been busy.

But I haven't been slacking! Alpha 3 went out today and its got a lot of new changes! I added much better file handling code that detects valid roms and won't file type invalid files (like your Finder for instance...whoops!) The standard deluge of errors has been removed and replaced with useful message boxes.

There were a lot of changes made to the video rendering (again) and its a hair faster and all flicker and garbage tiles related to rendering are fixed. I also changed the way the window rendering works and more demos and games work now. Space Graphics that comes with Virtual Gameboy works correctly for instance.

I'll try to get a movie up for your viewing pleasure shortly.

 


7/7/2000

I sent out Alpha 2 today that addresses some things that were bothering me, namely a speed limiter and a frameskip control. I still have a fair amount of work to do on the video system to improve performance and to fix up a few graphics mistakes.

 


7/6/2000

Alpha 1 of my project has been released to testers! If you want to get a copy, drop me a line and say so! I made some last minute changes that make the program run much much faster (Do I say that a lot or what?), so it needs a frame limiter on many macs, but its still a lot of fun to play with. I got some good sound documentation from the author of Boycott (I'm not cool enough to see any actual code), so I may work towards that end as I go along...the Gameboy has a white noise generator, I bet that can't be too hard to get right!

 


7/4/2000

Sprite priority issues explained:

 

The picture on the left is from my project, the right is from Boycott. In Boycott, the grass appears to be in the foreground of Samus, and in my project, Samus is in front of the grass. This is because I do not currently do anything about the Priority attribute that can be activated for sprites on a Gameboy. While this glitch with Samus is minor, certain games have some serious layering problems. What I will be doing in the near future is experimenting with ways to come up with the same priority effects in order to prevent these problems.

Also, as of this morning, the battery ram features of the circuitry I was able to find information on is now working. So that means you can save your Zelda and Pokemon games now. The project generates BAT files so as not to conflict with Virtual Gameboy's SAV format. If possible, I will attempt to add compatibility with the SAV format so that you can bring your VGB and Boycott games into this project and vice versa.

I also fixed up a memory leak that may have been causing some crashing problems I've been having.

I will likely be getting an alpha version of this project out to everyone who requested to test either later tonight or tomorrow night after I make some last minute adjustments to the interface and try to hunt down any annoying problems.

 


7/1/2000

I did more work on the video that speeds up a lot of games but causes the Donkey Kong series to scroll erratically. I'll probably have fast video as an option later on if this causes too many problems.

Next up on my list is the battery ram support and more bug fixing of the emulation core. I still can't play a rather large number of games. Also the sprite priorities are not handled at all, which causes some layering issues in games like Megaman 2 and Kid Icarus, among others. I'll try to get that added.

Things are doing good and if all goes well an alpha release will be available in about a week.

 


6/26/2000

I've gotten a little movie of the project running a game. Check it out.

I made some massive changes to the tile code and its pretty much as fast as its going to get. I have it decoding an entire tile at once and splatting it just as fast with no tile overlap from the scroll settings. Early guestimates would indicate a custom blitter would be appropriate to deal with the large number of unchanged pixels between frames...I'll get to that sooner or later.

 


6/23/2000

10 days without an update? Have I died? No! I've been wracking my brains for a faster scanline decode scheme and speedups overall. Did I get anywhere? Well, yes! I managed to double the speed of the video output without mangling the graphics (no mean trick). However there is still a long way to go. A pox on planar video.

I thought up an efficient manner in which to cache the background palette, which eliminates a rather large set of calculations that were done every pixel and this has been helpful in boosting speed. I have also moved away from the 'calc pixel, draw it' method to one that collects all the pixel bits at once and blasts a whole tile afterwards..this condenses the rendering code into fewer pixel plots and allows some internal loops to hum along a little faster. I'm still decoding pixels one at a time, but I'm sure there is a way to decode all 8 pixels in a tile instantly...that would cut the work done in the decoding section down by quite a lot. I feel like I need a mathematical leap to figure it out and its eluding me at the moment.

So basically, the emu is a lot faster, but not fast enough, that's more or less what I've been up to.

All this work has been done on the greyscale routines, the color video is going to be butt slow, if it turns out to work at all. Hopefully it won't be so bad once I get the greyscale figured out.

 


6/13/2000

Wow what an incredibly shitty birthday! Let's never have another! Okay I spent a lot of time optimizing the z80 core for speed and did a lot of experimenting in order to try to figure out where the slow parts are. I have to make some radical changes to my rendering system cuz the current method is simply too damn slow...not the drawing mind you, the whole 'take a scanline and figure out what the pixels should look like' step. The lag time really adds up over 144 scanlines. I chopped out the offending lines, which screwed up the background, but gave me fantastic speed. So I'll be working hard on a better way to decode scanlines.

Oh yeah, I fixed a relatively minor I/O problem as well, it brought up compatibility a bit. I seem to be getting about 50/50 as far as working games go.

 

Oh dear god, look what game is working now.

 


6/9/2000

Today's my birthday, yay. I added some buffering for the video and put in my absolutely fastest drawing code from a previous experiment I was doing. The buffering fixes gibberish tiles that were drawing between vblanks and overall the games seem to run as fast as the z80 can be emulated. The color palette has been changed a bit cuz it looked too dark to me. I also repaired the gameboy's windowing feature and the results are rather nice:

 

The previously black status bars in many games are now fixed. I finally figured it out when I changed over to my custom drawing code and saw yellow numbers and images. The windowing code wasn't using the gameboy's internal palette. Oops!

Games like Sword of Hope, which rely heavily on the windowing feature work great now.

 

 

Added compatibility lets these games run now.

Final Fantasy Adventure really needs some hand holding to work, but it eventually does start to play.

Castlevania Legends works great!

Somehow I broke support for Tetris though.

 


6/8/2000

I added some improved drawing code on 6/6 that gave the emu a good boost in speed and game play is more or less acceptable on my G3. I also streamlined the heck out of the z80 core. Got a lot more work to do before this is really worth releasing though.

I fixed some condition register results that were incorrect for a couple of opcodes, which fixed up several games so that they actually run...Super Mario Land 2 responds to input after this fix, but crashes itself at the save slot screen. There are still what appear to be math errors with Super Mario Land 1, and Megaman, which seems to work now, does very odd things when you try to jump. Many games have parts of the screen that don't seem to draw or get updated, I suspect they are trying to use the gameboy's window feature which I haven't actually verified is handled correctly.

I caused a bug on 6/6 late that night that gave me headaches for several hours..an innocent int changed to a byte caused all background tiles to smear when scrolled. Took me HOURS to find that mistake! Good thing I keep all revisions of my projects or I never would have found it...and I mean never...whew.

 

Say, this looks familiar....just needed some conditional results from certain opcodes to start working.

Several games have started to work that were previously locking up, but most crash or act weird at some point. Still more bugs to fix!

 


6/5/2000

I fixed up my DMA problems and also a math problem with the sprite rendering and another problem in the sprite rendering that screwed up the colors. I also did a lot of work on removing some of the emulation overhead and managed to get a noticeable speed up, though a small one. Take a look at the results:

 

Hey look! Samus is running around! Which is great cuz this is one of my all time favorite games.

There are some glitches between screens but they clear themselves up, so I'm not sure how to go about fixing them. And notice the status bar is messed up.

 

 

Missing graphics? Fixed at last! Zelda seems work rather well, no glitches except the status bar, no freezing and all the special effects are working. Very cool!

Kid Icarus and Dr. Mario also play perfectly without glitches.

I am going to be working on ways to speed up the games that actually play now that I'm getting good results, as well as fixing some game glitches (Super Mario Land 1 is a big offender graphically). Sound won't be added until I can get decent speed and color support is already present, though remarked out so as not to give me a hard time while debugging.

 


6/4/2000

James Jarvis wrote that he'd like me to write some slightly more technical information about what I am up to in the project, so here's a quick update. As you may have noticed, none of the recent images seem to have any sprites...mostly this shows up in the form of missing graphics.

The Gameboy actually has a special range of its memory reserved for sprite images, this is called the sprite ram, its about 160 bytes in size (enough info for 40 sprites). In order to set the current image of a sprite, the gb program has to start a DMA transfer from its defined set of tiles in the rom into sprite ram. Its sort of like 'uploading' the 8x8 tile from the rom to active memory. I have some code in the project which attempts this process, however upon inspection it seems clear to me that I've done it completely wrong, luckily sprite ram is never set to anything in particular, so at least no gibberish appears on the screen. But the DMA transfer is reading from the wrong place and writing to the place, which eventually crashes the ROM in many cases. Background tiles aren't set via a DMA transfer, which is why the backgrounds of the games are visible. Hopefully I can fix this mess in a day or so.


6/2/2000

I fixed about a dozen emulation mistakes and I fixed a lot of crashing/freezing games! Check it out!

 

I have *finally* fixed that stupid bunch of messed up tiles in this game. And it STILL won't respond to input! What's a guy got to do?

Oh well, its pretty to look at.

 

 

Metroid 2 no longer bombs when you press start...it actually starts!!!!

I'm not sure if Samus is invisible or if the game freezes here, but this was quite surprising to see suddenly work!

 

 

Dr. Mario actually plays! The sprites are sorta hit and miss, but the ones that appear even animate correctly:-)

This game also responds to input and appears to be working; my score and virus count changed as I fooled with the controls..too bad I couldn't see where my pieces were!

I got that stupid '0' thing fixed too.

 

 

Here's a game that never worked at all until today...one of the old school games from yesteryear. It tries to get started up, but I'm fairly sure it is freezing at this point...even though the sprites seem invisible, the game doesn't scroll.

 

 

This is another one that gave a scrambled screen previously....suddenly it was doing palette fades and scrolling the story for me! Wow!

Kid Icarus got a good distance but right about at this screen I'd say it gave up on me.

 

 

I saved the best for last :-) Even the opening sequence works!!!! Zelda has a lot of missing graphics, but this is in fact one of the best working games! My jaw hit the floor when I saw this. Programming is occasionally fun :-)

Pokemon does not work yet though, hehe

 


5/29/2000

After a barrage of tinkering and experimenting, here we have some working roms!

 

Right here is the second game that worked at the beginning. It originally had a color scheme like the first image below, but it didn't take me very long to appropriately get the palette colors and attributes correct.

This game goes into an infinite loop at the title screen :-(

 

 

This is one of the few games that actually tries to animate and for all I can see, it is even working. Astute readers will note the 'start' and 'continue' options are missing, they are actually sprite images which the project completely messes up.

This game crashes with an unknown opcode when you press start.

 

 

Dr. Mario suddenly started working after I fixed a tile image problem that gave scrambled screens...it should start animating immediately but seems to loop forever after setting the background tiles.

Notice the weird '0' in the title border?

 

 

This is one of the three games that I have been able to verify as 'not crashing or looping forever'.

However, after about, oh, 10 seconds of trying to animate the dancing Kirbies (you know what I'm talking about), Kirby's Dreamland goes insane....->

 

 

Kirby's Dreamland 2 doesn't fare nearly as well....ug...its trying to do something, I have no idea what though.

 


5/24/2000

This is after about 2 weeks of heavy duty coding...I wasn't even sleeping, just ask the people I live with. I enabled some graphics routines for the heck of it, and after seeing black screens and white windows for a week or more, SOMETHING DREW IN MY WINDOW!! WHOAAA!!! Sorry, I'm easily amazed.

Whoa, this was the very first image my project ever displayed for me...I was really floored when it happened and immediately went to my favorite hotline server and told everyone that I was an 37337 emu portier, cuz I like to say portier as much as possible. This image also blew me away cuz it drew nearly instantly and I was expecting really bad performance from it.

 

The colors...well I can explain that. I put together an rgb image based on not the sprite color, but the gb palette index number and the tile attributes, resulting in a crazy set of colors, but it lit up parts of the window that would have otherwise been blank or pure black at this early stage.

After some tinkering I fixed some of the glitches, but it still loops forever at this screen.

 

That's all of em. Head back to my main page.