I am working on a "small" NES emulation project, and I have a bit of a problem with some input. My input function seems to work fine for games like galaga (everything works for it), and Pyramid, but Arkanoid and most other games seem to ignore my input.
Here is what I know....
Arkanoid only reads from 4016 and 4017 in one spot, and my emulator reports sending the keystroke AND it getting loaded into the accumulator correctly.
I disassembled the code around here and got this...
Is it just me, or does the ROR after the read from 4016 do nothing. And then, our result from reading 4016 is destroyed with a read from 4017. What's up here? I know I am in error somewhere becuase this ROM works on other emulators.
note: $00 - $08 seem to be 0x00 during every read as well
Here is what I know....
Arkanoid only reads from 4016 and 4017 in one spot, and my emulator reports sending the keystroke AND it getting loaded into the accumulator correctly.
I disassembled the code around here and got this...
Code:
00/8BE3: A5 00 LDA $00
00/8BE5: 85 01 STA $01
00/8BE7: A5 02 LDA $02
00/8BE9: 85 03 STA $03
00/8BEB: A5 04 LDA $04
00/8BED: 85 05 STA $05
00/8BEF: A5 06 LDA $06
00/8BF1: 85 07 STA $07
00/8BF3: A5 08 LDA $08
00/8BF5: 85 09 STA $09
00/8BF7: A0 08 LDY #$08
00/8BF9: A9 01 LDA #$01
00/8BFB: 8D 16 40 STA $4016
00/8BFE: A9 00 LDA #$00
00/8C00: 8D 16 40 STA $4016
00/8C03: AD 16 40 LDA $4016
00/8C06: 6A ROR
00/8C07: 26 00 ROL $00
00/8C09: AD 17 40 LDA $4017
00/8C0C: 6A ROR
00/8C0D: 26 02 ROL $02
00/8C0F: 6A ROR
00/8C10: 6A ROR
00/8C11: 6A ROR
00/8C12: 26 06 ROL $06
00/8C14: 6A ROR
00/8C15: 26 08 ROL $08
00/8C17: 88 DEY
00/8C18: D0 E9 BNE $8C03
00/8BE5: 85 01 STA $01
00/8BE7: A5 02 LDA $02
00/8BE9: 85 03 STA $03
00/8BEB: A5 04 LDA $04
00/8BED: 85 05 STA $05
00/8BEF: A5 06 LDA $06
00/8BF1: 85 07 STA $07
00/8BF3: A5 08 LDA $08
00/8BF5: 85 09 STA $09
00/8BF7: A0 08 LDY #$08
00/8BF9: A9 01 LDA #$01
00/8BFB: 8D 16 40 STA $4016
00/8BFE: A9 00 LDA #$00
00/8C00: 8D 16 40 STA $4016
00/8C03: AD 16 40 LDA $4016
00/8C06: 6A ROR
00/8C07: 26 00 ROL $00
00/8C09: AD 17 40 LDA $4017
00/8C0C: 6A ROR
00/8C0D: 26 02 ROL $02
00/8C0F: 6A ROR
00/8C10: 6A ROR
00/8C11: 6A ROR
00/8C12: 26 06 ROL $06
00/8C14: 6A ROR
00/8C15: 26 08 ROL $08
00/8C17: 88 DEY
00/8C18: D0 E9 BNE $8C03
Is it just me, or does the ROR after the read from 4016 do nothing. And then, our result from reading 4016 is destroyed with a read from 4017. What's up here? I know I am in error somewhere becuase this ROM works on other emulators.
note: $00 - $08 seem to be 0x00 during every read as well