DragonMinded / libdragon

Open source library for N64 development.
https://libdragon.dev
The Unlicense
748 stars 108 forks source link

Hello world #501

Closed Wheest closed 8 months ago

Wheest commented 9 months ago

Hi there, new user here, this seems like a great library for my needs.

I've make an initial project with libdragon init, and build it into hello.z64. There is some initial hello world code:

#include <stdio.h>

#include <libdragon.h>

int main(void)
{
    console_init();

    debug_init_usblog();
    console_set_debug(true);

    printf("Hello world!\n");

    while(1) {}
}

However, launching it in simple64 doesn't print hello world anywhere (e.g., the logs, or the emulator screen). I've been reading a bit about the debug library, and thus also tried printing to stderr with fprintf(stderr, "Hello world!\n");, but I also don't get anything logged.

Am I doing something wrong, or does simple64 not support your debug logging? I've also tried ares and couldn't see any console output. I have checked the cartridge ROM and it does encode the string.

rasky commented 9 months ago

You need to use debug_init_isviewer() as well for emulators to show the debug logging.