puNES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

FHorse
Posts: 229
Joined: Sat May 08, 2010 9:31 am

Post by FHorse » Wed Feb 23, 2011 5:29 pm

New version added.

Changelog:
0.13:
Correct a little bug and now all cpu_interrupts_v2 test roms passed.

User avatar
Dwedit
Posts: 4236
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Wed Feb 23, 2011 10:33 pm

You should also fix the controller input problem. The problem with joystick input not working correctly that I mentioned earlier has nothing to with mappers.

This is the joystick code I'm using, it's a bit non-standard.

Right now, it seems that buttons and keypresses are shifted one bit over.
My guess is that it's shifting the register during the read in the strobe routine when it shouldn't.

JOY1 = $4016

Code: Select all

ReadJoypad1:
	lda joy1
	sta joy1last
	
	jsr Strobe
	jsr ReadJOY1_8
	sta joy1
ReadJoy1Again:	
	jsr Strobe
	jsr ReadJOY1_8
	cmp joy1
	sta joy1
	bne ReadJoy1Again
	
	eor joy1last
	and joy1
	sta joy1Pressed
	lda joy1
	rts

ReadJOY1_8:
	cpx JOY1
	ror a
	cpx JOY1
	ror a
	cpx JOY1
	ror a
	cpx JOY1
	ror a
	cpx JOY1
	ror a
	cpx JOY1
	ror a
	cpx JOY1
	ror a
	cpx JOY1
	ror a
	eor #$FF
	rts

Strobe:
	ldx #1
	stx JOY1
	lda JOY1
	dex
	stx JOY1
	and #$FC
	tax
	rts

Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

FHorse
Posts: 229
Joined: Sat May 08, 2010 9:31 am

Version 0.14

Post by FHorse » Thu Feb 24, 2011 2:00 am

Many thanks Dwedit, I've found and correct the bug and now I can return to work on the mmc3 implementation.

Changelog:
0.14:
Correct a a bug in the controller routine.

FHorse
Posts: 229
Joined: Sat May 08, 2010 9:31 am

Version 0.15

Post by FHorse » Sat Feb 26, 2011 6:40 pm

Changelog:
0.15:
added MMC3 emulation.

User avatar
Dwedit
Posts: 4236
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Sat Feb 26, 2011 7:12 pm

Great job, looking good so far.

The title screen of Kick Master is a little wavy though.

You should add in Mapper #7 (AOROM) so you can try the emulator torture testing games, like Battletoads.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

FHorse
Posts: 229
Joined: Sat May 08, 2010 9:31 am

version 0.16

Post by FHorse » Sun Feb 27, 2011 1:07 pm

thanks Dwedit. I'have investigated on the problem with Kick Master and this release is the result. I have to do a couple of things on the mmc3 and then I can work to the next mapper.

Changelog:
0.16:
correct a couple of bugs in the mmc3 emulation.

FHorse
Posts: 229
Joined: Sat May 08, 2010 9:31 am

Version 0.17

Post by FHorse » Mon Feb 28, 2011 5:36 pm

Changelog:
0.17:
fixed another bug and now Incredible Crash Dummies run without problems.

FHorse
Posts: 229
Joined: Sat May 08, 2010 9:31 am

Version 0.18

Post by FHorse » Tue Mar 01, 2011 6:07 pm

Changelog:
0.18:
added AxROM (mapper 7) emulation.

User avatar
Dwedit
Posts: 4236
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Tue Mar 01, 2011 9:51 pm

Many emulators are well known for their little quirks, the little things they get slightly off, it kind of acts as a signature that tells you that you are using that emulator. Sort of establishes the character of an emulator.

But this one plays Battletoads and Micro Machines perfectly! Who needs quirks when you have accuracy!

Now it just needs Sound, and some other mappers.

tepples
Posts: 21750
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples » Tue Mar 01, 2011 9:57 pm

Dwedit wrote:Who needs quirks when you have accuracy!
Puyo fans, for one. The official port of Puyo to DOS and Mac was called Qwirks. It was published by Spectrum Holobyte, as part of the "Alexey Pajitnov tried this and liked it so much he put his picture on the box" series.

User avatar
koitsu
Posts: 4215
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Post by koitsu » Wed Mar 02, 2011 12:53 am

tepples wrote:
Dwedit wrote:Who needs quirks when you have accuracy!
Puyo fans, for one. The official port of Puyo to DOS and Mac was called Qwirks. It was published by Spectrum Holobyte, as part of the "Alexey Pajitnov tried this and liked it so much he put his picture on the box" series.
Image

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox » Wed Mar 02, 2011 4:01 am

Seems like a decent emu, but it hogs one CPU core completely. Maybe something you want to look into. It might be SDL's (or display drivers'?) fault though, I remember using SDL_GL_SwapBuffers() in one of my apps and it was hogging the whole core even when it was also waiting for vsync...

FHorse
Posts: 229
Joined: Sat May 08, 2010 9:31 am

Post by FHorse » Wed Mar 02, 2011 11:23 am

I've uploade a modified version. Please thefox can you try it and tell me if eat less cpu? Many thanks.

User avatar
thefox
Posts: 3141
Joined: Mon Jan 03, 2005 10:36 am
Location: Tampere, Finland
Contact:

Post by thefox » Wed Mar 02, 2011 11:37 am

FHorse wrote:I've uploade a modified version. Please thefox can you try it and tell me if eat less cpu? Many thanks.
This one eats ~45% in software rendering mode, ~52% in OpenGL mode.

The previous one ate exactly 50% in s/w rendering and little bit more in OpenGL as well.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi

User avatar
Dwedit
Posts: 4236
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit » Wed Mar 02, 2011 11:52 am

I think this is entirely the fault of bad Vsync code. DirectDraw provides horrible vblank waiting code, then SDL uses that horrible vblank waiting code.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!

Post Reply