Emuforums.com

Go Back   Emuforums.com > PS2 Emulation > Misc PS2 Discussion
About Us Register FAQ Members List Calendar Mark Forums Read

Login to remove all ads!
Reply
 
LinkBack Thread Tools Display Modes
Old May 28th, 2004   #1 (permalink)
Registered User
 
Join Date: Mar 2004
Location: CHINA
Posts: 8
[Reading Source Code]Who can help me ?

In the R3000A.h file, the following codes

typedef union {
struct {
unsigned long r0, at, v0, v1, a0, a1, a2, a3,
t0, t1, t2, t3, t4, t5, t6, t7,
s0, s1, s2, s3, s4, s5, s6, s7,
t8, t9, k0, k1, gp, sp, s8, ra, lo, hi;
} n;
unsigned long r[34]; /* Lo, Hi in r[33] and r[34] */
} GPRRegs;

typedef union {
struct {
unsigned long Index, Random, EntryLo0, EntryLo1,
Context, PageMask, Wired, Reserved0,
BadVAddr, Count, EntryHi, Compare,
Status, Cause, EPC, PRid,
Config, LLAddr, WatchLO, WatchHI,
XContext, Reserved1, Reserved2, Reserved3,
Reserved4, Reserved5, ECC, CacheErr,
TagLo, TagHi, ErrorEPC, Reserved6;
} n;
unsigned long r[32];
} CP0Regs;


What's the meaning of GPRRegs & CP0Regs ?
__________________
sig too big , limits 500x100 & 20 kbs

I am Jedimaster
Jedimaster is offline   Reply With Quote
Old May 28th, 2004   #2 (permalink)
_E_
Administrator
 
_E_'s Avatar
 
Join Date: Aug 2002
Location: somewhere
Posts: 8,589
GPRRegs and CP0Regs are the union names, C unions are variable type that can contain many different variables such as structs, but only actually holds one of them at a time

Yours,
-Elly
__________________
-= Now watching=-
_E_ is offline   Reply With Quote
Old May 29th, 2004   #3 (permalink)
Registered User
 
Join Date: Mar 2004
Location: CHINA
Posts: 8
My Meaning IS:

What are they used for ? Which objects are they defined ?
__________________
sig too big , limits 500x100 & 20 kbs

I am Jedimaster
Jedimaster is offline   Reply With Quote
Old May 29th, 2004   #4 (permalink)
Emu author
 
zenogais's Avatar
 
Join Date: Aug 2003
Location: Victorville(Near Los Angeles or LA for those who are on the DL)
Posts: 839
This code defines the Playstations R3000A CPU Registers. A union is used to assign one chunk of memory many different names. They're are useful in many places in low level emulation.

GPRRegs = General Purpose Registers
CP0Regs = Coprocessor 0 Registers
__________________
-----------------
Emu Tinkerer and C++ Programmer
zenogais is offline   Reply With Quote
Old May 30th, 2004   #5 (permalink)
Registered User
 
Join Date: Mar 2004
Location: CHINA
Posts: 8
O~~

Thanks very much, that's I wanted1

谢谢
__________________
sig too big , limits 500x100 & 20 kbs

I am Jedimaster
Jedimaster is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 21:32.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5