N64 QOI Encoder Demo 1.0.1
Encoder for N64 that saves it to SD card
Loading...
Searching...
No Matches
qoi_enc.c File Reference

Main file for N64 QOI Encoder ROM. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "qoi_enc_n64.h"

Go to the source code of this file.

Macros

#define ENC_BUFFER_SIZE   16384
 Buffer size for the encoder to limit RAM usage.

Enumerations

enum  QOI_ENC_ARGS {
  ENC_NAME , ENC_INPUT_FILENAME , ENC_WIDTH , ENC_HEIGHT ,
  ENC_BITDEPTH , ENC_OUTPUT_FILENAME
}
 Enumeration for command-line argument indices. More...

Functions

uint16_t read_be_u16 (uint16_t val)
 Reads a big-endian 16-bit unsigned integer from memory.
uint32_t read_be_u32 (uint32_t val)
 Reads a big-endian 32-bit unsigned integer from memory.
void print_version (void)
 Prints the version information of the encoder.
void print_help (void)
 Prints the help information for the encoder.
int main (int argc, char *argv[])
 Main function for the QOI encoder.

Variables

const char version_number [] = "version 1.2.n64.0"
 Version number of the encoder.
const char revised_date [] = "2026-04-16"
 Date of the last revision.

Detailed Description

Main file for N64 QOI Encoder ROM.

N64 framebuffer to QOI program.

Author
Aftersol
Version
1.0.1
Date
2026-05-09

qoi_n64_scr.c - N64 ROM for demonstrating taking screenshots to QOI file.

This file is the entry point of the N64 QOI Encoder ROM

Code licensed under MIT License

Copyright (c) 2026 Aftersol

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
Aftersol
Version
1.2.n64.0
Date
2026-04-16

qoi_enc.c – N64 framebuffer to QOI program

  • version 1.2.n64.0 – revised 2026-04-13

– Changelog –

  • version 1.1.n64.1 (2026-04-13)
    • Modified program to display version info
  • version 1.1.n64.0 (2026-04-13)
    • Modified program to use modified sQOI library
    • Supports RGBA5551 conversion to RGBA32 for conversion to QOI
    • Updated MIT License copyright year
  • version 1.1 (2025-04-07)
    • Implemented error handling in case reading RGBA file fails
    • Strictly check requested color channels and colorspace according to QOI specifications
  • version 1.0 (2025-01-13)
    • Initial release

Code licensed under MIT License

Copyright (c) 2024-2026 Aftersol

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file qoi_enc.c.

Macro Definition Documentation

◆ ENC_BUFFER_SIZE

#define ENC_BUFFER_SIZE   16384

Buffer size for the encoder to limit RAM usage.

Definition at line 95 of file qoi_enc.c.

Enumeration Type Documentation

◆ QOI_ENC_ARGS

Enumeration for command-line argument indices.

Enumerator
ENC_NAME 

The name of the encoder program, typically "qoi_enc".

ENC_INPUT_FILENAME 

The input filename.

ENC_WIDTH 

The width of the image.

ENC_HEIGHT 

The height of the image.

ENC_BITDEPTH 

The bit depth of the image.

ENC_OUTPUT_FILENAME 

The output filename.

Definition at line 65 of file qoi_enc.c.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Main function for the QOI encoder.

Parameters
argcNumber of command-line arguments.
argvArray of command-line arguments.
Returns
Exit status.

Definition at line 152 of file qoi_enc.c.

◆ print_help()

void print_help ( void )

Prints the help information for the encoder.

Definition at line 140 of file qoi_enc.c.

◆ print_version()

void print_version ( void )

Prints the version information of the encoder.

Definition at line 132 of file qoi_enc.c.

◆ read_be_u16()

uint16_t read_be_u16 ( uint16_t val)

Reads a big-endian 16-bit unsigned integer from memory.

Parameters
valThe value to read.
Returns
The big-endian value.

Definition at line 102 of file qoi_enc.c.

◆ read_be_u32()

uint32_t read_be_u32 ( uint32_t val)

Reads a big-endian 32-bit unsigned integer from memory.

Parameters
valThe value to read.
Returns
The big-endian value.

Definition at line 113 of file qoi_enc.c.

Variable Documentation

◆ revised_date

const char revised_date[] = "2026-04-16"

Date of the last revision.

Definition at line 127 of file qoi_enc.c.

◆ version_number

const char version_number[] = "version 1.2.n64.0"

Version number of the encoder.

Definition at line 122 of file qoi_enc.c.