PCSX2 Linux Development
#51
(03-13-2014, 07:45 PM)gregory Wrote: Yes and no. Yes because it would allow to use to get some trick. No because I need to code it, and I seriouly need a debugger. Yes they also release one but it is limited to gl3.3. Anyway the real limitation of GSdx ogl is my free time (or additional people to work it, everybody want an Android port but nobody to help on opengl...) Wink I know a couple of trick that could improve performance (GL_buffer_storage, GL_shader_subroutine, fix threading issue for example).

I wish I could help you code the linux version. all i know is c++ and logic gates which gives me understanding of binary. Can anyone help me understand how emulating works and where exactly do I start?
Specifications:

AMD Sempron 3850 @ 1.3GHz
Zotac Geforce GT 640 2GB
4GB RAM
Kubuntu Linux 14.10 STS
Reply

Sponsored links

#52
why do you mean by logic gates. You mean verilog/vhdl stuff?

Edit: see this thread
http://forums.pcsx2.net/Thread-Areas-of-...pid=354969

Maybe you can look at item 12a
Reply
#53
(03-17-2014, 11:03 PM)gregory Wrote: why do you mean by logic gates. You mean verilog/vhdl stuff?

Edit: see this thread
http://forums.pcsx2.net/Thread-Areas-of-...pid=354969

Maybe you can look at item 12a

logic gates as in AND, OR , and XOR
Specifications:

AMD Sempron 3850 @ 1.3GHz
Zotac Geforce GT 640 2GB
4GB RAM
Kubuntu Linux 14.10 STS
Reply
#54
Well I work on the hardware industry so I know what is a gate Tongue2 I just wanted to know what you know if you work on this field too, or if you only know the operator.
Reply
#55
(03-18-2014, 12:03 AM)gregory Wrote: Well I work on the hardware industry so I know what is a gate Tongue2 I just wanted to know what you know if you work on this field too, or if you only know the operator.

but still are there any guides or stuff like that to teach me how emulating works and guides that can help me code in pcsx2
Specifications:

AMD Sempron 3850 @ 1.3GHz
Zotac Geforce GT 640 2GB
4GB RAM
Kubuntu Linux 14.10 STS
Reply
#56
I don't have any generic doc. But I will try to explain. Hardware is like sw. It take some parameters as input (for example a pressed button). Then it compute a new value. Hardware is fasr and expensive. Sw is slow and cheap.

In the emulator we will emulate several components. For example the ps2 cpu will execute an instruction every cycle. For the addition, we get the 2 operands and then we do a '+'. Easy. Hardware can handle severals corner case as overflow. So we must add an additional test to check the overflow case. And so on.

On the gs side. It is the same processus. We get the ps2 vertex/texture, we transform into standard pc vertex/texture. Then we ask the gpu to do its jobs. Nothing more!
Reply
#57
(03-18-2014, 12:46 AM)gregory Wrote: I don't have any generic doc. But I will try to explain. Hardware is like sw. It take some parameters as input (for example a pressed button). Then it compute a new value. Hardware is fasr and expensive. Sw is slow and cheap.

In the emulator we will emulate several components. For example the ps2 cpu will execute an instruction every cycle. For the addition, we get the 2 operands and then we do a '+'. Easy. Hardware can handle severals corner case as overflow. So we must add an additional test to check the overflow case. And so on.

On the gs side. It is the same processus. We get the ps2 vertex/texture, we transform into standard pc vertex/texture. Then we ask the gpu to do its jobs. Nothing more!

sounds real easy when you explain, but real hard when you attempt to do that

edit: also for the past two hours, i found this site named nesdocs.com, and it's helping me understand how hardware works.
Specifications:

AMD Sempron 3850 @ 1.3GHz
Zotac Geforce GT 640 2GB
4GB RAM
Kubuntu Linux 14.10 STS
Reply
#58
In theory it is not complicated. The complex parts are the speed opmization, the size of the system and the timing. To explain a bit the timing. You have several blocks that do operations in //. Sometimes they need to communicate so you need guarantee that the computing is done in good order. Note that you don't want to emulate timing (aka cycle accurate) because it is very hard and very slow.

To understand emulation looking at emulation of basic system could help. For PCSX2 the best is to limit to a single feature and become familiar with the code step by step. I have worked for 3-4 years in this project and I barely know 10% of the code!
Reply
#59
I've been reading some of the developer blogs, which helped me to understand how the code works. Originally I though that there are multiple instances of GSThread created that all work concurrently.

But I read Air's post about how PCSX2 is primarily just a dual thread application. There is one thread that handles the PS2's Emotion Engine and input and output, and another thread that handles the Graphics Synthesizer (GSThread).
"I know now why you cry... but it is something I can never do."
-Emotion Engine
Reply
#60
No => gdb: info thread. That the PCSX2 thread but plugins are allow to spawn any new threads. For the GS thread, don't forget to enable extra thread in the configuration (took me 5 minutes to find it Tongue2 )

Quote:(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0xe91fadf0 in GSThread::GSThread() at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GSThread.cpp:71
(gdb) c
Continuing.
[New Thread 0xea326b40 (LWP 8225)]
[New Thread 0xe72bdb40 (LWP 8228)]
[Switching to Thread 0xe72bdb40 (LWP 8228)]

Breakpoint 1, GSThread::GSThread (this=0xe7d005f8) at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GSThread.cpp:71
71 GSThread::GSThread()
(gdb) bt
#0 GSThread::GSThread (this=0xe7d005f8) at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GSThread.cpp:71
#1 0xe91c6b5a in GSJobQueue (this=0xe7d005f8) at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GSThread.h:290
#2 GSRasterizerList::GSWorker::GSWorker (this=0xe7d005f8, r=0xe7d389e0) at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GSRasterizer.cpp:1215
#3 0xe91d4d3e in Create (perfmon=0xe7d071a4, threads=5) at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GSRasterizer.h:221
#4 GSRendererSW::GSRendererSW (this=0xe7d01e40, threads=5) at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GSRendererSW.cpp:44
#5 0xe9172d7e in _GSopen (dsp=dsp@entry=0x9dd65a0 , title=title@entry=0x0, renderer=13, threads=5) at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GS.cpp:272
#6 0xe9172ee3 in GSopen2 (dsp=0x9dd65a0 , flags=1) at /home/gregory/project/ps2_kernel/emulator/plugins/GSdx/GS.cpp:446
#7 0x080af759 in SysMtgsThread:OhmypenPlugin (this=0x9ec9950 ) at /home/gregory/project/ps2_kernel/emulator/pcsx2/MTGS.cpp:191
#8 0x080affdd in SysMtgsThread:OhmynResumeInThread (this=0x9ec9950 , isSuspended=true) at /home/gregory/project/ps2_kernel/emulator/pcsx2/MTGS.cpp:570
#9 0x08276e5a in SysThreadBase:WackotateCheckInThread (this=0x9ec9950 ) at /home/gregory/project/ps2_kernel/emulator/pcsx2/System/SysThreadBase.cpp:315
#10 0x080af96b in SysMtgsThread::ExecuteTaskInThread (this=0x9ec9950 ) at /home/gregory/project/ps2_kernel/emulator/pcsx2/MTGS.cpp:288
#11 0x08353788 in Threading:Tongue2xThread::_try_virtual_invoke (this=0x9ec9950 , method=&virtual Threading:Tongue2xThread::ExecuteTaskInThread()) at /home/gregory/project/ps2_kernel/emulator/common/src/Utilities/ThreadTools.cpp:545
#12 0x08353b6b in Threading:Tongue2xThread::_internal_execute (this=0x9ec9950 ) at /home/gregory/project/ps2_kernel/emulator/common/src/Utilities/ThreadTools.cpp:644
#13 0x08353cfa in Threading:Tongue2xThread::_internal_callback (itsme=0x9ec9950 ) at /home/gregory/project/ps2_kernel/emulator/common/src/Utilities/ThreadTools.cpp:684
#14 0xf6e53d65 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#15 0xf6db0a0e in clone () from /lib/i386-linux-gnu/libc.so.6
Reply




Users browsing this thread: 1 Guest(s)