puNES Emulator

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

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

Post by FHorse »

New version added.

Changelog:
0.13:
Correct a little bug and now all cpu_interrupts_v2 test roms passed.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

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: 232
Joined: Sat May 08, 2010 9:31 am

Version 0.14

Post by FHorse »

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: 232
Joined: Sat May 08, 2010 9:31 am

Version 0.15

Post by FHorse »

Changelog:
0.15:
added MMC3 emulation.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

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: 232
Joined: Sat May 08, 2010 9:31 am

version 0.16

Post by FHorse »

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: 232
Joined: Sat May 08, 2010 9:31 am

Version 0.17

Post by FHorse »

Changelog:
0.17:
fixed another bug and now Incredible Crash Dummies run without problems.
FHorse
Posts: 232
Joined: Sat May 08, 2010 9:31 am

Version 0.18

Post by FHorse »

Changelog:
0.18:
added AxROM (mapper 7) emulation.
User avatar
Dwedit
Posts: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

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: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

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: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Post by koitsu »

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: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Post by thefox »

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: 232
Joined: Sat May 08, 2010 9:31 am

Post by FHorse »

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: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Post by thefox »

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: 4924
Joined: Fri Nov 19, 2004 7:35 pm
Contact:

Post by Dwedit »

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