Skip to content

Commit 43db8cc

Browse files
committed
Move around files
1 parent a23632a commit 43db8cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+351
-319
lines changed

Diff for: .gitignore

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77
*.aps
88
/obj/
99
/bin/
10-
/tables/overworld/*.yaml
11-
/tables/dungeon/*.yaml
12-
/tables/img/
13-
/tables/old/
14-
/tables/zelda3.sfc
15-
/tables/zelda3.smc
10+
/assets/overworld/*.yaml
11+
/assets/dungeon/*.yaml
12+
/assets/img/
13+
/assets/old/
14+
/zelda3.sfc
15+
/zelda3.smc
1616
/saves/*.sav
1717
/saves/sram.dat
1818
/saves/sram.bak
1919
/zelda3
2020
__pycache__
21-
/*.o
21+
/src/*.o
2222
/*.exe
2323
/*.out
2424
/snes/*.o
2525
/msu/
2626
/tmp/
27-
/tables/zelda3_assets.dat
27+
/zelda3_assets.dat
2828
/SDL2.dll
2929
/zelda3.*.ini
3030
/zelda3.wiki

Diff for: Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
TARGET_EXEC:=zelda3
22
ROM:=tables/zelda3.sfc
3-
SRCS:=$(wildcard *.c snes/*.c) third_party/gl_core/gl_core_3_1.c third_party/opus-1.3.1-stripped/opus_decoder_amalgam.c
3+
SRCS:=$(wildcard src/*.c snes/*.c) third_party/gl_core/gl_core_3_1.c third_party/opus-1.3.1-stripped/opus_decoder_amalgam.c
44
OBJS:=$(SRCS:%.c=%.o)
55
PYTHON:=/usr/bin/env python3
6-
CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-O2 -Werror)
6+
CFLAGS:=$(if $(CFLAGS),$(CFLAGS),-O2 -Werror) -I .
77
CFLAGS:=${CFLAGS} $(shell sdl2-config --cflags) -DSYSTEM_VOLUME_MIXER_AVAILABLE=0
88

99
ifeq (${OS},Windows_NT)
@@ -16,23 +16,23 @@ endif
1616

1717
.PHONY: all clean clean_obj clean_gen
1818

19-
all: $(TARGET_EXEC) tables/zelda3_assets.dat
19+
all: $(TARGET_EXEC) zelda3_assets.dat
2020
$(TARGET_EXEC): $(OBJS) $(RES)
2121
$(CC) $^ -o $@ $(LDFLAGS) $(SDLFLAGS)
2222
%.o : %.c
2323
$(CC) -c $(CFLAGS) $< -o $@
2424

25-
$(RES): platform/win32/zelda3.rc
25+
$(RES): src/platform/win32/zelda3.rc
2626
@echo "Generating Windows resources"
2727
@$(WINDRES) $< -O coff -o $@
2828

29-
tables/zelda3_assets.dat:
29+
zelda3_assets.dat:
3030
@echo "Extracting game resources"
31-
@cd tables; $(PYTHON) restool.py --extract-from-rom -r ../$(ROM)
31+
$(PYTHON) assets/restool.py --extract-from-rom
3232

3333
clean: clean_obj clean_gen
3434
clean_obj:
3535
@$(RM) $(OBJS) $(TARGET_EXEC)
3636
clean_gen:
37-
@$(RM) $(RES) tables/zelda3_assets.dat tables/*.txt tables/*.png tables/sprites/*.png tables/*.yaml
37+
@$(RM) $(RES) zelda3_assets.dat tables/zelda3_assets.dat tables/*.txt tables/*.png tables/sprites/*.png tables/*.yaml
3838
@rm -rf tables/__pycache__ tables/dungeon tables/img tables/overworld tables/sound

Diff for: README.md

+9-11

Diff for: tables/.gitignore renamed to assets/.gitignore

File renamed without changes.
File renamed without changes.

Diff for: tables/compile_resources.py renamed to assets/compile_resources.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ def write_assets_to_file(print_header = False):
809809
file_data += b'\0'
810810
file_data += v
811811

812-
open('zelda3_assets.dat', 'wb').write(file_data)
812+
open('../zelda3_assets.dat', 'wb').write(file_data)
813813

814814
def main(args):
815815
print_all(args)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: tables/restool.py renamed to assets/restool.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import argparse
22
import util
33
import sys
4+
import os
5+
6+
os.chdir(os.path.dirname(__file__))
7+
48

59
parser = argparse.ArgumentParser(description='Resource tool used to build zelda3_assets.dat', allow_abbrev=False)
610
parser.add_argument('-r', '--rom', nargs='?', metavar='ROM')
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: tables/tables.py renamed to assets/tables.py

File renamed without changes.
File renamed without changes.

Diff for: tables/util.py renamed to assets/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def cache(user_function):
1010

1111
# Both are common SNES rom extensions. For Zelda3 (NA), they are equivalent files.
1212
COMMON_ROM_NAMES = ['zelda3.sfc', 'zelda3.smc']
13-
DEFAULT_ROM_DIRECTORY = os.path.dirname(__file__)
13+
DEFAULT_ROM_DIRECTORY = os.path.join(os.path.dirname(__file__), '..')
1414

1515
ZELDA3_SHA1_US = '6D4F10A8B10E10DBE624CB23CF03B88BB8252973'
1616
ZELDA3_SHA1 = {

Diff for: extract_assets.bat

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@echo off
2+
3+
2>nul (del zelda3_assets.dat)
4+
python assets/restool.py --extract-from-rom
5+
IF NOT ERRORLEVEL 0 goto ERROR
6+
7+
IF NOT EXIST "zelda3_assets.dat" (
8+
ECHO ERROR: The python program didn't generate zelda3_assets.dat successfully.
9+
goto ERROR
10+
) ELSE (
11+
REM
12+
)
13+
14+
goto DONE
15+
16+
17+
:ERROR
18+
ECHO:
19+
ECHO ERROR: Asset extraction failed!
20+
pause
21+
EXIT /B 1
22+
23+
:DONE
24+
echo Complete!
25+
pause

Diff for: run_with_tcc.bat

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ IF NOT EXIST "%SDL2%\lib\x64\SDL2.dll" (
2525
REM
2626
)
2727

28-
IF NOT EXIST "tables\zelda3_assets.dat" (
28+
IF NOT EXIST "zelda3_assets.dat" (
2929
ECHO:
30-
ECHO ERROR: tables\zelda3_assets.dat was not found.
30+
ECHO ERROR: zelda3_assets.dat was not found.
3131
ECHO You need to extract assets from the ROM first, or get this file from a friend. Please see README.md
3232
ECHO:
3333
PAUSE
@@ -38,7 +38,7 @@ IF NOT EXIST "tables\zelda3_assets.dat" (
3838

3939

4040
echo Building with TCC...
41-
third_party\tcc\tcc.exe -ozelda3.exe -DCOMPILER_TCC=1 -DSTBI_NO_SIMD=1 -DHAVE_STDINT_H=1 -D_HAVE_STDINT_H=1 -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I%SDL2%/include -L%SDL2%/lib/x64 -lSDL2 *.c snes/*.c third_party/gl_core/gl_core_3_1.c third_party/opus-1.3.1-stripped/opus_decoder_amalgam.c
41+
third_party\tcc\tcc.exe -ozelda3.exe -DCOMPILER_TCC=1 -DSTBI_NO_SIMD=1 -DHAVE_STDINT_H=1 -D_HAVE_STDINT_H=1 -DSYSTEM_VOLUME_MIXER_AVAILABLE=0 -I%SDL2%/include -L%SDL2%/lib/x64 -lSDL2 -I. src/*.c snes/*.c third_party/gl_core/gl_core_3_1.c third_party/opus-1.3.1-stripped/opus_decoder_amalgam.c
4242
IF ERRORLEVEL 1 goto GETOUT
4343

4444
copy %SDL2%\lib\x64\SDL2.dll .

Diff for: snes/ppu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <stddef.h>
77
#include <assert.h>
88
#include "ppu.h"
9-
#include "../types.h"
9+
#include "src/types.h"
1010

1111
static const uint8 kSpriteSizes[8][2] = {
1212
{8, 16}, {8, 32}, {8, 64}, {16, 32},

Diff for: snes/ppu.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#include <string.h>
88
#include <stdint.h>
99
#include <stdbool.h>
10-
#include "saveload.h"
10+
#include "snes/saveload.h"
1111
typedef struct Ppu Ppu;
1212

13-
#include "../types.h"
13+
#include "src/types.h"
1414

1515
typedef struct BgLayer {
1616
uint16_t hScroll;

Diff for: ancilla.c renamed to src/ancilla.c

File renamed without changes.

Diff for: ancilla.h renamed to src/ancilla.h

File renamed without changes.

Diff for: assets.h renamed to src/assets.h

File renamed without changes.

Diff for: attract.c renamed to src/attract.c

File renamed without changes.

Diff for: attract.h renamed to src/attract.h

File renamed without changes.

Diff for: audio.c renamed to src/audio.c

File renamed without changes.

Diff for: audio.h renamed to src/audio.h

File renamed without changes.

Diff for: config.c renamed to src/config.c

File renamed without changes.

Diff for: config.h renamed to src/config.h

File renamed without changes.

Diff for: dungeon.c renamed to src/dungeon.c

File renamed without changes.

Diff for: dungeon.h renamed to src/dungeon.h

File renamed without changes.

Diff for: ending.c renamed to src/ending.c

File renamed without changes.

Diff for: ending.h renamed to src/ending.h

File renamed without changes.

Diff for: features.h renamed to src/features.h

File renamed without changes.

Diff for: glsl_shader.c renamed to src/glsl_shader.c

File renamed without changes.

Diff for: glsl_shader.h renamed to src/glsl_shader.h

File renamed without changes.

Diff for: hud.c renamed to src/hud.c

File renamed without changes.

Diff for: hud.h renamed to src/hud.h

File renamed without changes.

Diff for: load_gfx.c renamed to src/load_gfx.c

File renamed without changes.

Diff for: load_gfx.h renamed to src/load_gfx.h

File renamed without changes.

Diff for: main.c renamed to src/main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -810,9 +810,9 @@ uint32 g_asset_sizes[kNumberOfAssets];
810810

811811
static void LoadAssets() {
812812
size_t length = 0;
813-
uint8 *data = ReadWholeFile("tables/zelda3_assets.dat", &length);
813+
uint8 *data = ReadWholeFile("zelda3_assets.dat", &length);
814814
if (!data)
815-
data = ReadWholeFile("zelda3_assets.dat", &length);
815+
data = ReadWholeFile("tables/zelda3_assets.dat", &length);
816816
if (!data) Die("Failed to read zelda3_assets.dat. Please see the README for information about how you get this file.");
817817

818818
static const char kAssetsSig[] = { kAssets_Sig };

Diff for: messaging.c renamed to src/messaging.c

File renamed without changes.

Diff for: messaging.h renamed to src/messaging.h

File renamed without changes.

Diff for: misc.c renamed to src/misc.c

File renamed without changes.

Diff for: misc.h renamed to src/misc.h

File renamed without changes.

Diff for: nmi.c renamed to src/nmi.c

File renamed without changes.

Diff for: nmi.h renamed to src/nmi.h

File renamed without changes.

Diff for: opengl.c renamed to src/opengl.c

File renamed without changes.

Diff for: overlord.c renamed to src/overlord.c

File renamed without changes.

Diff for: overlord.h renamed to src/overlord.h

File renamed without changes.

Diff for: overworld.c renamed to src/overworld.c

File renamed without changes.

Diff for: overworld.h renamed to src/overworld.h

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: platform/win32/zelda3.rc renamed to src/platform/win32/zelda3.rc

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
2727

2828
1 TEXTINCLUDE
2929
BEGIN
30-
"platform\\win32\\resource.h\0"
30+
"src\\platform\\win32\\resource.h\0"
3131
END
3232

3333
2 TEXTINCLUDE
@@ -52,7 +52,7 @@ END
5252

5353
// Icon with lowest ID value placed first to ensure application icon
5454
// remains consistent on all systems.
55-
IDI_ICON1 ICON "platform\\win32\\triforce.ico"
55+
IDI_ICON1 ICON "src\\platform\\win32\\triforce.ico"
5656

5757
#endif // English (United States) resources
5858
/////////////////////////////////////////////////////////////////////////////

Diff for: player.c renamed to src/player.c

File renamed without changes.

Diff for: player.h renamed to src/player.h

File renamed without changes.

Diff for: player_oam.c renamed to src/player_oam.c

File renamed without changes.

Diff for: player_oam.h renamed to src/player_oam.h

File renamed without changes.

Diff for: poly.c renamed to src/poly.c

File renamed without changes.

Diff for: poly.h renamed to src/poly.h

File renamed without changes.

Diff for: select_file.c renamed to src/select_file.c

File renamed without changes.

Diff for: select_file.h renamed to src/select_file.h

File renamed without changes.

Diff for: spc_player.c renamed to src/spc_player.c

File renamed without changes.

Diff for: spc_player.h renamed to src/spc_player.h

File renamed without changes.

Diff for: sprite.c renamed to src/sprite.c

File renamed without changes.

Diff for: sprite.h renamed to src/sprite.h

File renamed without changes.

Diff for: sprite_main.c renamed to src/sprite_main.c

File renamed without changes.

Diff for: sprite_main.h renamed to src/sprite_main.h

File renamed without changes.

Diff for: tagalong.c renamed to src/tagalong.c

File renamed without changes.

Diff for: tagalong.h renamed to src/tagalong.h

File renamed without changes.

Diff for: tile_detect.c renamed to src/tile_detect.c

File renamed without changes.

Diff for: tile_detect.h renamed to src/tile_detect.h

File renamed without changes.

Diff for: types.h renamed to src/types.h

File renamed without changes.

Diff for: util.c renamed to src/util.c

File renamed without changes.

Diff for: util.h renamed to src/util.h

File renamed without changes.

Diff for: variables.h renamed to src/variables.h

File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: zelda_rtl.c renamed to src/zelda_rtl.c

File renamed without changes.

Diff for: zelda_rtl.h renamed to src/zelda_rtl.h

File renamed without changes.

0 commit comments

Comments
 (0)