Skip to content

ResistanceVault/neocore

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Neocore

Platform License: MIT GitHub last commit GitHub repo size NeoGeo-CD Uses Doxygen

๐ŸŽฏ Overview

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.

โœจ Key Features

  • ๐Ÿš€ 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

๐Ÿ”— Quick Links

โš ๏ธ Current Version: This version includes breaking changes. Please check the migration guide before updating your existing projects.

๐Ÿ“š Table of Contents


Requirements


๐Ÿ“… Roadmap

๐ŸŸก Soon

  • Custom HUD / Fix layer
    • Upgrade to Neocore v3 with DATlib 0.3
  • AES / MVS support (5% completed)

๐Ÿ•“ Later

  • RGB palette handlers (60% completed)
    • Samples: pal_backdrop, pal_rgb, pal_rgb_mixer
  • Joypad 2 support
  • Improve sound FX management
  • Palette bank switcher
  • DRAM asset management (unload/load from CD-ROM)

๐Ÿง Maybe

  • XML WYSIWYG editor
  • Memory card support
  • CLI-based asset packager
  • GCC upgrade to version > 2.95.2
  • Raine version selection
  • MAME version selection

๐Ÿš€ Quick Start

โšก Installation

1. Clone the repository

git clone https://github.com/David-Vandensteen/neocore.git
cd neocore

2. Test the installation

cd samples\hello
.\mak.bat sprite
.\mak.bat
.\mak.bat run:mame

3. Create your first project

cd <neocore>\bootstrap\scripts\project
.\create.bat -name MyGame -projectPath C:\temp\MyGame
cd C:\temp\MyGame\src
.\mak.bat sprite
.\mak.bat
.\mak.bat run:mame

๐ŸŽ‰ Congratulations! You've created and launched your first Neo Geo CD project.

๐Ÿ’ก Next Steps: See Project Management section for detailed project creation options and workflows.


โš™๏ธ Command Reference

๐Ÿ”จ Mak Rules

โš ๏ธ 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.

Command Description
.\mak.bat Build the program
.\mak.bat clean Remove built resources
.\mak.bat clean:build Remove the entire build folder
.\mak.bat sprite Build sprites
.\mak.bat run:raine Run with Raine emulator
.\mak.bat run:mame Run with MAME emulator
.\mak.bat serve:mame Run in hot reload mode
.\mak.bat dist:iso Create ISO distribution package
.\mak.bat dist:mame Create MAME distribution package
.\mak.bat dist:exe Create Windows standalone executable
.\mak.bat framer Launch DATlib Framer
.\mak.bat animator Launch DATlib Animator
.\mak.bat lib Compile Neocore library
.\mak.bat --version Display version information

๐ŸŽฎ Custom Emulator Profiles

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
.\mak.bat run:raine:full     # Fullscreen

๐Ÿ”ง Development Workflow

Build Steps (v3.0.0+)

Starting with version 3.0.0, build steps are now explicit and must be executed manually for better control and performance optimization:

Development Workflows

# 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!

Build Step Breakdown

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

Performance Benefits

  • ๐Ÿš€ 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:raine or mak run:mame automatically executed all build steps.
This workflow change provides better performance for iterative development.


๐Ÿ“ฆ Project Management

๐Ÿ†• Create a New Project

cd <neocore>\bootstrap\scripts\project
.\create.bat -name MyGame -projectPath C:\temp\MyGame

Available options:

  • -force: Overwrite existing files
  • -name: Project name
  • -projectPath: Destination path

๐Ÿ†™ Upgrade an Existing Project

โš ๏ธ Important: Backup your project before upgrading. Check the migration guide for breaking changes.

# 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\neocore

The upgrade script performs comprehensive validation and updates:

Automatic validation:

  • ๐Ÿ“‹ Verifies project structure and required files (including Makefile)
  • ๐Ÿ” Analyzes C code for breaking changes and deprecated patterns
  • ๏ฟฝ๏ธ Removes deprecated files (common_crt0_cd.s, crt0_cd.s)
  • ๏ฟฝ๐Ÿ’พ Creates automatic backup before making changes
  • ๐Ÿ“ Generates detailed migration logs

What gets updated:

  • โœ… Neocore toolchain and C library
  • โœ… Build scripts (mak.bat and mak.ps1)
  • โœ… Project structure validation
  • โœ… Deprecated file cleanup (automatic removal)
  • โœ… XML project definition
  • โŒ Your source code (manual migration needed - see logs for guidance)
  • โŒ Project assets

๐Ÿ’ก Tip: The script generates detailed logs showing breaking changes found in your code. Review these logs to understand what manual changes may be needed.

๐Ÿ”’ Security Note: Migration logs may contain absolute paths from your system. Review generated logs before sharing them publicly and consider adding *.log to your .gitignore if needed.

๐Ÿ“ค Release a Project

From 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

๐Ÿ“– Documentation & Resources

๐Ÿ“š C API Documentation

๐ŸŽจ DATlib Assets

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 Animator

๐ŸŽต Audio Configuration

CDDA (CD Digital Audio) Configuration

For Neo Geo CD projects, you can configure CDDA tracks in your project.xml:

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>

Key points:

  • Track ID 1 is reserved for the binary program
  • Use WAV files for source audio (high quality)
  • Distribution format (MP3) optimizes ISO size
  • Pregap of 00:02:00 is standard for CD audio
  • Mixed source formats supported (WAV, MP3)

Audio file organization:

assets/
โ””โ”€โ”€ sounds/
    โ””โ”€โ”€ cdda/
        โ”œโ”€โ”€ track02.wav
        โ”œโ”€โ”€ track03.wav
        โ””โ”€โ”€ track04.mp3

๐Ÿค Contribution

๐ŸŽฏ How to Contribute

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.

๐Ÿ’ฐ Make a PayPal donation

โš ๏ธ Disclaimers

  • 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! ๐Ÿ™


๐ŸŽฎ Game Examples & Showcases


๐Ÿ› ๏ธ Advanced Development

โ™ป๏ธ Hot Reload

Hot reload allows you to automatically recompile and restart your project when making changes:

cd <neocore>\samples\hello
.\mak.bat serve:mame
  1. The emulator launches
  2. Edit main.c
  3. Save the file
  4. 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)

๐Ÿ”ง Compile Library

Necessary if you modify Neocore source code:

.\mak.bat clean
.\mak.bat lib

๐ŸŒฟ Branches & Versions

โš ๏ธ Important: Remove the .\neocore\build folder before compiling after a branch change to avoid cache conflicts.

.\mak.bat clean:build

๐Ÿ“š Dependencies

  • NeoDev
  • DATlib
  • DATimage
  • NGFX SoundBuilder
  • Raine
  • Mame
  • CHDMAN
  • Doxygen
  • MSYS2
  • Mkisofs
  • GCC
  • mpg123
  • ffmpeg
  • NSIS

๐Ÿ“ Changelog

Complete version history and changes documentation.


๐Ÿ“„ License

Neocore is licensed under the MIT license. Copyright 2019 by David Vandensteen. Some graphics by Grass.

About

Library & toolchain for Neo Geo CD develop. with C language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 57.2%
  • C 33.1%
  • Linker Script 5.1%
  • Assembly 2.9%
  • Batchfile 0.9%
  • Makefile 0.7%
  • NSIS 0.1%