Skip to content

Commit

Permalink
Port Linux X11 window system to the newer XCB API and misc tweaks
Browse files Browse the repository at this point in the history
* Imagine: Update all Xlib code to equivalent XCB/xkbcommon functions
* Imagine: Explicitly initialize XFixes extension in case X server hasn't done so already
* Imagine: Update bundled libxcb to 1.17.0 and add related xkbcommon and xcb-util-wm libraries
* Imagine: Remove all unused bundled Xlib libraries
* Imagine: Update bundled libarchive to 3.7.4
* Imagine: Update Linux compatibility wrappers for old glibc versions
* Imagine: Set NativeDisplayConnection and ScreenId types in platform headers
* GBA.emu: Simplify line renderer function pointer code
  • Loading branch information
Robert Broglia committed May 18, 2024
1 parent ab49bdc commit eb2b413
Show file tree
Hide file tree
Showing 83 changed files with 1,343 additions and 970 deletions.
14 changes: 7 additions & 7 deletions GBA.emu/src/core/gba/gba.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1809,19 +1809,19 @@ void CPUUpdateRender(GBASys &gba)
if (DISPCNT & 0x80)
{
systemMessage(0, "Set forced blank");
gba.lcd.renderLine = ((DISPCNT & 7) == 0) ? blankLine : blankLineUpdateLastVCount;
gba.lcd.renderLine = blankLine;
}
else
{
static constexpr GBALCD::RenderLineFunc norm[8] =
static constexpr GBALCD::RenderLineFunc norm[8]
{ mode0RenderLine, mode1RenderLine, mode2RenderLine, mode3RenderLine, mode4RenderLine, mode5RenderLine,
blankLine };
static constexpr GBALCD::RenderLineFunc noWin[8] =
blankLine, blankLine };
static constexpr GBALCD::RenderLineFunc noWin[8]
{ mode0RenderLineNoWindow, mode1RenderLineNoWindow, mode2RenderLineNoWindow, mode3RenderLineNoWindow, mode4RenderLineNoWindow, mode5RenderLineNoWindow,
blankLine };
static constexpr GBALCD::RenderLineFunc all[8] =
blankLine, blankLine };
static constexpr GBALCD::RenderLineFunc all[8]
{ mode0RenderLineAll, mode1RenderLineAll, mode2RenderLineAll, mode3RenderLineAll, mode4RenderLineAll, mode5RenderLineAll,
blankLine };
blankLine, blankLine };
size_t mode = DISPCNT & 7;
gba.lcd.renderLine = ((!fxOn && !windowOn && !(layerEnable & 0x8000)) || coreOptions.cpuDisableSfx) ? norm[mode] :
(fxOn && !windowOn && !(layerEnable & 0x8000)) ? noWin[mode] :
Expand Down
5 changes: 0 additions & 5 deletions GBA.emu/src/main/GBASys.hh
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,5 @@ static void blankLine(MixColorType *lineMix, GBALCD &lcd, const GBAMem::IoMem &i
{
for (int x = 0; x < 240; x++)
lineMix[x] = 0x7fff;
}

static void blankLineUpdateLastVCount(MixColorType *lineMix, GBALCD &lcd, const GBAMem::IoMem &ioMem)
{
blankLine(lineMix, lcd, ioMem);
lcd.gfxLastVCOUNT = ioMem.VCOUNT;
}
37 changes: 0 additions & 37 deletions imagine/bundle/all/src/fixesproto/common.mk

This file was deleted.

1 change: 0 additions & 1 deletion imagine/bundle/all/src/fixesproto/config.mk

This file was deleted.

Binary file not shown.
37 changes: 0 additions & 37 deletions imagine/bundle/all/src/inputproto/common.mk

This file was deleted.

1 change: 0 additions & 1 deletion imagine/bundle/all/src/inputproto/config.mk

This file was deleted.

Binary file not shown.
41 changes: 0 additions & 41 deletions imagine/bundle/all/src/libX11/common.mk

This file was deleted.

2 changes: 0 additions & 2 deletions imagine/bundle/all/src/libX11/config.mk

This file was deleted.

Binary file removed imagine/bundle/all/src/libX11/libX11-1.8.7.tar.xz
Binary file not shown.
1 change: 0 additions & 1 deletion imagine/bundle/all/src/libX11/linux-armv7-pandora.mk

This file was deleted.

41 changes: 0 additions & 41 deletions imagine/bundle/all/src/libXext/common.mk

This file was deleted.

2 changes: 0 additions & 2 deletions imagine/bundle/all/src/libXext/config.mk

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion imagine/bundle/all/src/libXext/linux-armv7-pandora.mk

This file was deleted.

39 changes: 0 additions & 39 deletions imagine/bundle/all/src/libXfixes/common.mk

This file was deleted.

2 changes: 0 additions & 2 deletions imagine/bundle/all/src/libXfixes/config.mk

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion imagine/bundle/all/src/libXfixes/linux-armv7-pandora.mk

This file was deleted.

41 changes: 0 additions & 41 deletions imagine/bundle/all/src/libXi/common.mk

This file was deleted.

2 changes: 0 additions & 2 deletions imagine/bundle/all/src/libXi/config.mk

This file was deleted.

Binary file removed imagine/bundle/all/src/libXi/libXi-1.7.9.tar.bz2
Binary file not shown.
1 change: 0 additions & 1 deletion imagine/bundle/all/src/libXi/linux-armv7-pandora.mk

This file was deleted.

2 changes: 1 addition & 1 deletion imagine/bundle/all/src/libarchive/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ endif

include $(buildSysPath)/imagineSDKPath.mk

libarchiveVer := 3.7.2
libarchiveVer := 3.7.4
libarchiveSrcDir := $(tempDir)/libarchive-$(libarchiveVer)
libarchiveSrcArchive := libarchive-$(libarchiveVer).tar.xz

Expand Down
Binary file not shown.
Binary file not shown.
22 changes: 12 additions & 10 deletions imagine/bundle/all/src/libxcb/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,38 @@ else
buildArg := --build=$(shell cc -dumpmachine)
endif

libxcbVer := 1.16
libxcbSrcDir := libxcb-$(libxcbVer)
libxcbVer := 1.17.0
libxcbSrcDir := $(tempDir)/libxcb-$(libxcbVer)
libxcbSrcArchive := libxcb-$(libxcbVer).tar.xz

makeFile := $(buildDir)/Makefile
outputLibFile := $(buildDir)/src/.libs/libxcb.a
outputLibFiles := $(buildDir)/src/.libs/libxcb.a $(buildDir)/src/.libs/libxcb-xinput.a $(buildDir)/src/.libs/libxcb-randr.a \
$(buildDir)/src/.libs/libxcb-xkb.a $(buildDir)/src/.libs/libxcb-xfixes.a $(buildDir)/src/.libs/libxcb-render.a $(buildDir)/src/.libs/libxcb-shape.a
installIncludeDir := $(installDir)/include/xcb

all : $(outputLibFile)
all : $(outputLibFiles)

install : $(outputLibFile)
install : $(outputLibFiles)
@echo "Installing libxcb to: $(installDir)"
@mkdir -p $(installIncludeDir) $(installDir)/lib/pkgconfig
cp $(outputLibFile) $(installDir)/lib/
cp $(outputLibFiles) $(installDir)/lib/
cp $(libxcbSrcDir)/src/*.h $(buildDir)/src/*.h $(installIncludeDir)/
cp $(buildDir)/xcb.pc $(installDir)/lib/pkgconfig/
cp $(buildDir)/xcb.pc $(buildDir)/xcb-xinput.pc $(buildDir)/xcb-randr.pc $(buildDir)/xcb-xkb.pc $(buildDir)/xcb-xfixes.pc $(buildDir)/xcb-render.pc $(buildDir)/xcb-shape.pc $(installDir)/lib/pkgconfig/

.PHONY : all install

$(libxcbSrcDir)/configure : | $(libxcbSrcArchive)
@echo "Extracting libxcb..."
tar -mxJf $|
mkdir -p $(tempDir)
tar -mxJf $| -C $(tempDir)
cd $(libxcbSrcDir) && autoreconf -isf

$(outputLibFile) : $(makeFile)
$(outputLibFiles) : $(makeFile)
@echo "Building libxcb..."
$(MAKE) -C $(<D)

$(makeFile) : $(libxcbSrcDir)/configure
@echo "Configuring libxcb..."
@mkdir -p $(@D)
dir=`pwd` && cd $(@D) && CC="$(CC)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" LD="$(LD)" LDFLAGS="$(LDLIBS)" $$dir/$(libxcbSrcDir)/configure --prefix=$(installDir) --disable-build-docs --disable-shared --host=$(CHOST) PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) PKG_CONFIG=pkg-config $(buildArg)
dir=`pwd` && cd $(@D) && CC="$(CC)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" LD="$(LD)" LDFLAGS="$(LDLIBS)" $(libxcbSrcDir)/configure --prefix=$(installDir) --disable-build-docs --disable-shared --host=$(CHOST) PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) PKG_CONFIG=pkg-config $(buildArg)

Binary file removed imagine/bundle/all/src/libxcb/libxcb-1.16.tar.xz
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions imagine/bundle/all/src/libxcb/linux-x86.mk
1 change: 1 addition & 0 deletions imagine/bundle/all/src/libxcb/linux-x86_64.mk
Loading

0 comments on commit eb2b413

Please sign in to comment.