Help with Quran custom mapper on Carnivore 2

Por wbahnassi

Master (191)

imagem de wbahnassi

18-03-2020, 22:12

Hi, I'm trying to have the Quran rom work on C2, but a straight up setup doesn't cut it as it uses a custom mapper.
The ROM is playable on WebMSX, which has a custom mapper specifically for that ROM. You can see it in action on file-hunter.
I found the WebMSX code for that mapper, but I don't know how to translate that to C2 entry registry values.
Any help/directions on this would be much appreciated!

Cheers

Entrar ou registrar-se para comentar

Por wbahnassi

Master (191)

imagem de wbahnassi

29-04-2020, 15:10

Bump Smile

Por wbahnassi

Master (191)

imagem de wbahnassi

06-05-2020, 22:36

Since this is the month of Ramadan, I thought it fit to revisit this topic. After studying the whole business with memory mappers, I managed to figure out how to setup C2 to memory-map Holy Quran properly. I've uploaded an RCP file that contains the settings to my OneDrive here:
QURAN.RCP

In case OneDrive.com closes or if you prefer to input the numbers manually, here are the full settings to be put with C2MAN's entry editor:

Holy Quran

14 FF  1D 10    61-a

Bank1: FF 50 00 84 7F 40
Bank2: FF 54 01 84 7F 60
Bank3: FF 58 02 84 7F 80
Bank4: FF 5C 03 84 7F A0

       D5 88 00 01 FF

Enjoy! :)

Por Grauw

Ascended (10699)

imagem de Grauw

06-05-2020, 23:07

Congrats for figuring it out! Smile

Por wbahnassi

Master (191)

imagem de wbahnassi

06-05-2020, 23:21

Thanks a lot Grauw! It was a great execuse to learn how ROM mappers work. I also added the mapper to our ROM Mappers wiki. I hope I got it right. Feel free to correct it if necessary.

Por Manuel

Ascended (19270)

imagem de Manuel

07-05-2020, 00:04

openMSX source code says:
// It is like an ASCII 8KB, but using the 5000h, 5400h, 5800h and 5C00h
// addresses.

Note that the original Holy Quran cartridge is encrypted and has on-the-fly decryption in the mapper circuit on the PCB Smile

Por wbahnassi

Master (191)

imagem de wbahnassi

07-05-2020, 01:48

Yes. I was also comparing the Quran mapper against ASCII8 on WebMSX since they looked very similar except for the write addresses. You can also see the decode function there, but it's probably never tested. The ROM image I have is already decoded too, so that's one less thing to worry about.

So when I first started testing on Carnivore2 I chose ASCII 8 as the base mapper. Then I went on to just modify the write addresses, but that wasn't enough. This is how the ASCII8 C2 registers look like:

15 FF  2D 10    61-a

Bank1: F8 60 00 84 FF 40
Bank2: F8 68 01 84 FF 60
Bank3: F8 70 02 84 FF 80
Bank4: F8 78 03 84 FF A0

       FF A8 00 01 FF

The main problem is what C2MAN calls the RxMask, which is the F8 value at the start of each bank entry in the table above. It says: "RxMask: BitMask for register bank number" .. So F8 is masking out the lower three bits from the number. Only when I changed this to a pass-through mask (FF) did the program work.
Finally, the column with FF in the table above represents the bit mask for the bank number's value. I changed this to 7F to match what WebMSX's mapper is doing. The initial bank segments don't seem to effectively matter so I'm assuming the program is initializing them itself anyways, but WebMSX sets them all to 0, so that's what I documented in the wiki.

Por Wierzbowsky

Guardian (3568)

imagem de Wierzbowsky

07-05-2020, 18:24

Thanks. We can include the RCP into the next release for Carnivore2. Does the ROM work well with these settings?

Por wbahnassi

Master (191)

imagem de wbahnassi

07-05-2020, 20:38

Yes Alexey, I ran the ROM with this RCP on my AX-170 and it was stable without any issues. I also made sure to jump around different sections in the program to stress the bank switching.. so I'd say it's working Smile
For the initial segments, this RCP uses 0,1,2,3 and it works fine. WebMSX uses 0,0,0,0. I tried that too and both are good. It's irrelevant.

Por Manuel

Ascended (19270)

imagem de Manuel

07-05-2020, 21:34

openMSX also sets 0, 0, 0, 0 for the initial banks. Alexey, can you point me to the documentation of that RCP file? It looks interesting, but I still don't understand it, trying to map it onto https://github.com/openMSX/openMSX/blob/master/src/memory/Ro...

Por Wierzbowsky

Guardian (3568)

imagem de Wierzbowsky

08-05-2020, 10:14