Giter Club home page Giter Club logo

aosdk's Introduction

Audio Overload SDK - Development Release 1.4.8 February 15, 2009

Copyright (c) 2007-2009 R. Belmont and Richard Bannister. All rights reserved.

Please refer to license.txt for the specific licensing details of this software.


This SDK opens up some of the music file format engines developed for the Audio Overload project. You may use this code to play the formats on systems we don't support or inside of applications other than AO.

Prerequisites

pkg-config and GLFW 3 are required to compile the debug GUI. Depending on your distribution, they can be installed as follows:

  • On Arch: sudo pacman -S glfw
  • On Debian: sudo apt-get install libglfw3-dev
  • On MinGW/MSYS2 (64-bit): pacman -S pkg-config mingw-w64-x86_64-glfw

Alternatively, you can compile Audio Overload without the GUI by setting the environment variable NOGUI before you run make:

	NOGUI=1 make
Compilation

Make sure that you've pulled all Git submodules together with this repo:

	git clone --recursive https://github.com/nmlgc/aosdk.git

On Windows, MinGW is required to build the code through the Makefile. Cygwin's own gcc is unsupported, so make sure to specify MinGW's gcc in the CC environment variable when building on Cygwin or MSYS2:

	# For 32-bit builds
	CC=i686-w64-mingw32-gcc make
	# For 64-bit builds
	CC=x86_64-w64-mingw32-gcc make

On Linux, set the environment variable OSTYPE to linux before you run make:

	OSTYPE=linux make

To build on a big-endian platform, change LSB_FIRST=1 to =0 in the Makefile.

By default, the code is compiled with optimizations using the release make target. Use the debug target to generate debugging information and disable optimizations:

	make debug

New in Release 1.4.8

  • Guard against invalid data sometimes created by makessf.py (fixes crashing Pebble Beach ST-V rips)

MIDI dumping support

The following table lists the MIDI events generated by the MIDI dumper for each individual engine, as well as the loss of data in this conversion.

Engine Note On (Pitch) Note On (Velocity) Note Off
Capcom QSound (.qsf)
Sega Saturn (.ssf)
Sony PlayStation 1 (.psf, .spu)
Sega Dreamcast (.dsf) ✔ (- 5½ octaves) ✔ (- 1 bit)
Sony PlayStation 2 (.psf2)

Entry points of an AO engine are as follows:

  • int32 XXX_start(uint8 *, uint32)

    This function attempts to recognize and load a file of a specific type. It is assumed external code has already checked the file's signature in cases where that's possible. The first parameter is a pointer to the entire file in memory, and the second is the length of the file. The return value is AO_SUCCESS if the engine properly loaded the file and AO_FAIL if it didn't.

  • int32 XXX_sample(stereo_sample_t *)

    This function actually plays the song, generates the next sample in 16-bit stereo format at 44100 Hz, and returns it through the given pointer.

  • int32 XXX_frame(void)

    This function is called once per frame and can be used to update the internal state of the format engine if necessary.

  • int32 XXX_stop(void)

    This function ceases playback and cleans up the engine. You must call _start() again after this to play more music.

  • int32 XXX_command(int32, int32)

    For some engines, this allows you to send commands while a song is playing. The first parameter is the command (these are defined in ao.h), the second is the parameter. These commands are as follows:

    • COMMAND_PREV (parameter ignored) - for file formats which have more than one song in a file (NSF), this moves back one song.

    • COMMAND_NEXT (parameter ignored) - for file formats which have more than one song in a file (NSF), this moves forward one song.

    • COMMAND_RESTART (parameter ignored) - Restarts the current song from the beginning. Not supported by all engines.

    • COMMAND_HAS_PREV (parameter ignored) - for file formats which have more than one song in a file (NSF), this checks if moving backwards from the current song is a valid operation. (Returns AO_FAIL if not)

    • COMMAND_HAS_NEXT (parameter ignored) - for file formats which have more than one song in a file (NSF), this checks if moving forward from the current song is a valid operation. (Returns AO_FAIL if not)

    • COMMAND_GET_MIN (parameter ignored) - for file formats which have more than one song in a file (NSF), this returns the lowest valid song number.

    • COMMAND_GET_MAX (parameter ignored) - for file formats which have more than one song in a file (NSF), this returns the highest valid song number.

    • COMAND_JUMP - for file formats which have more than one song in a file (NSF), this command jumps directly to a specific song number, which is passed in as the parameter.

  • int32 XXX_fillinfo(ao_display_info *)

    This function fills out the ao_display_info struct (see ao.h for details) with information about the currently playing song. The information provided varies by engine.

aosdk's People

Contributors

hcs64 avatar nmlgc avatar osmose avatar rb6502 avatar sappharad 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aosdk's Issues

macOS build

Hello, I am trying to compile a 64-bit binary in order to continue using Audio Overload on macOS 10.15, as the OS X build found on the website is unfortunately a 32-bit one. I have tried changing the OSTYPE environment variable to no avail. My build breaks either way, while performing the following actions (click to reveal console output):

Compiling win32_utf8/src/win32_utf8.h on a Windows build, due to including Windows.h.

$ make
Compiling main.c...
main.c:384:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 warning generated.
Compiling ao.c...
Compiling corlett.c...
Compiling m1sdr.c...
Compiling utils.c...
Compiling mididump.c...
mididump.c:427:16: warning: using the result of an assignment as a condition without
      parentheses [-Wparentheses]
        } while(vchan = vchans_iterate(&iter));
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
mididump.c:427:16: note: place parentheses around the assignment to silence this warning
        } while(vchan = vchans_iterate(&iter));
                      ^
                (                            )
mididump.c:427:16: note: use '==' to turn this assignment into an equality comparison
        } while(vchan = vchans_iterate(&iter));
                      ^
                      ==
1 warning generated.
Compiling sampledump.c...
Compiling wavedump.c...
Compiling argparse/argparse.c...
Compiling dsnd.c...
In file included from dsnd.c:31:
./win32_utf8/src/win32_utf8.h:11:10: fatal error: 'Windows.h' file not found
#include <Windows.h>
         ^~~~~~~~~~~
1 error generated.
make: *** [obj/x86_64-apple-darwin18.7.0/dsnd.o] Error 1

Compiling oss.c on a Linux build, due to including sys/soundcard.h.

$ OSTYPE=linux make
Compiling main.c...
main.c:384:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 warning generated.
Compiling ao.c...
Compiling corlett.c...
Compiling m1sdr.c...
Compiling utils.c...
Compiling mididump.c...
mididump.c:427:16: warning: using the result of an assignment as a condition without
      parentheses [-Wparentheses]
        } while(vchan = vchans_iterate(&iter));
                ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
mididump.c:427:16: note: place parentheses around the assignment to silence this warning
        } while(vchan = vchans_iterate(&iter));
                      ^
                (                            )
mididump.c:427:16: note: use '==' to turn this assignment into an equality comparison
        } while(vchan = vchans_iterate(&iter));
                      ^
                      ==
1 warning generated.
Compiling sampledump.c...
Compiling wavedump.c...
Compiling argparse/argparse.c...
Compiling oss.c...
oss.c:35:10: fatal error: 'sys/soundcard.h' file not found
#include <sys/soundcard.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
make: *** [obj/x86_64-apple-darwin18.7.0/oss.o] Error 1

Of course, using NOGUI=1 doesn’t make a difference, as the failures are caused not by GUI libraries but by OS libraries. As such, would it be possible to obtain the code used to compile for Mac, if it is indeed still available? @nmlgc

eng_psf: PS2 DMA4 / DMA7 are implemented incorrectly

I thought I'd point out how to fix that. Basically, both are coded to copy twice as many halfwords as they're supposed to. And the DMA7 has its BCR and CHCP registers swapped for some mysterious reason.

The double memory has the following bug effects apparent in released sets:

nenolod's Final Fantasy X rip: DMA4 copies twice as much, compensating for DMA7 being totally broken. Normally, this rip uses simultaneous DMA4 and DMA7 copies to split up transfers of individual samples.

CaitSith2's Final Fantasy 4 rip: DMA4 is used to stream all of the sample data for both playing channels, which breaks completely because it is copying twice as much data as it is supposed to.

gcc 10 multiple definition compilation error

On debian unstable - gcc-10:
OSTYPE=linux NOGUI=1 make

/dev/dsp not found. Playback will be unavailable.
Linking aosdk-x86_64-linux-gnu...
/usr/bin/ld: obj/x86_64-linux-gnu/eng_dsf/dc_hw.o:(.bss.EG_TABLE+0x0): multiple definition of `EG_TABLE'; obj/x86_64-linux-gnu/eng_dsf/eng_dsf.o:(.bss.EG_TABLE+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_dsf/aica.o:(.bss.EG_TABLE+0x0): multiple definition of `EG_TABLE'; obj/x86_64-linux-gnu/eng_dsf/eng_dsf.o:(.bss.EG_TABLE+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_dsf/aicadsp.o:(.bss.EG_TABLE+0x0): multiple definition of `EG_TABLE'; obj/x86_64-linux-gnu/eng_dsf/eng_dsf.o:(.bss.EG_TABLE+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_ssf/scsp.o:(.bss.EG_TABLE+0x0): multiple definition of `EG_TABLE'; obj/x86_64-linux-gnu/eng_dsf/eng_dsf.o:(.bss.EG_TABLE+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_ssf/scspdsp.o:(.bss.EG_TABLE+0x0): multiple definition of `EG_TABLE'; obj/x86_64-linux-gnu/eng_dsf/eng_dsf.o:(.bss.EG_TABLE+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_ssf/scspdsp.o:(.bss.FNS_Table+0x0): multiple definition of `FNS_Table'; obj/x86_64-linux-gnu/eng_ssf/scsp.o:(.bss.FNS_Table+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_ssf/sat_hw.o:(.bss.EG_TABLE+0x0): multiple definition of `EG_TABLE'; obj/x86_64-linux-gnu/eng_dsf/eng_dsf.o:(.bss.EG_TABLE+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_ssf/sat_hw.o:(.bss.FNS_Table+0x0): multiple definition of `FNS_Table'; obj/x86_64-linux-gnu/eng_ssf/scsp.o:(.bss.FNS_Table+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_ssf/eng_ssf.o:(.bss.EG_TABLE+0x0): multiple definition of `EG_TABLE'; obj/x86_64-linux-gnu/eng_dsf/eng_dsf.o:(.bss.EG_TABLE+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/eng_ssf/eng_ssf.o:(.bss.FNS_Table+0x0): multiple definition of `FNS_Table'; obj/x86_64-linux-gnu/eng_ssf/scsp.o:(.bss.FNS_Table+0x0): first defined here
/usr/bin/ld: obj/x86_64-linux-gnu/main.o: in function `main':
main.c:(.text.startup.main+0x3d1): undefined reference to `m1sdr_TimeCheck'
/usr/bin/ld: main.c:(.text.startup.main+0x485): undefined reference to `m1sdr_Init'
/usr/bin/ld: main.c:(.text.startup.main+0x496): undefined reference to `m1sdr_PlayStart'
collect2: error: ld returned 1 exit status

On debian stable - gcc-8: build pass

eng_spu.c

I'd say the order of the params is wrong..

	strncpy((char *)&buffer[4], name, 128);
	strncpy((char *)&buffer[0x44], song, 128);
	strncpy((char *)&buffer[0x84], company, 128);

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.