Page 1 of 2

M68k opcode sizes test ROM

Posted: Wed Aug 30, 2017 3:58 pm
by r57shell
Source: https://github.com/realmonster/smd_emu_tests
Compiled: http://www.mediafire.com/file/03oy89xl4 ... _sizes.bin
:D
Pass: Hardware, gens-gx(musashi), mess(musashi), Exodus.
Hangs: BlastEm, PicoDrive
Fails: Gens, GensGS, Regen, Fusion, Mednafen.

Surprisingly, it shows, that M68000PRM rev 1 has no errors!
At least in scope of allowed addressing modes.

Re: M68k opcode sizes test ROM

Posted: Wed Aug 30, 2017 5:42 pm
by Mask of Destiny
Thanks for making this! I suspected my instruction decoder still had issues with some instructions that should be illegal not decoding as such. I suspect the hang is related, but regardless this new test ROM will be very helpful in tracking down any remaining decoder issues.

Re: M68k opcode sizes test ROM

Posted: Wed Aug 30, 2017 6:01 pm
by r57shell
For hangs it shows barcode at bottom right corner
with columns colors equal to hex digits of opcode starting from highest.

Re: M68k opcode sizes test ROM

Posted: Fri Sep 01, 2017 7:23 pm
by r57shell
Post processing code added.

Re: M68k opcode sizes test ROM

Posted: Sun Sep 10, 2017 2:45 pm
by notaz
The purple screen means failure, right?
This is what I get on my PAL MD with Hitachi 68k:
http://notaz.gp2x.de/img/mess/megadrive ... _sizes.jpg

Re: M68k opcode sizes test ROM

Posted: Sun Sep 10, 2017 7:04 pm
by r57shell
I have no idea. Is it official MD?
Normaly passed check is two green big tiles.
All other results I consider as some bug, or flashcart issue.
Screen should not be purple, It should be black with blue pixels in MD region.
I setup palette at start, and never change it.
And backdrop color is set to zero which is black.

Keep in mind, that I didn't check any console myself.
Also, I simply belive to words that said one mate who did check.

Re: M68k opcode sizes test ROM

Posted: Sun Sep 10, 2017 8:47 pm
by notaz
Yes it's a proper German MD1: http://notaz.gp2x.de/img/hw/megadrive_model1.jpg
Note that I also have MegaCD + 32X attached, I know those have effect on open bus at least.

The purple screen is on a Mega Everdrive v1, consistently getting it every time on the same spot. I haven't seen any other problems caused by MED except my own tests that use STOP opcode - this causes MED's DRAM corruption because MED wants bus activity to work properly.

I've tested with another flashcart (raw flash, no SD card or any menus) and only getting black screen with that. I've checked and it runs other games fine.
EDIT: I've retried maybe 20 times with this flashcard and it worked 2 times to completion (2 green tiles), all other times just black screen. Maybe you're inadvertently using uninitialized RAM or some register?

Re: M68k opcode sizes test ROM

Posted: Mon Sep 11, 2017 11:37 am
by r57shell
notaz wrote:
Sun Sep 10, 2017 8:47 pm
EDIT: I've retried maybe 20 times with this flashcard and it worked 2 times to completion (2 green tiles), all other times just black screen. Maybe you're inadvertently using uninitialized RAM or some register?
https://github.com/realmonster/smd_emu_ ... s.asm#L217
This is m68k RAM clearing for example.
I guess it detects not cold start, and skips all initialization.
You may try comment this line (bne.s start)
https://github.com/realmonster/smd_emu_ ... s.asm#L177

Also attached 32X or Sega CD may cause issue.

Re: M68k opcode sizes test ROM

Posted: Mon Sep 11, 2017 8:44 pm
by Mask of Destiny
For what it's worth, I've seen the same thing on my VA3 Model 1 US Genesis also with a MED v1. Not sure which 68K variant it has off hand. Haven't had a chance to test with my VA6 Model 1 or my Model 3 or using my UMDK yet though. I had no 32X or Sega CD attached during the test.

Re: M68k opcode sizes test ROM

Posted: Tue Sep 12, 2017 12:26 pm
by TmEE co.(TM)
I'll have to flash this on my bare flash cart and see what results I get with various CPUs. I have socketed the CPU in several of my machines and have multiple CPUs to test with.

Re: M68k opcode sizes test ROM

Posted: Tue Sep 12, 2017 4:28 pm
by HardWareMan
Can you post compiled versions of updated tests?

Re: M68k opcode sizes test ROM

Posted: Tue Sep 12, 2017 7:08 pm
by r57shell
I can't send compiled update one until I update it.
At this moment I don't know what to fix.
Can someone at least figure out why backdrop is purple.
It should not be so if VDP works correctly.

Re: M68k opcode sizes test ROM

Posted: Wed Sep 13, 2017 7:27 am
by Mask of Destiny
OK, tested on the same Genesis with my UMDK and it works correctly there. Looking at where it seems to get stuck, I think I know what the problem is. You're not filtering out the RESET instruction. While RESET does nothing to the Genesis/MD hardware itself, it does pulse !VRES on the cartridge port which some carts use to reset their mapping hardware. In the case of the MED (at least the v1), I happen to know that this completely resets the MED hardware (FPGA reset and boot FLASH is mapped in rather than RAM). As a result, everything crashes after RESET is tested.

Re: M68k opcode sizes test ROM

Posted: Wed Sep 13, 2017 8:01 am
by HardWareMan
Mask of Destiny wow, nice debugging! Now I know, why my cartridge also reboots. I'm just forgot about RESET opcode... So, it must be launched only with dumb ROM cartridge.

Re: M68k opcode sizes test ROM

Posted: Wed Sep 13, 2017 12:25 pm
by r57shell
Nice!
Should I also remove warm-boot check?
Is filtering RESET passes test?