I have two random variables, $X$ and $Y$, with joint density function

$$f(x,y) = \begin{cases}1, \hspace{2mm}\mathrm{for}\hspace{1mm}0 \leq x \leq 1 \hspace{1mm}\mathrm{and}\hspace{1mm}\max(0,x-1) \leq y \leq \min(1,x) \\ 0, \hspace{2mm}\mathrm{elsewhere} \end{cases} $$

I want to find the joint distribution function.

Someone helped me solve this using the support set of $X$ and $Y$, and it worked. But, that was only possible because $f(x,y)$ is homogeneous. I would like to know how to generally solve this type of question. And I am totally lost, without a teacher, so at the moment I feel a bit frustrated.

So to start, I'm focusing on the case where i want $\mathrm{Pr}(X \leq x_0, Y \leq y_0)$ for $0 < x_0 < 1$ and $x_0 < y_0$. I know that the answer should be $$F(x,y) = \frac{x^2}{2}.$$ I am lost on how to set it up. I would like to do it like such:

$$\int_x^y \int_0^x f(u,v) \hspace{1mm} dudv,$$

but that gives me the answer $xy - x^2$, which is clearly wrong.