News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: How does SNES RAM memory address vs ROM address play a part in creating an emula  (Read 2161 times)

ShelleyThornton

  • Jr. Member
  • **
  • Posts: 1
    • View Profile
hello,
greetings community
If you are making an emulator, does the ROM's machine code reference it's own addresses? Does it refer to locations that it gets mapped to in SNES memory?

When manuals are talking about Direct Paging, absolute, long, etc addressing modes -- they are referring to the SNES's WRAM memory, is this correct?

So when interpreting the machine code of a ROM, do you have to convert to SNES memory locations?

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7154
  • *sigh* A changed avatar. Big deal.
    • View Profile
When manuals are talking about Direct Paging, absolute, long, etc addressing modes -- they are referring to the SNES's WRAM memory, is this correct?

It can be WRAM, it can be ROM, anything. The CPU expects to get SOME NUMBER IN or write SOME NUMBER OUT, it's up to the rest of the hardware what happens before and after.
The Addressing Modes are how the CPU calculates what address to read from.
Direct Page = within current bank (in the DB register), read the direct page register D, and add the one byte following the opcode to get the final address
Absolute = two byte address follows, expected to be within current (DB) bank
Long = three byte address (including the bank)
"My watch says 30 chickens" Google, 2018