Skip to content

Commit

Permalink
Clean up and flesh out readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Hydr8gon committed Dec 27, 2023
1 parent 1dc3fad commit 913939d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
While I appreciate anyone who wants to contribute, my goal with this project is to challenge myself and not to review code. I feel guilty rejecting a change that someone spent time on, but I also don't feel great accepting changes that I didn't ask for. For this reason, I've decided to stop accepting pull requests. You're of course still free to do anything with the code that's allowed by the license, but if you submit a pull request it will likely be ignored. I hope this is understandable!
Pull requests are not accepted for this project; see the contributing section of the readme for more details.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
/rokuyon.nro
pif_rom.bin
rokuyon.ini
/VS2022
39 changes: 17 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
NAME := rokuyon
BUILD := build
SOURCES := src src/desktop
ARGS := -O3 -flto -std=c++11 -DLOG_LEVEL=0
LIBS := $(shell pkg-config --libs portaudio-2.0)
INCLUDES := $(shell pkg-config --cflags portaudio-2.0)
NAME := rokuyon
BUILD := build
SRCS := src src/desktop
ARGS := -O3 -flto -std=c++11 -DLOG_LEVEL=0
LIBS := $(shell pkg-config --libs portaudio-2.0)
INCS := $(shell pkg-config --cflags portaudio-2.0)

APPNAME := rokuyon
PKGNAME := com.hydra.rokuyon
Expand All @@ -12,10 +12,10 @@ DESTDIR ?= /usr
ifeq ($(OS),Windows_NT)
ARGS += -static -DWINDOWS
LIBS += $(shell wx-config-static --libs std,gl) -lole32 -lsetupapi -lwinmm
INCLUDES += $(shell wx-config-static --cxxflags std,gl)
INCS += $(shell wx-config-static --cxxflags std,gl)
else
LIBS += $(shell wx-config --libs std,gl)
INCLUDES += $(shell wx-config --cxxflags std,gl)
INCS += $(shell wx-config --cxxflags std,gl)
ifeq ($(shell uname -s),Darwin)
ARGS += -DMACOS
LIBS += -headerpad_max_install_names
Expand All @@ -25,9 +25,9 @@ else
endif
endif

CPPFILES := $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.cpp))
HFILES := $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.h))
OFILES := $(patsubst %.cpp,$(BUILD)/%.o,$(CPPFILES))
CPPFILES := $(foreach dir,$(SRCS),$(wildcard $(dir)/*.cpp))
HFILES := $(foreach dir,$(SRCS),$(wildcard $(dir)/*.h))
OFILES := $(patsubst %.cpp,$(BUILD)/%.o,$(CPPFILES))

all: $(NAME)

Expand Down Expand Up @@ -64,24 +64,19 @@ uninstall:
endif
endif

switch:
$(MAKE) -f Makefile.switch

$(NAME): $(OFILES)
g++ -o $@ $(ARGS) $^ $(LIBS)

$(BUILD)/%.o: %.cpp $(HFILES) $(BUILD)
g++ -c -o $@ $(ARGS) $(INCLUDES) $<
g++ -c -o $@ $(ARGS) $(INCS) $<

$(BUILD):
for dir in $(SOURCES); \
do \
mkdir -p $(BUILD)/$$dir; \
done
for dir in $(SRCS); do mkdir -p $(BUILD)/$$dir; done

switch:
$(MAKE) -f Makefile.switch

clean:
ifneq ($(strip $(DEVKITPRO)),)
$(MAKE) -f Makefile.switch clean
endif
if [ -d "build-switch" ]; then $(MAKE) -f Makefile.switch clean; fi
rm -rf $(BUILD)
rm -f $(NAME)
48 changes: 34 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,48 @@
An experimental N64 emulator

### Overview
My main goal with rokuyon is to learn about the Nintendo 64 hardware so I can write homebrew like [sodium64](https://github.com/Hydr8gon/sodium64). If it ends up being more than that... I wouldn't mind making a modern, accurate N64 emulator with built-in software/hardware rendering and no messy plugins.
My main goal with rokuyon is to learn about the N64's hardware so I can write homebrew like
[sodium64](https://github.com/Hydr8gon/sodium64). If it ends up being more than that, I wouldn't mind making a modern,
accurate N64 emulator with built-in software/hardware rendering and no messy plugins.

### Downloads
rokuyon is available for Linux, macOS, Windows, and Switch. Automatic builds are provided via GitHub Actions; you can download them on the [releases page](https://github.com/Hydr8gon/rokuyon/releases).
rokuyon is available for Windows, macOS, Linux, and Switch. The latest builds are automatically provided via GitHub
Actions, and can be downloaded from the [releases page](https://github.com/Hydr8gon/rokuyon/releases).

### Usage
Although still in early stages, rokuyon should be plug-and-play with any NTSC ROMs in big-endian format. Performance will be bad and there will be plenty of issues. At this stage, rokuyon should be considered a curiosity and not a dedicated emulator for playing games.
No setup is required to run things in rokuyon, but right now it only supports NTSC ROMs in big-endian format. Save types
are not automatically detected, and must be manually selected in the file menu to work. Performance will be bad without
a powerful CPU, and you'll probably encounter plenty of emulation issues. At this stage, rokuyon should be considered a
curiosity and not a dedicated emulator for playing games.

### Contributing
While I appreciate anyone who wants to contribute, my goal with this project is to challenge myself and not to review code. I feel guilty rejecting a change that someone spent time on, but I also don't feel great accepting changes that I didn't ask for. For this reason, I've decided to stop accepting pull requests. You're of course still free to do anything with the code that's allowed by the license, but if you submit a pull request it will likely be ignored. I hope this is understandable!
This is a personal project, and I've decided to not review or accept pull requests for it. If you want to help, you can
test things and report issues or provide feedback. If you can afford it, you can also donate to motivate me and allow me
to spend more time on things like this. Nothing is mandatory, and I appreciate any interest in my projects, even if
you're just a user!

### References
* [n64dev](https://github.com/mikeryan/n64dev) - A collection of useful materials for initial research
* [N64brew Wiki](https://n64brew.dev/wiki/Main_Page) - Extensive and organized documentation of the whole system
* [libdragon](https://github.com/DragonMinded/libdragon) - An open-source N64 SDK with good examples of using the hardware
### Building
**Windows:** Install [MSYS2](https://www.msys2.org) and run the command
`pacman -Syu mingw-w64-x86_64-{gcc,pkg-config,wxWidgets,portaudio,jbigkit} make` to get dependencies. Navigate to the
project root directory and run `make -j$(nproc)` to start building.

**macOS/Linux:** On the target system, install [wxWidgets](https://www.wxwidgets.org) and
[PortAudio](https://www.portaudio.com). This can be done with the [Homebrew](https://brew.sh) package manager on macOS,
or a built-in package manager on Linux. Run `make -j$(nproc)` in the project root directory to start building.

**Switch:** Install [devkitPro](https://devkitpro.org/wiki/Getting_Started) and its `switch-dev` package. Run
`make switch -j$(nproc)` in the project root directory to start building.

### Hardware References
* [N64brew Wiki](https://n64brew.dev/wiki/Main_Page) - Extensive documentation of both hardware and software
* [RSP Vector Instructions](https://emudev.org/2020/03/28/RSP.html) - Detailed information on how vector opcodes work
* [RCP Documentation](https://dragonminded.com/n64dev/Reality%20Coprocessor.pdf) - Nice reference for a subset of RDP functionality
* [RDP Triangle Command Guide](https://docs.google.com/document/d/17ddEo61V0suXbSkKP5mY97QxgUnB-QfAjuBIsPiLWko) - Covers everything related to RDP triangles
* [N64 bilinear filter (3-point)](https://www.shadertoy.com/view/Ws2fWV) - Reference implementation of the N64's texture filter
* [dgb-n64](https://github.com/Dillonb/n64) - Provides details of the FLASH interface, since it isn't documented
* Hardware tests - I'll probably be testing things myself as I go along
* [RCP Documentation](https://dragonminded.com/n64dev/Reality%20Coprocessor.pdf) - Nice reference for a subset of RDP
functionality
* [RDP Triangle Command Guide](https://docs.google.com/document/d/17ddEo61V0suXbSkKP5mY97QxgUnB-QfAjuBIsPiLWko) - Covers
everything related to RDP triangles
* [n64-systemtest](https://github.com/lemmy-64/n64-systemtest) - Comprehensive tests that target all parts of the system
* [n64dev](https://github.com/mikeryan/n64dev) - A collection of useful documents and source code

### Other Links
* [Hydra's Lair](https://hydr8gon.github.io) - Blog where I may or may not write about things
* [Discord Server](https://discord.gg/JbNz7y4) - Place to chat about my projects and stuff
* [Discord Server](https://discord.gg/JbNz7y4) - A place to chat about my projects and stuff
2 changes: 1 addition & 1 deletion src/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ template <typename T> void Memory::write(uint32_t address, T value)

void Memory::writeFlash(uint32_t value)
{
// Handle a FLASH register write based on the command byte
// Handle a FLASH register write based on https://github.com/Dillonb/n64
switch (uint8_t command = value >> 24)
{
case 0xD2: // Execute
Expand Down
2 changes: 1 addition & 1 deletion src/rdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ uint32_t RDP::getTexel(Tile &tile, int s, int t, bool rect)
s -= tile.sBase;
t -= tile.tBase;

// Fall back to nearest sampling when appropriate
// Fall back to nearest sampling, or filter based on https://www.shadertoy.com/view/Ws2fWV
if (!Settings::texFilter || !texFilter || cycleType >= COPY_MODE)
return getRawTexel(tile, s >> 5, t >> 5);

Expand Down

0 comments on commit 913939d

Please sign in to comment.