Skip to content

Commit

Permalink
fixed texture copy more
Browse files Browse the repository at this point in the history
  • Loading branch information
burhanr13 committed Jan 3, 2025
1 parent 9a86f02 commit 05243b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/pica/hostshaders/gpu.frag
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void calc_lighting(out vec4 primary, out vec4 secondary) {
} else {
l = normalize(quatrot(nq, view + light[i].vec.xyz));
}
vec3 h = normalize((l + v) / 2);
vec3 h = normalize(l + v);

// right now we just use phong shading
// TODO: implement this properly
Expand Down
9 changes: 6 additions & 3 deletions src/services/gsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,20 @@ void gsp_handle_command(E3DS* s) {
addrin, pitchin, gapin, addrout, pitchout, gapout, copysize,
flags);

// texture copy can be used to copy between framebuffers and this wont work right now

u8* src = PTR(addrin);
u8* dst = PTR(addrout);

int cnt = 0;
int curline = 0;
while (cnt < copysize) {
memcpy(dst, src, pitchin);
cnt += pitchin;
curline += pitchin;
src += pitchin + gapin;
dst += pitchout + gapout;
if (curline >= pitchout) {
dst += pitchout + gapout;
curline = 0;
}
}

gsp_handle_event(s, GSPEVENT_PPF);
Expand Down

0 comments on commit 05243b8

Please sign in to comment.