N64 QOI Demo
A N64 homebrew app that opens QOI images from ROM
Loading...
Searching...
No Matches
main.c File Reference

This file is the entry point of the N64 QOI Viewer ROM. More...

#include <stdio.h>
#include <string.h>
#include <libdragon.h>
#include "config.h"
#include "qoi_viewer.h"

Go to the source code of this file.

Data Structures

struct  name_node_pool_t
 A container for holding a bunch of names. More...

Macros

#define POOL_IMG_SIZE   15
 How many names can fit in a block.
#define MAX_STRING_SIZE   MAX_FILENAME_LEN + 1
 Maximum length of a string. File names are limited by libdragon to 243 characters.

Typedefs

typedef struct name_node_pool_t name_node_pool_t
 A container for holding a bunch of names.

Functions

joypad_inputs_t joypad_poll_port (joypad_port_t port)
 Poll controller and get input from a specific port.
void readNames (name_node_pool_t *start_node)
 Reads the names of QOI images from ROM.
void start_viewer ()
 This function starts QOI viewer to display first QOI image decoded.
void printFirstDecodedValues (qoi_img_info_t *info)
 Prints the first values of the pixel decoded by the QOI Decoder.
int main (void)
 This function is the entry point for QOI Viewer.

Variables

uint8_t buffer0 [IMG_BUFFER_SIZE]
 Raw image buffer that decoded from qoi image file.
uint8_t buffer1 [IMG_BUFFER_SIZE]
 second raw image buffer that decoded from qoi image file

Detailed Description

This file is the entry point of the N64 QOI Viewer ROM.

Definition in file main.c.

Macro Definition Documentation

◆ MAX_STRING_SIZE

#define MAX_STRING_SIZE   MAX_FILENAME_LEN + 1

Maximum length of a string. File names are limited by libdragon to 243 characters.

Definition at line 51 of file main.c.

◆ POOL_IMG_SIZE

#define POOL_IMG_SIZE   15

How many names can fit in a block.

Definition at line 48 of file main.c.

Typedef Documentation

◆ name_node_pool_t

typedef struct name_node_pool_t name_node_pool_t

A container for holding a bunch of names.

Definition at line 68 of file main.c.

Function Documentation

◆ joypad_poll_port()

joypad_inputs_t joypad_poll_port ( joypad_port_t port)
inline

Poll controller and get input from a specific port.

Parameters
portport controller from the n64
Returns
input to a specified port

Definition at line 62 of file main.c.

◆ main()

int main ( void )

This function is the entry point for QOI Viewer.

Definition at line 180 of file main.c.

◆ printFirstDecodedValues()

void printFirstDecodedValues ( qoi_img_info_t * info)

Prints the first values of the pixel decoded by the QOI Decoder.

Parameters
infoQOI Image Metadata

Definition at line 156 of file main.c.

◆ readNames()

void readNames ( name_node_pool_t * start_node)

Reads the names of QOI images from ROM.

Parameters
start_nodeThe initial node

Definition at line 88 of file main.c.

◆ start_viewer()

void start_viewer ( )

This function starts QOI viewer to display first QOI image decoded.

Definition at line 138 of file main.c.

Variable Documentation

◆ buffer0

uint8_t buffer0[IMG_BUFFER_SIZE]

Raw image buffer that decoded from qoi image file.

Definition at line 54 of file main.c.

◆ buffer1

uint8_t buffer1[IMG_BUFFER_SIZE]

second raw image buffer that decoded from qoi image file

Definition at line 57 of file main.c.