Skip to content

Commit

Permalink
The shifter should read from RAM without the usual wait states.
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbrinkhoff committed Apr 11, 2016
1 parent 03bca64 commit d9e203c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ void mmu_clock(void)
// MMU can only access RAM at cycle 2 within a bus cycle.
if((clock & 3) == 2 && (load & -4) == 0) {
CLOCK("LOAD");
shifter_load(ram_read_word(scrptr));
shifter_load(ram_read_word_shifter(scrptr));
scrptr += 2;
load = de ? 4 : -1;
}
Expand Down
6 changes: 6 additions & 0 deletions ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ WORD ram_read_word(LONG addr)
return (ram_read_byte(addr)<<8)|ram_read_byte(addr+1);
}

WORD ram_read_word_shifter(LONG addr)
{
if(addr > RAM_PHYSMAX) return 0;
return (*real(addr) << 8) + *real(addr+1);
}

static void ram_write_byte(LONG addr, BYTE data)
{
MMU_WAIT_STATES();
Expand Down
2 changes: 1 addition & 1 deletion ram.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

void ram_init();
void ram_clear();
WORD ram_read_word(LONG addr);
WORD ram_read_word_shifter(LONG addr);

#endif

0 comments on commit d9e203c

Please sign in to comment.