Search found 1541 matches

by byuu
Tue Jul 02, 2019 9:09 pm
Forum: SNESdev
Topic: Mesen-S - SNES Emulator
Replies: 304
Views: 128266

Re: Mesen-S - SNES Emulator

I'm fine with changing it to 32040Hz, though, if that's what's been determined to work the best? But was just a bit curious. I found that d4s' Breath of Fire II (German) fan translation's streaming HDMA audio engine was extremely timing sensitive, and didn't work well at 32000hz. qwertymodo reverte...
by byuu
Mon Jul 01, 2019 12:15 am
Forum: SNESdev
Topic: Mesen-S - SNES Emulator
Replies: 304
Views: 128266

Re: Mesen-S - SNES Emulator

Speaking of which, do you have a build of bsnes/higan I could use to produce trace logs? Ah yes, I still need to make that for you ... can you compile from source? If so, it'll save me some effort making a Windows binary on my other dev box. I'll use bsnes v107, which is identical to higan once you...
by byuu
Sun Jun 30, 2019 6:58 pm
Forum: SNESdev
Topic: Mesen-S - SNES Emulator
Replies: 304
Views: 128266

Re: Mesen-S - SNES Emulator

I gave fixing the whole DMA/IRQ timing issue a try, too. Wrote a pretty simple test suite to validate a few scenarios on hardware. Waiting on the hardware results, but for now I'm assuming higan is correct and my implementation gives the same result as higan for the test. It also fixes the power ra...
by byuu
Sun Jun 30, 2019 4:40 pm
Forum: SNESdev
Topic: Mesen-S - SNES Emulator
Replies: 304
Views: 128266

Re: Mesen-S - SNES Emulator

Oh cool. So it returns a possibly unstable value when it happens. This is worth looking into. Will do that first then. Many, many years ago (ten, probably), I wrote a test ROM to start trying to emulate this behavior. I loaded it onto my SNES copier (Super UFO 8.3j), and it froze the system. The co...
by byuu
Sat Jun 29, 2019 2:16 pm
Forum: SNESdev
Topic: Mesen-S - SNES Emulator
Replies: 304
Views: 128266

Re: Mesen-S - SNES Emulator

I have no idea what happened but it always looks correct now, using same test build when report created. :confused: I must have some really random glitchy stuff going on. :grumble: Whoever you are, I wish you were around when I was bug-hunting my SNES core, hahah. You're doing a thoroughly awesome ...
by byuu
Sat Jun 29, 2019 6:53 am
Forum: SNESdev
Topic: Mesen-S - SNES Emulator
Replies: 304
Views: 128266

Re: Mesen-S - SNES Emulator

According to anomie's docs, writing to $420B (DMA enable) allows the CPU to continue up to the point where it reads the next instruction's op code before DMA starts. That's another thing that also happens. That's part of the DMA<>CPU synchronization. This is a really complex topic to talk about ......
by byuu
Fri Jun 28, 2019 5:37 am
Forum: SNESdev
Topic: Mesen-S - SNES Emulator
Replies: 304
Views: 128266

Re: Mesen-S - SNES Emulator

If the CPU is halted (i.e. for DMA) while /NMI goes low, the NMI will trigger after the DMA completes (even if /NMI goes high again before the DMA completes). In this case, there is a 24-30 cycle delay between the end of DMA and the NMI handler, time enough for an instruction or two. The 24-30 cycl...
by byuu
Fri Jun 21, 2019 6:59 pm
Forum: GBDev
Topic: STAT bug vs STAT IRQ blocking
Replies: 3
Views: 5510

Re: STAT bug vs STAT IRQ blocking

That sounds more complete than any info I've seen so far. So it sounds like a cheap way to emulate this is to test for the STAT IRQ flag being 0 before firing the STAT bug IRQ. Simulating the STAT interrupt enable bits all being set for one cycle (M or T? though it likely doesnt matter here) would b...
by byuu
Fri Jun 21, 2019 12:42 pm
Forum: GBDev
Topic: STAT bug vs STAT IRQ blocking
Replies: 3
Views: 5510

STAT bug vs STAT IRQ blocking

Seems there's two conflicting behaviors. The infamous STAT bug that is required in games like Legend of Zerd supposedly acts as follows: * when on a non-GBC system, and writing any value (even 00) to STAT, while the display is enabled, and you are in mode 1 (Vblank) [and possibly in Hblank as well],...
by byuu
Fri Jun 14, 2019 11:14 pm
Forum: SNESdev
Topic: The best emulator ? SNES9X ?
Replies: 13
Views: 6784

Re: The best emulator ? SNES9X ?

I don't know the reasoning behind these numbers, but they're from the big N. Auto joypad polling reads from $4016/4017 (well, from the controller port lines, not actually going to the address bus for it) sixteen times, once every ~256 clock cycles from the SNES CPU. Each read will barrel shift in o...
by byuu
Fri Jun 14, 2019 2:42 am
Forum: SNESdev
Topic: The best emulator ? SNES9X ?
Replies: 13
Views: 6784

Re: The best emulator ? SNES9X ?

I once spent two weeks exhaustively ruling out every possibility to determine why rarely my timing was off by 1/10-millionth of a second during some IRQs but not others. By comparison, Snes9X is still an opcode-based emulator for the 65816. Still, nothing is perfect. Make a minimal test case as proo...
by byuu
Wed Jun 12, 2019 12:38 pm
Forum: Other Retro Dev
Topic: Designing a cooperative-threaded scheduler for an emulator
Replies: 3
Views: 6966

Re: Designing a cooperative-threaded scheduler for an emulat

Yeah, so without relying on any special hardware ... Right now I can run the SNES CPU basically as far ahead of the SNES SMP as I want, as long as the SNES CPU doesn't access the four register ports on the SMP. Because it's no speed hit and to keep audio sample latency down, I will force a sync once...
by byuu
Wed Jun 12, 2019 8:51 am
Forum: Other Retro Dev
Topic: Designing a cooperative-threaded scheduler for an emulator
Replies: 3
Views: 6966

Re: Designing a cooperative-threaded scheduler for an emulat

Alright, I came up with a workable solution. Flow: A needs to be in sync with B and C, so A jumps to B. B needs to be in sync with D, so B jumps to D. D only needs to be in sync with A, so D jumps to A. But in this scenario, B hasn't caught up to A yet, so the a.syncTo(b) call returns before B is re...
by byuu
Wed Jun 12, 2019 1:47 am
Forum: Other Retro Dev
Topic: Designing a cooperative-threaded scheduler for an emulator
Replies: 3
Views: 6966

Designing a cooperative-threaded scheduler for an emulator

(I also posted this to Spritesmind for more feedback.) I know I'm a bit of an outlier here with using cooperative-threading to design emulators, and that most will use state machines that run each chip the minimum amount of time, but I ran into a rather interesting challenge with threads, and was cu...
by byuu
Mon Apr 29, 2019 10:02 pm
Forum: SNESdev
Topic: Mesen-S - SNES Emulator
Replies: 304
Views: 128266

Re: Mesen-S - SNES Emulator

No rush, I've moved onto Sega CD emulation lately, so I've kept busy meanwhile ^-^;; Also haven't managed to pass most of your irq/nmi/hdma timing tests either. They are absolutely brutal tests. It took me months to get them working myself. They are based around my creation of a function that, once ...