Skip to content

Commit

Permalink
Audio: move from old MAME YM core to ymfm (#141)
Browse files Browse the repository at this point in the history
* Audio: move from old MAME YM core to ymfm

* remove unused and unplanned chip types

* whitespace

* remove commented out object file

* whitespace
  • Loading branch information
mooinglemur authored Jul 19, 2023
1 parent 60a151f commit d8b5dc4
Show file tree
Hide file tree
Showing 20 changed files with 8,994 additions and 2,236 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ else
SDL2CONFIG=sdl2-config
endif

CFLAGS=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Isrc/extern/include -Isrc/extern/src
CFLAGS=-std=c99 -O3 -Wall -Werror -g $(shell $(SDL2CONFIG) --cflags) -Isrc/extern/include
CXXFLAGS=-std=c++17 -O3 -Wall -Werror -Isrc/extern/ymfm/src
LDFLAGS=$(shell $(SDL2CONFIG) --libs) -lm -lz

# build with link time optimization
Expand Down Expand Up @@ -57,8 +58,10 @@ ifeq ($(CROSS_COMPILE_WINDOWS),1)
LDFLAGS+=-Wl,--subsystem,console
ifeq ($(TARGET_CPU),x86)
CC=i686-w64-mingw32-gcc
CXX=i686-w64-mingw32-g++
else
CC=x86_64-w64-mingw32-gcc
CXX=x86_64-w64-mingw32-g++
endif
endif

Expand All @@ -71,8 +74,8 @@ ifdef EMSCRIPTEN
MAKECART_OUTPUT=makecart.html
endif

_X16_OBJS = cpu/fake6502.o memory.o disasm.o video.o i2c.o smc.o rtc.o via.o serial.o ieee.o vera_spi.o audio.o vera_pcm.o vera_psg.o sdcard.o main.o debugger.o javascript_interface.o joystick.o rendertext.o keyboard.o icon.o timing.o wav_recorder.o testbench.o files.o cartridge.o
_X16_OBJS += extern/src/ym2151.o
_X16_OBJS = cpu/fake6502.o memory.o disasm.o video.o i2c.o smc.o rtc.o via.o serial.o ieee.o vera_spi.o audio.o vera_pcm.o vera_psg.o sdcard.o main.o debugger.o javascript_interface.o joystick.o rendertext.o keyboard.o icon.o timing.o wav_recorder.o testbench.o files.o cartridge.o ymglue.o
_X16_OBJS += extern/ymfm/src/ymfm_opm.o
X16_OBJS = $(patsubst %,$(X16_ODIR)/%,$(_X16_OBJS))
X16_DEPS := $(X16_OBJS:.o=.d)

Expand All @@ -85,12 +88,16 @@ MAKECART_DEPS := $(MAKECART_OBJS:.o=.d)
all: x16emu makecart

x16emu: $(X16_OBJS)
$(CC) -o $(X16_OUTPUT) $(X16_OBJS) $(LDFLAGS)
$(CXX) -o $(X16_OUTPUT) $(X16_OBJS) $(LDFLAGS)

$(X16_ODIR)/%.o: $(X16_SDIR)/%.c
@mkdir -p $$(dirname $@)
$(CC) $(CFLAGS) -c $< -MD -MT $@ -MF $(@:%o=%d) -o $@

$(X16_ODIR)/%.o: $(X16_SDIR)/%.cpp
@mkdir -p $$(dirname $@)
$(CXX) $(CXXFLAGS) -c $< -MD -MT $@ -MF $(@:%o=%d) -o $@

makecart: $(MAKECART_OBJS)
$(CC) -o $(MAKECART_OUTPUT) $(MAKECART_OBJS) $(LDFLAGS)

Expand Down
2 changes: 1 addition & 1 deletion src/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "vera_psg.h"
#include "vera_pcm.h"
#include "wav_recorder.h"
#include "ym2151.h"
#include "ymglue.h"
#include <stdint.h>
#include <stdio.h>
#include <string.h>
Expand Down
Loading

0 comments on commit d8b5dc4

Please sign in to comment.