Join us on Discord!
You can help CodeWalrus stay online by donating here.
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - jacobly

#1
dst += (320 - b->width)/2; would be correct if the copy were modifying dst, but since it isn't, it should be dst += 320/2; to go to the next line of the framebuffer.

Edit: The fact that x and y are never used indicates there is something missing in the logic.  I would just do:

void CopySprite(BITMAP* b, u32* dst, short x, short y)
{
    u16* from = (u16*)b->data;
    u16* to = (u16*)dst + x + y * 320;
    int j;
    for(j = 0; j < b->height; j++)
    {
        memcpy(to, from, b->width*2);
        to += 320;
        from += b->width;
    }
}
#2
Not in the near future as calc84 hasn't even finished GB emulation and GBA would be significantly harder.
#3
Just use the formula final_velocity2 = initial_velocity2 + 2*acceleration*(final_position - initial_position), so you have initial_velocity = sqrt(final_velocity2 - 2*acceleration*(final_position - initial_position)), or in your case, final_velocity = 0, so initial_velocity = sqrt(2*gravity*jump_height).
#4
That probably means that the request failed.  Try changing "load" to "error" and responseText to statusText which should give you an idea what is going wrong.
#5
Something like:
Code (JavaScript) Select
function technology()
{
    personTwoSays.value = "";
    submitButtonThree.style.display = "none";

    var submitButtonFour = document.createElement("button");

    submitButtonFour.innerHTML = "Submit";
    personTwoTalk.appendChild(submitButtonFour);
    personTwoSays.setAttribute("placeholder", "Type reply...");

//Get the latest technology news from the internet
function fetchLatestNews()
{
    var request = new XMLHttpRequest();
    request.addEventListener("load", handleResponse);
    request.open("GET", "php/news.php");
    request.send();
}

function handleResponse() {
    personOneTalk.innerHTML = "Sure! Have you heard of " + this.responseText;
}

    fetchLatestNews();
};


Edit: In response to your edit, you can't really return the result of an asynchronous request in javascript.
#6
It says undefined because fetchLatestNews() doesn't return anything and functions that don't return anything return undefined.  You probably want to add an event listener for the load event to request so you can display the result of the request.
#7
Media Talk / Re: Funny (and awesome) picture thread
October 08, 2015, 12:30:34 PM
I was testing on some drawing related math routines and I must have a bug somewhere because this was not the intended output.

Powered by EzPortal