|
Neocore
|
#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_player * | nc_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) |
| #define nc_abs | ( | num | ) | ((num) < 0 ? ~(num) + 1 : (num)) |
Get absolute value of a number.
Optimized implementation using bitwise operations for negative numbers
| num | Number to get absolute value of |
| #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
| value | Value to divide (any integer type) |
| #define nc_bitwise_division_4 | ( | value | ) | (value >> 2) |
| #define nc_bitwise_division_8 | ( | value | ) | (value >> 3) |
| #define nc_bitwise_multiplication_128 | ( | value | ) | (value << 7) |
| #define nc_bitwise_multiplication_16 | ( | value | ) | (value << 4) |
| #define nc_bitwise_multiplication_256 | ( | value | ) | (value << 8) |
| #define nc_bitwise_multiplication_32 | ( | value | ) | (value << 5) |
| #define nc_bitwise_multiplication_64 | ( | value | ) | (value << 6) |
| #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
| box_src | Source box to copy from |
| box_dest | Destination box to copy to |
| #define nc_get_palette_packed_color16 | ( | palette_number, | |
| palette_index | |||
| ) |
| #define nc_max | ( | a, | |
| b | |||
| ) | ((a) > (b) ? (a) : (b)) |
| #define nc_min | ( | a, | |
| b | |||
| ) | ((a) < (b) ? (a) : (b)) |
| #define nc_random | ( | range | ) | rand() % range |
Generate random number within specified range.
Uses standard rand() function with modulo operation for range limiting
| range | Maximum value (exclusive) - result will be 0 to range-1 |
| #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]
| color | RGB16 structure with color components |
| #define nc_set_palette_backdrop_by_packed_color16 | ( | packed_color | ) |
| #define nc_set_palette_backdrop_by_rgb16 | ( | color | ) |
| #define nc_set_palette_by_packed_color16 | ( | palette_number, | |
| palette_index, | |||
| color | |||
| ) |
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.
| palette_number | Palette number (0-255) |
| palette_index | Color index within palette (0-15) |
| color | Packed 16-bit color value |
| #define nc_set_palette_by_rgb16 | ( | palette_number, | |
| palette_index, | |||
| color | |||
| ) |
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().
| palette_number | Palette number (0-255) |
| palette_index | Color index within palette (0-15) |
| color | RGB16 structure with color components |
| #define nc_stop_cdda | ( | ) | nc_pause_cdda() |
| #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.
| typedef struct Adpcm_player Adpcm_player |
| typedef struct GFX_Animated_Sprite GFX_Animated_Sprite |
| typedef struct GFX_Animated_Sprite_Physic GFX_Animated_Sprite_Physic |
| typedef struct GFX_Picture GFX_Picture |
| typedef struct GFX_Picture_Physic GFX_Picture_Physic |
| typedef struct GFX_Scroller GFX_Scroller |
| enum Sound_state |
| void nc_byte_to_hex | ( | BYTE | value, |
| char * | hexchar | ||
| ) |
| void nc_clear_display | ( | ) |
| void nc_clear_palette_index_table | ( | ) |
| void nc_clear_sprite_index_table | ( | ) |
Test collision between two bounding boxes.
Performs axis-aligned bounding box (AABB) collision detection using corner points p0, p1, and p3 for overlap testing.
| [in] | box1 | First bounding box (must not be NULL) |
| [in] | box2 | Second bounding box (must not be NULL) |
| true | Boxes are overlapping or touching |
| false | Boxes are completely separate |
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.
| [in] | box | Box to test for collisions (must not be NULL) |
| [in] | boxes | Array of box pointers to test against (must not be NULL) |
| [in] | box_max | Number of boxes in the array |
| 0-255 | Index of colliding box |
| NONE | No collision found |
| void nc_debug_joypad | ( | BYTE | id | ) |
| void nc_destroy_gfx_animated_sprite | ( | GFX_Animated_Sprite * | gfx_animated_sprite | ) |
| void nc_destroy_gfx_animated_sprite_physic | ( | GFX_Animated_Sprite_Physic * | gfx_animated_sprite_physic | ) |
| void nc_destroy_gfx_picture | ( | GFX_Picture * | gfx_picture | ) |
| void nc_destroy_gfx_picture_physic | ( | GFX_Picture_Physic * | gfx_picture_physic | ) |
| void nc_destroy_gfx_scroller | ( | GFX_Scroller * | gfx_scroller | ) |
| void nc_destroy_palette | ( | const paletteInfo * | paletteInfo | ) |
| 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.
| [in] | animated_sprite | Pointer to animated sprite object |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| [in] | anim | Animation frame index |
| 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.
| [in] | gfx_animated_sprite_physic | Pointer to animated sprite with physics object |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| [in] | anim | Animation frame index |
| WORD nc_display_gfx_picture | ( | GFX_Picture * | gfx_picture, |
| short | x, | ||
| short | y | ||
| ) |
Display a picture at specified position.
| [in] | gfx_picture | Pointer to picture object |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| WORD nc_display_gfx_picture_physic | ( | GFX_Picture_Physic * | gfx_picture_physic, |
| short | x, | ||
| short | y | ||
| ) |
Display a picture with physics at specified position.
| [in] | gfx_picture_physic | Pointer to picture with physics object |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| WORD nc_display_gfx_scroller | ( | GFX_Scroller * | gfx_scroller, |
| short | x, | ||
| short | y | ||
| ) |
Display a scroller at specified position.
| [in] | gfx_scroller | Pointer to scroller object |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| void nc_display_gfx_with_sprite_id | ( | WORD | sprite_id | ) |
| BOOL nc_each_frame | ( | DWORD | frame | ) |
| 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.
| palette_info | Pointer to palette data structure containing colors and count |
| 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.
| [in] | bank | Font bank number (0-15) |
| 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.
| [in] | palette | Palette ID number (0-15) |
| 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.
| palette_id | Palette index to free (2-16) |
| 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().
| palette_info | Pointer to palette info structure that was used to load the palette |
| DWORD nc_frame_to_second | ( | DWORD | frame | ) |
| WORD nc_free_ram_info | ( | ) |
| Adpcm_player * nc_get_adpcm_player | ( | ) |
| WORD nc_get_free_sprite_index | ( | ) |
| WORD nc_get_max_free_palette_index | ( | ) |
| WORD nc_get_max_free_sprite_index | ( | ) |
| WORD nc_get_max_palette_index_used | ( | ) |
| WORD nc_get_max_sprite_index_used | ( | ) |
| 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 | ||
| ) |
| WORD nc_get_position_x_log | ( | ) |
Get current horizontal log cursor position.
| WORD nc_get_position_y_log | ( | ) |
Get current vertical log cursor position.
| WORD nc_get_shrunk_proportional_table | ( | WORD | index | ) |
| void nc_hide_gfx_animated_sprite | ( | GFX_Animated_Sprite * | gfx_animated_sprite | ) |
| void nc_hide_gfx_animated_sprite_physic | ( | GFX_Animated_Sprite_Physic * | gfx_animated_sprite_physic | ) |
| void nc_hide_gfx_picture | ( | GFX_Picture * | gfx_picture | ) |
| void nc_hide_gfx_picture_physic | ( | GFX_Picture_Physic * | gfx_picture_physic | ) |
| void nc_init_adpcm | ( | ) |
| 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.
| [out] | box | Pointer to Box structure to initialize (must not be NULL) |
| [in] | width | Box width in pixels |
| [in] | height | Box height in pixels |
| [in] | widthOffset | Horizontal offset from sprite origin |
| [in] | heightOffset | Vertical offset from sprite origin |
| 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.
| [in] | gfx_animated_sprite | Pointer to animated sprite object |
| [in] | spriteInfo | Pointer to sprite metadata |
| [in] | paletteInfo | Pointer to palette information |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| [in] | anim | Animation frame index |
| 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.
| [in] | gfx_animated_sprite_physic | Pointer to animated sprite with physics object |
| [in] | spriteInfo | Pointer to sprite metadata |
| [in] | paletteInfo | Pointer to palette information |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| [in] | box_witdh | Collision box width |
| [in] | box_height | Collision box height |
| [in] | box_width_offset | Collision box horizontal offset |
| [in] | box_height_offset | Collision box vertical offset |
| [in] | anim | Animation frame index |
| 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.
| [in] | gfx_picture | Pointer to picture object |
| [in] | pictureInfo | Pointer to picture metadata |
| [in] | paletteInfo | Pointer to palette information |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| 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.
| [in] | gfx_picture_physic | Pointer to picture with physics object |
| [in] | pictureInfo | Pointer to picture metadata |
| [in] | paletteInfo | Pointer to palette information |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| [in] | box_witdh | Collision box width |
| [in] | box_height | Collision box height |
| [in] | box_width_offset | Collision box horizontal offset |
| [in] | box_height_offset | Collision box vertical offset |
| [in] | autobox_enabled | Whether automatic box updates are enabled |
| 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.
| [in] | gfx_scroller | Pointer to scroller object |
| [in] | scrollerInfo | Pointer to scroller metadata |
| [in] | paletteInfo | Pointer to palette information |
| [in] | x | Horizontal position in pixels |
| [in] | y | Vertical position in pixels |
| 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.
| [out] | gfx_animated_sprite | Pointer to GFX_Animated_Sprite structure to initialize |
| [in] | spriteInfo | Pointer to DATlib sprite information (must not be NULL) |
| [in] | paletteInfo | Pointer to DATlib palette information (must not be NULL) |
| 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.
Sets up a GFX_Picture structure for rendering static images on Neo Geo hardware. Automatically calculates pixel dimensions and prepares for display.
| [out] | gfx_picture | Pointer to GFX_Picture structure to initialize |
| [in] | pictureInfo | Pointer to DATlib picture information (must not be NULL) |
| [in] | paletteInfo | Pointer to DATlib palette information (must not be NULL) |
| 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_init_gpu | ( | ) |
| 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.
| void nc_init_system | ( | ) |
| 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 | ) |
| 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_up | ( | BYTE | id | ) |
| void nc_joypad_update | ( | BYTE | id | ) |
| void nc_log_bool | ( | BOOL | value | ) |
| void nc_log_box | ( | Box * | b | ) |
| void nc_log_byte | ( | BYTE | value | ) |
| void nc_log_dword | ( | DWORD | value | ) |
| 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.
| [in] | txt | Format string (printf-style) |
| [in] | ... | Variable arguments for format string |
| 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.
| [in] | txt | Format string (printf-style) |
| [in] | ... | Variable arguments for format string |
| void nc_log_int | ( | int | value | ) |
| void nc_log_next_line | ( | ) |
Move log cursor to next line.
Advances log cursor to beginning of next line, handles screen wrapping
| void nc_log_packed_color16 | ( | WORD | packed_color | ) |
| void nc_log_palette_info | ( | paletteInfo * | paletteInfo | ) |
| void nc_log_pictureInfo | ( | pictureInfo * | pi | ) |
| void nc_log_rgb16 | ( | RGB16 * | color | ) |
| void nc_log_short | ( | short | value | ) |
| void nc_log_spriteInfo | ( | spriteInfo * | si | ) |
| void nc_log_word | ( | WORD | value | ) |
| void nc_move_gfx_animated_sprite | ( | GFX_Animated_Sprite * | gfx_animated_sprite, |
| 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_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_scroller | ( | GFX_Scroller * | gfx_scroller, |
| short | x, | ||
| short | y | ||
| ) |
| void nc_packet_color16_to_rgb16 | ( | WORD | packed_color, |
| RGB16 * | rgb_color | ||
| ) |
| 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.
| [in] | paletteInfo | Pointer to palette information structure containing color data (must not be NULL) |
| [in] | palette_index | Target palette index where the palette will be loaded (0-15) |
| palette_index | Echo of the input palette_index parameter |
nc_fix_set_palette_id(nc_palette_set_info(&my_palette, 5)); | void nc_pause | ( | BOOL(*)() | exitFunc | ) |
| void nc_pause_cdda | ( | ) |
| void nc_play_cdda | ( | BYTE | track | ) |
| void nc_print | ( | int | x, |
| int | y, | ||
| char * | label | ||
| ) |
| void nc_push_remaining_frame_adpcm_player | ( | DWORD | frame | ) |
| void nc_read_palette_rgb16 | ( | BYTE | palette_number, |
| BYTE | palette_index, | ||
| RGB16 * | rgb_color | ||
| ) |
| void nc_reset | ( | ) |
| void nc_resize_box | ( | Box * | Box, |
| short | edge | ||
| ) |
| void nc_resume_cdda | ( | ) |
| DWORD nc_second_to_frame | ( | DWORD | second | ) |
| 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_set_joypad_edge_mode | ( | BOOL | actived | ) |
| void nc_set_position_gfx_animated_sprite | ( | GFX_Animated_Sprite * | gfx_animated_sprite, |
| 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_picture | ( | GFX_Picture * | gfx_picture, |
| short | x, | ||
| short | y | ||
| ) |
| void nc_set_position_gfx_picture_physic | ( | GFX_Picture_Physic * | gfx_picture_physic, |
| short | x, | ||
| short | y | ||
| ) |
| void nc_set_position_gfx_scroller | ( | GFX_Scroller * | gfx_scroller, |
| short | x, | ||
| short | y | ||
| ) |
| 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
| [in] | _x | Horizontal position (0-39 for 320px width) |
| [in] | _y | Vertical position (0-27 for 224px height) |
| 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_shrunk | ( | WORD | base_sprite, |
| WORD | max_width, | ||
| WORD | value | ||
| ) |
| void nc_shrunk_addr | ( | WORD | addr, |
| WORD | shrunk_value | ||
| ) |
| 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_centroid_gfx_picture | ( | GFX_Picture * | gfx_picture, |
| short | center_x, | ||
| short | center_y, | ||
| WORD | shrunk_value | ||
| ) |
| WORD nc_shrunk_forge | ( | BYTE | xc, |
| BYTE | yc | ||
| ) |
| WORD nc_shrunk_range | ( | WORD | addr_start, |
| WORD | addr_end, | ||
| WORD | shrunk_value | ||
| ) |
| char nc_sin | ( | WORD | index | ) |
| void nc_sleep | ( | DWORD | frame | ) |
| void nc_stop_adpcm | ( | ) |
| void nc_update | ( | ) |
| void nc_update_adpcm_player | ( | ) |
| 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_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.
| [in,out] | box | Pointer to Box structure to update (must not be NULL) |
| [in] | x | World X coordinate for box positioning |
| [in] | y | World Y coordinate for box positioning |
| void nc_update_joypad | ( | BYTE | id | ) |
| BOOL nc_vector_is_left | ( | short | x, |
| short | y, | ||
| short | v1x, | ||
| short | v1y, | ||
| short | v2x, | ||
| short | v2y | ||
| ) |
| DWORD nc_wait_vbl_max | ( | WORD | nb | ) |
| void nc_word_to_hex | ( | WORD | value, |
| char * | hexchar | ||
| ) |