Bug in genesis.c?

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

Post by HardWareMan » Tue Jul 29, 2008 2:00 am

Stef wrote:...i do know the officials documents said we must write the last command from RAM...
Official docs says:
The final write must use the work RAM. There are two ways to accomplish this:
1. by copying the DMA program into RAM, or
2. by doing a final "move.w RAM_address,$C00004"
So, opcode it self no need to be in RAM, but operand wich must be writen in $C00004 must be in RAM. But, I am already used "move.w ROM_address,$C00004" and all works fine. I think this some how connected with hardware limitation: cartrige can be written by byte but can be read only by word and RAM can be reading or writting by byte or word. Or something like that.

notaz
Very interested
Posts: 193
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz » Tue Jul 29, 2008 10:39 am

I've checked what commercial games do again, and they use register, immediate values or RAM as their source operand. Here are some examples:

Code: Select all

move.w  $f640.w, (A5) ; a5=00c0000
move.w  D0, (A4)      ; a4=00c0000
move.w  (A1)+, (A0)   ; a0=00c00004, a1=ffffe4be
There are some games (mostly Konami) which only use RAM, but many others like to use immediates and registers. Perhaps what the docs wanted to say is that we should not use ROM -> c00004 move on the instruction which activates DMA (none of the games I tested do that).

Post Reply