Search found 200 matches

by Fiskbit
Thu Oct 29, 2020 6:39 pm
Forum: NESdev
Topic: Interrupt disrupting my MMC1 bankswap
Replies: 3
Views: 2041

Re: Interrupt disrupting my MMC1 bankswap

The code you've posted makes it a bit hard to be sure what's going on, since it's lacking addresses (so branch targets are unspecified) and the interrupt handler isn't present. That said, you'll need to be resetting the shift register both unconditionally in the interrupt before writing to MMC1 (bec...
by Fiskbit
Tue Oct 13, 2020 3:10 pm
Forum: NESdev
Topic: 6502 vdelay - cycle delay routine with variable length at runtime
Replies: 37
Views: 7716

Re: 6502 vdelay - cycle delay routine with variable length at runtime

Luck is a big part of this level of optimization. :) These seem very lean now. Really cool that the 16-bit one only needs 2 extra cycles. Looking at vdelay_modify.s, I think if you move vdelay_toolow to the end, you can use #$18 (CLC) as the clockslide's branch operand/instruction and put the vdelay...
by Fiskbit
Mon Oct 12, 2020 1:43 am
Forum: NESdev
Topic: 6502 vdelay - cycle delay routine with variable length at runtime
Replies: 37
Views: 7716

Re: 6502 vdelay - cycle delay routine with variable length at runtime

I came up with another improvement. Since the problem with clockslide is that odd lengths will read from $EA, which could have side effects, I've opted to change the instruction to an always-taken branch, which is also 2 bytes and takes 3 cycles. The operand needs to both lead to an RTS instruction ...
by Fiskbit
Sun Oct 11, 2020 11:25 pm
Forum: NESdev
Topic: 6502 vdelay - cycle delay routine with variable length at runtime
Replies: 37
Views: 7716

Re: 6502 vdelay - cycle delay routine with variable length at runtime

Sure, please use these if they're useful! When I can, I like to license my code as permissively as possible. Attribution is not necessary, but if you'd like, you're welcome to credit me as Fiskbit. I do have a github profile , but don't have anything public on it at this time. I can look at extendin...
by Fiskbit
Sun Oct 11, 2020 10:43 pm
Forum: NESdev
Topic: 6502 vdelay - cycle delay routine with variable length at runtime
Replies: 37
Views: 7716

Re: 6502 vdelay - cycle delay routine with variable length at runtime

I made a self-modifying version that requires a 33 cycle minimum. I don't have ideas at the moment for further improvements. VDelay_RAM := $6000 VDELAY_MINIMUM = 33 ; Waits for A cycles. JSR/RTS is included. Minimum is 33 cycles. ; Input: A: Number of cycles to delay. ; Clobbers: A/Y VDelay: ; +6 = ...
by Fiskbit
Sun Oct 11, 2020 8:14 pm
Forum: NESdev
Topic: 6502 vdelay - cycle delay routine with variable length at runtime
Replies: 37
Views: 7716

Re: 6502 vdelay - cycle delay routine with variable length at runtime

I tweaked my clockslide code to operate like yours and to use RTS and the stack and got 46 cycles in total. If you can guarantee that VDelay_Clockslide starts at $xx01, then you can shave off another 2 cycles by removing the ADC. VDELAY_MINIMUM = 46 ; Waits for A cycles. JSR/RTS is included. Minimum...
by Fiskbit
Sat Oct 10, 2020 10:01 am
Forum: NESdev
Topic: 6502 vdelay - cycle delay routine with variable length at runtime
Replies: 37
Views: 7716

Re: 6502 vdelay - cycle delay routine with variable length at runtime

I haven't fully digested the code yet, but it looks pretty neat. Have you considered using a clockslide instead of the jump table for delaying 0-7 cycles? You could put an 8-byte clockslide between vdelay_low and vdelay_low_rest and remove 3 cycles of overhead by not needing to jump to vdelay_low_re...
by Fiskbit
Sun Oct 04, 2020 4:24 pm
Forum: NESemdev
Topic: Mesen - NES Emulator
Replies: 887
Views: 430617

Re: Mesen - NES Emulator

Sour's confirmed that he's not planning on returning to these projects, so further development will need to be in a fork.
by Fiskbit
Sun Oct 04, 2020 2:54 am
Forum: NES Hardware and Flash Equipment
Topic: Reverse Engineering the CIC
Replies: 589
Views: 250004

Re: Reverse Engineering the CIC

My desoldering station arrived, so tonight I pulled a 3195A and a 3198A for dumping. The good news is that the 3195A matches the 508 accessible bytes of the existing 512 byte dump, as expected. The bad news is that the 3198A matches Patnukem's dump, with the low 2 bits missing. As it's very unlikely...
by Fiskbit
Thu Oct 01, 2020 2:50 pm
Forum: NES Hardware and Flash Equipment
Topic: Reverse Engineering the CIC
Replies: 589
Views: 250004

Re: Reverse Engineering the CIC

We should change the read loop to try to get 762 (or 1016) bytes in case the chip is trying to change fields on its own, though I have some skepticism. It also looks like the code should be printing 508 iterations, so I'm not sure why it's ending early. [I see before posting that you did get it to p...
by Fiskbit
Thu Oct 01, 2020 2:27 pm
Forum: NES Hardware and Flash Equipment
Topic: Reverse Engineering the CIC
Replies: 589
Views: 250004

Re: Reverse Engineering the CIC

I'm a bit confused. With the newer code run on the 3199A, what does it output for i1F5-i1FB, and does it start repeating the i0+ data at i1FC? With the older code, when it starts at a different spot, is there evidence of it outputting anything that is not included in the 508 bytes from the new code'...
by Fiskbit
Thu Oct 01, 2020 2:12 pm
Forum: NES Hardware and Flash Equipment
Topic: Reverse Engineering the CIC
Replies: 589
Views: 250004

Re: Reverse Engineering the CIC

That 3199A dump has all the bits, so that's a great start. It's missing 7 bytes at the end, though, just like your last dump, and those bytes look in this case like they're probably not all 0. Why are these getting dropped now? I'm a little uneasy about the fact that these pages don't have a bunch o...
by Fiskbit
Wed Sep 30, 2020 6:46 pm
Forum: NES Hardware and Flash Equipment
Topic: Reverse Engineering the CIC
Replies: 589
Views: 250004

Re: Reverse Engineering the CIC

No need to rush on this stuff. :) I'll be working on 3198A dumps soon, and 3199(A?) hopefully in the next couple months. I forgot to comment on the FamicomStation menu cart. It's unsurprising it wouldn't work in a normal system; the FamicomBox has a number of additional features, such as additional ...
by Fiskbit
Wed Sep 30, 2020 5:45 pm
Forum: NES Hardware and Flash Equipment
Topic: Reverse Engineering the CIC
Replies: 589
Views: 250004

Re: Reverse Engineering the CIC

Ah, I had my pins mixed up and was thinking 0 and 1 were outputted on R1_2 and R1_3, which are slot ID inputs.
by Fiskbit
Wed Sep 30, 2020 5:26 pm
Forum: NES Hardware and Flash Equipment
Topic: Reverse Engineering the CIC
Replies: 589
Views: 250004

Re: Reverse Engineering the CIC

Aside from missing seven 00's at the end of the dump, that matches my dump and the accessible portion of the existing 512 byte dump. Regarding the 3198A, there's no actual need for a hardware difference to support the slot ID pins; all the port pins can be read from and written to in software. Howev...