Pac-Man Core

wdelaar
Posts: 5
Joined: Mon Sep 19, 2022 8:46 pm
Been thanked: 3 times

Pac-Man Core

Unread post by wdelaar »

I have the Mister FPGA using an I-PAC for my input via USB. Everything works correctly; however, I am a hard core player trying to make it to the Kill Screen (Level 256) and it seems that this core does not match the Arcade. I thought by investing in the Mister that this would not be an issue. Am I doing something wrong? The Ghosts are not moving in the same pattern as the Arcade.
thorr
Top Contributor
Posts: 1311
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 634 times
Been thanked: 308 times

Re: Pac-Man Core

Unread post by thorr »

I have no idea, but maybe dip switch settings could affect this, or the ROM version, or there may be a different issue. I suggest to check the issues on github and create one with more details so someone can look into it: https://github.com/MiSTer-devel/Arcade- ... Ter/issues
Lightwave
Posts: 262
Joined: Sun May 24, 2020 10:06 pm
Has thanked: 137 times
Been thanked: 78 times

Re: Pac-Man Core

Unread post by Lightwave »

wdelaar wrote: Mon Sep 19, 2022 8:57 pm I have the Mister FPGA using an I-PAC for my input via USB. Everything works correctly; however, I am a hard core player trying to make it to the Kill Screen (Level 256) and it seems that this core does not match the Arcade. I thought by investing in the Mister that this would not be an issue. Am I doing something wrong? The Ghosts are not moving in the same pattern as the Arcade.
If you look in "Arcade/Alternates" you can find more Pac-Man ROM variants. Perhaps one of those has what you are expecting.
User avatar
Minpin
Posts: 24
Joined: Mon May 25, 2020 6:45 am
Has thanked: 16 times
Been thanked: 10 times

Re: Pac-Man Core

Unread post by Minpin »

goldenage
Posts: 22
Joined: Mon Feb 14, 2022 1:11 am
Has thanked: 1 time
Been thanked: 3 times

Re: Pac-Man Core

Unread post by goldenage »

The video linked above shows the difference between difficulty settings. On the original hardware there is a jumper that can be bridged that sets the difficulty and if I remember is read via the DIP switches.

You should be able to change the difficulty using the DIP settings in the Mister menu. Checking MAME, it looks like it should be switch #7 on DIP bank 1.

I would toggle that DIP switch, then try your patterns again. Looks like ON = Normal, and OFF = Hard. Not sure if I ever encountered Hard mode in the wild. From the differences in the attract mode pointed out in the video, it looks like ghost behavior is a little different.
mhartman
Posts: 96
Joined: Fri Jul 03, 2020 1:26 pm
Has thanked: 47 times
Been thanked: 20 times

Re: Pac-Man Core

Unread post by mhartman »

How far off is it? I've played mine using the traditional arcade patterns up to about 200k and I didn't have any problems.
SpoonyUK
Posts: 5
Joined: Mon Oct 26, 2020 12:35 am

Re: Pac-Man Core

Unread post by SpoonyUK »

Hi, just checked and if you change dip switch difficulty to hard it comes up with the same pattern shown in the video for v2 of pacman
wdelaar
Posts: 5
Joined: Mon Sep 19, 2022 8:46 pm
Been thanked: 3 times

Re: Pac-Man Core

Unread post by wdelaar »

I play on a real machine and the pink ghost behaves differently on the Apple to 2nd Key levels. In an Arcade machine I can get the pink ghost to cross in the Middle of the board which causes it to be in the upper right hand córner as I make my move to clear all the remaining dots. In the Mister it is Very hard to ges the pink ghost to cross which causes it to be at the Lower right córner where I have to do the kiss move instead.
wdelaar
Posts: 5
Joined: Mon Sep 19, 2022 8:46 pm
Been thanked: 3 times

Re: Pac-Man Core

Unread post by wdelaar »

The dip switches aren't the issue. I have them set correctly. I'm going to try the Puck-Man (Japaneese Set I) core. It seems to be the closest. I tried the Japaneese Set 2 and got 350K; however, the ninth key patean was different from the Arcade at times.
Zeosstud
Posts: 106
Joined: Sun Jun 21, 2020 4:56 pm
Has thanked: 2 times
Been thanked: 25 times

Re: Pac-Man Core

Unread post by Zeosstud »

When I was fighting this, for me, it came down to my monitor refresh rate and the joystick I used.. I have the ability to test out a fair amount of things in the basement, for me, my Mister, with my monitor set vertically, the input lag hack and a dedicated 4 way stick using the Midway version of pacman I have managed just under 650k, so it is not to off, if I recall correctly I just got tired that particular game. I have messed with Mame, 60-1 board, Bitkit, Leaf sticks, vga out, hdmi out, Mistercade to a VGA monitor, several things. When I get some time I want to test it on my one true CRT monitor and see if that makes a difference.
dazzer69
Posts: 39
Joined: Fri Jul 03, 2020 8:34 pm
Has thanked: 18 times
Been thanked: 11 times

Re: Pac-Man Core

Unread post by dazzer69 »

I noticed before that at some point in the cores history it gained a refresh rate of exactly 60Hz rather than the 60.60606 reported by MAME. Could this account for any inaccuracies?
wdelaar
Posts: 5
Joined: Mon Sep 19, 2022 8:46 pm
Been thanked: 3 times

Re: Pac-Man Core

Unread post by wdelaar »

I'm pretty sure I figured out my issue. I had to Edit the MISTer.ini file and change this Setting: vsync_adjust=2 by default this is set to zero which has the most lag and 2 is the best Setting if your display supports it. I changed this Setting and played a game and scored over 500K and only Lost due to my own mistakes. EVERYTHING worked just like the ARCADE! AWESOME! Now I can try to get to level 256!
fierman
Posts: 111
Joined: Mon Mar 28, 2022 11:08 pm
Has thanked: 84 times
Been thanked: 23 times

Re: Pac-Man Core

Unread post by fierman »

wdelaar wrote: Fri Sep 23, 2022 9:27 pm I'm pretty sure I figured out my issue. I had to Edit the MISTer.ini file and change this Setting: vsync_adjust=2 by default this is set to zero which has the most lag and 2 is the best Setting if your display supports it. I changed this Setting and played a game and scored over 500K and only Lost due to my own mistakes. EVERYTHING worked just like the ARCADE! AWESOME! Now I can try to get to level 256!
Kind of unexpected, but worth investigating for developers perhaps.
rhester72
Top Contributor
Posts: 1323
Joined: Thu Jun 11, 2020 2:31 am
Has thanked: 15 times
Been thanked: 213 times

Re: Pac-Man Core

Unread post by rhester72 »

The thing that surprises me most is that vsync has nothing to do with lag, latency, or programmed behavior. The same clock cycles executing the same instructions in the same amount of time will occur regardless of the setting.
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Pac-Man Core

Unread post by LamerDeluxe »

That depends on how the game was programmed. A lot of old games are timed on the vertical blank interrupt. IIRC I ran Outrun 2006(?) on my PC, without vertical blank enabled and the whole game became really fast.

Though you'd just expect the whole game to run faster, not affecting the ghost AI. Maybe they are using a random generator seeding on a timer, but that is unlikely. Or maybe they are using a timer for only some of the timing.

It is an odd bug though, something to keep in mind with other cores.
User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: Pac-Man Core

Unread post by pgimeno »

That's one possibility. The other is that display lag is causing muscle memory to work differently to the case with no display lag. I was fascinated by this video that tests Battletoads in an emulator vs. a NES and a MiSTer:

https://www.youtube.com/watch?v=5ZTS04rVOn0
goldenage
Posts: 22
Joined: Mon Feb 14, 2022 1:11 am
Has thanked: 1 time
Been thanked: 3 times

Re: Pac-Man Core

Unread post by goldenage »

Pac-man definitely uses the vblank to trigger an IRQ. However, I'm not sure with the vsync ini setting if that changes the vertical blanking interval, or just the length of the vsync pulse?
User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: Pac-Man Core

Unread post by pgimeno »

My question is whether the setting changes either. I would guess that there's an "emulated display" and a "real display" that are separate, and that the real display's vsync is not the one that generates the interrupt, but the emulated display's, which would run at the frequency of the emulated core regardless of the refresh frequency of the real monitor; if that's the case, changing the core's behaviour depending on the setting would not be possible. That's why I considered display lag as a factor. But I'm not sure if that description corresponds to the real situation.
goldenage
Posts: 22
Joined: Mon Feb 14, 2022 1:11 am
Has thanked: 1 time
Been thanked: 3 times

Re: Pac-Man Core

Unread post by goldenage »

That's a good point, and I guess it would depend on if analog video output was used. I would assume with analog video (no frame buffer) that the output would be the 'emulated display', or 1:1 with the original hardware? If the output was upscaled (frame buffer) then there would be a measurable offset between the 'emulated' and 'real' display, which in that case would be better described as display 'lag'.
wdelaar
Posts: 5
Joined: Mon Sep 19, 2022 8:46 pm
Been thanked: 3 times

Re: Pac-Man Core

Unread post by wdelaar »

It Took a few days. I thought the issue was solved because I can score 500K consistantly; however, the Problem showed up yesterday again. Any help would be greatly appreciated.
mhartman
Posts: 96
Joined: Fri Jul 03, 2020 1:26 pm
Has thanked: 47 times
Been thanked: 20 times

Re: Pac-Man Core

Unread post by mhartman »

I would try to load some of the early core versions from GitHub and see if it still shows up. Someone mentioned a clock change at sone point in time.
dazzer69
Posts: 39
Joined: Fri Jul 03, 2020 8:34 pm
Has thanked: 18 times
Been thanked: 11 times

Re: Pac-Man Core

Unread post by dazzer69 »

I would suggest trying to get the attention of macro on this forum. He seems very knowledgable about early arcade stuff.
User avatar
macro
Core Developer
Posts: 141
Joined: Sun May 24, 2020 4:12 pm
Been thanked: 171 times

Re: Pac-Man Core

Unread post by macro »

I'm not an expert on pacman, never really liked the game ;)

however, the ghost AI is based on targeting particular locations on screen, for some ghosts (in chase mode - see later) it is the square that pacman is on, for others it is a square relative to pacmans position.

the ghosts switch between 3 modes, chase, scatter and frightened (blue!) and the first two are based on the current level and timers, so I guess changing the refresh rate would change the timings of the changes. To add to it, the AI for ghosts is modified based on the number of dots left!

In mame, the CPU clock is 18.432 / 3 (6.144 Mhz)

In the pacman core, it is 24.324 / 4 which is different (6.081 mhz)

so timings of changes between chase and scatter will be different, and if mame is identical to the real thing, then MiSTer wil be different.
Did I do something useful?

buy me a coffee
shertz
Posts: 147
Joined: Sun May 24, 2020 8:12 pm
Has thanked: 15 times
Been thanked: 27 times

Re: Pac-Man Core

Unread post by shertz »

macro wrote: Thu Oct 06, 2022 10:08 pm I'm not an expert on pacman, never really liked the game ;)

however, the ghost AI is based on targeting particular locations on screen, for some ghosts (in chase mode - see later) it is the square that pacman is on, for others it is a square relative to pacmans position.

the ghosts switch between 3 modes, chase, scatter and frightened (blue!) and the first two are based on the current level and timers, so I guess changing the refresh rate would change the timings of the changes. To add to it, the AI for ghosts is modified based on the number of dots left!

In mame, the CPU clock is 18.432 / 3 (6.144 Mhz)

In the pacman core, it is 24.324 / 4 which is different (6.081 mhz)

so timings of changes between chase and scatter will be different, and if mame is identical to the real thing, then MiSTer wil be different.
Well thats disappointing 😕
dazzer69
Posts: 39
Joined: Fri Jul 03, 2020 8:34 pm
Has thanked: 18 times
Been thanked: 11 times

Re: Pac-Man Core

Unread post by dazzer69 »

Thanks, Macro. I had a hunch you would be able to shed some light.

Looking back through the core releases the video refresh rate jumped from 59.2Hz to 60Hz on release 20200106. MAME has it at 60.60606Hz. I also noticed that Galaxian has the same discrepancy, 59.2 versus 60.60606. I know you like that game.

Is this something you would be willing to take a look at at some point?
User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: Pac-Man Core

Unread post by LamerDeluxe »

So it would indeed be a discrepancy between the refresh rate and other timing used by the game. I hope this isn't very difficult to fix.
User avatar
macro
Core Developer
Posts: 141
Joined: Sun May 24, 2020 4:12 pm
Been thanked: 171 times

Re: Pac-Man Core

Unread post by macro »

If you changed the clocks to 49139348 Hz and 24569674 Hz then it should give you nearly 60.60606 Hz screen refresh.
Did I do something useful?

buy me a coffee
shertz
Posts: 147
Joined: Sun May 24, 2020 8:12 pm
Has thanked: 15 times
Been thanked: 27 times

Re: Pac-Man Core

Unread post by shertz »

macro wrote: Fri Oct 07, 2022 1:50 pm If you changed the clocks to 49139348 Hz and 24569674 Hz then it should give you nearly 60.60606 Hz screen refresh.
How do you do that?
Zeosstud
Posts: 106
Joined: Sun Jun 21, 2020 4:56 pm
Has thanked: 2 times
Been thanked: 25 times

Re: Pac-Man Core

Unread post by Zeosstud »

I can not speak to any clock cycles or screen refresh stuff but I can share this..
CRT monitor, True 4-way Dominux8 Joystick, new Switching Power Supply wired into a arcadeshop Dig Dug to Jamma Adapter and ran through the Mistercade, last night I was able to run thru 15 screens of the 9th key pattern and the ghosts behaved perfectly, not one issue, things not only looked perfect they acted perfect. I have waited a longtime to have the setup I have now, I feel like going for a kill screen finally and confident I can get there.
Post Reply