MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Pages: 1

tallcuss
MAME Fan
Reged: 01/05/18
Posts: 2
Send PM


Problems loading modified roms
#372796 - 01/06/18 09:18 AM


I have modified the Vs. Dr Mario code creating my own dm-uiprg file. Other than "WRONG CHECKSUMS" it loads correctly with Mame. "WRONG CHECKSUMS" is to be expected and seems to cause no problem. However, only part of my rom image is loaded into memory. For example, the pointer to the N2A03 initial start code (at 0xfffc) and the start code itself (at 0xff00) are there and are executed correctly. However when the code tries to jump to a subroutine located at 0xbc0a there is nothing there but zeroes. It's the same for areas beginning at 0x8000, 0x8281, 0xb8ec and 0xbbfe. I've tried to find the Mame code that does the actual load thinking I might find the explanation there but no luck. I started with Vs. Dr Mario (drmario) and I'm using mamesdl 0.180. I'm fairly new to Mame. Your thoughts, ideas or comments would be appreciated.



tallcuss
MAME Fan
Reged: 01/05/18
Posts: 2
Send PM


Re: Problems loading modified roms new [Re: tallcuss]
#373104 - 01/15/18 02:34 AM


I found the definition for drmarion ROM in src/mame/drivers/vsnes.cpp

ROM_START( drmario )
ROM_REGION( 0x20000,"maincpu", 0 ) /* 6502 memory */
ROM_LOAD( "dm-uiprg", 0x10000, 0x10000, CRC(d5d7eac4) SHA1(cd74c3a7a2fc7c25420037ae5f4a25307aff6587) )

ROM_REGION( 0x8000,"gfx1", 0 ) /* PPU memory */
ROM_LOAD( "dm-u3chr", 0x0000, 0x8000, CRC(91871aa5) SHA1(32a4299ead7b37f49877dc9597653b07a73ddbf3) )

PALETTE_2C04_0003
ROM_END

This indicates the rom "region" that I'm interested in (dm-uiprg) has a length of 0x20000. The N2A03 (6502) processor has only 16 bits of address giving it an address space of 0x10000 bytes, so how can the region be twice that size?



Haze
Reged: 09/23/03
Posts: 5245
Send PM


Re: Problems loading modified roms new [Re: tallcuss]
#373119 - 01/15/18 07:16 PM


> I found the definition for drmarion ROM in src/mame/drivers/vsnes.cpp
>
> ROM_START( drmario )
> ROM_REGION( 0x20000,"maincpu", 0 ) /* 6502 memory */
> ROM_LOAD( "dm-uiprg", 0x10000, 0x10000, CRC(d5d7eac4)
> SHA1(cd74c3a7a2fc7c25420037ae5f4a25307aff6587) )
>
> ROM_REGION( 0x8000,"gfx1", 0 ) /* PPU memory */
> ROM_LOAD( "dm-u3chr", 0x0000, 0x8000, CRC(91871aa5)
> SHA1(32a4299ead7b37f49877dc9597653b07a73ddbf3) )
>
> PALETTE_2C04_0003
> ROM_END
>
> This indicates the rom "region" that I'm interested in (dm-uiprg) has a length of
> 0x20000. The N2A03 (6502) processor has only 16 bits of address giving it an address
> space of 0x10000 bytes, so how can the region be twice that size?

It's all about the other hardware on the PCB. That's the entire reason you have NES 'mappers' etc. to provide extended mapping through rom windows / banks and such.

The rom region isn't always a 1:1 map of what the CPU can see, if you've got a 16-bit CPU most of the time it is, but for 8-bit CPUs you've usually got a lot of banking going on.

I can't help you with this specific case, but I suspect that's your problem, you're assuming it's a 1:1 mapping, when really there are a bunch of banks and different things visible in memory at different times.


Pages: 1

MAMEWorld >> Programming
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 62 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 780