update samples for powerpc

This commit is contained in:
Wolfgang Thaller 2015-09-08 18:05:00 +02:00
parent e2cb927c65
commit a65704d4fa
3 changed files with 11 additions and 9 deletions

View File

@ -35,16 +35,15 @@ link_directories(${CMAKE_CURRENT_BINARY_DIR}/libretro)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libretro)
set(REZ_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libretro:${CMAKE_INSTALL_PREFIX}/RIncludes" )
if(CMAKE_SYSTEM_NAME MATCHES Retro68)
add_subdirectory(Console)
add_subdirectory(TestApps)
add_subdirectory(Samples/HelloWorld)
add_subdirectory(Samples/Raytracer)
add_subdirectory(Samples/Dialog)
if(CMAKE_SYSTEM_NAME MATCHES Retro68)
add_subdirectory(Samples/Launcher)
add_subdirectory(Samples/Dialog)
add_subdirectory(Samples/SystemExtension)
else()
add_subdirectory(Samples/Dialog)
endif()
else()

View File

@ -27,6 +27,3 @@ add_application(Dialog
dialog.c
dialog.r
)
if(CMAKE_SYSTEM_NAME MATCHES RetroPPC)
target_link_libraries(Dialog InterfaceLib)
endif()

View File

@ -29,20 +29,26 @@ inline std::int32_t muls(std::int16_t x, std::int16_t y)
inline std::uint32_t mulu(std::uint16_t x, std::uint16_t y)
{
//return (std::uint32_t)x * y;
#if TARGET_CPU_M68K
std::uint32_t res;
__asm("mulu %1, %0" : "=d"(res) : "d"(x), "0"(y));
return res;
#else
return (std::uint32_t)x * y;
#endif
}
inline std::int32_t mulsu(std::int16_t x, std::uint16_t y)
{
//return (std::int32_t)a * (std::uint32_t)b;
#if TARGET_CPU_M68K
std::int32_t res;
__asm("mulu %1, %0" : "=d"(res) : "d"(x), "0"(y));
if(x < 0)
res -= ((std::uint32_t)y) << 16;
return res;
#else
return (std::int32_t)x * (std::uint32_t)y;
#endif
}
#define COUNT_OP(var) ++var