API Reference

This page provides a structured overview of the ratr0-engine API.

Core Lifecycle

These functions manage the global state of the engine.

Ratr0Engine *ratr0_engine_startup(struct Ratr0MemoryConfig *memory_config, int argc, char **argv)

Startup the engine and all its subsystems.

Parameters:
  • memory_config – memory configuration

  • argc – number of command line arguments

  • argv – command line arguments

Returns:

pointer to the initialized engine system

Memory Management

The memory subsystem handles internal pools and chip memory allocations.

struct Ratr0MemoryConfig

Pre-allocate memory at the start of the game. This ensures we never explicitly allocate or deallocate memory outside of the engine.

Public Members

UINT32 general_pool_size

pool size in bytes

UINT32 general_table_size

num entries in table

UINT32 chip_pool_size

pool size in bytes

UINT32 chip_table_size

num entries in table

Data Structures

struct Ratr0Surface

Information about the current display in this object. We can use this for both playfield hardware setup and blitter setup. In the future we can use this for backbuffer and/or dual playfield information.

Public Members

UINT16 width

surface width

UINT16 height

surface height

UINT16 depth

surface bitplane number

BOOL is_interleaved

TRUE if the data is interleaved.

void *buffer

image data

Graphics & Display

(Add your other functions here as you develop them)

void ratr0_display_init_buffers(UINT16 vp_width, UINT16 vp_height, UINT16 num_playfields, struct Ratr0PlayfieldInfo pf_infos[])

Initializes the display using the information in the init struct. If the information is not equal to the existing one, the current display buffer will be discarded and a new one will be built. This will build a bunch of playfield buffer structures in a batch. num_playfields can be a value from 1 to n

Parameters:
  • vp_width – viewport width

  • vp_height – viewport height

  • num_playfields – size of the pf_infos array (1..)

  • pf_infos – array of playfield information


Search Index

Looking for a specific symbol?