IOS: Add constants for some missing IOSes #4907

Merged
merged 1 commit into from Feb 15, 2017

Projects

None yet

7 participants

@leoetlino
Member
leoetlino commented Feb 13, 2017 edited

This adds memory values for IOS11, 20, 30, 50, 51, 52, 60 and 70. Fixes older system menus.

Unfortunately, IOS40 (in its working version) is not present on NUS, so constants for that one are still missing.

@sepalani
Contributor
sepalani commented Feb 13, 2017 edited

@leoetlino Do you think there are game's updates containing that missing IOS?

@leoetlino
Member

Perhaps, but I don't have any Korean game either :(

Source/Core/Core/IOS/IPC.cpp
@@ -348,6 +391,11 @@ constexpr std::array<IosMemoryValues, 31> ios_memory_values = {
0x935E0000, 0x935E0000, 0x93600000, HOLLYWOOD_REVISION,
RAM_VENDOR, 0x93600000, 0x93620000, 0,
},
+ {60, 0x3c181e, 0x112408, MEM1_SIZE,
@BhaaLseN
BhaaLseN Feb 13, 2017 edited Contributor

Does lint format it like that, or did you simply miss a newline here between the brace and the IOS number? Also at the end.

@leoetlino
leoetlino Feb 13, 2017 Member

lint. I found it weird too :(

@sepalani
sepalani Feb 13, 2017 Contributor

Does it happen if you add that "useless" comma at the end (after the "0")?

@leoetlino leoetlino IOS: Add constants for some missing IOSes
This adds memory values for IOS11, 20, 30, 50, 51, 52, 60 and 70.

Unfortunately, IOS40 (in its working version) is not present on NUS, so
constants for that one are still missing.
089f452
@JMC47
Contributor
JMC47 commented Feb 15, 2017

LGTM

@Fallcrest
Fallcrest commented Feb 15, 2017 edited

@leoetlino According to WiiBrew, IOS40 v3072 is available via the NUS, or is it just a problem of you not having access to a Korean Wii/game? (Or is v3072 not the "working version"? I'm not quite sure what you mean by that.)

@leoetlino
Member

v3072 is a stub.

@Fallcrest

Oh, I understand, sorry.

@JosJuice JosJuice merged commit 339f6e3 into dolphin-emu:master Feb 15, 2017

10 checks passed

default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-freebsd-x64 Build succeeded on builder pr-freebsd-x64
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details
@leoetlino leoetlino deleted the leoetlino:ios-constants branch Feb 15, 2017
@Bent82
Bent82 commented Feb 16, 2017

I have access to IOS40, v2321. Any way I can get you these constants?

@leoetlino
Member

Using a disassembler, find out what the values written to the 0x3100 region are. IOS does it all in a single function and basically just pokes the values in.

The fastest way to find that function is probably to search for 0x93600000 -- in newer IOSes, there will be at least two matches; one early in the kernel boot process (near "Updated DDR settings in lomem for current map"). The other one is usually the one you want.

@Bent82
Bent82 commented Feb 16, 2017

I'll see what I can do. My programming skills are... rusty, at best, and I've never used a disassembler before, but your instructions seemed clear enough.

@Bent82
Bent82 commented Feb 16, 2017

I have isolated the function. Is there an easy way to tell which values are needed? I could step through the code by hand (ugh) laying out the memory addresses, but I'm still not sure how you have the array laid out, which values correspond to what addresses. I could do some more reading, but I want to make sure there isn't a faster way you have before I do this.

@leoetlino
Member

Here's a list of constants and their addresses in memory.

IOS40 probably shares the majority of the values with IOS28 and higher (and some of them are likely the same on every single IOS, such as the mem1 size). Could you check whether the following values are identical to IOS41, and if not, what their values are:

  • 0x3114, 0x312c, 0x3150, 0x3154 (which should be placeholder values: 0xdeadbeef)
  • 0x3124 and 0x3128 (mem2 arena)
  • 0x3130 and 0x3134 (IPC memory zone)
  • 0x3148 and 0x314c (unknown values)

Thanks for looking into it! :)

@Bent82
Bent82 commented Feb 16, 2017

Ok, here goes:

  • Yes, 0x3114, 0x312c, 0x3150, and 0x3154 all are the value 0xdeadbeef.
  • 0x3124 is loaded with 0x90000800. 0x3128 is loaded with 0x935e0000.
  • 0x3130 is loaded with 0x935e0000. 0x3134 is loaded with 0x93600000.
  • 0x3148 is loaded with 0x93600000. 0x314c is loaded with 0x93620000.

Glad to help, I hope I did it right.

@leoetlino
Member

So IOS40's values are pretty much the same as IOS41's. I'll add an entry for it. Again, thanks a lot!

@leoetlino
Member

Oops, I forgot one value -- could you check what's at 0x3144 (which is the IOS date)?

@Bent82
Bent82 commented Feb 16, 2017

Sure, it is 0x22308 at that address.

@leoetlino leoetlino added a commit to leoetlino/dolphin that referenced this pull request Feb 16, 2017
@leoetlino leoetlino IOS: Add constants for IOS40
This adds memory constants for IOS40.

We should now support every system menu, courtesy of Bent82:
dolphin-emu#4907 (comment)
ab9702c
@leoetlino leoetlino added a commit to leoetlino/dolphin that referenced this pull request Feb 16, 2017
@leoetlino leoetlino IOS: Add constants for IOS40
This adds memory constants for IOS40.

We should now support every system menu, courtesy of Bent82:
dolphin-emu#4907 (comment)
aa9ed91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment