Videopac / Odyssey2 forum

Emulation => Emulating the Videopac / Odyssey2 => Topic started by: manskirtbrew on March 10, 2014, 08:12:44 PM



Title: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 10, 2014, 08:12:44 PM
Way back in the day, I wrote Nostalgia, an Intellivision emulator. (http://www.intellivision.us/intvgames/nostalgia/nostalgia.php) Recently, I'd been itching for a new project. The Odyssey2 was the first console we had as kids, so I thought it'd be fun to try.

I'm mostly doing this as a challenge to myself to see if I can build the emulator just from available documentation. So far things are going well. This board has been a tremendous resource for information, so thanks for that!

Most of the roms I've tried work, even the cool intro for Killer Bees.

I've attached the latest version to this post. I'll edit it as I update versions so you don't have to find them all over the thread.

Latest version 0.6
- Command line options temporarily removed
- F2 toggles sound
- F3 toggles fullscreen
- F4 resets CPU
- F7/F8 decreases/increases volume
- F9 toggles pause
- GUI loader displays all ROM files. Double-click to play
- Input keys are now customizable via keys.cfg file
- Valid key codes are listed in key_codes.txt file
- Config data and screen size/position is now stored in options.cfg file
- I know there's a gray bar at the top. Working on that.


Title: Re: New Odyssey2 emulator: Homer!
Post by: Rafael on March 12, 2014, 02:03:57 AM
I would like to test your Homer, do you have a direct link?


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 12, 2014, 02:40:01 AM
I'd like you to test it too! Is the Dropbox link not working for you?


Title: Re: New Odyssey2 emulator: Homer!
Post by: Janzl on March 12, 2014, 08:39:59 AM
For me the Dropbox link is working fine. You don't need Dropbox to download it.


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 12, 2014, 04:51:30 PM
I've got sound mostly working! Still a lot of pops and dropouts, but it's totally recognizable.

I also fixed the Atlantis sprite bug, after realizing there were too many sprites on screen at once and the code was re-drawing them mid-scan.

The new version should be up later today.


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 12, 2014, 10:22:32 PM
I figured out the Krazy Chase bug, too! Turns out it was writing to 0x80 in XRAM. Does Krazy Chase have a built in RAM chip?


Title: Re: New Odyssey2 emulator: Homer!
Post by: Rafael on March 12, 2014, 11:42:33 PM
I had pressed the button that would take me straight to hell. Now I found the correct link. m will soon test the Homer!


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 13, 2014, 01:59:10 AM
Okay, Homer 0.2 is up at the same location. (https://www.dropbox.com/sh/faqvupvbdqvaadc/GbnMESoYCu) Changes:

- Added sound
- Fixed sprite drawing to allow mid screen changes
- Fixed K.C.'s Krazy Chase

Also added a /s or -s option for Silent mode if you don't like the bad sound.


Title: Re: New Odyssey2 emulator: Homer!
Post by: Rafael on March 15, 2014, 01:41:23 AM
I just tried Atlantis, typed: homer atlantis.bin and received a error message ???


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 15, 2014, 08:17:19 AM
I get an error message, too. Something about a .dll file not being there. So I downloaded the dll file and got this:

The application was unable to start correctly (0xc000007b).


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 16, 2014, 10:04:07 PM
Oh I've seen that before. I think the problem is 64 vs 32 bit operating systems. Can you please tell me what OS you both are using? I'll check to make sure I'm building a 32-bit version, since that should work on both.

Thanks!

-Joe


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 16, 2014, 10:04:56 PM
Also, Chris, what DLL was missing? I thought it would only need sdl2.dll, which I included in the zip.


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 16, 2014, 10:33:26 PM
In the meantime, I rebuilt things and uploaded the latest code. Changes:

- Fixed bug in collision detection (caused KTAA to always detect hits)
- Fixed bug in sound emulation
- Fixed sound emulation to be much more accurate
- Added -v## switch for volume from 0-10

This is built for x86 and should include all the libraries it needs to run. Let me know how it goes for you guys.


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 17, 2014, 01:28:18 AM
It was MSVCP110.dll. I'm using Windows 7 and a 64 bit version.


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 17, 2014, 01:38:18 AM
I tried Homer 0.3 and I still get problems. Maybe if you removed the "roms" part of the file name system getting thingy (I don't know much about making emulators as you can see). I get this message:
"Unable to open file: roms\C:\Users\Chris\Documents\Homer_0.3\Homer\niceice26.bin Error: 22"


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 17, 2014, 02:02:06 AM
Oh you're giving it a whole path? The idea is the roms go in Homer\roms, then you run it just by specifying the name of the rom (like o2em does)

So you'd put niceice26.bin inside C:\Users\Chris\Documents\Homer_0.3\Homer\roms, then run:

C:\Users\Chris\Documents\Homer_0.3\Homer> Homer niceice26.bin





Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 17, 2014, 02:12:22 AM
OK, I moved it into the C:\ folder, and used DosBox because I can't find the DOS on my computer anywhere, and it gives me a message saying "this program cannot be run in DOS mode."


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 17, 2014, 02:25:54 AM
OK, I finally got Homer to run! I made a batch file since Windows 7 is too stupid and hides the DOS prompt for me. It's a great emulator, but it does have a slight screen problem (or maybe it's just me): there's too much space at the right hand side. I'm used to seeing the tree in niceice26.bin be centered between the edge of the pool and the right side of the screen. I guess it's because I'm playing my Odyssey 2 on a CRT that's 4:3 and not 16:9? Also, 2 should be down, not 5. On my keyboard, there's a down arrow on the 2 key. I kept pressing 2 to go down and nothing happened. So I had to look at the readme and found out that 5 is down.


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 17, 2014, 02:34:27 AM
Thanks Chris, that's all great feedback. The keys will be customizable and it will have a real GUI at some point. For now, I appreciate you working around the restrictions and trying it out for me.


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 17, 2014, 02:35:59 AM
Another little thing I noticed. In this game, sprite 0 is Santa and Sprite 2 is the reindeer. Notice what happens once Santa hits the reindeer in the two emulators. On hardware, Santa goes ahead of the reindeer.
EDIT: OOps. I meant to say O2EM. OdyEmu is the Odyssey 1 emulator!


Title: Re: New Odyssey2 emulator: Homer!
Post by: manopac on March 17, 2014, 07:55:27 AM
The idea is the roms go in Homer\roms, then you run it just by specifying the name of the rom (like o2em does)

well - current versions of o2em allow both ;-) (and look first for the file in absolute/current path, then in roms directory ...)


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 17, 2014, 05:37:20 PM
Interesting. I guess the sprites are emitted in reverse order.

As for the screen width, I did notice that my screen seemed too wide. However, looking at the docs I have, it seems sprites can be emitted up to X-position 181. From Kevin Horton's research on timing:

Quote
Sprites were reset to X coords B8, B6, B4, B2.

Sprites 2 and 3 emitted pixels this time, so the maximum X coord is greater than B4, but less than B6.

That also coincides with the time HBLANK starts, at half-cycle 365. So my screen width is set to 182.

Is there a more correct screen width documented somewhere?


Title: Re: New Odyssey2 emulator: Homer!
Post by: Rene_G7400 on March 17, 2014, 05:42:57 PM
It depends on your TV, but usually objects beyond Xpos= 168 are not visible anymore.


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 17, 2014, 05:49:03 PM
It depends on your TV, but usually objects beyond Xpos= 168 are not visible anymore.
Ah, okay. So the 8244 emits a pixel, but the TV can't necessarily display it. Great, thanks!


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 18, 2014, 05:59:34 AM
Apparently O2EM throws a fit while playing Computer Golf! I don't know why but it likes to shoot shots without you pressing fire. In Homer, though, there's no problem with this and it plays perfectly, once you get the sprite order reversed.


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 19, 2014, 05:14:32 PM
I've attached Homer 0.4 to the first post in the thread. (http://videopac.nl/forum/index.php?topic=2249.msg21776#msg21776) It should address all the issues you guys found, plus add a few new features.

Soon to come: a real GUI, saving settings/window sizes, control customization.


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 21, 2014, 12:21:35 PM
I don't see version 0.4 to download anywhere.


Title: Re: New Odyssey2 emulator: Homer!
Post by: manopac on March 21, 2014, 12:54:10 PM
just click on the link in manskirtbrew's post ... it's attached at the end of the first message ...


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 21, 2014, 01:56:22 PM
just click on the link in manskirtbrew's post ... it's attached at the end of the first message ...
Yup. I figured attaching it to the first post would be easier, then it's archived with the board, too.

Also, there's a small bug that if you just run Homer.exe and get the black console window, after you choose a game you have to click in the game window with your mouse to play. Sorry about that.


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on March 22, 2014, 08:17:26 AM
OK, I just ran Nice Ice again and this time I got this:


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 22, 2014, 04:07:17 PM
haha that's no good. I guess the sprite display isn't as simple as forward- or reverse-order. I'll do some more tinkering, thanks for testing it out!


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on March 26, 2014, 07:41:38 PM
Figured it out and uploaded Homer 0.5 to the OP. The problem was the way I'm drawing sprites and characters. I'm doing it per-scanline, but drawing out the whole sprite/char. So if they overlap, no matter what order I do them in, a character at a later scanline always overwrites an earlier one.

This is now fixed for sprites -- they're drawn line-by-line -- but still needs to be fixed for characters. It seems to have made Nice Ice work correctly (great game, btw!) and everything else still looks good.


Title: Re: New Odyssey2 emulator: Homer!
Post by: LS650 on July 26, 2014, 06:18:07 PM
I use O2EM all the time, but hadn't heard of Homer until just now.
I will check it out this weekend.


Title: Re: New Odyssey2 emulator: Homer!
Post by: LS650 on July 27, 2014, 05:31:47 AM
I tried playing UFO! and KC Munchkin; this is with an old Toshiba running Windows XP.

I offer some "constructive criticism"...
 1) Seems slightly slower than a real console; maybe 10% slower.

 2) If you don't have a full keyboard, it's pretty difficult to play using number keys for a controller.  My suggestion would be to make it possible to use some of the alphabetic keys work, such as WASD.

 3) Why use Del and Enter as the fire buttons?  Very awkward.  I would use the Control and Alt keys instead.

 4) Option to resize screen (at least 2x) is needed.


Title: Re: New Odyssey2 emulator: Homer!
Post by: manskirtbrew on November 06, 2014, 07:54:38 PM
Thanks for the feedback! I appreciate all constructive criticism. I've been busy opening a brewery (no, really! (http://www.manskirtbrewing.com)), but I decided to work on Homer a little. To address your feedback directly:

1) Seems slightly slower than a real console; maybe 10% slower.

 2) If you don't have a full keyboard, it's pretty difficult to play using number keys for a controller.  My suggestion would be to make it possible to use some of the alphabetic keys work, such as WASD.

 3) Why use Del and Enter as the fire buttons?  Very awkward.  I would use the Control and Alt keys instead.

 4) Option to resize screen (at least 2x) is needed.
1) Is your console PAL or NTSC? I should be running at 60FPS.

2) I have added key customization. You can edit keys.cfg to whatever you like.

3) See #2

4) Screen was resizable in the last release. Just drag the corner. Now the size is saved each time you run. You can also F3 for fullscreen.

See the OP to download the latest 0.6 version. (http://videopac.nl/forum/index.php?topic=2249.0)


Title: Re: New Odyssey2 emulator: Homer!
Post by: 19rsn007 on January 26, 2015, 03:06:23 PM
is this gonna be an open source project?
I would love to see/build a linux version :D


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on July 27, 2015, 10:54:17 PM
I doubt that this is being worked on any more, but I have found a small error in Homer regarding my fireball in the Plumber game I'm working on. O2EM and real hardware handle it fine, but Homer seems to add one x pixel to the character that makes up the center.


Title: Re: New Odyssey2 emulator: Homer!
Post by: PowerpointGOD on April 12, 2016, 06:24:40 PM
Sometimes i get a collision error popup. Is there someway to fix this?


Title: Re: New Odyssey2 emulator: Homer!
Post by: Chris! on April 19, 2016, 12:42:11 AM
I doubt it. The guy who made this seems to have vanished off the forums.