M68k opcode sizes test ROM

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:

M68k opcode sizes test ROM

Post by r57shell » Wed Aug 30, 2017 3:58 pm

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.
Image

Mask of Destiny
Very interested
Posts: 558
Joined: Thu Nov 30, 2006 6:30 am

Re: M68k opcode sizes test ROM

Post by Mask of Destiny » Wed Aug 30, 2017 5:42 pm

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.

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

Re: M68k opcode sizes test ROM

Post by r57shell » Wed Aug 30, 2017 6:01 pm

For hangs it shows barcode at bottom right corner
with columns colors equal to hex digits of opcode starting from highest.
Image

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

Re: M68k opcode sizes test ROM

Post by r57shell » Fri Sep 01, 2017 7:23 pm

Post processing code added.
Image

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

Re: M68k opcode sizes test ROM

Post by notaz » Sun Sep 10, 2017 2:45 pm

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

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

Re: M68k opcode sizes test ROM

Post by r57shell » Sun Sep 10, 2017 7:04 pm

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.
Image

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

Re: M68k opcode sizes test ROM

Post by notaz » Sun Sep 10, 2017 8:47 pm

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?

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

Re: M68k opcode sizes test ROM

Post by r57shell » Mon Sep 11, 2017 11:37 am

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.
Image

Mask of Destiny
Very interested
Posts: 558
Joined: Thu Nov 30, 2006 6:30 am

Re: M68k opcode sizes test ROM

Post by Mask of Destiny » Mon Sep 11, 2017 8:44 pm

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.

User avatar
TmEE co.(TM)
Very interested
Posts: 2285
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: M68k opcode sizes test ROM

Post by TmEE co.(TM) » Tue Sep 12, 2017 12:26 pm

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.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

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

Re: M68k opcode sizes test ROM

Post by HardWareMan » Tue Sep 12, 2017 4:28 pm

Can you post compiled versions of updated tests?

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

Re: M68k opcode sizes test ROM

Post by r57shell » Tue Sep 12, 2017 7:08 pm

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.
Image

Mask of Destiny
Very interested
Posts: 558
Joined: Thu Nov 30, 2006 6:30 am

Re: M68k opcode sizes test ROM

Post by Mask of Destiny » Wed Sep 13, 2017 7:27 am

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.

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

Re: M68k opcode sizes test ROM

Post by HardWareMan » Wed Sep 13, 2017 8:01 am

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.

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

Re: M68k opcode sizes test ROM

Post by r57shell » Wed Sep 13, 2017 12:25 pm

Nice!
Should I also remove warm-boot check?
Is filtering RESET passes test?
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests