What's new

Sega Genesis/Mega Drive Emulation

CodeSlinger

New member
After finishing a few emulators including the master system I am going to start a sega mega drive emulator. Has anyone emulated this system with any success?

I was having a quick look at some 68000 microprocessor docs and I cant seem to find one which lists instructions next to their equivalent hex opcodes. Anyone know of a doc that shows this so I can get started?

Thanks

:robot:
 
OP
C

CodeSlinger

New member
Thanks for the reply guys.

I found the reference manual AamirM suggested on the site cyberman posted (thats team work!). I do have one question though before I start to make sure I am interpreting everything correctly.

The ADDI instruction has a format like so:

InstructionFormat.png


Now I assume by this instruction format that I read the first 16 bits from the 8 bit array game memory, and look at the higher byte. If the value is 00000110 then I know that the instruction is an ADDI and the lower byte of the memory contains information on the ADDI instruction. Then depending on the "size" of the ADDI instruction I either have to read 16 bits, or 8 bits (by reading 16 bits and masking off the top 8 bits) or a 32 bit value. Does this sound correct?


Thanks
 
Last edited:

Cyberman

Moderator
Moderator
Endianess

Before you do so be sure you understand what the endianess of the machine is. I believe this processor happens to be big endian. That means in byte ordering larger values have higher index values (think of memory as a character array and the index of the MSB <most significant byte> is greater than the LSB <least significant byte>). Little endian is the oposite byte ordering (also known as endianess). This is especially useful when decoding instructions.

Cyb
 

nameuser

New member
I think you're saying the opposite of what is correct :
Big Endian is when the more significant bytes come first (have lower indexes) and Little Endian is when the more significant bytes come last (have higher indexes).
So 0x2132 is (0x21, 0x32) in Big Endian (like M68k) and (0x32, 0x21) in Little Endian.
 

Top