NeoCore is a library and toolchain for developing on Neo Geo CD.
It provides high-level functions over Neo Dev Kit and DATlib 0.3, and includes tools and code that can help with projects on this platform.
- ๐ High abstraction level for Neo Geo CD development
- ๐ง Toolchain with PowerShell scripts
- ๐ฎ Compatible with Windows 11
- ๐ Documentation generated with Doxygen
- ๐ Hot reload for rapid development
- ๐ฌ Discord
- ๐ Report a Bug
- ๐ก Request a Feature
- ๐ Migration from previous versions
- ๐ API Documentation
- ๐ Changelog
โ ๏ธ Upgrading from v2.x? This version includes breaking changes. Please check the migration guide before upgrading from NeoCore 2.x to 3.x.
- ๐ฏ Overview
- ๐ Requirements
- ๐ Roadmap
- ๐ Quick Start
- โ๏ธ Command Reference
- ๐ง Development Workflow
- ๐ฆ Project Management
- ๐ Documentation & Resources
- ๐ Profiling
- ๐ต Audio Configuration
- ๐ ๏ธ Advanced Development
- ๐ค Contribution
- ๐ Dependencies
- Up to date Windows 11
- Git https://git-scm.com/download/win
- Windows Terminal with cmd instance (shortcut win + r and type
wt cmd)
- โ neocore version switcher script for standalone projects
- โ One-liner command for project creation
- โ Mak lint command for project validation
- โ
Integrate city41/mameNeoGeoDevPlugin (use
\.\mak.bat run:mame:debugto enable it)- โ Fork and tweak for NeoCore - neocore-mameNeoGeoDevPlugin
- โ Add Windows compatibility
- โ Add Neo-Geo CD MAME compatibility
- โ Upgrade MAME for plugin API compatibility
- โ Upgrade Raine emulator to 0.97.5
- โ Fix issue 211: Incorrect CUE file paths when generating ISO with MP3 CDDA tracks (mak dist:iso)
- โ
DATlib JobMeter
- โ Sample demo: job_meter
- โ
Automatic generation of a structure aggregating a pointer to sprite data in ROM
and a pointer to palette information in ROM during sprite compilation
- ๐ Runtime palette creation: instantiate sprites with palettes built in RAM (may be delayed after NeoCore 4)
- ๐ NeoCore 4
- Remove deprecated functions, macros and structures since NeoCore 3.1.1
- Refactor nc_gfx* functions
- ๐ AES / MVS support (5% completed)
- โ Externalized CDDA functions (completed in v3.4.4)
- โ
Added auto-generated
out/platform.hto define the platform type (CD or Cartridge) (completed in v3.4.4) - ๐ Lib CD Makefile
- ๐ Lib Cartridge Makefile
- ๐ Generate hash and rom file for Mame
- ๐ Add basic modular C lib system for reusable functions and assets
- ๐ RGB palette handlers (60% completed)
- Samples:
pal_backdrop,pal_rgb,pal_rgb_mixer
- Samples:
- ๐ Joypad 2 support
- ๐ Improve sound FX management
- Evaluate Mezz-Estate-NeoGeo-Audio-Driver
- ๐ Palette bank switcher
- ๐ DRAM asset management (unload/load from CD-ROM)
- ๐ญ Split project.xml to separate user parameters from toolchain parameters
- ๐ญ Video recording support (MAME MNG format with manual ffmpeg conversion to MP4)
- ๐ญ XML WYSIWYG editor
- ๐ญ Memory card support
- ๐ญ CLI-based asset packager
- ๐ญ Split project.xml to separate user parameters from toolchain parameters
- ๐ญ GCC upgrade to version > 2.95.2
- Evaluate DATlib โ libNG (TheHpman/libNG)
- ๐ญ Raine version selection
- ๐ญ MAME version selection
If you want to create your own NeoGeo CD game or app, you do NOT need to clone this repository.
๐ Just use the one-liner below to initialize your project. This will always fetch the latest stable version and set up everything for you automatically.
You only need to clone this repository if you want to:
- Explore or run the included samples and demos
- Contribute to the NeoCore toolchain or C library
- Develop, debug, or customize the NeoCore internals
For 99% of new projects, the one-liner is all you need!
2๏ธโฃ Create Your Project
๐ก No need to clone or download NeoCore - the script does everything for you!
โ ๏ธ Avoid spaces in paths (useC:\MyGamenotC:\My Game)
md C:\MyGame && cd C:\MyGamecurl -L https://raw.githubusercontent.com/David-Vandensteen/neocore/master/bootstrap/scripts/project/create_from_oneliner.bat -o c.bat && c.bat && del c.batcd src.\mak.bat sprite && .\mak.bat && .\mak.bat run:mame3๏ธโฃ Next Steps
- ๐ Important: Review C89 Compliance rules before coding
- ๐ See Command Reference for all build commands
- ๐ฎ Explore Custom Emulator Profiles for testing
- ๐๏ธ Read Project Management for advanced project setup
โ ๏ธ Warning: The mak script overrides the PATH environment variable during compilation. If you encounter any problems after using it, simply close and restart a new command terminal.
Building:
| Command | Description |
|---|---|
.\mak.bat sprite |
Build sprites from assets |
.\mak.bat |
Compile C code and link |
.\mak.bat lib |
Compile NeoCore library |
.\mak.bat clean |
Remove built resources |
.\mak.bat clean:build |
Remove entire build folder |
Testing:
| Command | Description |
|---|---|
.\mak.bat run:raine |
Run with Raine emulator |
.\mak.bat run:mame |
Run with MAME emulator |
.\mak.bat run:mame:debug |
Run with MAME in debug mode (ngdev plugin) |
.\mak.bat serve:mame |
Run in hot reload mode |
| Command | Description |
|---|---|
.\mak.bat lint |
Validate project (project.xml, .gitignore, legacy code) |
.\mak.bat framer |
Launch DATlib Framer |
.\mak.bat animator |
Launch DATlib Animator |
| Command | Description |
|---|---|
.\mak.bat dist:iso |
Create ISO distribution package |
.\mak.bat dist:mame |
Create MAME distribution package |
.\mak.bat dist:exe |
Create Windows standalone executable |
| Command | Description |
|---|---|
.\mak.bat --version |
Display version information |
You can create custom emulator profiles for different testing scenarios.
NeoCore comes with default profiles (default, full, nosound, debug for MAME), but you can add your own.
Creating Custom MAME Profiles:
Add custom profiles to your project.xml:
<project>
<emulator>
<mame>
<profile>
<!-- Default profiles are already included -->
<myprofile>-window -skip_gameinfo -throttle neocdz</myprofile>
<benchmark>-window -skip_gameinfo -nothrottle -bench 60 neocdz</benchmark>
<record>-window -skip_gameinfo -aviwrite output.avi neocdz</record>
</profile>
</mame>
</emulator>
</project>Creating Custom Raine Configurations:
Create custom config files in your project and reference them:
<project>
<emulator>
<raine>
<config>
<!-- Default configs are already included -->
<myconfig>raine\config\myconfig.cfg</myconfig>
<test>raine\config\test.cfg</test>
</config>
</raine>
</emulator>
</project>Usage:
# Use your custom MAME profiles
.\mak.bat run:mame:myprofile
.\mak.bat run:mame:benchmark
.\mak.bat run:mame:record
# Use your custom Raine configs
.\mak.bat run:raine:myconfig
.\mak.bat run:raine:test
# Default profiles (included with NeoCore)
.\.mak.bat run:mame:full # Fullscreen
.\mak.bat run:mame:debug # Debug mode with ngdev plugin
.\mak.bat run:raine:full # FullscreenThe debug profile provides enhanced Neo Geo CD debugging capabilities:
.\mak.bat run:mame:debugPlugin Information:
- Automatically installed
- Based on city41/mameNeoGeoDevPlugin
- Forked and enhanced for NeoCore: neocore-mameNeoGeoDevPlugin
- Profile is automatically maintained by NeoCore
โ ๏ธ CRITICAL: This project usesgcc-2.95.2and requires strict C89 (ANSI C) compliance.
Key Rules:
- Declare all variables at the beginning of blocks
- Declare loop variables outside loops
- No mixed declarations and code
๐ Click for C89 compliance examples
1. All variables must be declared at the beginning of blocks:
/* โ
CORRECT */
int function(void) {
int i;
char* buffer;
i = 0;
buffer = NULL;
/* code here */
}
/* โ WRONG - will not compile */
int function(void) {
int i = 0;
doSomething();
char* buffer = NULL; /* ERROR: declaration after statement */
}2. Loop variables must be declared outside loops:
/* โ
CORRECT */
int i;
for (i = 0; i < 10; i++) {
/* code */
}
/* โ WRONG */
for (int i = 0; i < 10; i++) { /* ERROR: C99+ feature */
/* code */
}3. No inline variable initialization in declarations (unless constant):
/* โ
CORRECT */
int x;
x = getValue();
/* โ WRONG (unless getValue() is a constant) */
int x = getValue();Starting with version 3.0.0, build steps are now explicit and must be executed manually for better control and performance optimization:
# Initial development (build everything)
.\mak.bat sprite && .\mak.bat && .\mak.bat run:raine
# Code-only modifications (sprites unchanged)
.\mak.bat && .\mak.bat run:raine # โก Faster!
# Quick test without recompilation
.\mak.bat run:raine # ๐ Instant!| Step | Command | Purpose | When to use |
|---|---|---|---|
| 1. Sprites | .\mak.bat sprite |
Generate sprite data from assets | When assets change |
| 2. Compile | .\mak.bat |
Compile C code and link | When code changes |
| 3. Run | .\mak.bat run:raine |
Launch in emulator | Always for testing |
- ๐ Faster iteration: Skip sprite generation when only code changes
- ๐พ Cache optimization: Leverage build cache for unchanged components
- ๐ฏ Granular control: Build only what you need
- โฑ๏ธ Reduced build time: Avoid unnecessary regeneration
Migration Note: In versions before 3.0.0,
mak run:raineormak run:mameautomatically executed all build steps.
This workflow change provides better performance for iterative development.
โ ๏ธ Important: Backup your project before upgrading. Check the migration guide for breaking changes.
The version switcher provides a simple way to upgrade or switch between NeoCore versions:
# From your project root directory
cd C:\temp\MyGame
# Upgrade to latest stable version
.\neocore-version-switcher.bat master
# Or switch to a specific version
.\neocore-version-switcher.bat 3.2.0
# List all available versions
.\neocore-version-switcher.bat --list# 1. Remove build folder
rd /S /Q C:\temp\MyGame\build
# 2. Run upgrade script
cd <neocore>\bootstrap\scripts\project
.\upgrade.bat -projectSrcPath C:\temp\MyGame\src -projectNeocorePath C:\temp\MyGame\neocoreFrom your project's src folder:
# ISO distribution
.\mak.bat dist:iso
# MAME distribution
.\mak.bat dist:mame
# Windows standalone executable (game + emulator)
.\mak.bat dist:exe- Doxygen Documentation
- Migration Guide - Breaking changes and migration from previous versions
- Changelog - Version history
DATlib Documentation:
Configuration in project.xml:
<project>
<gfx>
<DAT>
<chardata>
<!-- DATlib configuration -->
</chardata>
<fixdata>
<!-- DATlib fixdata configuration -->
</fixdata>
</DAT>
</gfx>
</project>DATlib Tools:
.\mak.bat framer # Launch DATlib Framer
.\mak.bat animator # Launch DATlib AnimatorThe Job Meter is a visual profiling tool from DATlib that helps developers understand CPU time distribution across different parts of their game loop. It displays a color-coded vertical bar on the right side of the screen, showing which operations are consuming frame time.
Key Features:
- ๐จ Color-coded profiling: Each color represents a different operation
- ๐ Real-time visualization: See CPU usage live as your game runs
- ๐ฏ Performance optimization: Identify bottlenecks quickly
Quick Start:
#include <neocore.h>
/* Initialize job meter after sprite setup */
jobMeterSetup(true);
while(1) {
/* Mark input handling section */
jobMeterColor(JOB_CYAN);
nc_gpu_update();
/* Your input handling code */
/* Mark scrolling section */
jobMeterColor(JOB_YELLOW);
/* Your scrolling code */
/* Mark animation section */
jobMeterColor(JOB_BLUE);
/* Your animation code */
/* Free CPU time */
jobMeterColor(JOB_GREEN);
}Important Notes:
jobMeterSetup() must be called AFTER sprite and graphics initialization, not as the first function.
Complete Example:
Check the job_meter sample for a fully interactive demonstration with:
- Real-time CPU load adjustment
- Multiple profiling sections
- Visual feedback and color reference
- Configurable artificial overhead
Learning Resources:
- ๐ Job Meter Sample - Complete interactive example
- ๐ DATlib Reference (PDF) - Full DATlib documentation
Quick Facts:
- Track ID 1 is reserved for the binary program
- Use WAV files for source audio (automatic MP3 conversion for distribution)
- Mixed source formats supported (WAV, MP3)
๐ Click for complete CDDA configuration example
Configuration structure:
<project>
<sound>
<cd>
<cdda>
<dist>
<iso>
<format>mp3</format> <!-- Distribution format -->
</iso>
</dist>
<tracks>
<track><!-- track id 1 is reserved for the binary program -->
<id>2</id>
<file>assets\sounds\cdda\track02.wav</file>
<pregap>00:02:00</pregap>
</track>
<!-- Add more tracks as needed -->
</tracks>
</cdda>
</cd>
</sound>
</project>Audio file organization:
assets/
โโโ sounds/
โโโ cdda/
โโโ track02.wav
โโโ track03.wav
โโโ track04.mp3
Notes:
- Pregap of
00:02:00is standard for CD audio - Distribution format (MP3) optimizes ISO size
Developers:
- ๐ Create tutorials or code examples
- ๐ Report and fix bugs
- ๐ก Propose new features
- ๐ Improve documentation
Neo-Geo CD Owners:
- ๐งช Test examples on real hardware
- ๐ Report hardware compatibility issues
- โ Confirm functionality on real hardware
Financial Support: To improve hardware compatibility and project development, any financial contribution is appreciated.
- This project is under active development
- Mainly tested on Raine and MAME emulators
- No guarantee of functionality on real Neo-Geo hardware
- The author is not responsible for any software damage
Any help is welcome! ๐
- Pong: https://github.com/David-Vandensteen/neogeo-cd-pong
- Flamble:
Hot reload allows you to automatically recompile and restart your project when making changes:
cd <neocore>\samples\hello
.\mak.bat serve:mame- The emulator launches
- Edit
main.c - Save the file
- The project recompiles and restarts automatically
Current limitations:
โ ๏ธ Not a real watcher (triggers only when folder size changes)โ ๏ธ PATH is not restored when interrupted (close/reopen terminal)
Necessary if you modify NeoCore source code:
.\mak.bat clean
.\mak.bat lib
โ ๏ธ Important: Remove the.\neocore\buildfolder before compiling after a branch change to avoid cache conflicts.
.\mak.bat clean:build- GCC - C compiler (version 2.95.2 for C89 compliance)
- MSYS2 - Unix-like environment for Windows
- Git - Version control (required for installation)
- NeoDev - Neo Geo CD development toolkit
- DATlib - Data library for Neo Geo assets
- DATimage - Image processing for Neo Geo graphics
- NGFX SoundBuilder - Audio tool for Neo Geo sound effects
- Raine - Neo Geo CD emulator
- MAME - Multi-platform emulator (version 0.251)
- city41/mameNeoGeoDevPlugin - Enhanced MAME debugging (ngdev fork)
- Mkisofs - ISO image creation
- NSIS - Windows installer creation
- mpg123 - MP3 decoder
- ffmpeg - Audio/video conversion
- Doxygen - API documentation generation
๐ Changelog
Complete version history and changes documentation.
NeoCore is licensed under the MIT license. Copyright 2019 by David Vandensteen. Some graphics by Grass.





