Neocore
Loading...
Searching...
No Matches
neocore.h File Reference
#include <DATlib.h>
#include <math.h>

Go to the source code of this file.

Data Structures

struct  Position
 2D position coordinates More...
 
struct  Box
 Collision detection bounding box. More...
 
struct  GFX_Animated_Sprite
 Animated sprite graphics object. More...
 
struct  GFX_Picture
 
struct  GFX_Animated_Sprite_Physic
 
struct  GFX_Picture_Physic
 
struct  GFX_Scroller
 
struct  Adpcm_player
 
struct  RGB16
 Neo Geo RGB color representation with darkness level. More...
 

Macros

#define SHRUNK_TABLE_PROP_SIZE   0x2fe
 
#define MANUALBOX   0
 
#define AUTOBOX   1
 
#define DISPLAY_GFX_WITH_SPRITE_ID_AUTO   0xFFFF
 
#define SPRITE_INDEX_NOT_FOUND   0xFFFF
 
#define nc_shrunk_extract_x(value)   value >> 8
 
#define nc_shrunk_extract_y(value)   (BYTE)value
 
#define nc_wait_vbl()   waitVBlank();
 Wait for vertical blank interrupt. More...
 
#define nc_rgb16_to_packed_color16(color)    ((((color.dark) & 0xF) << 12) | (((color.r) & 0xF) << 8) | (((color.g) & 0xF) << 4) | ((color.b) & 0xF))
 Convert RGB16 color structure to packed 16-bit color. More...
 
#define nc_set_palette_by_packed_color16(palette_number, palette_index, color)
 Set palette entry using packed 16-bit color. More...
 
#define nc_set_palette_by_rgb16(palette_number, palette_index, color)
 Set palette entry using RGB16 color structure. More...
 
#define nc_get_palette_packed_color16(palette_number, palette_index)
 
#define nc_set_palette_backdrop_by_packed_color16(packed_color)
 
#define nc_set_palette_backdrop_by_rgb16(color)
 
#define nc_bitwise_division_2(value)   (value >> 1)
 Fast division by 2 using bit shifting. More...
 
#define nc_bitwise_division_4(value)   (value >> 2)
 Fast division by 4 using bit shifting. More...
 
#define nc_bitwise_division_8(value)   (value >> 3)
 Fast division by 8 using bit shifting. More...
 
#define nc_bitwise_division_16(value)   (value >> 4)
 
#define nc_bitwise_division_32(value)   (value >> 5)
 
#define nc_bitwise_division_64(value)   (value >> 6)
 
#define nc_bitwise_division_128(value)   (value >> 7)
 
#define nc_bitwise_division_256(value)   (value >> 8)
 
#define nc_bitwise_multiplication_2(value)   (value << 1)
 
#define nc_bitwise_multiplication_4(value)   (value << 2)
 
#define nc_bitwise_multiplication_8(value)   (value << 3)
 
#define nc_bitwise_multiplication_16(value)   (value << 4)
 
#define nc_bitwise_multiplication_32(value)   (value << 5)
 
#define nc_bitwise_multiplication_64(value)   (value << 6)
 
#define nc_bitwise_multiplication_128(value)   (value << 7)
 
#define nc_bitwise_multiplication_256(value)   (value << 8)
 
#define nc_random(range)   rand() % range
 Generate random number within specified range. More...
 
#define nc_min(a, b)   ((a) < (b) ? (a) : (b))
 Get minimum of two values. More...
 
#define nc_max(a, b)   ((a) > (b) ? (a) : (b))
 Get maximum of two values. More...
 
#define nc_abs(num)   ((num) < 0 ? ~(num) + 1 : (num))
 Get absolute value of a number. More...
 
#define nc_negative(num)   -num
 
#define nc_fix(num)   num * 65536
 
#define nc_fix_to_int(num)   fixtoi(num)
 
#define nc_int_to_fix(num)   itofix(num)
 
#define nc_fix_add(num1, num2)   fadd(num1, num2)
 
#define nc_fix_sub(num1, num2)   fsub(num1, num2)
 
#define nc_fix_mul(num1, num2)   fmul(num1, num2)
 
#define nc_cos(num)   fcos(num)
 
#define nc_tan(num)   ftan(num)
 
#define nc_copy_box(box_src, box_dest)   memcpy(box_dest, box_src, sizeof(Box))
 Copy one bounding box to another. More...
 
#define nc_stop_cdda()   nc_pause_cdda()
 
#define nc_get_frame_counter()   DAT_frameCounter
 

Typedefs

typedef struct Position Position
 
typedef struct Box Box
 
typedef struct GFX_Animated_Sprite GFX_Animated_Sprite
 
typedef struct GFX_Picture GFX_Picture
 
typedef struct GFX_Animated_Sprite_Physic GFX_Animated_Sprite_Physic
 
typedef struct GFX_Picture_Physic GFX_Picture_Physic
 
typedef struct GFX_Scroller GFX_Scroller
 
typedef struct Adpcm_player Adpcm_player
 
typedef struct RGB16 RGB16
 

Enumerations

enum  Direction {
  NONE , UP , DOWN , LEFT ,
  RIGHT
}
 
enum  Sound_state { IDLE , PLAYING }
 

Functions

void nc_update_mask (short x, short y, Position vec[], Position offset[], BYTE vector_max)
 
void nc_init_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite, const spriteInfo *spriteInfo, const paletteInfo *paletteInfo)
 Initialize an animated sprite graphics object. More...
 
void nc_init_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, const spriteInfo *spriteInfo, const paletteInfo *paletteInfo, short box_witdh, short box_height, short box_width_offset, short box_height_offset)
 
void nc_init_gfx_picture (GFX_Picture *gfx_picture, const pictureInfo *pictureInfo, const paletteInfo *paletteInfo)
 Initialize a picture graphics object. More...
 
void nc_init_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic, const pictureInfo *pi, const paletteInfo *pali, short box_witdh, short box_height, short box_width_offset, short box_height_offset, BOOL autobox_enabled)
 
void nc_init_gfx_scroller (GFX_Scroller *gfx_scroller, const scrollerInfo *scrollerInfo, const paletteInfo *paletteInfo)
 
void nc_display_gfx_with_sprite_id (WORD sprite_id)
 
WORD nc_display_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite, short x, short y, WORD anim)
 Display an animated sprite at specified position. More...
 
WORD nc_display_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, short x, short y, WORD anim)
 Display an animated sprite with physics at specified position. More...
 
WORD nc_display_gfx_picture (GFX_Picture *gfx_picture, short x, short y)
 Display a picture at specified position. More...
 
WORD nc_display_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic, short x, short y)
 Display a picture with physics at specified position. More...
 
WORD nc_display_gfx_scroller (GFX_Scroller *gfx_scroller, short x, short y)
 Display a scroller at specified position. More...
 
WORD nc_init_display_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite, const spriteInfo *spriteInfo, const paletteInfo *paletteInfo, short x, short y, WORD anim)
 Initialize and display an animated sprite at specified position. More...
 
WORD nc_init_display_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, const spriteInfo *spriteInfo, const paletteInfo *paletteInfo, short x, short y, short box_witdh, short box_height, short box_width_offset, short box_height_offset, WORD anim)
 Initialize and display an animated sprite with physics at specified position. More...
 
WORD nc_init_display_gfx_picture (GFX_Picture *gfx_picture, const pictureInfo *pictureInfo, const paletteInfo *paletteInfo, short x, short y)
 Initialize and display a picture at specified position. More...
 
WORD nc_init_display_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic, const pictureInfo *pictureInfo, const paletteInfo *paletteInfo, short x, short y, short box_witdh, short box_height, short box_width_offset, short box_height_offset, BOOL autobox_enabled)
 Initialize and display a picture with physics at specified position. More...
 
WORD nc_init_display_gfx_scroller (GFX_Scroller *gfx_scroller, const scrollerInfo *scrollerInfo, const paletteInfo *paletteInfo, short x, short y)
 Initialize and display a scroller at specified position. More...
 
void nc_hide_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite)
 
void nc_hide_gfx_picture (GFX_Picture *gfx_picture)
 
void nc_hide_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic)
 
void nc_hide_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic)
 
void nc_show_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite)
 
void nc_show_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic)
 
void nc_show_gfx_picture (GFX_Picture *gfx_picture)
 
void nc_show_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic)
 
void nc_get_position_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite, Position *position)
 
void nc_get_position_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, Position *position)
 
void nc_get_position_gfx_picture (GFX_Picture *gfx_picture, Position *position)
 
void nc_get_position_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic, Position *position)
 
void nc_get_position_gfx_scroller (GFX_Scroller *gfx_scroller, Position *position)
 
void nc_set_position_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic, short x, short y)
 
void nc_set_position_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, short x, short y)
 
void nc_set_position_gfx_scroller (GFX_Scroller *gfx_scroller, short x, short y)
 
void nc_set_position_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite, short x, short y)
 
void nc_set_position_gfx_picture (GFX_Picture *gfx_picture, short x, short y)
 
void nc_move_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic, short x_offset, short y_offset)
 
void nc_move_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, short x_offset, short y_offset)
 
void nc_move_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite, short x_offset, short y_offset)
 
void nc_move_gfx_picture (GFX_Picture *gfx_picture, short x, short y)
 
void nc_move_gfx_scroller (GFX_Scroller *gfx_scroller, short x, short y)
 
void nc_shrunk_centroid_gfx_picture (GFX_Picture *gfx_picture, short center_x, short center_y, WORD shrunk_value)
 
void nc_set_animation_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite, WORD anim)
 
void nc_set_animation_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic, WORD anim)
 
void nc_update_animation_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite)
 
void nc_update_animation_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic)
 
void nc_destroy_gfx_scroller (GFX_Scroller *gfx_scroller)
 
void nc_destroy_gfx_picture (GFX_Picture *gfx_picture)
 
void nc_destroy_gfx_animated_sprite (GFX_Animated_Sprite *gfx_animated_sprite)
 
void nc_destroy_gfx_picture_physic (GFX_Picture_Physic *gfx_picture_physic)
 
void nc_destroy_gfx_animated_sprite_physic (GFX_Animated_Sprite_Physic *gfx_animated_sprite_physic)
 
void nc_init_gpu ()
 
void nc_clear_display ()
 
void nc_update ()
 
DWORD nc_wait_vbl_max (WORD nb)
 
void nc_clear_sprite_index_table ()
 
WORD nc_get_max_free_sprite_index ()
 
WORD nc_get_max_sprite_index_used ()
 
void nc_destroy_palette (const paletteInfo *paletteInfo)
 
void nc_clear_palette_index_table ()
 
WORD nc_get_free_sprite_index ()
 
WORD nc_get_max_free_palette_index ()
 
WORD nc_get_max_palette_index_used ()
 
void nc_read_palette_rgb16 (BYTE palette_number, BYTE palette_index, RGB16 *rgb_color)
 
void nc_packet_color16_to_rgb16 (WORD packed_color, RGB16 *rgb_color)
 
WORD nc_get_shrunk_proportional_table (WORD index)
 
int nc_shrunk_centroid_get_translated_x (short centerPosX, WORD tileWidth, BYTE shrunkX)
 
int nc_shrunk_centroid_get_translated_y (short centerPosY, WORD tileHeight, BYTE shrunkY)
 
void nc_shrunk (WORD base_sprite, WORD max_width, WORD value)
 
WORD nc_shrunk_forge (BYTE xc, BYTE yc)
 
void nc_shrunk_addr (WORD addr, WORD shrunk_value)
 
WORD nc_shrunk_range (WORD addr_start, WORD addr_end, WORD shrunk_value)
 
void nc_byte_to_hex (BYTE value, char *hexchar)
 
void nc_word_to_hex (WORD value, char *hexchar)
 
char nc_sin (WORD index)
 
BYTE nc_collide_boxes (Box *box, Box *boxes[], BYTE box_max)
 Test collision between one box and an array of boxes. More...
 
BOOL nc_collide_box (Box *box1, Box *box2)
 Test collision between two bounding boxes. More...
 
void nc_init_box (Box *box, short width, short height, short widthOffset, short heightOffset)
 Initialize a bounding box with dimensions and offsets. More...
 
void nc_update_box (Box *box, short x, short y)
 Update bounding box corner positions based on world coordinates. More...
 
void nc_shrunk_box (Box *box, Box *bOrigin, WORD shrunkValue)
 
void nc_resize_box (Box *Box, short edge)
 
void nc_play_cdda (BYTE track)
 
void nc_pause_cdda ()
 
void nc_resume_cdda ()
 
void nc_stop_adpcm ()
 
void nc_set_joypad_edge_mode (BOOL actived)
 
void nc_update_joypad (BYTE id)
 
void nc_joypad_update (BYTE id)
 
BOOL nc_joypad_is_up (BYTE id)
 
BOOL nc_joypad_is_down (BYTE id)
 
BOOL nc_joypad_is_left (BYTE id)
 
BOOL nc_joypad_is_right (BYTE id)
 
BOOL nc_joypad_is_start (BYTE id)
 
BOOL nc_joypad_is_a (BYTE id)
 
BOOL nc_joypad_is_b (BYTE id)
 
BOOL nc_joypad_is_c (BYTE id)
 
BOOL nc_joypad_is_d (BYTE id)
 
void nc_debug_joypad (BYTE id)
 
DWORD nc_frame_to_second (DWORD frame)
 
DWORD nc_second_to_frame (DWORD second)
 
void nc_init_system ()
 
void nc_reset ()
 
void nc_get_relative_position (Position *position, Box box, Position world_coord)
 
void nc_pause (BOOL(*exitFunc)())
 
void nc_sleep (DWORD frame)
 
BOOL nc_each_frame (DWORD frame)
 
void nc_print (int x, int y, char *label)
 
WORD nc_free_ram_info ()
 
void nc_init_log ()
 Initialize the logging system. More...
 
WORD nc_get_position_x_log ()
 Get current horizontal log cursor position. More...
 
WORD nc_get_position_y_log ()
 Get current vertical log cursor position. More...
 
void nc_set_position_log (WORD _x, WORD _y)
 Set log cursor position. More...
 
void nc_log_next_line ()
 Move log cursor to next line. More...
 
void nc_fix_set_bank (WORD bank)
 Set font bank for log text display. More...
 
void nc_fix_set_palette_id (WORD palette)
 Set palette ID for log text display. More...
 
WORD nc_palette_set_info (const paletteInfo *paletteInfo, WORD palette_index)
 Load palette data and return the palette index. More...
 
WORD nc_fix_load_palette_info (const paletteInfo *palette_info)
 Allocate and set palette for fix layer. More...
 
BOOL nc_fix_unload_palette_info (const paletteInfo *palette_info)
 Unload palette data by palette info for fix layer. More...
 
BOOL nc_fix_unload_palette_id (WORD palette_id)
 Unload palette data by palette ID for fix layer. More...
 
WORD nc_log_info (char *txt,...)
 Log formatted text without automatic line break. More...
 
WORD nc_log_info_line (char *txt,...)
 Log formatted text with automatic line break. More...
 
void nc_log_word (WORD value)
 
void nc_log_int (int value)
 
void nc_log_dword (DWORD value)
 
void nc_log_short (short value)
 
void nc_log_byte (BYTE value)
 
void nc_log_bool (BOOL value)
 
void nc_log_spriteInfo (spriteInfo *si)
 
void nc_log_box (Box *b)
 
void nc_log_pictureInfo (pictureInfo *pi)
 
void nc_log_palette_info (paletteInfo *paletteInfo)
 
void nc_log_packed_color16 (WORD packed_color)
 
void nc_log_rgb16 (RGB16 *color)
 
void nc_init_adpcm ()
 
void nc_update_adpcm_player ()
 
void nc_push_remaining_frame_adpcm_player (DWORD frame)
 
Adpcm_playernc_get_adpcm_player ()
 
BOOL nc_vectors_collide (Box *box, Position vec[], BYTE vector_max)
 
BOOL nc_vector_is_left (short x, short y, short v1x, short v1y, short v2x, short v2y)
 

Macro Definition Documentation

◆ AUTOBOX

#define AUTOBOX   1

Definition at line 18 of file neocore.h.

◆ DISPLAY_GFX_WITH_SPRITE_ID_AUTO

#define DISPLAY_GFX_WITH_SPRITE_ID_AUTO   0xFFFF

Definition at line 20 of file neocore.h.

◆ MANUALBOX

#define MANUALBOX   0

Definition at line 17 of file neocore.h.

◆ nc_abs

#define nc_abs (   num)    ((num) < 0 ? ~(num) + 1 : (num))

Get absolute value of a number.

Optimized implementation using bitwise operations for negative numbers

Parameters
numNumber to get absolute value of
Returns
Absolute value of num
Warning
May have side effects if num is a function call or expression with side effects
Note
Uses two's complement arithmetic for negative number handling
Since
1.0.0

Definition at line 759 of file neocore.h.

◆ nc_bitwise_division_128

#define nc_bitwise_division_128 (   value)    (value >> 7)

Definition at line 697 of file neocore.h.

◆ nc_bitwise_division_16

#define nc_bitwise_division_16 (   value)    (value >> 4)

Definition at line 694 of file neocore.h.

◆ nc_bitwise_division_2

#define nc_bitwise_division_2 (   value)    (value >> 1)

Fast division by 2 using bit shifting.

Divides value by 2 using right bit shift for optimal performance on 68k processor

Parameters
valueValue to divide (any integer type)
Returns
value / 2
Note
Equivalent to (value / 2) but faster on Neo Geo hardware
Warning
For signed values, behavior with negative numbers follows arithmetic right shift
Since
1.0.0

Definition at line 675 of file neocore.h.

◆ nc_bitwise_division_256

#define nc_bitwise_division_256 (   value)    (value >> 8)

Definition at line 698 of file neocore.h.

◆ nc_bitwise_division_32

#define nc_bitwise_division_32 (   value)    (value >> 5)

Definition at line 695 of file neocore.h.

◆ nc_bitwise_division_4

#define nc_bitwise_division_4 (   value)    (value >> 2)

Fast division by 4 using bit shifting.

Parameters
valueValue to divide
Returns
value / 4
Note
Optimized for Neo Geo 68k processor
Since
1.0.0

Definition at line 684 of file neocore.h.

◆ nc_bitwise_division_64

#define nc_bitwise_division_64 (   value)    (value >> 6)

Definition at line 696 of file neocore.h.

◆ nc_bitwise_division_8

#define nc_bitwise_division_8 (   value)    (value >> 3)

Fast division by 8 using bit shifting.

Parameters
valueValue to divide
Returns
value / 8
Note
Optimized for Neo Geo 68k processor
Since
1.0.0

Definition at line 693 of file neocore.h.

◆ nc_bitwise_multiplication_128

#define nc_bitwise_multiplication_128 (   value)    (value << 7)

Definition at line 706 of file neocore.h.

◆ nc_bitwise_multiplication_16

#define nc_bitwise_multiplication_16 (   value)    (value << 4)

Definition at line 703 of file neocore.h.

◆ nc_bitwise_multiplication_2

#define nc_bitwise_multiplication_2 (   value)    (value << 1)

Definition at line 700 of file neocore.h.

◆ nc_bitwise_multiplication_256

#define nc_bitwise_multiplication_256 (   value)    (value << 8)

Definition at line 707 of file neocore.h.

◆ nc_bitwise_multiplication_32

#define nc_bitwise_multiplication_32 (   value)    (value << 5)

Definition at line 704 of file neocore.h.

◆ nc_bitwise_multiplication_4

#define nc_bitwise_multiplication_4 (   value)    (value << 2)

Definition at line 701 of file neocore.h.

◆ nc_bitwise_multiplication_64

#define nc_bitwise_multiplication_64 (   value)    (value << 6)

Definition at line 705 of file neocore.h.

◆ nc_bitwise_multiplication_8

#define nc_bitwise_multiplication_8 (   value)    (value << 3)

Definition at line 702 of file neocore.h.

◆ nc_copy_box

#define nc_copy_box (   box_src,
  box_dest 
)    memcpy(box_dest, box_src, sizeof(Box))

Copy one bounding box to another.

Efficiently copies all data from source box to destination box using memcpy

Parameters
box_srcSource box to copy from
box_destDestination box to copy to
Note
This is a macro that expands to memcpy for performance
Warning
No bounds checking - ensure both parameters are valid Box pointers
Since
1.0.0

Definition at line 790 of file neocore.h.

◆ nc_cos

#define nc_cos (   num)    fcos(num)

Definition at line 768 of file neocore.h.

◆ nc_fix

#define nc_fix (   num)    num * 65536

Definition at line 762 of file neocore.h.

◆ nc_fix_add

#define nc_fix_add (   num1,
  num2 
)    fadd(num1, num2)

Definition at line 765 of file neocore.h.

◆ nc_fix_mul

#define nc_fix_mul (   num1,
  num2 
)    fmul(num1, num2)

Definition at line 767 of file neocore.h.

◆ nc_fix_sub

#define nc_fix_sub (   num1,
  num2 
)    fsub(num1, num2)

Definition at line 766 of file neocore.h.

◆ nc_fix_to_int

#define nc_fix_to_int (   num)    fixtoi(num)

Definition at line 763 of file neocore.h.

◆ nc_get_frame_counter

#define nc_get_frame_counter ( )    DAT_frameCounter

Definition at line 925 of file neocore.h.

◆ nc_get_palette_packed_color16

#define nc_get_palette_packed_color16 (   palette_number,
  palette_index 
)
Value:
({ \
int address = 0x400000 | ((palette_number) << 5) | ((palette_index) << 1); \
volMEMWORD(address); \
})

Definition at line 630 of file neocore.h.

◆ nc_int_to_fix

#define nc_int_to_fix (   num)    itofix(num)

Definition at line 764 of file neocore.h.

◆ nc_max

#define nc_max (   a,
 
)    ((a) > (b) ? (a) : (b))

Get maximum of two values.

Safe macro implementation that evaluates arguments only once

Parameters
aFirst value to compare
bSecond value to compare
Returns
Larger of the two values
Note
Works with any comparable type (int, float, etc.)
Since
1.0.0

Definition at line 746 of file neocore.h.

◆ nc_min

#define nc_min (   a,
 
)    ((a) < (b) ? (a) : (b))

Get minimum of two values.

Safe macro implementation that evaluates arguments only once

Parameters
aFirst value to compare
bSecond value to compare
Returns
Smaller of the two values
Note
Works with any comparable type (int, float, etc.)
Since
1.0.0

Definition at line 733 of file neocore.h.

◆ nc_negative

#define nc_negative (   num)    -num

Definition at line 760 of file neocore.h.

◆ nc_random

#define nc_random (   range)    rand() % range

Generate random number within specified range.

Uses standard rand() function with modulo operation for range limiting

Parameters
rangeMaximum value (exclusive) - result will be 0 to range-1
Returns
Random number from 0 to range-1
Warning
Use srand() to seed random number generator before first use
Note
Distribution may not be perfectly uniform for ranges that don't divide evenly into RAND_MAX
Since
1.0.0

Definition at line 720 of file neocore.h.

◆ nc_rgb16_to_packed_color16

#define nc_rgb16_to_packed_color16 (   color)     ((((color.dark) & 0xF) << 12) | (((color.r) & 0xF) << 8) | (((color.g) & 0xF) << 4) | ((color.b) & 0xF))

Convert RGB16 color structure to packed 16-bit color.

Packs RGB16 structure into Neo Geo hardware palette format (16-bit word). Bit layout: [DARK:4][RED:4][GREEN:4][BLUE:4]

Parameters
colorRGB16 structure with color components
Returns
16-bit packed color value for Neo Geo palette
Note
Each component is masked to 4 bits for safety
Warning
Evaluates color parameter multiple times - avoid side effects
Since
2.8.0
See also
nc_packet_color16_to_rgb16(), nc_set_palette_by_rgb16()

Definition at line 585 of file neocore.h.

◆ nc_set_palette_backdrop_by_packed_color16

#define nc_set_palette_backdrop_by_packed_color16 (   packed_color)
Value:
do { \
int address = 0x401FFE; \
volMEMWORD(address) = (packed_color); \
} while (0)

Definition at line 636 of file neocore.h.

◆ nc_set_palette_backdrop_by_rgb16

#define nc_set_palette_backdrop_by_rgb16 (   color)
Value:
do { \
WORD packed_color = nc_rgb16_to_packed_color16(color); \
nc_set_palette_backdrop_by_packed_color16(packed_color); \
} while (0)
#define nc_rgb16_to_packed_color16(color)
Convert RGB16 color structure to packed 16-bit color.
Definition: neocore.h:585

Definition at line 642 of file neocore.h.

◆ nc_set_palette_by_packed_color16

#define nc_set_palette_by_packed_color16 (   palette_number,
  palette_index,
  color 
)
Value:
do { \
int address = 0x400000 | ((palette_number) << 5) | ((palette_index) << 1); \
volMEMWORD(address) = (color); \
} while (0)

Set palette entry using packed 16-bit color.

Directly writes to Neo Geo palette memory at calculated hardware address. Palette memory starts at 0x400000 with specific addressing scheme.

Parameters
palette_numberPalette number (0-255)
palette_indexColor index within palette (0-15)
colorPacked 16-bit color value
Note
Uses do-while(0) pattern for safe macro expansion
Warning
Direct hardware access - ensure valid palette parameters
Since
2.8.0
See also
nc_set_palette_by_rgb16(), nc_get_palette_packed_color16()

Definition at line 603 of file neocore.h.

◆ nc_set_palette_by_rgb16

#define nc_set_palette_by_rgb16 (   palette_number,
  palette_index,
  color 
)
Value:
do { \
WORD packed_color = nc_rgb16_to_packed_color16(color); \
nc_set_palette_by_packed_color16(palette_number, palette_index, packed_color); \
} while (0)

Set palette entry using RGB16 color structure.

Convenience macro that converts RGB16 to packed format and sets palette entry. Combines nc_rgb16_to_packed_color16() and nc_set_palette_by_packed_color16().

Parameters
palette_numberPalette number (0-255)
palette_indexColor index within palette (0-15)
colorRGB16 structure with color components
Note
More convenient than manual conversion for RGB16 colors
Warning
Direct hardware access - ensure valid parameters
Since
2.8.0
See also
nc_rgb16_to_packed_color16(), nc_set_palette_by_packed_color16()

Definition at line 624 of file neocore.h.

◆ nc_shrunk_extract_x

#define nc_shrunk_extract_x (   value)    value >> 8

Definition at line 487 of file neocore.h.

◆ nc_shrunk_extract_y

#define nc_shrunk_extract_y (   value)    (BYTE)value

Definition at line 488 of file neocore.h.

◆ nc_stop_cdda

#define nc_stop_cdda ( )    nc_pause_cdda()

Definition at line 883 of file neocore.h.

◆ nc_tan

#define nc_tan (   num)    ftan(num)

Definition at line 769 of file neocore.h.

◆ nc_wait_vbl

#define nc_wait_vbl ( )    waitVBlank();

Wait for vertical blank interrupt.

Synchronizes with Neo Geo display refresh (60Hz NTSC / 50Hz PAL). Essential for smooth animation and preventing screen tearing.

Note
This is a macro that expands to waitVBlank() from DATlib
Warning
Blocking operation - execution pauses until next VBL
Since
1.0.0
See also
nc_wait_vbl_max(), nc_update()

Definition at line 547 of file neocore.h.

◆ SHRUNK_TABLE_PROP_SIZE

#define SHRUNK_TABLE_PROP_SIZE   0x2fe

Definition at line 15 of file neocore.h.

◆ SPRITE_INDEX_NOT_FOUND

#define SPRITE_INDEX_NOT_FOUND   0xFFFF

Definition at line 21 of file neocore.h.

Typedef Documentation

◆ Adpcm_player

typedef struct Adpcm_player Adpcm_player

◆ Box

typedef struct Box Box

◆ GFX_Animated_Sprite

◆ GFX_Animated_Sprite_Physic

◆ GFX_Picture

typedef struct GFX_Picture GFX_Picture

◆ GFX_Picture_Physic

◆ GFX_Scroller

typedef struct GFX_Scroller GFX_Scroller

◆ Position

typedef struct Position Position

◆ RGB16

typedef struct RGB16 RGB16

Enumeration Type Documentation

◆ Direction

enum Direction
Enumerator
NONE 
UP 
DOWN 
LEFT 
RIGHT 

Definition at line 23 of file neocore.h.

◆ Sound_state

Enumerator
IDLE 
PLAYING 

Definition at line 24 of file neocore.h.

Function Documentation

◆ nc_byte_to_hex()

void nc_byte_to_hex ( BYTE  value,
char *  hexchar 
)

◆ nc_clear_display()

void nc_clear_display ( )

◆ nc_clear_palette_index_table()

void nc_clear_palette_index_table ( )

◆ nc_clear_sprite_index_table()

void nc_clear_sprite_index_table ( )

◆ nc_collide_box()

BOOL nc_collide_box ( Box box1,
Box box2 
)

Test collision between two bounding boxes.

Performs axis-aligned bounding box (AABB) collision detection using corner points p0, p1, and p3 for overlap testing.

Parameters
[in]box1First bounding box (must not be NULL)
[in]box2Second bounding box (must not be NULL)
Returns
true if boxes overlap, false otherwise
Return values
trueBoxes are overlapping or touching
falseBoxes are completely separate
Warning
No NULL pointer validation - caller must ensure valid pointers
Note
Algorithm checks for overlap in both X and Y axes simultaneously
Since
1.0.0
See also
nc_collide_boxes(), nc_update_box()

◆ nc_collide_boxes()

BYTE nc_collide_boxes ( Box box,
Box boxes[],
BYTE  box_max 
)

Test collision between one box and an array of boxes.

Checks if the given box collides with any box in the provided array. Returns the index of the first colliding box found.

Parameters
[in]boxBox to test for collisions (must not be NULL)
[in]boxesArray of box pointers to test against (must not be NULL)
[in]box_maxNumber of boxes in the array
Returns
Index of first colliding box, or NONE if no collision detected
Return values
0-255Index of colliding box
NONENo collision found
Warning
No NULL pointer validation - caller must ensure valid pointers
Note
Uses nc_collide_box() internally for individual collision tests
Since
1.0.0
See also
nc_collide_box(), NONE

◆ nc_debug_joypad()

void nc_debug_joypad ( BYTE  id)

◆ nc_destroy_gfx_animated_sprite()

void nc_destroy_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite)

◆ nc_destroy_gfx_animated_sprite_physic()

void nc_destroy_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic)

◆ nc_destroy_gfx_picture()

void nc_destroy_gfx_picture ( GFX_Picture gfx_picture)

◆ nc_destroy_gfx_picture_physic()

void nc_destroy_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic)

◆ nc_destroy_gfx_scroller()

void nc_destroy_gfx_scroller ( GFX_Scroller gfx_scroller)

◆ nc_destroy_palette()

void nc_destroy_palette ( const paletteInfo *  paletteInfo)

◆ nc_display_gfx_animated_sprite()

WORD nc_display_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite,
short  x,
short  y,
WORD  anim 
)

Display an animated sprite at specified position.

Parameters
[in]animated_spritePointer to animated sprite object
[in]xHorizontal position in pixels
[in]yVertical position in pixels
[in]animAnimation frame index
Returns
Sprite index used for display (either forced via nc_display_gfx_with_sprite_id or automatically allocated)
Note
Uses sprite manager for automatic allocation unless overridden by nc_display_gfx_with_sprite_id
Since
3.0.0

◆ nc_display_gfx_animated_sprite_physic()

WORD nc_display_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic,
short  x,
short  y,
WORD  anim 
)

Display an animated sprite with physics at specified position.

Parameters
[in]gfx_animated_sprite_physicPointer to animated sprite with physics object
[in]xHorizontal position in pixels
[in]yVertical position in pixels
[in]animAnimation frame index
Returns
Sprite index used for display (either forced via nc_display_gfx_with_sprite_id or automatically allocated)
Note
Updates collision box automatically after display
Since
3.0.0

◆ nc_display_gfx_picture()

WORD nc_display_gfx_picture ( GFX_Picture gfx_picture,
short  x,
short  y 
)

Display a picture at specified position.

Parameters
[in]gfx_picturePointer to picture object
[in]xHorizontal position in pixels
[in]yVertical position in pixels
Returns
Sprite index used for display (either forced via nc_display_gfx_with_sprite_id or automatically allocated)
Note
Uses sprite manager for automatic allocation unless overridden by nc_display_gfx_with_sprite_id
Since
3.0.0

◆ nc_display_gfx_picture_physic()

WORD nc_display_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic,
short  x,
short  y 
)

Display a picture with physics at specified position.

Parameters
[in]gfx_picture_physicPointer to picture with physics object
[in]xHorizontal position in pixels
[in]yVertical position in pixels
Returns
Sprite index used for display (either forced via nc_display_gfx_with_sprite_id or automatically allocated)
Note
Updates collision box automatically after display if autobox is enabled
Since
3.0.0

◆ nc_display_gfx_scroller()

WORD nc_display_gfx_scroller ( GFX_Scroller gfx_scroller,
short  x,
short  y 
)

Display a scroller at specified position.

Parameters
[in]gfx_scrollerPointer to scroller object
[in]xHorizontal position in pixels
[in]yVertical position in pixels
Returns
Sprite index used for display (either forced via nc_display_gfx_with_sprite_id or automatically allocated)
Note
Uses sprite manager for automatic allocation unless overridden by nc_display_gfx_with_sprite_id
Since
3.0.0

◆ nc_display_gfx_with_sprite_id()

void nc_display_gfx_with_sprite_id ( WORD  sprite_id)

◆ nc_each_frame()

BOOL nc_each_frame ( DWORD  frame)

◆ nc_fix_load_palette_info()

WORD nc_fix_load_palette_info ( const paletteInfo *  palette_info)

Allocate and set palette for fix layer.

Automatically allocates a palette index from the fix layer reserved range (2-16) and loads the palette data. Uses the palette manager to ensure proper allocation. Palettes 0-1 are reserved for system use and cannot be allocated.

Parameters
palette_infoPointer to palette data structure containing colors and count
Returns
WORD Allocated palette index (2-16), or 0 if allocation failed
// Allocate palette for fix layer font
WORD fix_palette = nc_fix_load_palette_info(&my_font_palette);
nc_fix_set_palette_id(fix_palette);
void nc_fix_set_palette_id(WORD palette)
Set palette ID for log text display.
WORD nc_fix_load_palette_info(const paletteInfo *palette_info)
Allocate and set palette for fix layer.
Note
This function is specifically for fix layer palettes (indices 2-16)
Palettes 0-1 are system reserved and never allocated
Returns 0 if no palette slots available in fix range
Since
3.1.0
See also
nc_palette_set_info(), nc_fix_set_palette_id(), nc_fix_unload_palette_info(), nc_fix_unload_palette_id(), use_palette_manager_index()

◆ nc_fix_set_bank()

void nc_fix_set_bank ( WORD  bank)

Set font bank for log text display.

Sets the font bank number used by logging functions for text rendering. Controls which font is used for subsequent log output.

Parameters
[in]bankFont bank number (0-15)
Note
Must be called before nc_log_info() to affect font selection
Bank 0 = system font (always available)
Since
3.1.0
See also
nc_fix_set_palette_id(), nc_fix_load_palette_info(), nc_log_info(), nc_init_log()

◆ nc_fix_set_palette_id()

void nc_fix_set_palette_id ( WORD  palette)

Set palette ID for log text display.

Sets the palette number used by logging functions for text color. Works with custom palettes loaded via palJobPut() and system palettes.

Parameters
[in]palettePalette ID number (0-15)
Note
Must be called before nc_log_info() to affect text color
Palette 0 = default system palette (usually white text)
Works in combination with nc_fix_set_bank() for full text control
Since
3.1.0
See also
nc_fix_set_bank(), nc_fix_load_palette_info(), nc_log_info(), palJobPut(), nc_init_log()

◆ nc_fix_unload_palette_id()

BOOL nc_fix_unload_palette_id ( WORD  palette_id)

Unload palette data by palette ID for fix layer.

Frees a palette at the specified index in the fix layer range (2-16). This is useful when you know the palette ID but don't have the original palette info.

Parameters
palette_idPalette index to free (2-16)
Returns
true if palette was freed, false if invalid ID or system reserved palette
Note
Only works with fix layer palette range (2-16)
System reserved palettes (0-1) cannot be unloaded
Will fail if palette_id is outside valid fix range
Since
3.1.0
See also
nc_fix_load_palette_info(), nc_fix_unload_palette_info()

◆ nc_fix_unload_palette_info()

BOOL nc_fix_unload_palette_info ( const paletteInfo *  palette_info)

Unload palette data by palette info for fix layer.

Frees a previously allocated palette in the fix layer range (2-16) by matching the palette info pointer. This is the counterpart to nc_fix_load_palette_info().

Parameters
palette_infoPointer to palette info structure that was used to load the palette
Returns
true if palette was found and freed, false if not found
Note
Only works with palettes allocated via nc_fix_load_palette_info()
System reserved palettes (0-1) cannot be unloaded
Since
3.1.0
See also
nc_fix_load_palette_info(), nc_fix_unload_palette_id()

◆ nc_frame_to_second()

DWORD nc_frame_to_second ( DWORD  frame)

◆ nc_free_ram_info()

WORD nc_free_ram_info ( )

◆ nc_get_adpcm_player()

Adpcm_player * nc_get_adpcm_player ( )

◆ nc_get_free_sprite_index()

WORD nc_get_free_sprite_index ( )

◆ nc_get_max_free_palette_index()

WORD nc_get_max_free_palette_index ( )

◆ nc_get_max_free_sprite_index()

WORD nc_get_max_free_sprite_index ( )

◆ nc_get_max_palette_index_used()

WORD nc_get_max_palette_index_used ( )

◆ nc_get_max_sprite_index_used()

WORD nc_get_max_sprite_index_used ( )

◆ nc_get_position_gfx_animated_sprite()

void nc_get_position_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite,
Position position 
)

◆ nc_get_position_gfx_animated_sprite_physic()

void nc_get_position_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic,
Position position 
)

◆ nc_get_position_gfx_picture()

void nc_get_position_gfx_picture ( GFX_Picture gfx_picture,
Position position 
)

◆ nc_get_position_gfx_picture_physic()

void nc_get_position_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic,
Position position 
)

◆ nc_get_position_gfx_scroller()

void nc_get_position_gfx_scroller ( GFX_Scroller gfx_scroller,
Position position 
)

◆ nc_get_position_x_log()

WORD nc_get_position_x_log ( )

Get current horizontal log cursor position.

Returns
Current X coordinate of log cursor
Since
2.9.0

◆ nc_get_position_y_log()

WORD nc_get_position_y_log ( )

Get current vertical log cursor position.

Returns
Current Y coordinate of log cursor
Since
2.9.0

◆ nc_get_relative_position()

void nc_get_relative_position ( Position position,
Box  box,
Position  world_coord 
)

◆ nc_get_shrunk_proportional_table()

WORD nc_get_shrunk_proportional_table ( WORD  index)

◆ nc_hide_gfx_animated_sprite()

void nc_hide_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite)

◆ nc_hide_gfx_animated_sprite_physic()

void nc_hide_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic)

◆ nc_hide_gfx_picture()

void nc_hide_gfx_picture ( GFX_Picture gfx_picture)

◆ nc_hide_gfx_picture_physic()

void nc_hide_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic)

◆ nc_init_adpcm()

void nc_init_adpcm ( )

◆ nc_init_box()

void nc_init_box ( Box box,
short  width,
short  height,
short  widthOffset,
short  heightOffset 
)

Initialize a bounding box with dimensions and offsets.

Sets up box dimensions and offset values. Corner points are not calculated until nc_update_box() is called with position coordinates.

Parameters
[out]boxPointer to Box structure to initialize (must not be NULL)
[in]widthBox width in pixels
[in]heightBox height in pixels
[in]widthOffsetHorizontal offset from sprite origin
[in]heightOffsetVertical offset from sprite origin
Note
Corner points (p0-p4) are not set - call nc_update_box() to calculate positions
Warning
No NULL pointer validation - caller must ensure valid box pointer
Since
1.0.0
See also
nc_update_box()

◆ nc_init_display_gfx_animated_sprite()

WORD nc_init_display_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite,
const spriteInfo *  spriteInfo,
const paletteInfo *  paletteInfo,
short  x,
short  y,
WORD  anim 
)

Initialize and display an animated sprite at specified position.

Parameters
[in]gfx_animated_spritePointer to animated sprite object
[in]spriteInfoPointer to sprite metadata
[in]paletteInfoPointer to palette information
[in]xHorizontal position in pixels
[in]yVertical position in pixels
[in]animAnimation frame index
Returns
Sprite index used for display
Since
3.0.0

◆ nc_init_display_gfx_animated_sprite_physic()

WORD nc_init_display_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic,
const spriteInfo *  spriteInfo,
const paletteInfo *  paletteInfo,
short  x,
short  y,
short  box_witdh,
short  box_height,
short  box_width_offset,
short  box_height_offset,
WORD  anim 
)

Initialize and display an animated sprite with physics at specified position.

Parameters
[in]gfx_animated_sprite_physicPointer to animated sprite with physics object
[in]spriteInfoPointer to sprite metadata
[in]paletteInfoPointer to palette information
[in]xHorizontal position in pixels
[in]yVertical position in pixels
[in]box_witdhCollision box width
[in]box_heightCollision box height
[in]box_width_offsetCollision box horizontal offset
[in]box_height_offsetCollision box vertical offset
[in]animAnimation frame index
Returns
Sprite index used for display
Since
3.0.0

◆ nc_init_display_gfx_picture()

WORD nc_init_display_gfx_picture ( GFX_Picture gfx_picture,
const pictureInfo *  pictureInfo,
const paletteInfo *  paletteInfo,
short  x,
short  y 
)

Initialize and display a picture at specified position.

Parameters
[in]gfx_picturePointer to picture object
[in]pictureInfoPointer to picture metadata
[in]paletteInfoPointer to palette information
[in]xHorizontal position in pixels
[in]yVertical position in pixels
Returns
Sprite index used for display
Since
3.0.0

◆ nc_init_display_gfx_picture_physic()

WORD nc_init_display_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic,
const pictureInfo *  pictureInfo,
const paletteInfo *  paletteInfo,
short  x,
short  y,
short  box_witdh,
short  box_height,
short  box_width_offset,
short  box_height_offset,
BOOL  autobox_enabled 
)

Initialize and display a picture with physics at specified position.

Parameters
[in]gfx_picture_physicPointer to picture with physics object
[in]pictureInfoPointer to picture metadata
[in]paletteInfoPointer to palette information
[in]xHorizontal position in pixels
[in]yVertical position in pixels
[in]box_witdhCollision box width
[in]box_heightCollision box height
[in]box_width_offsetCollision box horizontal offset
[in]box_height_offsetCollision box vertical offset
[in]autobox_enabledWhether automatic box updates are enabled
Returns
Sprite index used for display
Since
3.0.0

◆ nc_init_display_gfx_scroller()

WORD nc_init_display_gfx_scroller ( GFX_Scroller gfx_scroller,
const scrollerInfo *  scrollerInfo,
const paletteInfo *  paletteInfo,
short  x,
short  y 
)

Initialize and display a scroller at specified position.

Parameters
[in]gfx_scrollerPointer to scroller object
[in]scrollerInfoPointer to scroller metadata
[in]paletteInfoPointer to palette information
[in]xHorizontal position in pixels
[in]yVertical position in pixels
Returns
Sprite index used for display
Since
3.0.0

◆ nc_init_gfx_animated_sprite()

void nc_init_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite,
const spriteInfo *  spriteInfo,
const paletteInfo *  paletteInfo 
)

Initialize an animated sprite graphics object.

Sets up a GFX_Animated_Sprite structure for rendering animated sprites on Neo Geo hardware. Automatically handles DATlib integration and prepares the sprite for display.

Parameters
[out]gfx_animated_spritePointer to GFX_Animated_Sprite structure to initialize
[in]spriteInfoPointer to DATlib sprite information (must not be NULL)
[in]paletteInfoPointer to DATlib palette information (must not be NULL)
Note
Calls init_shadow_system() internally to prepare Neo Geo graphics subsystem
Warning
spriteInfo and paletteInfo must remain valid during object lifetime
Since
1.0.0
See also
nc_display_gfx_animated_sprite(), nc_destroy_gfx_animated_sprite()

◆ nc_init_gfx_animated_sprite_physic()

void nc_init_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic,
const spriteInfo *  spriteInfo,
const paletteInfo *  paletteInfo,
short  box_witdh,
short  box_height,
short  box_width_offset,
short  box_height_offset 
)

◆ nc_init_gfx_picture()

void nc_init_gfx_picture ( GFX_Picture gfx_picture,
const pictureInfo *  pictureInfo,
const paletteInfo *  paletteInfo 
)

Initialize a picture graphics object.

Sets up a GFX_Picture structure for rendering static images on Neo Geo hardware. Automatically calculates pixel dimensions and prepares for display.

Parameters
[out]gfx_picturePointer to GFX_Picture structure to initialize
[in]pictureInfoPointer to DATlib picture information (must not be NULL)
[in]paletteInfoPointer to DATlib palette information (must not be NULL)
Note
Calls init_shadow_system() internally and calculates pixel_width/pixel_height automatically
Warning
pictureInfo and paletteInfo must remain valid during object lifetime
Since
1.0.0
See also
nc_display_gfx_picture(), nc_destroy_gfx_picture()

◆ nc_init_gfx_picture_physic()

void nc_init_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic,
const pictureInfo *  pi,
const paletteInfo *  pali,
short  box_witdh,
short  box_height,
short  box_width_offset,
short  box_height_offset,
BOOL  autobox_enabled 
)

◆ nc_init_gfx_scroller()

void nc_init_gfx_scroller ( GFX_Scroller gfx_scroller,
const scrollerInfo *  scrollerInfo,
const paletteInfo *  paletteInfo 
)

◆ nc_init_gpu()

void nc_init_gpu ( )

◆ nc_init_log()

void nc_init_log ( )

Initialize the logging system.

Sets up the Neo Geo logging subsystem for debug output on screen. Must be called before using any logging functions.

Note
Initializes log cursor to default position (1, 2)
Since
3.0.0
See also
nc_set_position_log(), nc_log_info()

◆ nc_init_system()

void nc_init_system ( )

◆ nc_joypad_is_a()

BOOL nc_joypad_is_a ( BYTE  id)

◆ nc_joypad_is_b()

BOOL nc_joypad_is_b ( BYTE  id)

◆ nc_joypad_is_c()

BOOL nc_joypad_is_c ( BYTE  id)

◆ nc_joypad_is_d()

BOOL nc_joypad_is_d ( BYTE  id)

◆ nc_joypad_is_down()

BOOL nc_joypad_is_down ( BYTE  id)

◆ nc_joypad_is_left()

BOOL nc_joypad_is_left ( BYTE  id)

◆ nc_joypad_is_right()

BOOL nc_joypad_is_right ( BYTE  id)

◆ nc_joypad_is_start()

BOOL nc_joypad_is_start ( BYTE  id)

◆ nc_joypad_is_up()

BOOL nc_joypad_is_up ( BYTE  id)

◆ nc_joypad_update()

void nc_joypad_update ( BYTE  id)

◆ nc_log_bool()

void nc_log_bool ( BOOL  value)

◆ nc_log_box()

void nc_log_box ( Box b)

◆ nc_log_byte()

void nc_log_byte ( BYTE  value)

◆ nc_log_dword()

void nc_log_dword ( DWORD  value)

◆ nc_log_info()

WORD nc_log_info ( char *  txt,
  ... 
)

Log formatted text without automatic line break.

Prints formatted text at current log cursor position using printf-style formatting. Does not automatically advance to next line - use nc_log_next_line() manually.

Parameters
[in]txtFormat string (printf-style)
[in]...Variable arguments for format string
Returns
Number of characters in the format string
Warning
Buffer size limited to 256 characters - longer strings will be truncated
Note
Use nc_log_info_line() for automatic line breaks
Since
2.9.0
See also
nc_log_info_line(), nc_log_next_line()

◆ nc_log_info_line()

WORD nc_log_info_line ( char *  txt,
  ... 
)

Log formatted text with automatic line break.

Prints formatted text at current log cursor position and automatically advances to next line. Convenient for single-line log messages.

Parameters
[in]txtFormat string (printf-style)
[in]...Variable arguments for format string
Returns
Number of characters in the format string
Warning
Buffer size limited to 256 characters - longer strings will be truncated
Since
3.0.0
See also
nc_log_info(), nc_log_next_line()

◆ nc_log_int()

void nc_log_int ( int  value)

◆ nc_log_next_line()

void nc_log_next_line ( )

Move log cursor to next line.

Advances log cursor to beginning of next line, handles screen wrapping

Note
Automatically wraps to top of screen if at bottom
Since
3.0.0
See also
nc_log_info_line()

◆ nc_log_packed_color16()

void nc_log_packed_color16 ( WORD  packed_color)

◆ nc_log_palette_info()

void nc_log_palette_info ( paletteInfo *  paletteInfo)

◆ nc_log_pictureInfo()

void nc_log_pictureInfo ( pictureInfo *  pi)

◆ nc_log_rgb16()

void nc_log_rgb16 ( RGB16 color)

◆ nc_log_short()

void nc_log_short ( short  value)

◆ nc_log_spriteInfo()

void nc_log_spriteInfo ( spriteInfo *  si)

◆ nc_log_word()

void nc_log_word ( WORD  value)

◆ nc_move_gfx_animated_sprite()

void nc_move_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite,
short  x_offset,
short  y_offset 
)

◆ nc_move_gfx_animated_sprite_physic()

void nc_move_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic,
short  x_offset,
short  y_offset 
)

◆ nc_move_gfx_picture()

void nc_move_gfx_picture ( GFX_Picture gfx_picture,
short  x,
short  y 
)

◆ nc_move_gfx_picture_physic()

void nc_move_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic,
short  x_offset,
short  y_offset 
)

◆ nc_move_gfx_scroller()

void nc_move_gfx_scroller ( GFX_Scroller gfx_scroller,
short  x,
short  y 
)

◆ nc_packet_color16_to_rgb16()

void nc_packet_color16_to_rgb16 ( WORD  packed_color,
RGB16 rgb_color 
)

◆ nc_palette_set_info()

WORD nc_palette_set_info ( const paletteInfo *  paletteInfo,
WORD  palette_index 
)

Load palette data and return the palette index.

Loads palette data to the specified palette index using palJobPut() and returns the same palette index. This is a convenience function that combines palette loading and returns the index for immediate use with other palette functions.

Parameters
[in]paletteInfoPointer to palette information structure containing color data (must not be NULL)
[in]palette_indexTarget palette index where the palette will be loaded (0-15)
Returns
The same palette index that was passed as parameter
Return values
palette_indexEcho of the input palette_index parameter
Note
Typical usage: nc_fix_set_palette_id(nc_palette_set_info(&my_palette, 5));
The returned index can be used with nc_fix_set_palette_id() or other palette functions
Warning
No validation of palette_index bounds - ensure valid range (0-15)
Since
3.1.0
See also
nc_fix_set_palette_id(), nc_fix_set_bank(), nc_fix_load_palette_info(), palJobPut(), nc_log_info()

◆ nc_pause()

void nc_pause ( BOOL(*)()  exitFunc)

◆ nc_pause_cdda()

void nc_pause_cdda ( )

◆ nc_play_cdda()

void nc_play_cdda ( BYTE  track)

◆ nc_print()

void nc_print ( int  x,
int  y,
char *  label 
)

◆ nc_push_remaining_frame_adpcm_player()

void nc_push_remaining_frame_adpcm_player ( DWORD  frame)

◆ nc_read_palette_rgb16()

void nc_read_palette_rgb16 ( BYTE  palette_number,
BYTE  palette_index,
RGB16 rgb_color 
)

◆ nc_reset()

void nc_reset ( )

◆ nc_resize_box()

void nc_resize_box ( Box Box,
short  edge 
)

◆ nc_resume_cdda()

void nc_resume_cdda ( )

◆ nc_second_to_frame()

DWORD nc_second_to_frame ( DWORD  second)

◆ nc_set_animation_gfx_animated_sprite()

void nc_set_animation_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite,
WORD  anim 
)

◆ nc_set_animation_gfx_animated_sprite_physic()

void nc_set_animation_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic,
WORD  anim 
)

◆ nc_set_joypad_edge_mode()

void nc_set_joypad_edge_mode ( BOOL  actived)

◆ nc_set_position_gfx_animated_sprite()

void nc_set_position_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite,
short  x,
short  y 
)

◆ nc_set_position_gfx_animated_sprite_physic()

void nc_set_position_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic,
short  x,
short  y 
)

◆ nc_set_position_gfx_picture()

void nc_set_position_gfx_picture ( GFX_Picture gfx_picture,
short  x,
short  y 
)

◆ nc_set_position_gfx_picture_physic()

void nc_set_position_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic,
short  x,
short  y 
)

◆ nc_set_position_gfx_scroller()

void nc_set_position_gfx_scroller ( GFX_Scroller gfx_scroller,
short  x,
short  y 
)

◆ nc_set_position_log()

void nc_set_position_log ( WORD  _x,
WORD  _y 
)

Set log cursor position.

Moves the log cursor to specified screen coordinates for subsequent log output

Parameters
[in]_xHorizontal position (0-39 for 320px width)
[in]_yVertical position (0-27 for 224px height)
Note
Coordinates are in character cells, not pixels
Since
2.9.0

◆ nc_show_gfx_animated_sprite()

void nc_show_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite)

◆ nc_show_gfx_animated_sprite_physic()

void nc_show_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic)

◆ nc_show_gfx_picture()

void nc_show_gfx_picture ( GFX_Picture gfx_picture)

◆ nc_show_gfx_picture_physic()

void nc_show_gfx_picture_physic ( GFX_Picture_Physic gfx_picture_physic)

◆ nc_shrunk()

void nc_shrunk ( WORD  base_sprite,
WORD  max_width,
WORD  value 
)

◆ nc_shrunk_addr()

void nc_shrunk_addr ( WORD  addr,
WORD  shrunk_value 
)

◆ nc_shrunk_box()

void nc_shrunk_box ( Box box,
Box bOrigin,
WORD  shrunkValue 
)

◆ nc_shrunk_centroid_get_translated_x()

int nc_shrunk_centroid_get_translated_x ( short  centerPosX,
WORD  tileWidth,
BYTE  shrunkX 
)

◆ nc_shrunk_centroid_get_translated_y()

int nc_shrunk_centroid_get_translated_y ( short  centerPosY,
WORD  tileHeight,
BYTE  shrunkY 
)

◆ nc_shrunk_centroid_gfx_picture()

void nc_shrunk_centroid_gfx_picture ( GFX_Picture gfx_picture,
short  center_x,
short  center_y,
WORD  shrunk_value 
)

◆ nc_shrunk_forge()

WORD nc_shrunk_forge ( BYTE  xc,
BYTE  yc 
)

◆ nc_shrunk_range()

WORD nc_shrunk_range ( WORD  addr_start,
WORD  addr_end,
WORD  shrunk_value 
)

◆ nc_sin()

char nc_sin ( WORD  index)

◆ nc_sleep()

void nc_sleep ( DWORD  frame)

◆ nc_stop_adpcm()

void nc_stop_adpcm ( )

◆ nc_update()

void nc_update ( )

◆ nc_update_adpcm_player()

void nc_update_adpcm_player ( )

◆ nc_update_animation_gfx_animated_sprite()

void nc_update_animation_gfx_animated_sprite ( GFX_Animated_Sprite gfx_animated_sprite)

◆ nc_update_animation_gfx_animated_sprite_physic()

void nc_update_animation_gfx_animated_sprite_physic ( GFX_Animated_Sprite_Physic gfx_animated_sprite_physic)

◆ nc_update_box()

void nc_update_box ( Box box,
short  x,
short  y 
)

Update bounding box corner positions based on world coordinates.

Calculates all corner points (p0-p4) based on the given position and the box's stored dimensions and offsets.

Parameters
[in,out]boxPointer to Box structure to update (must not be NULL)
[in]xWorld X coordinate for box positioning
[in]yWorld Y coordinate for box positioning
Note
Automatically calculates center point (p4) using bitwise division for performance
Warning
No NULL pointer validation - caller must ensure valid box pointer
Since
1.0.0
See also
nc_init_box(), nc_collide_box()

◆ nc_update_joypad()

void nc_update_joypad ( BYTE  id)

◆ nc_update_mask()

void nc_update_mask ( short  x,
short  y,
Position  vec[],
Position  offset[],
BYTE  vector_max 
)

◆ nc_vector_is_left()

BOOL nc_vector_is_left ( short  x,
short  y,
short  v1x,
short  v1y,
short  v2x,
short  v2y 
)

◆ nc_vectors_collide()

BOOL nc_vectors_collide ( Box box,
Position  vec[],
BYTE  vector_max 
)

◆ nc_wait_vbl_max()

DWORD nc_wait_vbl_max ( WORD  nb)

◆ nc_word_to_hex()

void nc_word_to_hex ( WORD  value,
char *  hexchar 
)