Skip to content

Commit

Permalink
Merge pull request #283 from alekmaul/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
alekmaul authored Jun 10, 2024
2 parents 600f5d6 + f49bae6 commit 5edc3ef
Show file tree
Hide file tree
Showing 156 changed files with 7,051 additions and 1,573 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2012-2023 alekmaul
Copyright (c) 2012-2024 alekmaul

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion compiler/tcc
Submodule tcc updated 6 files
+3 −3 816-gen.c
+4 −2 Readme.md
+1 −1 libtcc.c
+19 −3 tcc.c
+5 −0 tcc.h
+19 −2 tccelf.c
11 changes: 8 additions & 3 deletions devkitsnes/readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
DevkitSnes 4.1.1

Programming Compiler and Tools for Snes
Programming Compiler and Tools for Snes

INTRODUCTION
----------------------
Expand Down Expand Up @@ -28,9 +26,16 @@ SPECIAL THANKS
n_Arno for his help on Linux version (https://github.com/nArnoSNES/)
kobenairb for python & docker optimizations
jeffythedragonslayer for code cleaning and new functions
DigiDwrf for hirom / fastrom support

CHANGE LOG
----------------------
VERSION V4.3.0 (June,10,2024)
- See github changelog of the release

VERSION V4.2.1 (March,04,2024)
- See github changelog of the release

VERSION V4.2.0 (March,04,2024)
- See github changelog of the release

Expand Down
48 changes: 45 additions & 3 deletions devkitsnes/snes_rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ ifeq ($(origin SRC), undefined)
SRC := src
endif

LIBDIRSOBJS := $(PVSNESLIB_HOME)/pvsneslib/lib

# to avoid some bugs if the PVSNESLIB_HOME is not well defined, we let a small check here
ifeq ($(findstring \,$(PVSNESLIB_HOME)),\)
$(error "PVSNESLIB_HOME environment variable is not defined correctly: the path must be in Unix style (on Windows operating system too!). For example, use /c/snesdev instead of c:\snesdev")
Expand All @@ -18,6 +16,32 @@ DEBUG = 0
$(info The debug mode is NOT enabled, you can do it by executing "export PVSNESLIB_DEBUG=1")
endif

ifeq ($(HIROM),1)
HIROM = 1
$(info HiROM compilation is enabled)
ifeq ($(FASTROM),1)
LIBDIRSOBJS := $(PVSNESLIB_HOME)/pvsneslib/lib/HiROM_FastROM
else
LIBDIRSOBJS := $(PVSNESLIB_HOME)/pvsneslib/lib/HiROM_SlowROM
endif
else
HIROM = 0
$(info LoROM compilation is enabled)
ifeq ($(FASTROM),1)
LIBDIRSOBJS := $(PVSNESLIB_HOME)/pvsneslib/lib/LoROM_FastROM
else
LIBDIRSOBJS := $(PVSNESLIB_HOME)/pvsneslib/lib/LoROM_SlowROM
endif
endif

ifeq ($(FASTROM),1)
FASTROM = 1
$(info FastROM compilation is enabled)
else
FASTROM = 0
$(info SlowROM compilation is enabled)
endif

#---------------------------------------------------------------------------------
# on windows, linkfile can only manage path like E:\pvsneslib\lib\crt0_snes.obj
# this one doesn't work /e/pvsneslib/lib/crt0_snes.obj
Expand Down Expand Up @@ -76,6 +100,11 @@ SFILES := $(SFILES) $(wildcard $(SRC)/*.asm)
SFILES := $(SFILES) $(wildcard $(SRC)/*/*.asm)
SFILES := $(SFILES) $(wildcard $(SRC)/*/*/*.asm)

DBGFILES = $(wildcard *.dbg)
DBGFILES+= $(wildcard $(SRC)/*.dbg)
DBGFILES+= $(wildcard $(SRC)/*/*.dbg)
DBGFILES+= $(wildcard $(SRC)/*/*/*.dbg)

export OFILES := $(BINFILES:.bin=.obj) $(CFILES:.c=.obj) $(SFILES:.asm=.obj)

# The first rule available in makefile become the default one
Expand All @@ -85,7 +114,20 @@ export OFILES := $(BINFILES:.bin=.obj) $(CFILES:.c=.obj) $(SFILES:.asm=.obj)
#---------------------------------------------------------------------------------
%.ps: %.c
@echo Compiling to .ps ... $(notdir $<)
ifeq ($(HIROM),1)
ifeq ($(FASTROM),1)
$(CC) $(CFLAGS) -Wall -c $< -H -F -o $@
else
$(CC) $(CFLAGS) -Wall -c $< -H -o $@
endif
else
ifeq ($(FASTROM),1)
$(CC) $(CFLAGS) -Wall -c $< -F -o $@
else
$(CC) $(CFLAGS) -Wall -c $< -o $@
endif
endif

ifeq ($(DEBUG),1)
cp $@ [email protected]
endif
Expand Down Expand Up @@ -152,7 +194,7 @@ $(SOUNDBANK).asm : $(AUDIOFILES)

cleanBuildRes: cleanDebug
@echo clean build resources
@rm -f $(OFILES) linkfile
@rm -f $(OFILES) $(DBGFILES) linkfile

cleanRom:
@echo clean rom
Expand Down
27 changes: 23 additions & 4 deletions pvsneslib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export TOPDIR := $(CURDIR)

# create version number which will be used everywhere
export PVSNESLIB_MAJOR := 4
export PVSNESLIB_MINOR := 2
export PVSNESLIB_MINOR := 3
export PVSNESLIB_PATCH := 0
export PVSNESLIB_VERSION := $(PVSNESLIB_MAJOR).$(PVSNESLIB_MINOR).$(PVSNESLIB_PATCH)

Expand All @@ -15,16 +15,35 @@ export PVSDOCSDIR := $(TOPDIR)/docs

all: include/snes/libversion.h pvsneslibversion release docs

HIROM_VALUES := 0 1
FASTROM_VALUES := 0 1
KEEP_LIB := 0

release: lib
$(MAKE) -C source all
@$(foreach HIROM, $(HIROM_VALUES), \
$(foreach FASTROM, $(FASTROM_VALUES), \
$(MAKE) HIROM=$(HIROM) FASTROM=$(FASTROM) build; \
$(MAKE) KEEP_LIB=1 clean; \
) \
)

build:
@$(MAKE) -C source all

lib:
@mkdir -p $@
@mkdir -p $@/LoROM_SlowROM
@mkdir -p $@/LoROM_FastROM
@mkdir -p $@/HiROM_SlowROM
@mkdir -p $@/HiROM_FastROM

clean:
$(MAKE) -C source clean
@rm -rf $(PVSDOCSDIR)/html
@rm -f pvsneslib_version.txt
@if [ "$(KEEP_LIB)" -eq 0 ]; then \
rm -rf $(PVSDOCSDIR)/html; \
rm -f pvsneslib_version.txt; \
rm -rf lib; \
fi

# Check if Doxygen is installed
doxygenInstalled := $(shell command -v doxygen -q 2> /dev/null)
Expand Down
18 changes: 11 additions & 7 deletions pvsneslib/include/snes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------------
Copyright (C) 2012-2021
Copyright (C) 2012-2024
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
Expand Down Expand Up @@ -52,7 +52,7 @@
- \ref interrupt.h "Interrupts"
\section user_io_api User Input/output
- \ref pad.h "Keypad"
- \ref input.h "Keypad"
- \ref console.h "Console and Debug Printing"
\section engine_api Engine API functions
Expand All @@ -75,6 +75,7 @@
- <a href="http://code.google.com/p/neo-myth-menu/">Neoflash Menu google code. </a>
- <a href="http://www.devkitpro.org/">Devkitpro team for pvsneslib structure (lib, makefile, examples, and so on ...). </a>
- <a href="https://github.com/undisbeliever/castle_platformer">undisbeliever for his great platform code example on github. </a>
- <a href="https://github.com/DigiDwrf">digidwrf for fastrom / hirom support, mouse and superscope support. </a>
*/

// adding the example page.
Expand Down Expand Up @@ -119,9 +120,11 @@
<!-- palettes -->
\example graphics/Palette/GetColors/GetColors.c
<!-- keypad -->
\example pads/input/input.c
\example pads/multiplay5/multiplay5.c
<!-- inputs -->
\example input/controller/controller.c
\example input/mouse/mouse.c
\example input/multiplay5/multiplay5.c
\example input/superscope/superscope.c
<!-- timing -->
\example timer/timer.c
Expand Down Expand Up @@ -160,9 +163,10 @@
<!-- scoring -->
\example scoring/scoring.c
<!-- region test & console type -->
<!-- region test, console type and rom type -->
\example testregion/testregion.c
\example typeconsole/src/pal_ntsc.c
\example memory_mapping/src/memory_mapping.c
*/

Expand All @@ -174,10 +178,10 @@
#include "snes/background.h"
#include "snes/console.h"
#include "snes/dma.h"
#include "snes/input.h"
#include "snes/interrupt.h"
#include "snes/map.h"
#include "snes/object.h"
#include "snes/pad.h"
#include "snes/scores.h"
#include "snes/sound.h"
#include "snes/sprite.h"
Expand Down
4 changes: 2 additions & 2 deletions pvsneslib/include/snes/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@

#include <snes/background.h>
#include <snes/dma.h>
#include <snes/input.h>
#include <snes/interrupt.h>
#include <snes/pad.h>
#include <snes/sprite.h>
#include <snes/sound.h>
#include <snes/video.h>

extern u8 scr_txt_font_map[0x800]; /*!< \brief tilemap used for text display */
extern u8 scr_txt_dirty; /*!< \brief flag to redraw text during vblank */

extern u16 snes_vblank_count; /*!< \brief Number of VBL since consoleInit called */
extern u16 snes_vblank_count; /*!< \brief Number of VBL since consoleInit called (16 bits longs so reset each 18 minutes in NTSC)*/
extern u8 snes_50hz; /*!< \brief 1 if on a PAL/50Hz SNES */
extern u8 snes_fps; /*!< \brief 50 if PAL console (50 Hz) or 60 if NTSC console (60Hz) */

Expand Down
Loading

0 comments on commit 5edc3ef

Please sign in to comment.