Game complete: Blurred Lines 2048 by Demptronic
Moderator: Moderators
- rainwarrior
- Posts: 8731
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Game complete: Blurred Lines 2048 by Demptronic
In case the poem is unclear, you have to use a different controller reading routine if you're playing DPCM samples, because they cause a conflict with the read (usually showing up as incorrectly pressing right now and then while samples are playing). This is kind of disastrous for 2048 gameplay.
Many emulators don't emulate this conflict. If you need an emulator to test the problem on, I would recommend Nintendulator.
I think puNES also attempts to emulate this conflict, but it doesn't appear to like your ROM at the moment.
Many emulators don't emulate this conflict. If you need an emulator to test the problem on, I would recommend Nintendulator.
I think puNES also attempts to emulate this conflict, but it doesn't appear to like your ROM at the moment.
- Dreamwriter
- Posts: 35
- Joined: Tue Jun 02, 2015 9:17 pm
- Location: Florida
- Contact:
Re: Game complete: Blurred Lines 2048 by Demptronic
Nice job, this is definitely a unique and skilled creation; I woulda rented it as an NES game as a kid, maybe even bought it.
- raydempsey
- Posts: 160
- Joined: Sat May 31, 2014 4:12 pm
Re: Game complete: Blurred Lines 2048 by Demptronic
Tested on FCEUX during development. How should the controller reading routine be changed?rainwarrior wrote:In case the poem is unclear, you have to use a different controller reading routine if you're playing DPCM samples, because they cause a conflict with the read (usually showing up as incorrectly pressing right now and then while samples are playing). This is kind of disastrous for 2048 gameplay.
Many emulators don't emulate this conflict. If you need an emulator to test the problem on, I would recommend Nintendulator.
I think puNES also attempts to emulate this conflict, but it doesn't appear to like your ROM at the moment.
- Dreamwriter
- Posts: 35
- Joined: Tue Jun 02, 2015 9:17 pm
- Location: Florida
- Contact:
Re: Game complete: Blurred Lines 2048 by Demptronic
What a lot of games do is read the controller twice in a row, and only act on it if both reads were exactly the same. The sample DMA will only corrupt one read. Or just keep reading it in a loop until it gets two of the same result in a row.
- rainwarrior
- Posts: 8731
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Game complete: Blurred Lines 2048 by Demptronic
This is the approach I prefer. There have been some lengthy threads on the most optimal/clever thing, etc. but this method is very simple and easy to implement if you already have a regular controller read, and it works quite well.Dreamwriter wrote:...just keep reading it in a loop until it gets two of the same result in a row.
It's also what Super Mario Bros. 3 and a number of other games do. Here's a quick disassembly of SMB3's method:
Code: Select all
jsr poll_controller ; 0F:FEB9:20 0B FF JSR $FF0B
reread: lda controller ; 0F:FEBC:A5 00 LDA $0000 = #$00
pha ; 0F:FEBE:48 PHA
jsr poll_controller ; 0F:FEBF:20 0B FF JSR $FF0B
pla ; 0F:FEC2:68 PLA
cmp controller ; 0F:FEC3:C5 00 CMP $0000 = #$00
bne reread ; 0F:FEC5:D0 F5 BNE $FEBC
- raydempsey
- Posts: 160
- Joined: Sat May 31, 2014 4:12 pm
Re: Game complete: Blurred Lines 2048 by Demptronic
Seems simple enough. I'll make the change today and repost. I would have definitely noticed something was wrong when I attempted my first transfer to cart coming soon. Is there any risk that it could get caught in a loop that ends only at the start of the next Vblank or will it surely be resolved within a few small loops?
Re: Game complete: Blurred Lines 2048 by Demptronic
Nestopia is another emulator that emulates the glitch.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Re: Game complete: Blurred Lines 2048 by Demptronic
It was decided that the highest number of rereads is (practically speaking) five, if a person changes what button they're pressing just after a glitch:
- correct, old
- corrupted, old
- correct, old
- correct, new
- correct, new
- correct, old
- corrupted, old
- correct, old
- correct, new
- correct, new
Re: Game complete: Blurred Lines 2048 by Demptronic
In practice, two reads should be enough because
And while you're at it, are you making sure to read both D0 and D1 of $4016? Famicom owners would appreciate it, as D0 is for hardwired controllers and D1 is for plug-in controllers on that system.
And while you're at it, are you making sure to read both D0 and D1 of $4016? Famicom owners would appreciate it, as D0 is for hardwired controllers and D1 is for plug-in controllers on that system.
Re: Game complete: Blurred Lines 2048 by Demptronic
Because...? Come on tepples, the suspense is killing me!tepples wrote:In practice, two reads should be enough because
Re: Game complete: Blurred Lines 2048 by Demptronic
...because a Threes clone isn't as twitchy as, say, Street Fighter series. Read twice and if they disagree, use the previous frame's presses.
Sorry, I got distracted by real life while composing that post.
Sorry, I got distracted by real life while composing that post.
- rainwarrior
- Posts: 8731
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Game complete: Blurred Lines 2048 by Demptronic
The worst case is very slightly worse than that. For most controller read loops, the DPCM at is fastest will be dormant for at least 2 passes through the poll routine, but it might be able to corrupt a 3rd consecutive one. So the worst case is really six:lidnariq wrote:It was decided that the highest number of rereads is (practically speaking) five, if a person changes what button they're pressing just after a glitch:
- correct, old
- corrupted, old
- correct, old
- correct, new
- correct, new
- correct, old
- corrupted, old
- correct, old
- correct, new
- corrupt, new
- correct, new
- correct, new
Of course, you have to be lucky/unlucky to even get a conflict in the first place. It won't corrupt EVERY third loop, just ones where the $4016 read aligns with the DPCM read. I think it's normally like once per hundreds of frames. For it to happen twice consecutively would be exceedingly rare, and then on top of that you'd have to manage to press a button during, so... rare * rare * rare = has it ever happened ever?
Not really. It's quite robust in any use I've seen. SMB3 seems pretty stable to me, I doubt the controller read loop ever caused a problem.raydempsey wrote:Is there any risk that it could get caught in a loop that ends only at the start of the next Vblank or will it surely be resolved within a few small loops?
Like, if you hooked a machine up to the controller port that changed the input on every strobe, it would hang the game in the controller loop, but this is kind of pathological. I don't think anyone would do that except if they were trying to build a turbo-button controller and didn't know that many games will read in a loop like this.
- raydempsey
- Posts: 160
- Joined: Sat May 31, 2014 4:12 pm
Re: Game complete: Blurred Lines 2048 by Demptronic
I used Nintendulator to observe the problem you were describing about the DPCM creating false right button presses. I fixed it the way rainwarrior suggested and it works better now. Here is the new uploaded version. Thanks for finding the bug. I didn't even know that was a thing. I'll let you know how uploading to cart is coming as I attempt it.
- Attachments
-
- BlurredLines2048.nes
- (384.02 KiB) Downloaded 506 times
- raydempsey
- Posts: 160
- Joined: Sat May 31, 2014 4:12 pm
Re: Game complete: Blurred Lines 2048 by Demptronic
My first attempt to upload BlurredLines2048 to a cartridge has failed. I have a TKROM 512 PRG 256 CHR flash cart WRAM w/ battery pack and I am attempting to use INL retro-prog v1.1 beta. Before I uploaded it, I trimmed a copy of my .nes file down so that the first 16 bytes went away causing the file to be 16 bytes shorter. Do I have to upload the PRG and CHR separately? I don't know if the file extension makes a difference but I tried uploading it when it was saved as both .nes and .bin but still no luck. No matter what I try to do, the program instantly crashes the moment I attempt to write to the cart. I never did this before.
I bought it from here: http://www.infiniteneslives.com/kazzo.php
I bought it from here: http://www.infiniteneslives.com/kazzo.php
Re: Game complete: Blurred Lines 2048 by Demptronic
Yes.raydempsey wrote:Do I have to upload the PRG and CHR separately?
That's weird, but I'd assume it's because the resulting file isn't a power of two.No matter what I try to do, the program instantly crashes the moment I attempt to write to the cart.