Skip to content

Commit

Permalink
NeoCD RX code
Browse files Browse the repository at this point in the history
  • Loading branch information
niuus committed Apr 4, 2023
1 parent 4d6379b commit cc81c10
Show file tree
Hide file tree
Showing 104 changed files with 99,897 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.PHONY = all wii gc wii-clean gc-clean wii-run gc-run

all: wii gc

clean: wii-clean gc-clean

clean-all: clean wii-clean-cpus

wii:
$(MAKE) -f Makefile.wii

wii-clean:
$(MAKE) -f Makefile.wii clean

wii-clean-cpus:
$(MAKE) -f Makefile.wii cpus-clean

wii-run:
$(MAKE) -f Makefile.wii run

gc:
$(MAKE) -f Makefile.gc

gc-clean:
$(MAKE) -f Makefile.gc clean

gc-clean-cpus:
$(MAKE) -f Makefile.gc cpus-clean

gc-run:
$(MAKE) -f Makefile.gc run
148 changes: 148 additions & 0 deletions Makefile.gc
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif

include $(DEVKITPPC)/gamecube_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET := neocd-rx_cube
TARGETDIR := executables
BUILD := build_cube
SOURCES := src/fileio src src/cdaudio src/cdrom src/z80i \
src/memory src/pd4990a src/cpu src/input src/video \
src/mcard src/sound

INCLUDES := src/z80 src/m68000 $(SOURCES)

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS = -O3 -Wall $(MACHDEP) $(INCLUDE) \
-fstrict-aliasing -fomit-frame-pointer \
-DTHREADED_AUDIO
CXXFLAGS = $(CFLAGS)
LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lfat -logc -lm -lz -lmad -ldb -L ./../build_cpu -lz80 -lmc68000

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS)

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUT := $(CURDIR)/$(TARGET)

export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIR := $(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
export LD := $(CC)
else
export LD := $(CXX)
endif

export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
$(sFILES:.s=.o) $(SFILES:.S=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
-L$(LIBOGC_LIB)

export OUTPUT := $(CURDIR)/$(TARGETDIR)/$(TARGET)
.PHONY: $(BUILD) clean cpus cpus-clean

#---------------------------------------------------------------------------------
$(BUILD):
@if test -d build_cpus; then echo ""; else [ -d $@ ] || mkdir -p build_cpu; cd src/m68000 && $(MAKE);cd ..; cd ..; cd src/z80 && $(MAKE); fi
@[ -d $@ ] || mkdir -p $@
@echo ""
@echo "*** NeoCD RX Gamecube ******************************************************"
@[ -d $(TARGETDIR) ] || mkdir -p $(TARGETDIR)
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.gc
@echo "*************************************************************** Yay! \o/ ***"

#---------------------------------------------------------------------------------
clean:
@echo clean gc...
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

cpus:
@[ -d $@ ] || mkdir -p build_cpu
@cd src/m68000 && $(MAKE)
@cd src/z80 && $(MAKE)

cpus-clean:
@rm -fr build_cpu

#---------------------------------------------------------------------------------
all: cpus $(BUILD)

clean-all: clean cpus-clean
#---------------------------------------------------------------------------------
run:
dolphin-emu -e $(OUTPUT).elf

run-dol:
$(DEVKITPRO)/emulators/gcube/gcube $(OUTPUT).dol

#---------------------------------------------------------------------------------
else

DEPENDS := $(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
147 changes: 147 additions & 0 deletions Makefile.wii
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
endif

include $(DEVKITPPC)/wii_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET := neocd-rx_wii
TARGETDIR := executables
BUILD := build_wii
SOURCES := src/fileio src src/cdaudio src/cdrom src/z80i \
src/memory src/pd4990a src/cpu src/input src/video \
src/mcard src/sound

INCLUDES := src/z80 src/m68000 $(SOURCES)

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS = -O3 -fomit-frame-pointer -mrvl -Wall -Wno-strict-aliasing $(MACHDEP) $(INCLUDE) -DHW_RVL \
-DTHREADED_AUDIO
CXXFLAGS = $(CFLAGS)
LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -ldi -lfat -lwiiuse -lbte -logc -lm -lz -lmad -L ./../build_cpu -lz80 -lmc68000

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS)

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUT := $(CURDIR)/$(TARGET)

export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIR := $(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
export LD := $(CC)
else
export LD := $(CXX)
endif

export OFILES := $(addsuffix .o,$(BINFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
$(sFILES:.s=.o) $(SFILES:.S=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
-L$(LIBOGC_LIB)

export OUTPUT := $(CURDIR)/$(TARGETDIR)/$(TARGET)
.PHONY: $(BUILD) clean cpus cpus-clean

#---------------------------------------------------------------------------------
$(BUILD):
@if test -d build_cpus; then echo ""; else [ -d $@ ] || mkdir -p build_cpu; cd src/m68000 && $(MAKE);cd ..; cd ..; cd src/z80 && $(MAKE); fi
@[ -d $@ ] || mkdir -p $@
@echo ""
@echo "*** NeoCD RX Wii ******************************************************"
@[ -d $(TARGETDIR) ] || mkdir -p $(TARGETDIR)
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.wii
@echo "*************************************************************** Yay! \o/ ***"

#---------------------------------------------------------------------------------
clean:
@echo clean wii...
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

cpus:
@[ -d $@ ] || mkdir -p build_cpu
@cd src/m68000 && $(MAKE)
@cd src/z80 && $(MAKE)

cpus-clean:
@rm -fr build_cpu

#---------------------------------------------------------------------------------
all: cpus $(BUILD)

clean-all: clean cpus-clean
#---------------------------------------------------------------------------------
run:
dolphin-emu -e $(OUTPUT).elf

run-dol:
$(DEVKITPRO)/emulators/gcube/gcube $(OUTPUT).dol

#---------------------------------------------------------------------------------
else

DEPENDS := $(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
Binary file added NeoCDRX/NeoCDRX_manual.pdf
Binary file not shown.
Binary file added NeoCDRX/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions NeoCDRX/meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="2">
<name>NeoCD RX</name>
<coder>NiuuS</coder>
<version>1.0.02</version>
<release_date>20230403142522</release_date>
<short_description>Neo Geo CD Emulator</short_description>
<long_description>Features:
- Wiimote, Wiimote Plus, Wiimote+Nunchuk, and GameCube controller support
- Neo Geo CD Virtual Memory Card saving to SD/USB or physical GameCube card for max nostalgia!
- Region select for uncut content and extra languages
- Super fast loading times, unlike the original console!
- UStealth USB devices support
- SD/SDHC, USB, WKF (GameCube), IDE-EXI V1, DVD support
- Sound FX / Music 3-Band equalizer

NeoCDRX is a Neo-Geo CD/CDZ emulator, running on the GameCube, Wii, and Wii U's Virtual Wii, forked from NEO-CD REDUX.

Please read the NeoCDRX_manual.pdf included in the zip.
/~https://github.com/niuus/NeoCDRX
</long_description>
<no_ios_reload/>
</app>
Binary file added NeoCDRX_manual.pdf
Binary file not shown.
Binary file added build_cpu/m68kmake.exe
Binary file not shown.
Loading

0 comments on commit cc81c10

Please sign in to comment.