libretro-samples/tests/test_advanced
Emery Hemingway fd6547e86f Tupfiles for super-repositories
Add minimal metadata for a Tup build system. Tup will discover any file
named "Tupfile" in a the sub-directories where it is run. In this case a
tupfile defines the core name and invokes the "include_rules" directive,
which will include the Tup rules defined in parent directories. This
allows a parent repository with platform-specific build rules to host
this repository as a submodule. The sample cores may thus be ported to
new platforms without polluting the local makefiles. Naturally the
external build rules must be synchronized with the source code herein,
the tupfiles here only define TARGET_NAME so that they will never
contradict information contained in the makefiles.

A sample Tuprules.tup for a super-repository:

ifeq ($(TARGET_NAME),advanced_tests)
	CFLAGS += -I../../libretro-common/include
	SOURCES_C += libretro-test.c
endif
CFLAGS += -O3 -Wall -pedantic -std=gnu99
: foreach $(SOURCES_C) |> !libretro_cc |> {objs}
: {objs} |> !libretro_ld |> $(TARGET_NAME)_libretro.so
2019-03-03 12:34:32 +01:00
..
jni Add JNI dir for test_advanced 2016-09-05 23:43:12 +02:00
libretro-test.c Clean up whitespace 2016-11-30 19:48:39 +01:00
libretro.h Add demos and tests 2016-09-05 23:39:46 +02:00
link.T Add demos and tests 2016-09-05 23:39:46 +02:00
Makefile Add demos and tests 2016-09-05 23:39:46 +02:00
README.md Clean up whitespace 2016-11-30 19:48:39 +01:00
Tupfile Tupfiles for super-repositories 2019-03-03 12:34:32 +01:00

libretro_test_advanced

An advanced test core written in C for libretro.

This core has a group of tests which you can cycle between by pressing the buttons on the gamepad.

Up and Down will cycle between the test groups. Left and Right will cycle between the tests in each group.

  1. Video output 1a. Color test: A static image, with one red, one green and one blue rectangle, to ensure the channels aren't mixed up. 1b. Tearing test, horizontal: Vertical lines moving horizontally. In pixel format XRGB8888, the Xs will be 00. 1c. Tearing test, vertical: Horizontal lines moving vertically. In pixel format XRGB8888, the Xs will be FF. 1d. vsync test: Flickers between white and black each frame. 1e. Stretching test: A checkerboard of black and white, to test if each square looks smooth. 1f. Border test: A white screen, with red and yellow borders.

  2. Latency and synchronization 2a. A/V sync test. Will switch between white and silent, and black and noisy, every two seconds. 2b. Latency test. If any of ABXYLRStSe are held, it's black and noisy; if not, it's white and silent.

  3. Input 3a. Press any key to check how fast input_state_cb can be called. Also usable as netplay desync detector; all players will get different answers.

  4. Netplay 4a. Input sync. All button presses are sent to the screen; a hash of that is used as background color (varies between pixel formats), for easy comparison.

It will also print two messages to RETRO_ENVIRONMENT_GET_LOG_INTERFACE, which should be identical.

Programming language

C

Building

To compile, you will need a C compiler and associated toolchain installed.

make

or

gcc libretro-test.c -shared -fPIC -lm -o advanced_tests_libretro.so (for Windows, use .dll instead)