• Welcome to Videopac / Odyssey2 forum.

MAME emulation improvements

Started by hap, January 26, 2021, 07:43:19 PM

Previous topic - Next topic

hap

I'm a developer for MAME (emulator software)
https://www.mamedev.org/
https://github.com/mamedev/mame

I suppose I can make this a followup post to this old one: https://videopac.nl/forum/index.php?topic=547.0
A couple of years ago, MAME incorporated MESS. So it's not just arcade games anymore, but anything goes. Including of course Videopac and Odyssey 2.

I recently did further improvements to the Videopac/Odyssey 2 emulation. Let me summarize them briefly and then I'll mention known remaining problems.
- cpu: fixed timer interrupt, some other bugfixes
- i824x(video chip): fixed collision detection, fixed some quads not showing, and increased renderer accuracy from per-scanline to per-pixel
- ef934x(the extra videochip in VP+): added double width/height, cursor, blink, bugfixes
- cartridge types: added Chess, Home Computer, Philips Service Test, 4 in a Row, Rally

Known problems:
- Backgammon does not draw all chars/sprites. I have no clue why and gave up trying, maybe there's an undocumented i8245 trick.
- Helicopter Rescue sometimes locks up on the sea level. Not sure, could be interrupt problem.
- Puzzle Piece Panic video glitches on PAL (works fine on odyssey2 and odyssey3). I think it's caused by imperfect video timing.
- Great Wallstreet Hunt has some video issues on PAL, maybe the dump we have is for the USA version and the Videopac rom is slightly different.
- major system overlay with itself doesn't work like on the real console (Rafael uses it to his advantage in some homebrews), this would need more research

For those that are interested in the VP/O2 related source code:
main driver file:
https://github.com/mamedev/mame/blob/master/src/mame/drivers/odyssey2.cpp

cartridges:
https://github.com/mamedev/mame/tree/master/src/devices/bus/odyssey2

softwarelist:
https://github.com/mamedev/mame/blob/master/hash/videopac.xml

8048 CPU:
https://github.com/mamedev/mame/tree/master/src/devices/cpu/mcs48

8244/5 video chip:
https://github.com/mamedev/mame/blob/master/src/devices/video/i8244.h
https://github.com/mamedev/mame/blob/master/src/devices/video/i8244.cpp

EF9340/1 video chip:
https://github.com/mamedev/mame/blob/master/src/devices/video/ef9340_1.h
https://github.com/mamedev/mame/blob/master/src/devices/video/ef9340_1.cpp

Actually, when I started coding on the emulation, my intention was to add that Chess Module. But as I progressed I saw more and more problems, so I just fixed/improved whatever I could.
Since my initial mission was the Chess module, lemme finish this post with a screenshot of that:

(I really can't get used to those chesspiece sprites)

hap

Something else I forgot to mention, it's valuable to O2EM users too:
René shared some of his rom dumps, and if you google around for the MAME videopac softwarelist they should be in there.

- Des Chiffres et des Lettres
- Philips Service Test Cartridge
- Sherlock Holmes prototype
- Linguaduc prototype

Odyssey3 prototypes:
- Attack of the Timelord
- Baseball
- Flash Point
- Freedom Fighters
- Killer Bees
- Terminal Program

Rafael

Thanks by your efforts, Ill be checkin it.

Florian

Quote from: hap on January 28, 2021, 04:16:37 PM
René shared some of his rom dumps, and if you google around for the MAME videopac softwarelist they should be in there.

- Des Chiffres et des Lettres
- Philips Service Test Cartridge
- Sherlock Holmes prototype
- Linguaduc prototype

I'd love to try those out with O2EM (or MAME). But unfortunately, I can't find those roms via a google search.
Is there a link?  :-*


Quote from: hap on January 28, 2021, 04:16:37 PM
Odyssey3 prototypes:
- Attack of the Timelord
- Baseball
- Flash Point
- Freedom Fighters
- Killer Bees
- Terminal Program

What is Terminal Program? Is that a game or could it be it was a terminal emulator for the O3 ???
(If the latter, how's a connection supposed to be realized (serial link?))

hap

I won't pretend that I don't break copyright laws, but I don't think it's a good idea to do that on a forum.

"Terminal Program" is not much, you can type stuff on the screen. I don't know what the final product was supposed to be (or if it even was meant as consumer product). I've made a screenshot.


Florian

Quote from: hap on February 04, 2021, 06:08:09 PM
I won't pretend that I don't break copyright laws, but I don't think it's a good idea to do that on a forum.

Ooo, I didn't mean anything bad  :-[
This stuff is almost 40 years old and mostly prototypes that were given to members of this Videopac community, so I assumed there was no legal issues.

Quote from: hap on February 04, 2021, 06:08:09 PM
"Terminal Program" is not much, you can type stuff on the screen. I don't know what the final product was supposed to be (or if it even was meant as consumer product). I've made a screenshot.


Thanks for the screenshot, it does look like it would be a terminal emulator indeed. And with it, you may have connected online to bulletin boards, etc.
I found an awesome prom video for the O3, look after 2m 22s: https://www.youtube.com/watch?v=HU5LiZH_W7Y

Perhaps we can use this tty to operate something like a RaspberryPi from a Command Center, that would be so cool to try :)  8)

∆ + 0 / 9

#6
Thanks for improving VIDEOPAC on MAME! The sound and the performance is much better than on the regular OEM2 emulator.
I found a bug on the following game called VOLLEYBALL, it's the VIDEOPAC game number 28. When you play it in 2 player mode, the 2nd player cannot serve the ball. It's just stuck while serving the ball in the game. This game is running normally on the O2EM emulator when using the french version but not with the normal version.
I hope you can you fix this in the next MAME version. This would be awesome, as I played this game in my youth with my father and brothers.

All the best from Switzerland,
;)  ∆ + 0 / 9

https://videopac.ch
https://videopac.eu

∆ + 0 / 9

My brother fixed the bin file by moving the ball 1 pixel! Now serving works with player 2.
;:)

bataais

Yeah, I did. :D Just changed 0x8c at address 0x375 to 0x8d (Player R start ball x-pos +1 pixel). Now the ball touches the serving right player in MAME. Good enough for now to be playable.
You cannot view this attachment.

Btw. the french version only changes displayed text to french..

bataais

Or change 0x387 from 90 to 8F, (player R start x-pos -1)..
Some collision issue in i8244.cpp I suspect.

You cannot view this attachment.

Pickaxe Brad!

#10
Those are two good mods, but there is a *slightly* better option, IMHO:

This ROM changes 0x0776 0x39 to move the ball a subpixel (sprite X-resolution is double the drawing resolution, but the extra bit is in the next byte).  This ROM runs in MAME to look just like the original cartridge looks on my TV.

If the OP MAME dev is still following this thread, the same collision issue happens in Computer Golf when you hit the ball into the hole from the a drive on the fairway (meaning you didn't even get to the putting screen yet).  The Odyssey2 detects this and finishes the hole correctly, but not MAME.  It sounds like a small thing, but it's really frustrating to hit the ball out of the hole so that you can get to the putting screen to tap it in (along with the two additional strokes on your score than you deserve).
Does anyone read these signatures?  Let me know in your signature.

hap

Yes, Volleyball doesn't work properly on MAME. I believe the sprite/char positioning is correct so graphically nothing is wrong. But something's not right with collision detection, apparently a real Videopac will in some cases (how?) detect a collision when 2 objects are adjacent to eachother and not overlapping.

A few years ago, I did have a look at why the game works fine on O2EM. Answer is simple: it has a workaround for it. Like: if (game is volleyball) then { move all the sprites a bit to the right }

bataais

#12
hap,

while programming CHESS4K, I encountered a strange bug in MAME.

Something to do with memory bank switching SEL MB0/1.

PC was in MB0, MB1 was selected, and I forgot to switch to MB0, calling somewhere.
But MAME called the right subroutinge in MB0, all was working fine, I thought.
But on O2EM and the real machine it didn't work.

example:

A11 set to 1

0:77B call $5A0 B8 21 ;->
1:5A0 mov r0,#$21 B4 B7 ; PC is shown correctly, in MB1, but it calls in MB0!
(DA0)

(Memory View in Mame Debugger shows, MB0 is repeated from C00-FFF)

MAME Mermory View
000-3FF      8048 internal ROM
400-7FF      external ROM MB0
800-BFF      external ROM MB1
C00-FFF      external ROM MB0 repeated!!

So if it wanted to call DA0, it landed in MB0, instead of MB1!

This bug in MAME makes it hard to program and debug new games, I hope you can fix it?
(Maybe it's already fixed? I use MAME 0.261)

BTW this was a 4k rom, cartridge bank 02, not 03

hap

#13
Hi bataais, good to see you making homebrew games.

It sounds like the exact same issue Pickaxe Brad told me about a few months ago. If so, then I believe it's fixed here: https://github.com/mamedev/mame/commit/4c8a6cd650f8c76ef404f0a414912f37c7e01a34