https://github.com/PCSX2/pcsx2/blob/c272359f20f17d497eb2a9d0eda3a5c78358411e/pcsx2/Hw.h#L296
https://github.com/PCSX2/pcsx2/blob/c272359f20f17d497eb2a9d0eda3a5c78358411e/pcsx2/Hw.h#L297
https://github.com/PCSX2/pcsx2/blob/c272359f20f17d497eb2a9d0eda3a5c78358411e/pcsx2/Hw.h#L298
Reverse engineering a game and trying to find the correct names for the registers it's accessing. I was looking at this when I noticed that the members for D9 start at 0x1000D400, but the next two members are in 0x1000D000, which is what D8 is under. Unless this is a special case scenario, it looks like stuff that checks access to D9 (if any) will get mixed up with D8.
Could this be a bug? Or is this intentional? Just wanted to point it out in any case.
Yeah, that's obviously wrong. Jake probably made a bad copy/paste when he commited this code (https://github.com/PCSX2/pcsx2/commit/003da7d287a1bc5490cffbea91b608b28c285520)
@gregory38
I personally prefer having the DMA channel number instead of aliases like fromSPR and toSPR, any opinion?
Ughh, Nevermind.
//GS
D2_CHCR = 0x1000A000,
D2_MADR = 0x1000A010,
D2_QWC = 0x1000A020,
D2_TADR = 0x1000A030,
D2_ASR0 = 0x1000A040,
D2_ASR1 = 0x1000A050,
GIF_CHCR = 0x1000A000,
GIF_MADR = 0x1000A010,
GIF_QWC = 0x1000A020,
GIF_TADR = 0x1000A030,
GIF_ASR0 = 0x1000A040,
GIF_ASR1 = 0x1000A050,
I guess there's no problem in having both of the formats and most of the other DMA channel constants seem to have it this way.
Can you please elaborate for noobs like me why the change is 'safe' if OP saw the wrongly used value in a game? I was first rather happy that you found a core bug.
The PS2 has a total of 10 DMA channels (D0 - D9) and each channel has a set of 32 bit registers mapped on different memory spaces and _every_ channel definitely has a CHCR register ( Channel control register ). For example, DMA0 is mapped on 0x10008000 and DMA1 is mapped on 0x10009000. (The CHCR register of those channels are also mapped at that starting location)
We only use the address value of the CHCR register on the DMA controller code to identify which channel is being used and do the relevant actions based on the channel detected, the other registers are used to identify things like the qwords which need to be transferred and so and so but we don't really _need_ the address of the other registers.
In this case, the address of MADR and QWC were wrong which doesn't really matter as we don't make use of its address. In the DMA code, we have a custom struct/union set up for the DMA which initializes all the bitfield value based on the address of the channel control register, so only the address of CHCR matters in the end. In our current DMA code, as long as the address of CHCR is correct, we shouldn't have any problems. I'm not even sure why Jake has added the address of the other registers, maybe for logging purpose? Don't know, I just filled up the gap since the address values of the other registers are included.
Also nice to see you around after such a long time, Willkuer. Coincidentally I was just talking about you yesterday to my sister (who's 13 year old right now), she apparently wants to be a physicist in the future for some reason as she has interest in Physics and asked me if I knew what needs to be done to become a good physicist. I was like, I have no clue but I know a really good physicist in one of the internet forums which I browse around and I'll try asking him. (You were obviously the one I was talking about 馃槤 )
Thanks for the explanation.
There are basically two different kinds of physicists. Ambitious ones and the others. If she is ambitious she won't fail.
Science is done where the money is. To start from India is harder than from US or Europe but better than most other countries (e.g. as the arabian ones). By experience from coworkers I'd say your universities are not so bad and your culture fits better to the western world than say the Chinese one. She should learn English and ideally study in English. She should learn how to code (maybe from her brother?). I think Python is currently the best choice. She can do her Bachelor in India but should plan to move to Europe/US for the master, latest for the PhD. She will hate the weather. The university is free in Germany so I'd say that would be one of the best choices. That means she needs to impress the people from DAAD (which like to support women) to get a scholarship. So top 20% of the graduates appears reasonable to me. If she wants to be a scientist afterwards she needs to add stations in other countries ideally in famous groups.
Studying physics means being bored to death for three years (B.Sc.) where the expectation is too high for your level of education. Afterwards you will have the best two years of your life (M.Sc.). PhD is pure luck. If the work group is good you will be productive and finish in three years if not you need more time and in worst case need to change the group. You can not fail the PhD. Independent on your work you will get it.
To become a professor is basically impossible if you are not sociopathically ambitous. The loan of a post-doc is sub-par comparing to industry. So ideally she'll go to industry after obtaining her PhD. A women from India, which studied in English, is able to code, did her MSc in Berlin and her PhD in Lausanne... most companies would instantly give her a position.
I would always study physics again but probably only 5% of B.Sc. beginners will finish with a PhD where most students are lost during the B.Sc.