Giter Site home page Giter Site logo

dciabrin / ngdevkit Goto Github PK

View Code? Open in Web Editor NEW
258.0 21.0 27.0 372 KB

Open source development for Neo-Geo

License: GNU Lesser General Public License v3.0

Makefile 5.07% C 21.68% Python 29.65% Assembly 39.51% M4 2.57% Shell 1.52%
devkit neogeo neo-geo 16bit m68k homebrew z80

ngdevkit's Introduction

ngdevkit, open source development for Neo-Geo

Platform License: LGPL v3 Fedora Ubuntu Homebrew MSYS2

Overview

ngdevkit is a C software development kit for the Neo-Geo AES or MVS hardware. It includes:

  • A toolchain for cross compiling to m68k, based on GCC 11.4 and newlib 4.0 for the C standard library.

  • C headers for accessing the hardware. The headers follow the naming convention found at the NeoGeo Development Wiki.

  • Helpers for declaring ROM information (name, DIP, interrupt handlers...)

  • A C and ASM cross-compiler for the z80 (SDCC 4.2), for developing your music and sound driver.

  • An open source replacement BIOS for testing your ROMs under you favorite emulator.

  • Tools for managing graphics for fix and sprite ROM.

  • Support for source-level debugging with GDB!

  • A modified version of the emulator GnGeo, with support for libretro's GLSL shaders and remote debugging!

  • A simple scanline pixel shader for a nice retro look!

How to use the devkit

Installing pre-built binary packages

There are nightly packages available for Linux, macOS and Windows, so you get the most up-to-date devkit without recompiling the entire toolchain any time there is an update in git.

Linux

If you are running an Ubuntu or Debian distribution, you can install pre-built debian packages from the ngdevkit PPA, as well as a couple of dependencies for the examples ROMs:

add-apt-repository -y ppa:dciabrin/ngdevkit
apt-get update
apt-get install ngdevkit ngdevkit-gngeo
# the remaining packages are only requred for the examples
apt-get install pkg-config autoconf zip imagemagick sox libsox-fmt-mp3

If you are running a Fedora distribution, pre-built packages are available in COPR, and can be installed with the following commands:

dnf copr enable dciabrin/ngdevkit
dnf install ngdevkit ngdevkit-gngeo
# the remaining packages are only requred for the examples
dnf install install pkg-config autoconf zip ImageMagick sox

macOS

If you are running on macOS, you can install brew packages, available in the ngdevkit tap:

# If you haven't done it yet, make sure XCode is installed first
sudo xcode-select --install
# If needed, init brew and its environment variables
eval $(/opt/homebrew/bin/brew shellenv)
# install ngdevkit
brew tap dciabrin/ngdevkit
brew install ngdevkit ngdevkit-gngeo
# make sure you use brew's python3 in your shell
export PATH=$HOMEBREW_PREFIX/opt/python3/bin:$PATH
pip3 install pygame
# the remaining packages are only required for the examples
brew install pkg-config autoconf automake zip imagemagick sox

Some macOS versions are not currently pre-built (macOS 11 Intel and M1), as our CI provider doesn't currently offer free hosted agents yet, so it might take some time to install the packages.

Windows

You can run ngdevkit natively on Windows, via the MSYS2 environment. Pre-built ngdevkit packages are available for the ucrt64 subsystem of MSYS2. To use them, start a MSYS2 shell for ucrt64, and configure the pacman repository as follows:

MSYSTEM=UCRT64 /usr/bin/bash -l
echo -e "\n[ngdevkit]\nSigLevel = Optional TrustAll\nServer = https://dciabrin.net/msys2-ngdevkit/\$arch" >> /etc/pacman.conf

# install pacboy with `pacman -S pactoys` if necessary
pacboy -Sy
pacboy -S ngdevkit:u ngdevkit-gngeo:u
# the remaining packages are only required for the examples
pacboy -S autoconf automake make zip imagemagick:u sox:u

An old version of ngdevkit supported Windows 10 via WSL, but it is now deprecated in favour of the native MSYS2 environment. Likewise, we no longer build nightly packages for MSYS2's mingw64 subsystem, ucrt64 is the only supported subsystem for ngdevkit.

Build the included examples

The devkit comes with a series of examples to demonstrate how to use the compiler and tools. Once ngdevkit packages are installed, you can clone the ngdevkit-examples repository:

git clone --recursive https://github.com/dciabrin/ngdevkit-examples examples

And build all the examples with the following commands if you are running on Linux or Windows/MSYS2:

cd examples
autoreconf -iv
./configure
make

For macOS, make sure you use brew's python3 and gmake:

cd examples
export PATH=$HOMEBREW_PREFIX/opt/python3/bin:$PATH
autoreconf -iv
./configure
gmake

Running the emulator

Once you have built the examples, go into a subdirectory to test the compiled example and run GnGeo from the makefile:

cd examples/01-helloworld
make gngeo
# or run "make gngeo-fullscreen" for a more immersive test

If you are running a recent macOS, System Integrity Protection may prevent you from running GnGeo from gmake, so you may need to run it from your terminal:

eval $(gmake -n gngeo)

Debugging your programs

The devkit uses a modified version of GnGeo which supports remote debugging via GDB. In order to use that feature on the example ROM, you first need to start the emulator in debugger mode:

cd examples/01-helloworld
# example ROM is named puzzledp
ngdevkit-gngeo -i rom puzzledp -D

With argument -D, the emulator waits for a connection from a GDB client on port 2159 of localhost.

Then, run GDB with the original ELF file as a target instead of the final ROM file:

cd examples/01-helloworld
m68k-neogeo-elf-gdb rom.elf

The ELF file contains all the necessary data for the debugger, including functions, variables and source-level line information.

Once GDB is started, connect to the emulator to start the the debugging session. For example:

(gdb) target remote :2159
Remote debugging using :2159
0x00c04300 in ?? ()
(gdb) b main.c:52
Breakpoint 1 at 0x57a: file main.c, line 52.
(gdb) c

Building the devkit from sources

If you want to build from source, this repository is the main entry point: it provides the necessary tools, headers, link scripts and open source BIOS to build your homebrew roms. The rest of the devkit is split into separate git repositories that are automatically cloned at build time:

  • ngdevkit-toolchain provides the GNU toolchain, newlib, SDCC and GDB.

  • gngeo and emudbg provide a custom GnGeo with support for GLSL shaders and remote gdb debugging.

  • ngdevkit-examples shows how to use the devkit and how to program the Neo Geo hardware. It comes with a GnGeo configuration to run your roms with a "CRT scanline" pixel shader.

There are dedicated instructions to build ngdevkit for Linux, macOS or Windows.

History

This work started a long time ago (2002!) and was originally called neogeodev on sourceforge.net. Since then, a community has emerged at NeoGeo Development Wiki, and it is a real treasure trove for Neo-Geo development. Coincidentally, they are hosted at neogeodev.org, so I decided to revive my original project on github as ngdevkit :P

Acknowledgments

Thanks to Charles Doty for his Chaos demo, this is how I learned about booting the console, and fiddling with sprites!

Thanks to Mathieu Peponas for GnGeo and its effective integrated debugger. Thanks to the contributors of the mame project for such a great emulator.

A big thank you goes to Furrtek, ElBarto, Razoola...and all the NeoGeo Development Wiki at large. It is an amazing collection of information, with tons of hardware details and links to other Neo-Geo homebrew productions!

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

ngdevkit's People

Contributors

dciabrin avatar khelkun avatar kscl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngdevkit's Issues

make fails due to version of libisl (debian)

On fresh install of Debian

Make sure you apt-get install zip before continuing

build process fails on apt-get install libisl-0.18-dev || true
Library doesn't exist since newest version is .20

Temp solution to get around this

sudo dpkg -r libisl-dev
sudo dpkg -i --force-depends libisl-0.18-dev_0.18-4_amd64.deb

you'll need to find the .deb version and download it. It will install, but will complain about a dependency, which doesn't seem to cause a problem.

I'm afraid if I resolve the depends, it will try to upgrade libisl or something.

run make clean
make

devkit should make it all the way through.
go into examples and run make and you will get your roms.

If you do not install zip package before removing the old libisl, apt-get will complain about the missing depends

Problems with tiles rom on real hardware

Hi.

I try to run some demos on the real Neo Geo hardware.

I use the NeoSD :
The NeoSD

Whereas the fixed layer works well, the display for sprites has a problem. For example, the logo in the Sprite demo doesn't show:
Video of Sprite Demo

Trying with with some demos I built (with map of 10000+ tiles), I started to see sprites on screen, but all is messy. I could guess from the results on screen that the tiles in the C-ROM don't start at the expected index.

You can compare:
Video of my demo on MAME

Video of my demo on Neo Geo

In your demo code you add this:
/// First tile for the sprite in the ROM #define START_TILE 60

Is it related to our problem ? Why the 60 value ? On real hardware this value should be higher, but why ?

more examples!! ;-)

Hey! looks like a super cool project to get our hands on neo-geo using C language! :)

Adding few more examples about sprites, backgrounds, sound, synchro etc in 'C' would be welcome!!

What about some cygwin intructions for sdk installation for windows users? ;-)

Keep on the good work!

Size image in 02-sprite example

Hi.

I am playing with 02-sprite example and I couldn't figure out why your C code assumes logo.png is made of 16x4 tiles for the Neo Geo hardware whereas the size of the image is 240x64px.

Indeed tiles are 16x16px, so 240x64px should rather give 15x4 tiles in hardware. Why not ?

Installing on Ubuntu 18.04, can't find <isl/band.h> [SOLVED]

Adding this here in case anyone else hits this.

On Ubuntu 18.04 I hit "no such file or directory" for <isl/band.h>

Easily solved with apt install libisl-0.18-dev

Don't forget to uncomment the deb-src repos in /etc/apt/sources.list as documented in the mingw/wsl README here in the repo.

Issue with checksum in Mame

After compiling the 01-helloworld example, I try to run the rom in Mame but it doesn't work, always leading to checksum issues. I tried few simple set-up:

Set-up n1:
Mame32 0.65
1 rom :

  • puzzlebobble found on the internet

bios :

  • some bios found on the internet

Result :

  • puzzlebobble works fine

Set-up n2:
Mame32 0.65 (same as set-up n1)
2 roms :

  • puzzlebobble, found on the internet (same as set-up n1)
  • puzzledp, result of 01-helloworld example compilation

bios :

  • some bios found on the internet (same as set-up n1)

Results :

  • puzzlebobble works fine
  • puzzledp doesn't pass the audit of Mame and couldn't be run: INCORRECT CHECKSUM

Set-up n3:
Mame32 0.65 (same as set-up n1)
2 roms :

  • puzzlebobble, found on the internet (same as set-up n1)
  • puzzledp, result of 01-helloworld example compilation (same as set-up n2)

bios :

  • the compiled nullbios

Results : both puzzlebobble and puzzledp leads to INCORRECT CHECKSUM errors

Did I miss something ?

ngdevkit installation under WSL : recipe for target 'graphite.o' failed

Hello,

First of all, nice piece of work for WSL support which now makes ngdevkit available for Windows users ;-)
(for the moment i'm using Neodev but i really would like to switch to ngdevkit!)

While building the toolchain there are errors concerning 'graphite' ->
graphite-error

More generally speaking now, what will be your advice concerning an active neogeo dev forum ?
It will be nice to get in touch with some active coders to share knowledge and other stuff..
Maybe it would be a nice idea to set up one ?

run example : pygame.error: File is not a Windows BMP file

MAC mojave 10.14
I follow the tutorial,
I downloaded nightly-202101221736.zip
autoreconf -iv
./configure --prefix=$PWD/local
make or gmake,I both tried...
afer half an hour,everthing seems finished,
make install
cd examples
./configure
make or gmake,I both tried...
error report:
pygame.error: File is not a Windows BMP file

:( I'm a rookie. I'm ##stuck......

bogon:examples fanta$ gmake
for i in 01-helloworld 02-sprite 03-sprite-animation 04-palette 05-scrolling 06-sound-adpcma 07-attract-and-game 08-software-dips 09-horizontal-sync; do gmake -C $i cart nullbios || exit 1; done
gmake[1]: Entering directory '/Users/fanta/Downloads/ngdevkit-nightly-202101221736/examples/01-helloworld'
gmake -C ../assets
gmake[2]: Entering directory '/Users/fanta/Downloads/ngdevkit-nightly-202101221736/examples/assets'
./build-srom.py -s smalltext-shadow.png -t talltext-shadow.png -b talltext.png -o srom-shadow.bmp
Traceback (most recent call last):
File "/Users/fanta/Downloads/ngdevkit-nightly-202101221736/examples/assets/./build-srom.py", line 108, in
main()
File "/Users/fanta/Downloads/ngdevkit-nightly-202101221736/examples/assets/./build-srom.py", line 81, in main
smalltxt = pygame.image.load(arguments.small)
pygame.error: File is not a Windows BMP file
gmake[2]: *** [Makefile:37: srom-shadow.bmp] Error 1
gmake[2]: Leaving directory '/Users/fanta/Downloads/ngdevkit-nightly-202101221736/examples/assets'
gmake[1]: *** [Makefile:30: ../assets/rom/c1.bin] Error 2
gmake[1]: Leaving directory '/Users/fanta/Downloads/ngdevkit-nightly-202101221736/examples/01-helloworld'
gmake: *** [Makefile:31: all] Error 1
bogon:examples fanta$

Help me with this error please!

Hey, so i am trying to install ngdevkit on ubuntu and i am getting a error that is not letting me install the examples for ngdevkit. It says "No Package ngdevkit Found" or something like that so can you help me please!

Pin OUT controlers

Hi.

I was looking on this documentation about the Mahjong controler:
Mahjong controler

It gives ideas about prototyping a multitap for the Neo Geo.

Multiplexing uses the pins OUT of the controler port. Is it possible to play with the pins OUT from NGDevkit code ?

Add continuous deployment to Launchpad PPA

Now that Travis CI has been enabled for all ngdevkit git repositories, it would be nice to have deb packages rebuilt automatically on every commit or pull request merged on master.

Failing to swap bytes of p1 file: "cannot reverse bytes: length of section .padding must be evenly divisible by 2"

I have been working on a game using this dev kit for a while now. I am now getting this error

/home/matt/dev/ngdevkit/local/bin/m68k-neogeo-elf-objcopy: cannot reverse bytes: length of section .padding must be evenly divisible by 2
Makefile:61: recipe for target 'prom' failed

When I dump the rom.elf file, sure enough the .padding section has an odd number of bytes

Contents of section .padding:
 0468f ffffffff ffffffff ffffffff ffffffff  ................
 0469f ffffffff ffffffff ffffffff ffffffff  ................
 046af ffffffff ffffffff ffffffff ffffffff  ................

... many bytes skipped ...

 7ffdf ffffffff ffffffff ffffffff ffffffff  ................
 7ffef ffffffff ffffffff ffffffff ffffffff  ................
 7ffff ff                                   .               
Contents of section .comment:
 0000 4743433a 2028474e 55292035 2e352e30  GCC: (GNU) 5.5.0
 0010 00                                   .               
Contents of section .debug_info:
 0000 000000ad 00040000 00000401 00000045  ...............E

I have found telling objcopy to strip the padding section seems to get past this and work on gngeo. But it completely does not work at all on NeoSD. I also encounter some bugs in gngeo which feel like might be due to not having .padding in the rom.

This is totally blocking me, so I'm researching and experimenting to try and find a fix. Figured I'd post here too in case anyone else has hit this.

I also tried swapping the bytes using tools that aren't elf aware, they just swap all bytes in the file. That has not gone well :)

Remove sprites/tiles from screen

Hi.

If we consider the 02-sprite example, how could I remove properly a sprite from screen ? Same question for removing a single tile belonging to a sprite ?

At the beginning of the program, you use the value 255 as the rank of a transparent tile in BIOS ROM to clear the tiles of the fix map. Does it mean my 255th tile in c-ROM is compulsorily overwriten by this transparent tile ?

Using an empty tile to "clear" sprites or tiles should work but it looks like a waste of ressources for me. Maybe my point of view is wrong ?

Error compilling Macos

rm -f readline.o
gcc -c -DHAVE_CONFIG_H -I. -I/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 /Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/readline.c
rm -f vi_mode.o
gcc -c -DHAVE_CONFIG_H -I. -I/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 /Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/vi_mode.c
rm -f funmap.o
gcc -c -DHAVE_CONFIG_H -I. -I/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 /Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/funmap.c
rm -f keymaps.o
gcc -c -DHAVE_CONFIG_H -I. -I/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 /Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/keymaps.c
rm -f parens.o
gcc -c -DHAVE_CONFIG_H -I. -I/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 /Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/parens.c
rm -f search.o
gcc -c -DHAVE_CONFIG_H -I. -I/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 /Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/search.c
rm -f rltty.o
gcc -c -DHAVE_CONFIG_H -I. -I/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 /Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/rltty.c
/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/rltty.c:83:7: error: implicit declaration of function 'ioctl' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
if (ioctl (tty, TIOCGWINSZ, &w) == 0)
^
/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/rltty.c:720:3: error: implicit declaration of function 'ioctl' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
ioctl (fildes, TIOCSTART, 0);
^
/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/toolchain/toolchain/gdb-8.3.1/readline/rltty.c:759:3: error: implicit declaration of function 'ioctl' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
ioctl (fildes, TIOCSTOP, 0);
^
3 errors generated.
make[4]: *** [rltty.o] Error 1
make[3]: *** [all-readline] Error 2
make[2]: *** [all] Error 2
make[1]: *** [/Users/laurenmanuelgarciacarro/Code/repositories/NeoGeo-Devkit/ngdevkit/build/nggdb] Error 2
make: *** [build-toolchain] Error 2

ngdevkit install under windows 10 through Windows Subsystem for Linux (WSL)

Hello,

It would be even better if ngdevkit will be available and/or accessible more directly for ppl like me using Windows10 for their everyday work!

While installing ngdevkit using cygwin looks like a dead end.. i've been investigating WSL ->

I'm using this ->
https://www.linux.com/learn/intro-to-linux/2017/3/how-use-different-linux-bash-shells-windows-10

Just because the 'easy' installation through the store (using debian linux app' doesn't work on my config..

So far, ngdevkit packages dependies were met and all packages were installed successfuly but some errors are remaining when calling ./make

Please check the screenshots below :

https://www.jeuxdecartes.ovh/data/wls.png
https://www.jeuxdecartes.ovh/data/dinfo.png

Neo Geo Splash screen jingle

Hi !

First, I think you could be interested to see some results achieved with NGDEVKIT.

Neotris DEMO 2

Then, I could'nt figure out how to play the Neo Geo jingle while '330 MEGA PRO_GEAR SPEC'. Any idea ?

Last, it sounds fair to credit NGDEVKIT in my project. I could display a logo between the splash screen and the title screen. Fell free to provide any logo, image or animation of any kind.

Many errors while building the toolchain

Hi.

Using Debian running in a virtualbox, I face many issues when building the toolchain:

[...]
Makefile:11025: recipe for target 'install-target-libgcc' failed
make[2]: *** [install-target-libgcc] Error 2
make[2]: Leaving directory '/home/cedric/ngdevkit-master/build/nggcc'
Makefile:2249: recipe for target 'install' failed
make[1]: *** [install] Error 2
make[1]: Leaving directory '/home/cedric/ngdevkit-master/build/nggcc'
Makefile:125: recipe for target 'build/nggcc' failed
make: *** [build/nggcc] Error 2

I am not an experimented Linux user.

Package ngdevkit for macOS

Currently Linux and Windows (via WSL) can consume packaged/pre-built versions of ngdevkit repositories [1]. This issues tracks development needed to provide ngdevkit packages for macOS, via homebrew [2].

[1] implemented in #26, #30
[2] https://brew.sh

Disable eye catcher

Hi

The eye catcher is running on Mame whereas it doesn't run on real hardware.

Is there a way to enable/disable the eye catcher on both platforms ?

Preferably, I would like to disable it completely.

Understanding the dark bit in color definition

Hi.

I'm trying to play with the 16bits colors system. My reference is the Neo Geo dev wiki page:

https://wiki.neogeodev.org/index.php?title=Colors

Encoding colors is not a problem, but I couldn't see the role played by the dark bit. It should be the least significant bit shared by the 3 channels but in practice I can't see any difference when set to 0 or 1.

For example, given two red value 0xcf00 and 0x4f00. In binary (dark bit in bold) :
0xcf00 -> 1100 1111 0000 0000
0x4f00 -> 0100 1111 0000 0000

Then distributing the dark bit to each channels (in bold) and reordering them, it gives the following channels composition:
0xcf00 -> R(111111) G(000001) B(000001)
0x4f00 -> R(111110) G(000000) B(000000)

In consequence, 0xcf00 should appear a bit more saturated and lighter than 0x4f00. But on my screen both appear as full saturated red value 24bits (0xFF0000).

Did I miss something ? Maybe my understanding is incorrect ? Or an issue in color space projection ? (at this point I still use my old MAME for testing).

play longer sound

Hello @dciabrin

A friend and I are working on a game prototype with ngdevkit.
Starting from your great work and the 06-sound-adpcma example, I'm a bit stuck and looking for help about how I could play longer sound.

I'll try to be the most accurate that I can considering my actual knowledge on the neogeo hardware and ngdevkit.

So I have a 2.8 MB stereo music.mp3 file with a 1 minute duration. sox down samples it to 18,5k sample rate mono into a WAV file. Then it's processed by your adpcmtool.py to generate the ADPMC-A raw file.
The resulting music.adpcma file has a size of 605.4 kB which is greater than the 202-v1.v1 rom of the puzzledp game layout used by the examples.

So we consider 3 actions to solve the issue:

  1. Changing the game layout to have more and bigger audio roms like a Metal Slug or a King of Fighters game. This has to be done anyway because we want to create a game prototype bigger than puzzledp.
  2. Working on adpcmtool.py to accept WAV with a bit depth of 8bits (unsigned int) and may be a lower sample rate.
  3. Working on adpcmtool.py to generate ADPMC-B raw file which have a max size of 16MB against 1MB for ADPMC-A according to the neogeodev wiki.

We'd really be grateful if you could share though, experience, and documentation you might have on those 3 possible actions because:

  • We're still not sure what changing the game layout will imply.
  • I'm still trying to figure out what's really going on in adpcmtool.py in terms of format conversion.
  • I have no idea what would be necessary to do to handle ADPMC-B instead of ADPMC-1 with ngdevkit.
  • It's may be unexpected a 1 minute music mp3 gets converted to anmusic.adpcma of 605.4 kB, should it be smaller?

And thanks for this really great work on ngdevkit!

Gngeo does not compile

A couple of months ago I compiled your ngdevkit and everything worked great. Now I'm trying to compile the toolkit again, on the same OS (arcolinux), but I get a bunch of errors, here are a small part of them.
ksnip_20200521-165257

undefined reference to DIP roms

m68k-neogeo-elf-gcc fix.o main.o utils.o z80.o -specs ngdevkit-specs -Wl,--defsym,rom_eye_catcher_mode=2  -o prom.elf
/home/gbacretin/Software/ngdevkit/local/m68k-neogeo-elf/lib/gcc/m68k-neogeo-elf/5.5.0/../../../../../m68k-neogeo-elf/bin/ld: /home/gbacretin/Software/ngdevkit/local/m68k-neogeo-elf/lib/gcc/m68k-neogeo-elf/5.5.0/../../../../../m68k-neogeo-elf/lib/ngdevkit-crt0.o: in function `_start':
(.text+0x116): undefined reference to `dip_jp_rom'
/home/gbacretin/Software/ngdevkit/local/m68k-neogeo-elf/lib/gcc/m68k-neogeo-elf/5.5.0/../../../../../m68k-neogeo-elf/bin/ld: (.text+0x11a): undefined reference to `dip_us_rom'
/home/gbacretin/Software/ngdevkit/local/m68k-neogeo-elf/lib/gcc/m68k-neogeo-elf/5.5.0/../../../../../m68k-neogeo-elf/bin/ld: (.text+0x11e): undefined reference to `dip_eu_rom'
collect2: error: ld returned 1 exit status

This issue can be temporarily solved by adding these lines in the compiled c files:

const int dip_jp_rom;
const int dip_eu_rom;
const int dip_us_rom;

Provide .deb binary packages for the toolkit

ngdevkit currently bundles several subcomponents that together form a devkit:

  • a toolchain with gcc, sdcc, gdb and newlib
  • crt0, a module for bootstrapping rom execution
  • nullbios, the replacement neogeo bios
  • an API, a couple of C headers meant to help accessing the neogeo hardware
  • nullsound, an do-nothing z80 sound driver
  • emudbg, an RSP server + debugging API for emulator
  • qcrt, a simple opengl shader
  • gngeo, a neogeo emulator with emudbg support and pixel shaders
  • a set of tools, to manipulate neogeo palette and graphics

Grouping these component together is not ideal because any time a new commit is merged in one in the repository, users need to recompile the entire toolkit to ensure they use it.

It would be nice to somehow automatically publish new packages when new commit occurs.

Ideally, every subcomponent should be packaged independently, so that one change in a subcomponent does not force users to download all the binaries.

This issue tracks the refactoring steps needed to provide .deb packages for each subcomponent of the toolkit.

Black screen in Gngeo on macOS

After October's WSL fixes, building the devkit on macOS results in a Gngeo that doesn't draw anything. Keyboard input still works (e.g. pressing esc + up + enter quits the app)

I'm backtracking through the commits now to see what breaks it, but I could reproduce this on my other Mac which already had a working ngdevkit from before.

Prerequisites: needed to setup deb-src repositories on Ubuntu

Thanks for making this dev kit!

When installing on Ubuntu 16.04, I'd get this error on the prerequisites: Unable to find a source package for gcc-5 (and sdcc).

To get past this, I needed to go to /etc/apt/sources.list and uncomment all the deb-src repos. Not sure exactly which one I needed so I just uncommented all of them. Then apt update.

After doing that the dev kit installed without a hitch.

I figured I'd at least file an issue here in case other Ubuntu users hit this. I'm also happy to send a PR updating the README if you like.

Investigate alternative to travis for CI/CD

Lately, automatic jobs are getting trigger very slowly due to the sunsetting of travis-ci.org. And it seems like the new credit-base model for open source projects is not suitable for ngdevkit because ngdevkit-toolchain and homebrew-ngdevkit are really resource-heavy.

Let's evaluate an alternative CI/CD provider that would allow cross-platform CI, bottling macOS packages, and calling Launchpad for deb packaging.

Make deb packages consumable on windows

Currently one can use ngdevkit on windows by using WSL and a linux distro. But one cannot consume all the deb packages because there's no MinGW/native package for GnGeo.
Consequently windows users are stuck with compiling the toolkit.

Can you help me with this error please!

hello, so i was trying to compile a c program and this error comes up saying: No rule to make target '../Makefile.common. so can you help me with this error please!

Building the devkit with gcc-10 doesn't work

As detailed in the changelog for GCC 10 [1], gcc now defaults to -fno-common:

In C, global variables with multiple tentative definitions now result in linker errors. With -fcommon such definitions are silently merged during linking

Practically for ngdevkit, this change exposed various invalid C declarations [2], so the devkit fails to compile successfully.

[1] https://gcc.gnu.org/gcc-10/changes.html
[2] at least in gngeo last time I checked

The GCC toolchain included with ngdevkit has some problems with multiplication

I've tried to compile a c file to assembly using this command
m68k-neogeo-elf-gcc -S -O2 fixmath.c.

I've noticed a problem both with division and multiplication, instead then using the 68k instruction for multiplication and division, this happens

; [...]
	.globl	__mulsi3
	.align	2
	.globl	fix_mul
	.type	fix_mul, @function
fix_mul:
	link.w %fp,#0
	move.l 12(%fp),-(%sp)
	move.l 8(%fp),-(%sp)
	jsr __mulsi3                            ; <======== This should use 68k's multiplication instructions
	addq.l #8,%sp
	swap %d0
	ext.l %d0
	unlk %fp
	rts
	.size	fix_mul, .-fix_mul
	.globl	__divsi3
	.align	2
	.globl	fix_div
	.type	fix_div, @function
fix_div:
	link.w %fp,#0
	move.l 8(%fp),%d0
	swap %d0
	clr.w %d0
	move.l 12(%fp),-(%sp)
	move.l %d0,-(%sp)
	jsr __divsi3                                ; <======== This should use 68k's division instructions
	addq.l #8,%sp
	unlk %fp
	rts
	.size	fix_div, .-fix_div
	.align	2
; [...]

This was confirmed when I tried to use a different toolchain with the same command, compiling the same file. This was the result:

; [...]
	.globl	fix_mul
	.type	fix_mul, @function
fix_mul:
	move.l 4(%sp),%d0
	muls.l 8(%sp),%d0               ; <======== Uses the 68k's multiplication instruction
	swap %d0
	ext.l %d0
	rts
	.size	fix_mul, .-fix_mul
	.align	2
	.globl	fix_div
	.type	fix_div, @function
fix_div:
	move.l 4(%sp),%d0
	swap %d0
	clr.w %d0
	divs.l 8(%sp),%d0  ; <======== Uses the 68k's division instruction
	rts
	.size	fix_div, .-fix_div
	.align	2
; [...]

fixmath.c
neogeo_fixmath.s
toolchain68k_fixmath.s

Runtime callbacks

Hi!
I understand, according to the runtime configuration in ngdevkit.ld (along with ngdekit-crt0.S) that I can override default behavior by providing code in the main C program.
It's working just fine with rom_callback_VBlank(), but I can't get another one working.
For examples:

  • If I provide a rom_eye_catcher() function and I set rom_eye_catcher_mode=1 (with --defsym,rom_eye_catcher_mode=1), then I expected the rom_eye_catcher() callback to be triggered.
  • Same with the player_start() callback. I can't get it triggered the same way.
  • Seems rom_callback_Timer() isn't called as well but I'm probably doing something wrong here.

Thanks!

Cygwin

Hello, Can You Make A Tutorial On How To Get NGDEVKIT Set Up On Cygwin

Thanks.

MakeFile Issue

Hello, so when i try to compile a c file to be made as a rom by typing in make, it gives me this error saying makefile.comon: no such file or directory. so how do i try to compile my own c file with make?

GnGeo: provide VRAM memory inspection + GDB pretty printers

As discussed with @yo6snap, it would be nice to improve the debugging capabilities of GnGeo.

Currently GnGeo has no integrated graphical debugger, but we can probably expose the Neo Geo internals over the GDB interface. For example:
. VRAM inspection (palette, Sprite control registers...)
. enable extra debug flags in GnGeo: super-imposed sprite number on screen
. GDB python pretty printers

I'll use that issue as an epic to track sub-features.

Playing sound and music

Hi.

Does the kit include a solution to play sounds and music ?

I made a demo using the NeoSound Z80 driver by Jeff Kurtz. iI works fine on MAME but it still stays mute on the real hardware.

Any idea why ? :)

Can't run example 01

Not sure why but I can't get it to run any of the examples, however I can start gngeo with no game loaded.

Edit: I should also mention I am running Ubuntu 18.04

/examples/01-helloworld$  make gngeo
/usr/bin/ngdevkit-gngeo -b glsl --shaderpath="/mnt/6caf58d5-d873-41ac-930d-63ff042b1cad/Code/examples/shaders" --shader="qcrt-flat.glslp" --scale 3 --no-resize -i rom puzzledp
Option rompath
c=98
flags blitter set on cmd line
c=83
flags shaderpath set on cmd line
c=272
flags shader set on cmd line
c=282
flags scale set on cmd line
c=4369
flags resize set on cmd line
c=105
flags rompath set on cmd line
Using GL: 3.2.0 NVIDIA 440.59
Loading GLSL preset /mnt/6caf58d5-d873-41ac-930d-63ff042b1cad/Code/examples/shaders/qcrt-flat.glslp
Initializing a 3-passes shader pipeline
Linked shader program: shaders/qcrt-sharpen-ghost-intensity.glsl
Linked shader program: shaders/qcrt-aperture_grille-s_intensity.glsl
Linked shader program: shaders/qcrt-scanlines.glsl
Pass 0 output texture size: 304 x 224
Pass 1 output texture size: 896 x 224
Pass 2 output texture size: 896 x 672
CURSOR=1
CURSOR=0
Get mapid A
Get mapid B
Get mapid C
Get mapid D
Get mapid START
Get mapid COIN
Get mapid UP
Get mapid DOWN
Get mapid LEFT
Get mapid RIGHT
Get mapid MENU
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=126265 
STBILOAD 0x5607613c7cb0 304 224 4 1216
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=33898 
STBILOAD 0x5607611a7870 605 14 4 2420
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=33898 
STBILOAD 0x5607613a8f60 605 14 4 2420
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=33898 
STBILOAD 0x5607613b13c0 605 14 4 2420
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=33898 
STBILOAD 0x5607613b9820 605 14 4 2420
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=33898 
STBILOAD 0x56076140a4c0 605 14 4 2420
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=33898 
STBILOAD 0x560761412920 605 14 4 2420
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=69626 
STBILOAD 0x56076142bd90 1243 14 4 4972
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=69626 
STBILOAD 0x56076143cd80 1243 14 4 4972
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=69626 
STBILOAD 0x56076144dd70 1243 14 4 4972
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=69626 
STBILOAD 0x56076145ed60 1243 14 4 4972
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=69626 
STBILOAD 0x56076146fd50 1243 14 4 4972
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=69626 
STBILOAD 0x560761480d40 1243 14 4 4972
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=2540 
STBILOAD 0x5607611afcd0 32 32 4 128
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=2455 
STBILOAD 0x5607611b0ce0 32 32 4 128
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=2861 
STBILOAD 0x5607613c1c80 32 32 4 128
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=2826 
STBILOAD 0x5607613c2c90 32 32 4 128
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=12237 
STBILOAD 0x5607611a08d0 75 67 4 300
DATAFILE = /usr/share/ngdevkit-gngeo/gngeo_data.zip
Readed=1263 
STBILOAD 0x56076141ad80 75 90 4 300
AA Blitter glsl effect none
CURSOR=0
CURSOR=0
BBB Blitter glsl effect none
Loading rom/puzzledp.zip
Allocating 0x00100000 byte for Region 8
Allocating 0x00020000 byte for Region 1
Allocating 0x00200000 byte for Region 9
Allocating 0x00020000 byte for Region 6
Allocating 0x00001000 byte for Region 11
Allocating 0x00080000 byte for Region 3
Allocating 0x00000000 byte for Region 4
BIOS SIZE 00000000 00000000 00000000
Trying to load file 202-p1.bin        in region 8
Catch a sigsegv
Load file 202-p1.bin        in region 8: OK 
Trying to load file 202-s1.bin        in region 6
Load file 202-s1.bin        in region 6: OK 
Trying to load file 202-m1.bin        in region 1
Load file 202-m1.bin        in region 1: OK 
Trying to load file 202-v1.bin        in region 3
../Makefile.common:101: recipe for target 'gngeo' failed
make: *** [gngeo] Error 255

Can you make a MSYS toolchain installer for windows

Hello, I want a easy way to develop neo geo aes/MVS games on windows but I can't get the toolchain or the commands to work for installing ngdevkit on windows 10 so can you please make a MSYS toolchain!

Add continuous integration for pull requests

This Issue tracks the work needed to enable continuous integration among all ngdevkit repositories.
The goal is to add Travis CI jobs to trigger a build as a minimal sanity check for every incoming PR.

ngdevkit installation

Hello :)

First of all i have to say that i'm more a windows user/coder than a gnu/linux expert :)

But as this project look so much interesting and has also so much potential for 'modern' neogeo coding, i'm ok to do my part using gnu/linux and command line crazyness ^^

So far, i've tested on fresh installations of debian 9.4 and debian 8.10 (tiny cd + network installation, without going through important updates though) and i was unable to survive to 'make' which is generating a long list of problems (i think there is a main issue concerning binutils)

Before reaching this point, there were missing/wrong informations from your pre-requisite section concerning the installation of required packages. For instance libsdl2.0-dev doesn't match libsdl2-dev and some missing packages to list a few are : bison, flex, curl and so on.. Maybe also a special attention would be needed when trying to compile examples about external pythongame program.

I know, that it is not the most interesting part for a maintainer but for completely new users like me who couldn't be gnu/linux friendly aswell you should:

  • Not too much assume what is evident and what are the normally pre-installed packages on a distro as an experimented gnu/linux user.
  • Add every command line involved with all required package installation before reaching gcc/scc 'make'
    (it could looks silly but is so important for newcomers.)
  • Try it out yourself as a maintainer on fresh distros to be sure that any user interested by ngdevkit will be able to complete the installation flawlessly. ;-)

That's it, i hope to be able to install ngdevkit soon or later!

Hope this helps and keep on the good work!

Ozzy.

Problem with palette on real hardware

Hi.

I met a serious issue on real hardware related to palette color mapping.

The 16 colors of a palette are not fully mapped on the tiles. Instead, it looks like only the 4 first colors are mapped.

A simple example, 4 sprites and 4 gradient palettes
Result on Mame
Result on hardware

I have this result using both the tiletool.py and my own png-to-crom conversion program.

Any idea ?

Controls do not work

I can not get any input to work in the examples.

I alreadyconfigured the following inmy ~/.gngeo file:

p1control A=K122,B=K120,C=K97,D=K115,START=K49,COIN=K51,UP=K273,DOWN=K274,LEFT=K276,RIGHT=K275,MENU=K27

The toolchain won't compile correctly using g++ 11

The error is error: use of an operand of type ‘bool’ in ‘operator++’ is forbidden in C++17. This seems to happen because g++ 11 uses by default c++17 instead of c++14. This is confirmed by the fact that the toolchain does compile using g++ 10.

Typo in readme

README-linux.md has 'The examples require ImageMagick for all the graphics trickery and sox for audio convertion purpose.'

convertion -> conversion

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.