Skip to content

Commit

Permalink
Try to be more toolchain agnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
andwn committed Apr 13, 2023
1 parent 8f3da9c commit d195fd8
Show file tree
Hide file tree
Showing 61 changed files with 11,759 additions and 126 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
doukutsu.bin
doukutsu-*.bin
temp.bin
bin/
*.lst
*.cpxm
*.pal
*.pat
*.map
*.tsb
*.spr
*.uftc
*.pcm
*.xgc
*.patch
Expand Down
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/cave-story-md.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/codestream.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/dictionaries/andy.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

38 changes: 0 additions & 38 deletions .idea/misc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

25 changes: 0 additions & 25 deletions .vscode/c_cpp_properties.json

This file was deleted.

24 changes: 18 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ GCCVER := $(shell $(CC) -dumpversion)
PLUGIN := $(MDROOT)/libexec/gcc/m68k-elf/$(GCCVER)

# Z80 Assembler to build XGM driver
ASMZ80 := $(MDBIN)/sjasm
ASMZ80 := bin/sjasm
# SGDK Tools
BINTOS := bin/bintos
RESCOMP := bin/rescomp
WAVTORAW := bin/wavtoraw
XGMTOOL := bin/xgmtool
# Sik's Tools
MDTILER := $(MDBIN)/mdtiler
SLZ := $(MDBIN)/slz
UFTC := $(MDBIN)/uftc
MDTILER := bin/mdtiler
SLZ := bin/slz
UFTC := bin/uftc
# Cave Story Tools
AIGEN := python3 tools/aigen.py
PATCHROM := bin/patchrom
Expand Down Expand Up @@ -139,6 +139,7 @@ translate: $(TARGET)-es.bin $(TARGET)-fr.bin $(TARGET)-de.bin $(TARGET)-it.bin
translate: $(TARGET)-pt.bin $(TARGET)-br.bin $(TARGET)-ja.bin $(TARGET)-zh.bin
translate: $(TARGET)-ko.bin

prereq: $(ASMZ80) $(MDTILER) $(SLZ) $(UFTC)
prereq: $(BINTOS) $(RESCOMP) $(XGMTOOL) $(WAVTORAW) $(TSCOMP)
prereq: $(CPXMS) $(XGCS) $(PCMS) $(ZOBJ) $(TSBS)
prereq: $(TSETO) $(CTSETP) $(CTSETO) $(SPRO) $(CSPRP) $(CSPRO)
Expand Down Expand Up @@ -170,10 +171,13 @@ prereq: $(TSETO) $(CTSETP) $(CTSETO) $(SPRO) $(CSPRP) $(CSPRO)
%.o80: %.s80
$(ASMZ80) $(Z80FLAGS) $< $@ z80_xgm.lst

# Old SGDK tools

bin:
mkdir -p bin

$(ASMZ80): bin
c++ -w -DMAX_PATH=MAXPATHLEN tools/sjasm/*.cpp -o $(ASMZ80)

$(BINTOS): bin
cc tools/bintos.c -o $@

Expand All @@ -186,7 +190,15 @@ $(XGMTOOL): bin
$(WAVTORAW): bin
cc tools/wavtoraw.c -o $@ -lm

# Cave Story tools
$(MDTILER): bin
cc tools/mdtiler/*.c -o $(MDTILER) -lpng

$(SLZ): bin
cc tools/slz/*.c -o $(SLZ)

$(UFTC): bin
cc tools/uftc/*.c -o $(UFTC)

$(TSCOMP): bin
cc tools/tscomp/tscomp.c -o $@

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ You can still get crushed, drown and fall out of bounds.
Note that you can't load or save the game while cheating (including the counter).

## Compilation
1. Setup [marsdev](https://github.com/andwn/marsdev) and `python3`
- Marsdev targets: `m68k-toolchain z80-tools sik-tools`
1. Dependencies: `build-essential libpng-dev python3` and one of the following toolchains:
- [m68k-elf-toolchain](github.com/andwn/m68k-elf-toolchain)
- [Marsdev](github.com/andwn/marsdev)
- [SGDK](github.com/Stephane-D/SGDK)
- [Megadev](github.com/drojaazu/megadev)
- [Gendev](github.com/kubilus1/gendev)
2. Clone & `make`
- For translations: `make translate`

Expand Down
12 changes: 0 additions & 12 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,14 @@ uint8_t paused;
uint8_t gameFrozen;

void aftervsync() {
//disable_ints();
//z80_pause_fast();

vdp_fade_step_dma();
dma_flush();
dqueued = FALSE;
if(ready) {
if(inFade) vdp_sprites_clear();
//if(gamemode == GM_GAME) stage_update(); // Scrolling
vdp_sprites_update();
ready = FALSE;
}

//z80_resume();
//enable_ints();

vdp_fade_step_calc();
joy_update();
}
Expand All @@ -54,9 +46,7 @@ void main() {
if(system_checkdata() != SRAM_INVALID) {
system_load_config();
}
//dma_clear();
joy_init();
//enable_ints();
// Initialize time and speed tables (framerate adjusted)
if(pal_mode) {
time_tab = time_tab_pal;
Expand All @@ -65,8 +55,6 @@ void main() {
time_tab = time_tab_ntsc;
speed_tab = speed_tab_ntsc;
}
// let's the fun go on !

sound_init();

// Error Tests
Expand Down
Loading

0 comments on commit d195fd8

Please sign in to comment.