marhel / r68k

A m68k emulator in rust - let r68k = musashi.clone();
MIT License
72 stars 7 forks source link

Implement Scc #45

Closed marhel closed 8 years ago

marhel commented 8 years ago

Please implement the instruction for Set Conditionally. See implementation of Bcc. For more information, please read the instruction contribution guidelines

emoon commented 8 years ago

I can take this

emoon commented 8 years ago

I have started to work on this but I have a strange issue

https://github.com/emoon/r68k/commit/810ec281d11fcb66b7f2dc2668727e015178206b

I have started with implementing shi (dn) but when I try to run the qc test for this the instruction never gets called. I'm sure I have missed something stupid but not sure what it is.

marhel commented 8 years ago

I made the mistake of swapping (or, not swapping, rather) the arguments to the qc-macro a few times. It's easily done, and with the mask and the match reversed, it won't call the intended instruction. We should probably made the qc and op_handler macros have their arguments in the same order, or find a way to make this mistake not typecheck.

emoon commented 8 years ago

Seems I forgot the MASK_OUT_Y here (doh!)

marhel commented 8 years ago

Also, please do a test for implementing the correct op-constant, like at the bottom of handlers.rs, to see if you messed that up... And I think the default mask-argument to the qc-macro is MASK_OUT_X_Y, which is not the mask your op used. (Oh, noticed just now you found it! :cake: )

emoon commented 8 years ago

:)

marhel commented 8 years ago

We Should probably remove the default mask-argument to qc all together, I've actually stopped using that. Now I just copy the op_handler, and transpose the first and second arguments which is a quick and easy move in sublime text. but if course it would be easier not to have to do that swap at all.

emoon commented 8 years ago

Yeah I think that is a good idea.

marhel commented 8 years ago

It seems that the Scc register cycle issue is fixed in Mame.