Previous Thread
Next Thread
Print Thread
Page 99 of 120 1 2 97 98 99 100 101 119 120
Joined: Jun 2008
Posts: 205
B
Senior Member
Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
Originally Posted by etabeta78
great! I was waiting for that since forever!!!!

Ah, should have asked me frown

Code
  if(mapper == LoROM) {
    xml << "  <rom>\n";
    xml << "    <map mode='linear' address='00-7f:8000-ffff'/>\n";
    xml << "    <map mode='linear' address='80-ff:8000-ffff'/>\n";
    xml << "  </rom>\n";

    if(ram_size > 0) {
      xml << "  <ram size='" << strhex(ram_size) << "'>\n";
      //20-3f|a0-bf probably isn't mapped, just being paranoid ...
      xml << "    <map mode='linear' address='20-3f:6000-7fff'/>\n";
      xml << "    <map mode='linear' address='a0-bf:6000-7fff'/>\n";
      if((rom_size > 0x200000) || (ram_size > 32 * 1024)) {
        xml << "    <map mode='linear' address='70-7f:0000-7fff'/>\n";
        xml << "    <map mode='linear' address='f0-ff:0000-7fff'/>\n";
      } else {
        xml << "    <map mode='linear' address='70-7f:0000-ffff'/>\n";
        xml << "    <map mode='linear' address='f0-ff:0000-ffff'/>\n";
      }
      xml << "  </ram>\n";
    }
  }

Note how when ROM size > 2MB or RAM size > 32KB, ROM is mapped to 70-7f|f0-ff:8000-ffff. This is required for Fire Emblem: Torakia 776, otherwise the graphics will be corrupted.

And when you have a ROM size <= 2MB and RAM size <= 32KB, you have to map RAM to 70-7f|f0-ff:8000-ffff. This is required to save your progress in Ys 3: Wanderers from Ys.

Thank Nach for that observation.

byuu #61087 04/12/10 06:11 AM
Joined: Jan 2006
Posts: 3,691
Very Senior Member
Offline
Very Senior Member
Joined: Jan 2006
Posts: 3,691
I knew. if you remember, the first thing I asked to borrow from bsnes was the cart mapping code
but I never found a game requiring that specific part so I was always mapping the whole 70-7f:0000-ffff as SRAM (and, to be fair, I only remembered about this possible source of problems last week).

actually we are also diverging a bit more for SRAM (no "paranoid part" in MESS), but I might consider switching to your approach now that we have finally found issues due to SRAM mapping, and hence I have test cases...


EDIT: improved SRAM mapping for large LoROM carts. As a result, I was able to progress a bit in Tokimeki Memorial (still no text, but the game didn't freeze at the first selection...)

in a few days, when I'm back from a work trip, I'll try to make our SRAM handling the same as bsnes

Joined: Jun 2008
Posts: 205
B
Senior Member
Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
Quote
but I never found a game requiring that specific part so I was always mapping the whole 70-7f:0000-ffff as SRAM

Yeah, I tend to do most of these things for a reason wink
Please don't hesitate to ask if you are about to diverge on something. Never know, it may be a bug in my code.

byuu #61089 04/12/10 08:15 AM
Joined: Jan 2006
Posts: 3,691
Very Senior Member
Offline
Very Senior Member
Joined: Jan 2006
Posts: 3,691
Originally Posted by byuu
Note how when ROM size > 2MB or RAM size > 32KB, ROM is mapped to 70-7f|f0-ff:8000-ffff. This is required for Fire Emblem: Torakia 776, otherwise the graphics will be corrupted.

And when you have a ROM size <= 2MB and RAM size <= 32KB, you have to map RAM to 70-7f|f0-ff:8000-ffff. This is required to save your progress in Ys 3: Wanderers from Ys.

Thank Nach for that observation.

while we are at this, byuu, I have a question about LinearMap of cartram (cartrom is understood).
Say a cart has 32k of SRAM, and we map it "linearly" in 64k (0x1000) of memory. what happens if a write occurs at 0xc00? does the cart save the value written there? and how, given it only have 32k of SRAM? or does the upper half (0x800-0x1000) become RAM (i.e. it gets written and read, but not saved at exit)?

this is the last missing bit to make our handling the same as yours...


EDIT: as you can see, I haven't hesitated wink

Kale #61090 04/12/10 08:44 AM
Joined: Sep 2009
Posts: 15
J
Member
Offline
Member
J
Joined: Sep 2009
Posts: 15
You can fix the text by fixing the
Code
snes_cart.small_sram == SNES_MODE_20
typo in snescart.c. wink

Joined: Jan 2006
Posts: 3,691
Very Senior Member
Offline
Very Senior Member
Joined: Jan 2006
Posts: 3,691
d'oh... I should not code while preparing my luggage...

thanks a lot: we finally have text in Tokimeki and Wizardry Gaiden starts :party:

Last edited by etabeta78; 04/12/10 08:53 AM.
Joined: Dec 2005
Posts: 330
A
AWJ Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2005
Posts: 330
Originally Posted by etabeta78
while we are at this, byuu, I have a question about LinearMap of cartram (cartrom is understood).
Say a cart has 32k of SRAM, and we map it "linearly" in 64k (0x1000) of memory. what happens if a write occurs at 0xc00? does the cart save the value written there? and how, given it only have 32k of SRAM? or does the upper half (0x800-0x1000) become RAM (i.e. it gets written and read, but not saved at exit)?

I would guess that it's most likely mirrored...

AWJ #61095 04/12/10 09:35 AM
Joined: Jan 2006
Posts: 3,691
Very Senior Member
Offline
Very Senior Member
Joined: Jan 2006
Posts: 3,691
I would expect the same, but I would like to know the exact behavior of byuu's MapLinear. because for mirroring the writes I would have expected something like (bogus example for our 64k at 0x70)

map(MapLinear, 0x70, 0x70, 0x0000, 0x0fff, memory::cartram, 0x0000, 0x07ff);

and I find in bsnes something like

map(MapLinear, 0x70, 0x70, 0x0000, 0x0fff, memory::cartram);

with no mention of the behavior of writes to mirrored addresses (the last 2 parameters are used to say the program to ignore higher bits...)

Joined: Aug 2009
Posts: 1,250
Likes: 171
Kale Online Sleepy OP
Very Senior Member
OP Online Sleepy
Very Senior Member
Joined: Aug 2009
Posts: 1,250
Likes: 171
Uhm ...

[Linked Image from mamedev.emulab.it]

[Linked Image from mamedev.emulab.it]

[Linked Image from mamedev.emulab.it]

[Linked Image from mamedev.emulab.it]

Fushigi no Dungeon 2 garbage on ranking screen is gone, but game still doesn't save properly.

EDIT: just fixed laugh

[Linked Image from mamedev.emulab.it]

Last edited by Kale; 04/12/10 01:39 PM.
Kale #61105 04/12/10 02:22 PM
Joined: Dec 1999
Posts: 1,180
Likes: 2
J
Very Senior Member
Offline
Very Senior Member
J
Joined: Dec 1999
Posts: 1,180
Likes: 2
Great work smile

Tokimeki graphics are not quite 100% in-game though:
[Linked Image from interbutt.com]

Page 99 of 120 1 2 97 98 99 100 101 119 120

Link Copied to Clipboard
Who's Online Now
4 members (ameath, Kale, robcfg, 1 invisible), 519 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,320
Posts121,930
Members5,074
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com