What's new

Gekko Video Plugin Update 2

ShizZy

Emulator Developer
Some progress since I started the new video plugin for Gekko, about a month ago. As of right now, it's dubbed a "wireframe plugin" - however it's just as capable of rendering faces (I just choose to debug in wireframe mode). No textures are implemented yet, and I have not concentrated to much on vertex colors, although some formats are indeed implemented.

It is very functional, however something is not right causing mostly all commercial games to crash. Havn't quite figured it out yet, but I know it's because of bugs in parsing the fifo.

-ShizZy
 

dolqube

Winphin Developer
He is running a program you get with the official sdk from nintendo.

Its a test gcm for the cube.
It has several rooms to test the capabilitys of the gamecube.

EDIT: go to gcubes homepage and you will see a screen of it there.

Nice work shizzy (wish i was good at gfx emulation) (time todo research on it)
 
Last edited:

dolqube

Winphin Developer
What exactly is wrong with the fifo emulation.
Try removing it. then it will show that it is that is crashing the gcms.
Then put it back piece by piece.

floating point exceptions also mess up graphics (i learned that the hard way)

In the last few weeks i have discovered that dsp does a lot more than just unlocking memory cards and sound. Recheck your code for that.

Good Luck... (hope i was any bit helpful at all)
 

dolqube

Winphin Developer
monk posted a reply for both of us at emuboards.

EDIT: he seems like a really nice guy.

sorry about three posts in a row.
 
OP
ShizZy

ShizZy

Emulator Developer
Well, it's not an emu related crash, it's on the plugin side.
 

dolqube

Winphin Developer
tell me every thing that you have emulated in the plugin and we will go through how you emulated each function and ill see if i can spot the bug.
 

emwearz

New member
tell me every thing that you have emulated in the plugin and we will go through how you emulated each function and ill see if i can spot the bug.

haha, with that comment I lost all faith in your 'emulator'

Thats like going to KFC, hey tell me the secret and I will tell you what needs to be added haha.
 

dolqube

Winphin Developer
@emwearz:what are you talking about lost faith. I really dont care what anyone thinks

@shizzy: debug the fifo commands in the plugin and tell me the last few commands before it crashes.
 
Last edited:

dolqube

Winphin Developer
@emwearz: I never asked him for source code all I asked was how much of the fifo was emulated. I need to know how the function that crashes is emulated in order to crush the bug.
 

emwearz

New member
dolqube, theres a edit button for a reason, you dont have to constantly multi post.
 
Last edited:

dolqube

Winphin Developer
sorry its a bad habbit i know (but i have got good intentions)

@zaba_3 : thanks for telling him exactly what he knows

EDIT: see Im using it now.

I just sent monk an email with an explanation of my cpu emulator.

Ill post it here as well

Its to long to post it in an edit
 
Last edited:

dolqube

Winphin Developer
here is an explanation of my cpu recompiler
its very buggy right now but i learned a lot from it


TAKE YOUR TIME READING IT ITS PREYY COMPLICATED!!!

this will be very complicated to understand (I normally dont teach)
but the pros will understand
(remember this is only an explanation I wrote in five minutes so it could have lots of mistakes)




I based my cpu from gcemu's.
(guess it will be open source then)


/-----------------------------------------------
this is how gcemu interpereted (add)
/-----------------------------------------------

unsigned int * pra;
unsigned int * prb;
unsigned int * prd;

void ppc_int_add()
{
unsigned int rD, rA, rB;

rD = ((opcode)>>21)&0x1f;
rA = ((opcode)>>16)&0x1f;
rB = ((opcode)>>11)&0x1f;


prd = &gpr[rD];
pra = &gpr[rA];
prb = &gpr[rB];
_asm
{
mov edx, dword ptr pra
mov eax, [edx]
mov edx, dword ptr prb
add eax, [edx]
mov edx, dword ptr prd
mov [edx], eax
};

}
/------------------------------------------------

that was just for sme background info on how emulators interperate the opcode

the structure is (add rD,rA,rB)




/------------------------------------------------
LEVEL 1 RECOMPILER

well now lets say that we generated this in asm.

add 1,2,3

that would be (this is just an explanation its not accurate)

mov eax, gpr2 //move gpr2 into eax
mov ebx, gpr3 //move gpr3 into ebx
add eax, ebx //add ebx to eax
mov gpr1,eax //move eax into gpr1
/------------------------------------------------



/-------------------------------------------------
LEVEL 2 RECOMPILER

well now lets say that we generated this in asm.

add 1,2,3
add 3,2,1

that would be (this is just an explanation its not accurate)

mov eax, gpr2 //move gpr2 into eax
mov ebx, gpr3 //move gpr3 into ebx
add eax, ebx //add ebx to eax
mov gpr1,eax //move eax into gpr1

add eax,ebx //add gpr1 to gpr2
mov gpr3,eax //and move into gpr3

/-------------------------------------------------

whereas a level 1 recompiler would generate

mov eax, gpr2 //move gpr2 into eax
mov ebx, gpr3 //move gpr3 into ebx
add eax, ebx //add ebx to eax
mov gpr1,eax //move eax into gpr1

mov eax, gpr2 //move gpr2 into eax
mov ebx, gpr1 //move gpr1 into ebx
add eax, ebx //add ebx to eax
mov gpr3,eax //move eax into gpr3

/-------------------------------------------------

it saves a lot of cycles for other stuff like gfx and audio emulation.






HERE IS THE BIG ONE LEVEL 3 as I call it.


well now lets say that we generated this in asm.

add 1,2,3
add 3,2,1
add 1,2,3
add 3,2,1
add 1,2,3
add 3,2,1
add 1,2,3
add 3,2,1
add 1,2,3
add 3,2,1


now if you notice that you add rA and rB together. You add which one you want to the other. eg. rA + rB, or rB + rA

the level three recompiler has a bit of ai because it recognizes patterns. for example above gpr2 is used in all opcodes

lets say we generate

mov eax, gpr2 //move gpr2 into eax
mov ebx, gpr3 //move gpr3 into ebx
add eax, ebx //add ebx to eax
mov gpr1,eax //move eax into gpr1

gpr2 is in eax. (eax has the fastest add transfers.)

this is not good because we write over eax (gpr2) for every opcode emulated.
so level three scans the opcode block to see what register would be best place to put the registers.

in this case it would be (as you can see below there are other factors taken into acoount in the algorithem.)


mov eax, gpr3 //move gpr3 into eax
mov ebx, gpr2 //move gpr2 into ebx

add eax, ebx //add ebx to eax (now eax contains gpr1 not gpr3)
add eax, ebx //add ebx to eax (now eax contains gpr3 not gpr1)
add eax, ebx //add ebx to eax (now eax contains gpr1 not gpr3)
add eax, ebx //add ebx to eax (now eax contains gpr3 not gpr1)
add eax, ebx //add ebx to eax (now eax contains gpr1 not gpr3)
add eax, ebx //add ebx to eax (now eax contains gpr3 not gpr1)
add eax, ebx //add ebx to eax (now eax contains gpr1 not gpr3)
add eax, ebx //add ebx to eax (now eax contains gpr3 not gpr1)
add eax, ebx //add ebx to eax (now eax contains gpr1 not gpr3)

mov gpr1,eax //move eax into gpr1

add eax, ebx //add ebx to eax (now eax contains gpr3 not gpr1)

mov gpr3,eax //move eax into gpr3


/--------------------------------------------------------------------------------------------------

this takes 14 opcodes most of which are eax adds.
compare that with the 40 opcode it would take with level 1 and you see speed, lots of speed

EDIT: sorry this was suposto be a threat for shizzy (ill move it to a new thread if you want)
 
Last edited:

BlueFalcon7

New member
@Dolqube: you know that you can go to #Gekko on Efnet, Sometimes you will see me there. Thats assuming that I dont have an insane amount of work to do... Then again, you might be in a totally different timezone than me.
 

Sercio

New member
uhm i was on #gekko using mirc but noone was there.... and i tryed 10 x the day! Do im something wrong maybe?
 

Sercio

New member
i typed #gekko on the connect screen and a window opened... nothing else and noone other was in that "chatroom"

edit: ok now i find out how its work... meet you there ^^
 
Last edited:

Top