Undefined behavior for ABCD and SBCD

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

r57shell
Very interested
Posts: 475
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Re: Undefined behavior for ABCD and SBCD

Post by r57shell » Thu Apr 27, 2017 2:32 pm

HardWareMan wrote:I do not understand, hasn't anyone looked at the CPU die shots yet?
Basic die shots. Then, Quietust has made a great contribution by isolating the metal traces. Olivier Galibert was able to make use of this layer image, with a few corrections, to produce a full transistor-level schematic of the 68000. In result, here the interactive map. You can look at ALU under the magnifying glass. I don't see any problem in getting true behavior without guessing.
After hours of pain, was able to compile https://github.com/galibert/dietools.git using Visual Studio 2010
Not all...
logx was failed to compile because of C++11 syntax.
mscheme probably bugged compilation because I had to implement what is not defined in LuaJIT.
sview a bit modified to make pins text work + vcc/gnd voltage change. In repo vcc & gnd voltage forced to 0, otherwise you'll get tons of errors "Unhandled equation system." :lol:

So. For anyone who wanna play with it:
1) Download scheme: https://og.kervella.org/m68k/schem.txt
2) Download deietools (my build): http://www.mediafire.com/file/2p5giq3fs ... ietools.7z
3) Unpack in some dir
4) Open cmd.exe there, run: sview "path_to_schem.txt". Or simply drag schem.txt and drop over sview.exe
5) ?!?!?
6) Have Fun!
Image

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

Re: Undefined behavior for ABCD and SBCD

Post by notaz » Wed Sep 20, 2017 7:48 pm

Small update to flamewing's test to trigger a bug in Genesis-Plus-GX at least:
https://github.com/flamewing/68k-bcd-ve ... e3afd720bf
http://notaz.gp2x.de/md/rel/bcd-verifier-u1.zip

Eke
Very interested
Posts: 820
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Re: Undefined behavior for ABCD and SBCD

Post by Eke » Sun Sep 24, 2017 10:41 pm

notaz wrote:
Wed Sep 20, 2017 7:48 pm
Small update to flamewing's test to trigger a bug in Genesis-Plus-GX at least:
https://github.com/flamewing/68k-bcd-ve ... e3afd720bf
http://notaz.gp2x.de/md/rel/bcd-verifier-u1.zip
Well, this was indeed a very stupid bug in Musashi: upper bits of NBCD source operand were not masked when it comes from a 68k register, which would lead to incorrect calculation when those bits are not cleared before calling the instruction. Thanks for the notice.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest