Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 10294 10295 [10296] 10297 10298 ... 10984

Author Topic: Things that made you go "WTF?" today o_O  (Read 13196261 times)

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154425 on: November 17, 2020, 08:12:15 pm »

Does it really? Was this on a 16-bit architecture? I can imagine omitting a check on an 8-bit architecture.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154426 on: November 17, 2020, 08:23:44 pm »

It's 8 bit, yes. Zilog Z80 CPU and (IIRC) TMS9918A VDP
Logged

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154427 on: November 17, 2020, 09:06:25 pm »

Then how does an overflow on one byte overflow into the next byte? It it's 8-bit it probably has 8-bit registers for addition and so probably can't produce a 2-byte value, right?
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Lord Shonus

  • Bay Watcher
  • Angle of Death
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154428 on: November 17, 2020, 10:01:54 pm »

It's 8 bit, yes. Zilog Z80 CPU and (IIRC) TMS9918A VDP

The NES was a modified 6502. They used a Z80 family chip for the Game Boy.
Logged
On Giant In the Playground and Something Awful I am Gnoman.
Man, ninja'd by a potentially inebriated Lord Shonus. I was gonna say to burn it.

MrRoboto75

  • Bay Watcher
  • Belongs in the Trash!
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154429 on: November 17, 2020, 10:22:30 pm »

TBH they probably didn't expect people to be able to reach board 256 of pac-man, assuming they were aware of the problem.  Same with the Donkey Kong killscreen.
Logged
I consume
I purchase
I consume again

Reelya

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154430 on: November 17, 2020, 10:32:46 pm »

It's a coding error, because there is no check to prevent further increment, which then corrupts the next byte over.

That's not actually what happens.

What happens is that there's a test for level number for displaying the fruit in the bottom right, there are three if-statements for cases of levels 1-7, level 8-18 and level 19+. From level 19 onwards it always draws the same thing. The notable part here is that on levels 1-7 it draws a variable amount of fruit (up to 7), but from level 8 onwards it always draws the full 7 fruit. The "draw a variable amount of fruit" is important for how the bug works.

The internal level number is always from zero, and what the game does is add 1 to that number, then use that value for the if statement. On level 255, it adds one to this, giving level 256, but since it's only a 1-byte number, this is treated as zero. Then the if-statement, it says "hey zero is less than 8!" so it runs the code for levels 1-7.

So, what does the code for levels 1-7 do? It starts a counter at 1, draws a fruit from the fruit table, increments the counter, and it stops drawing when the counter equals the level number. Since the level number is now zero however, it counts all the way up from 1 to 255, then loops back to zero, then says "hey zero, right, ok I'll stop now!"

So, instead of a maximum of 7 fruit like it's supposed to, it draws 256 fruit to the screen, but this overflows the part of memory for the fruit and starts overwriting the map.

EDIT: it's actually far more interesting than just saying a value overflowed, which isn't what's going on, since the number of stars that had to align and overlapping edge cases involved here is pretty interesting. If they never did the add-1 trick before the if-statement then it would have been fine, the first level would have been level 0, and the game would seamlessly wrap around to level "0". Alternatively, if the fruit-drawer had used "less than or equal" instead of "equal" to test when to stop this bug would never have appeared in the first place, or it would merely have drawn no fruit on that level.
« Last Edit: November 17, 2020, 10:57:17 pm by Reelya »
Logged

MaxTheFox

  • Bay Watcher
  • Лишь одна дорожка да на всей земле
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154431 on: November 17, 2020, 10:37:57 pm »

TBH they probably didn't expect people to be able to reach board 256 of pac-man, assuming they were aware of the problem.  Same with the Donkey Kong killscreen.
Just treat it as a win screen TBH.
Logged
Woe to those who make unjust laws, to those who issue oppressive decrees, to deprive the poor of their rights and withhold justice from the oppressed of my people, making widows their prey and robbing the fatherless. What will you do on the day of reckoning, when disaster comes from afar?

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154432 on: November 17, 2020, 11:16:02 pm »

Some people have said they have been able to beat level 256. Not been verified, though. I wonder if there's a way you could figure it out from looking at the source code... reverse flow analysis or something like that.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Lord Shonus

  • Bay Watcher
  • Angle of Death
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154433 on: November 17, 2020, 11:23:06 pm »

Pac-Man doesn't work on a "whennumberofdots=0, nextlevel" basis, but on a "when dotseaten=244" one, and level 256 only generates 131. It can't be beaten, because it doesn't generate enough dots to trigger the next level.
Logged
On Giant In the Playground and Something Awful I am Gnoman.
Man, ninja'd by a potentially inebriated Lord Shonus. I was gonna say to burn it.

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154434 on: November 17, 2020, 11:25:31 pm »

Unless you exploit another bug. :)
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154435 on: November 17, 2020, 11:37:10 pm »

It's 8 bit, yes. Zilog Z80 CPU and (IIRC) TMS9918A VDP

The NES was a modified 6502. They used a Z80 family chip for the Game Boy.

I specified Pacman Arcade.  (as in, the upright.)
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154436 on: November 18, 2020, 12:03:28 am »

Yeah, when talking Pac Man releases it would be normal to assume that means the cabinet, or the Atari 2600 version at a pinch. It'd be very unlikely to be a NES reference since Pac Man was out several years before the NES and was really a separate generation of gaming.

MrRoboto75

  • Bay Watcher
  • Belongs in the Trash!
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154437 on: November 18, 2020, 12:04:48 am »

The NES port was far closer to the arcade version than the 2600 one was.
Logged
I consume
I purchase
I consume again

Reelya

  • Bay Watcher
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154438 on: November 18, 2020, 12:08:26 am »

However the NES version got to American shores far later and in far smaller numbers.

They sold 7 million copies of Atari Pac Man.

EDIT: I'm having to re-edit this on reading closer.
https://www.mobygames.com/game/nes/pac-man/release-info

The American NES owners didn't get Pac Man until 1988, and that was a bootleg version. The licensed version actually came out in 1990. So it was literally a 10 year old game before any actual NES owners saw that. It missed the boat by a decade.

So, year Atari Pac Man isn't as faithful to the arcade as NES Pac Man, but it had the advantage that you could play that in 1982 vs 1990.
« Last Edit: November 18, 2020, 12:18:25 am by Reelya »
Logged

Lord Shonus

  • Bay Watcher
  • Angle of Death
    • View Profile
Re: Things that made you go "WTF?" today o_O
« Reply #154439 on: November 18, 2020, 12:56:48 am »

It's 8 bit, yes. Zilog Z80 CPU and (IIRC) TMS9918A VDP

The NES was a modified 6502. They used a Z80 family chip for the Game Boy.

I specified Pacman Arcade.  (as in, the upright.)

When I posted that I was focusing on the 256 lives overflow in Mario.
Logged
On Giant In the Playground and Something Awful I am Gnoman.
Man, ninja'd by a potentially inebriated Lord Shonus. I was gonna say to burn it.
Pages: 1 ... 10294 10295 [10296] 10297 10298 ... 10984