Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bittboy support #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ ifeq ($(PLATFORM), rs90)
RELEASEDIR := release
endif

ifeq ($(PLATFORM), bittboy)
CC := arm-linux-gcc
STRIP := arm-linux-strip
SYSROOT := $(shell $(CC) --print-sysroot)
CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
CFLAGS += -DSCREEN_SCALE=1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this change to the previous commit, as it is unrelated to the tearing fix.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to move it around.

LDFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs) -lm
endif

ifeq ($(PLATFORM), mingw32)
CC := i486-mingw32-gcc
STRIP := i486-mingw32-strip
Expand Down
14 changes: 14 additions & 0 deletions default/game.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Joystick control mode. Value: 0 - off, 1 - digital, 2 - analog
JOY_MODE 2

# Joystick device number. Value: 0 - first joystick, 1 - second joystick, etc.
JOY_NUM 0

# Joystick deadzone. Value range: 0 - 65535
JOY_DEADZONE 5000

# Screen scale. Value: 1 - original, 2 - double
SCALE 1

# Display mode. Value: 0 - windowed, 1 - fullscreen
FULLSCREEN 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to include a default game config, as the game will generate one on the fly if it doesn't find an existing one.
The same goes about the default score file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some issues with those and got Segmentation Fault on Bittboy. Not sure if it was the reason as I made other changes as well, but for completeness I have put defaults in there. Feel free to remove them.

Binary file added default/score.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion src/states.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void logic()

void draw()
{
clearScreen();
//clearScreen();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't leave commented out code like that.
It appears that clearScreen() has become redundant, as in both STATE_TITLE and STATE_GAME the whole screen area gets repainted with drawBackground() anyway, so we can safely remove this call from the code.
But how does it fix tearing on your platform?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bittboy does not have vsync and apparently the screen is being cleared directly after clearScreen() call. This is a probable reason of black horizontal bars showing in random positions on the screen. After removing that call, screen tearing is not visible to that extent and becomes acceptable (at least for me). Lack of vsync is a known issue on Bittboy.


switch (programStateActive)
{
Expand Down