Skip to content
Merged
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
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ set(INSTALL_PKGCONFIG_DIR "${GSKIT}/lib/pkgconfig" CACHE PATH "Installation dire
set(GSKIT_EXTERNAL_LIBS "")
set(GSKIT_EXTERNAL_INCLUDES "")

# Enable interprocedural optimization LTO
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)

set(CUR_GIT_TAG v0.0.0)
find_package(Git)
if(GIT_FOUND)
Expand Down Expand Up @@ -125,6 +128,8 @@ add_object_library_macros(GS_CORE_OBJS ee/gs/src/gsCore.c
gsKit_remove_vsync_handler
gsKit_add_hsync_handler
gsKit_remove_hsync_handler
gsKit_add_finish_handler
gsKit_remove_finish_handler
gsKit_clear
gsKit_set_scissor
gsKit_set_test
Expand Down
6 changes: 6 additions & 0 deletions ee/gs/include/gsCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ int gsKit_add_hsync_handler(int (*hsync_callback)());
/// Removes a hsync interrupt handler
void gsKit_remove_hsync_handler(int callback_id);

/// Installs a finish interrupt handler
int gsKit_add_finish_handler(int (*finish_callback)());

/// Removes a finish interrupt handler
void gsKit_remove_finish_handler(int callback_id);

/// Sets gsGlobal->EvenOrOdd depending on current field drawing
void gsKit_get_field(GSGLOBAL *gsGlobal);

Expand Down
28 changes: 28 additions & 0 deletions ee/gs/src/gsCore.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,34 @@ void gsKit_remove_hsync_handler(int callback_id)
}
#endif

#if F_gsKit_add_finish_handler
int gsKit_add_finish_handler(int (*finish_callback)())
{
int callback_id;

DIntr();
callback_id = AddIntcHandler(INTC_GS, finish_callback, 0);
EnableIntc(INTC_GS);
// Unmask Finish interrupt
GsPutIMR(GsGetIMR() & ~0x0200);
EIntr();

return callback_id;
}
#endif

#if F_gsKit_remove_finish_handler
void gsKit_remove_finish_handler(int callback_id)
{
DIntr();
// Mask HSync interrupt
GsPutIMR(GsGetIMR() | 0x0200);
DisableIntc(INTC_GS);
RemoveIntcHandler(INTC_GS, callback_id);
EIntr();
}
#endif

#if F_gsKit_clear
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
void gsKit_clear(GSGLOBAL *gsGlobal, u64 color)
Expand Down
Loading