Skip to content

Commit d92e9ef

Browse files
Copilotsmokku
andcommitted
Address code review feedback for JSL test
Co-authored-by: smokku <147687+smokku@users.noreply.github.com>
1 parent f9607d2 commit d92e9ef

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/tests/cputest.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,15 +473,16 @@ TEST_CASE("JSL instruction correctly sets PBR and PC") {
473473
cpu.PBR = 0x00;
474474
cpu.S = 0x01FF; // Stack pointer
475475

476-
size_t code_ptr = 0;
477476
int cycle = 0;
478477

479-
// Run for 8 cycles (JSL takes 8 cycles)
478+
// Run for 8 cycles (JSL takes 8 cycles according to W65C816S datasheet)
480479
while (cycle < 8) {
481480
if (pins & W65816_RW) {
482481
// memory read
483-
uint32_t addr = W65816_GET_ADDR(pins);
484-
uint8_t bank = (pins >> 32) & 0xFF;
482+
// Get the full 24-bit address (bank:address)
483+
uint32_t full_addr = W65816_GET_ADDR(pins);
484+
uint8_t bank = (full_addr >> 16) & 0xFF;
485+
uint16_t addr = full_addr & 0xFFFF;
485486

486487
// Read from our test memory
487488
if (bank == 0 && addr < sizeof(memory)) {

0 commit comments

Comments
 (0)