We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9607d2 commit d92e9efCopy full SHA for d92e9ef
1 file changed
src/tests/cputest.cpp
@@ -473,15 +473,16 @@ TEST_CASE("JSL instruction correctly sets PBR and PC") {
473
cpu.PBR = 0x00;
474
cpu.S = 0x01FF; // Stack pointer
475
476
- size_t code_ptr = 0;
477
int cycle = 0;
478
479
- // Run for 8 cycles (JSL takes 8 cycles)
+ // Run for 8 cycles (JSL takes 8 cycles according to W65C816S datasheet)
480
while (cycle < 8) {
481
if (pins & W65816_RW) {
482
// memory read
483
- uint32_t addr = W65816_GET_ADDR(pins);
484
- uint8_t bank = (pins >> 32) & 0xFF;
+ // Get the full 24-bit address (bank:address)
+ uint32_t full_addr = W65816_GET_ADDR(pins);
+ uint8_t bank = (full_addr >> 16) & 0xFF;
485
+ uint16_t addr = full_addr & 0xFFFF;
486
487
// Read from our test memory
488
if (bank == 0 && addr < sizeof(memory)) {
0 commit comments