1
0
mirror of https://github.com/sethm/symon.git synced 2024-06-20 10:29:33 +00:00
symon/src/test/java/com/loomcom/symon
Tim Allen b5a470d3ba Make the Processor Status register match a real 6502 at power-on.
When describing the CPU's reset pin, the W65C02S data sheet says:

> All Registers are initialized by software except the Decimal and Interrupt
> disable mode select bits of the Processor Status Register (P) are initialized
> by hardware.

It then has a diagram of the power-on state of the processor status register:

>     7 6 5 4 3 2 1 0
>     * * 1 1 0 1 * *
>     N V - B D I Z C
>
> * = software initialized

Confusingly the text indicates that only the D and I flags are initialised by
hardware, while the diagram indicates that the B flag is initialised too.

Meanwhile, https://www.nesdev.org/wiki/CPU_power_up_state says that
the power-on state of the NES CPU is $34 (exactly matching the diagram above)
but https://www.nesdev.org/wiki/Status_flags#The_B_flag says that the B flag
does not physically exist within P register, it's only relevant in the copy
of P that gets pushed to the stack by BRK (set), PHP (set), or an interrupt
signal (cleared).

As a result, the most sensible power-on state for the processor status register
is with the "interrupt disable" flag set and everything else cleared.
2023-02-03 18:16:57 +11:00
..
Acia6850Test.java * Add ACIA Interrupt tests. 2017-06-06 12:55:35 +10:00
AciaTest.java * Add ACIA Interrupt tests. 2017-06-06 12:55:35 +10:00
BusTest.java rework bus. Don't throw an Exception any more with overlapping device addresses - this is normal for some machines. Introduce the concept of priorities to ensure that device overlap in the correct order. 2014-07-25 19:32:00 +02:00
Cpu65C02AbsoluteModeTest.java * Add Support for All 65C02 Opcodes and all Rockwell/WDC opcodes except WAI/STP 2017-06-06 19:59:01 +10:00
Cpu65C02AbsoluteXModeTest.java * Add Support for All 65C02 Opcodes and all Rockwell/WDC opcodes except WAI/STP 2017-06-06 19:59:01 +10:00
Cpu65C02ImmediateModeTest.java * Add Support for All 65C02 Opcodes and all Rockwell/WDC opcodes except WAI/STP 2017-06-06 19:59:01 +10:00
Cpu65C02ImpliedModeTest.java * Add Support for All 65C02 Opcodes and all Rockwell/WDC opcodes except WAI/STP 2017-06-06 19:59:01 +10:00
Cpu65C02ZeroPageModeTest.java * Add Support for All 65C02 Opcodes and all Rockwell/WDC opcodes except WAI/STP 2017-06-06 19:59:01 +10:00
Cpu65C02ZeroPageRelativeTest.java * Add Support for All 65C02 Opcodes and all Rockwell/WDC opcodes except WAI/STP 2017-06-06 19:59:01 +10:00
Cpu65C02ZeroPageXModeTest.java * Add Support for All 65C02 Opcodes and all Rockwell/WDC opcodes except WAI/STP 2017-06-06 19:59:01 +10:00
CpuAbsoluteModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuAbsoluteXModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuAbsoluteYModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuAccumulatorModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuImmediateModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuImpliedModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuIndexedIndirectModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuIndirectIndexedModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuIndirectModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuIndirectXModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuRelativeModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuZeroPageIndirectTest.java * Add Support for All 65C02 Opcodes and all Rockwell/WDC opcodes except WAI/STP 2017-06-06 19:59:01 +10:00
CpuZeroPageModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuZeroPageXModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CpuZeroPageYModeTest.java Make the Processor Status register match a real 6502 at power-on. 2023-02-03 18:16:57 +11:00
CrtcTest.java Use correct Mockito package 2023-01-12 16:56:28 -08:00
FifoRingBufferTest.java Work In Progress: CPU behavior, UI changes 2012-11-25 22:49:21 -08:00
MemoryRangeTest.java - Continued refactoring of address decoding. 2010-01-09 16:53:04 -08:00
TestAnsiControlSequenceParser.java implement jterminal in source 2017-08-30 10:34:50 -05:00
TestVt100TerminalModel.java implement jterminal in source 2017-08-30 10:34:50 -05:00
UtilsTest.java Add disassembled instructions to breakpoints 2016-01-02 19:05:38 -08:00