@Sorgelig - you've no idea how much it means to me that you approve of the work.
I was going to ask you on Faceplant about it soon.
As you know, I've struggled with getting anything ported to MiSTer before, and I thought my attempt atm is a bit of a "kludge", but hey, it loads the ROMs, right? lol
I know that it's constantly sending a Read request all the while CART_SRAM_CE_N is low atm, and I don't know if there is a problem there with the way it might not always "catch" the read, depending on when the core is bought out of reset, and which phase the SNES_CE counter is in?
But yep, the core looks very well-written, but does have timing issues with some builds. @kitrinx, @GreyRogue, @Vitor and others have been helping a lot with getting the rest working.
I know the timing constraints and async stuff is really tricky, though, so it would be great if you could help with that.
I added a 64KB on-chip RAM on it for the Backup RAM, but Vitor said that a few games apparently even use up to 128KB.
I doubt it's very many games that need quite that much, though?
Some games like Donkey Kong Country actually check the size of the Backup SRAM, and show a copy protection error if it's wrong, hence it will still need a mask for the BRAM address, based on when the auto-detect stuff is added.
They have been working on adding auto-detection of LoROM / HiROM / other mappers, and the Backup SRAM size, which would allow a lot more games to work without manual config.
I found that if I used the 21 MHz clock for the SPC (now CLK_24M on main), it seemed to get a reliable compile more often. I guess because Quartus won't be struggling so much with the async clocks?
I ended up translating main.vhd to main.v yesterday, as I just couldn't handle trying to work with VHDL any more.
I noticed you did something similar for genesis.v as well recently. lol :p
I was wondering if you think we should just put the instantiations for the SNES core, mapper, and other custom chips directly into SNES.sv, or whether it's good to have the top-level in main.v for all of that, to keep SNES.sv neater?
My mouse support thing isn't working yet, and the OSD option for that often keeps changing to Mouse by default, as I don't recall what that status bit was originally for? I used the NES core as the basis for porting.
Also, I think we could just merge the CART_SRAM and CART_SRAM2 busses into one, since the real carts obviously only have the one main bus any for sharing between the cart ROM and Backup SRAM.
The WSRAM_BLE_N and BLH_N signals aren't even used now, since the author was originally using a 16-bit wide SRAM for that, and it only needs 8-bit.
The audio RAM (ASRAM_ADDR) is 21-bits wide as well, but it only needs to access 64KB for that.
Oh, and the video syncs were a nightmare to get right, and still need tweaking. @kitrinx and I couldn't quite figure out what the exact values should be, so we spent hours messing with the "Sources and Probes" thing on Quartus to get it "close enough". lol
Obviously the HDMI scaler works quite well anyway, as it just uses the FRAME signal as DE.
The video syncs don't currently adjust themselves for PAL mode, btw.
What else? Erm - I don't know if the on-chip RAM blocks could use a slower clock, rather than the full 21 MHz, but it seems to all work OK anyway?
(it could be causing multiple writes to the same locations maybe?)
The joypad spoofer logic I just cobbled together very quickly, but it seems to work OK.
I tried removing "posedge JOY_STRB" from the sensitivity lists, thinking that it would all be synchronous to JOY1_CLK, but yeah, that just broke it.
I didn't use the original audio I2S signals at all, as I don't recall if there was already a decoder block for that on MiSTer, so I just routed the signals directly from the SPC core.
Oh yeah, and X_OUT / Y_OUT are definitely not ideal to use for sync generation, as they do some weird counting.
H_CNT and V_CNT are the real counters.
Thanks again for you work on MiSTer. I can't believe how far it's come in just the past few months.
The SNES core really is the icing on the cake now for a lot of people. That covers pretty much all of the popular consoles of the 16-bit era.
I'm hoping to do more work on my Capcom CPS core soon. I used Jotego's wonderful jt51 YM core, and it's sounding great so far. This is all running on MiSTer, btw...https://drive.google.com/file/d/1MNxVg5 ... sp=sharing
(plus my own MSM6295 ADPCM core.)
I think I've probably bombarded you with enough info now. hehe
OzOnE / ElectronAsh.