mirror of
https://github.com/mlaux/gb6.git
synced 2026-04-21 16:16:56 +00:00
rename to Gray Brick
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#  gb6 - Game Boy emulator for Macintosh System 6
|
||||
#  Gray Brick - Game Boy emulator for Macintosh System 6
|
||||
|
||||
gb6 is a Game Boy emulator targeting 68k Macintosh with a focus on execution speed.
|
||||
The emulator features a JIT compiler that translates Game Boy code into 68k code
|
||||
for maximum speed.
|
||||
Gray Brick is a Game Boy emulator targeting 68k Macintosh with a focus on
|
||||
execution speed. The emulator features a JIT compiler that translates Game Boy
|
||||
code into 68k code for maximum speed.
|
||||
|
||||
This project does not make any attempt to be particularly accurate to the GB
|
||||
hardware - I had to make too many compromises in order to get it working at all.
|
||||
|
||||
+16
-5
@@ -1,11 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
project(GameBoyEmulator)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project("Gray Brick")
|
||||
|
||||
include(add_application.cmake)
|
||||
|
||||
include_directories(../src ../compiler)
|
||||
|
||||
set(CMAKE_C_FLAGS "-O3")
|
||||
|
||||
add_application(Emulator
|
||||
add_application("Gray Brick"
|
||||
TYPE APPL
|
||||
CREATOR MGBE
|
||||
../src/dmg.c
|
||||
@@ -36,3 +36,14 @@ add_application(Emulator
|
||||
emulator.c
|
||||
resources.r
|
||||
)
|
||||
|
||||
target_compile_options(Gray_Brick PRIVATE
|
||||
-O3
|
||||
-ffunction-sections
|
||||
-fdata-sections
|
||||
)
|
||||
|
||||
target_link_options(Gray_Brick PRIVATE
|
||||
"-Wl,--gc-sections"
|
||||
#"-Wl,--print-gc-sections"
|
||||
)
|
||||
@@ -0,0 +1,141 @@
|
||||
# modified stock Retro68 add_application.cmake to support spaces in the app name
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
cmake_policy(PUSH)
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
|
||||
function(add_application name)
|
||||
|
||||
# Create a sanitized target name for CMake (no spaces allowed in target names)
|
||||
string(REPLACE " " "_" target_name "${name}")
|
||||
|
||||
set(options DEBUGBREAK CONSOLE)
|
||||
set(oneValueArgs TYPE CREATOR)
|
||||
set(multiValueArgs FILES MAKEAPPL_ARGS)
|
||||
|
||||
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
list(APPEND ARGS_FILES ${ARGS_UNPARSED_ARGUMENTS})
|
||||
|
||||
set(REZ_FLAGS)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES RetroPPC OR CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
|
||||
set(REZ_FLAGS -DTARGET_API_MAC_CARBON=1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(files)
|
||||
set(rsrc_files)
|
||||
set(rez_files)
|
||||
|
||||
set(rez_include_options ${REZ_INCLUDE_PATH})
|
||||
list(TRANSFORM rez_include_options PREPEND -I)
|
||||
|
||||
foreach(f ${ARGS_FILES})
|
||||
get_filename_component(abspath "${f}" ABSOLUTE)
|
||||
if(${f} MATCHES "\\.r$")
|
||||
get_filename_component(rsrc_file "${f}" NAME)
|
||||
set(rsrc_file "${CMAKE_CURRENT_BINARY_DIR}/${rsrc_file}.rsrc.bin")
|
||||
add_custom_command(
|
||||
OUTPUT ${rsrc_file}
|
||||
COMMAND ${REZ} ${REZ_FLAGS} ${abspath} ${rez_include_options} -o ${rsrc_file}
|
||||
DEPENDS ${abspath})
|
||||
list(APPEND rsrc_files "${rsrc_file}")
|
||||
list(APPEND rez_files "${abspath}")
|
||||
elseif(${f} MATCHES "\\.rsrc$")
|
||||
list(APPEND rsrc_files "${abspath}")
|
||||
elseif(${f} MATCHES "\\.rsrc.bin$")
|
||||
list(APPEND rsrc_files "${abspath}")
|
||||
else()
|
||||
list(APPEND files "${abspath}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_executable(${target_name} ${files} ${rez_files})
|
||||
|
||||
if(${ARGS_DEBUGBREAK})
|
||||
target_link_options(${target_name} PRIVATE "LINKER:--defsym=__break_on_entry=1")
|
||||
endif()
|
||||
if(${ARGS_CONSOLE})
|
||||
if(TARGET RetroConsole OR NOT (CMAKE_SYSTEM_NAME MATCHES RetroCarbon))
|
||||
target_link_libraries(${target_name} RetroConsole)
|
||||
else()
|
||||
target_link_libraries(${target_name} RetroConsoleCarbon)
|
||||
endif()
|
||||
|
||||
# RetroConsole library uses C++:
|
||||
set_target_properties(${target_name} PROPERTIES LINKER_LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
foreach(f ${rsrc_files})
|
||||
# DO NOT add --copy here.
|
||||
# The files in rsrc_files are guaranteed to be .rsrc or .rsrc.bin, so they
|
||||
# will be recognized by Rez.
|
||||
# Currently, the --copy flag has the side effect that Rez processes all --copy inputs
|
||||
# before other inputs, so this messes up the overriding mechanics, leading to the wrong SIZE resource
|
||||
# being included. (duplicate resources shouldn't be replaced silently, and overriding should be explicit...)
|
||||
list(APPEND ARGS_MAKEAPPL_ARGS "${f}")
|
||||
endforeach()
|
||||
|
||||
if(NOT ARGS_TYPE)
|
||||
set(ARGS_TYPE "APPL")
|
||||
endif()
|
||||
if(NOT ARGS_CREATOR)
|
||||
set(ARGS_CREATOR "????")
|
||||
endif()
|
||||
|
||||
|
||||
if(TARGET retrocrt)
|
||||
add_dependencies(${target_name} retrocrt)
|
||||
endif(TARGET retrocrt)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES Retro68)
|
||||
|
||||
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME "${name}.code.bin")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${name}.bin" "${name}.APPL" "${name}.dsk"
|
||||
COMMAND ${REZ} ${REZ_FLAGS}
|
||||
${REZ_TEMPLATES_PATH}/Retro68APPL.r
|
||||
${rez_include_options}
|
||||
--copy "${name}.code.bin"
|
||||
-o "${name}.bin"
|
||||
-t "${ARGS_TYPE}" -c "${ARGS_CREATOR}"
|
||||
--cc "${name}.dsk" --cc "${name}.APPL" --cc "%${name}.ad"
|
||||
${ARGS_MAKEAPPL_ARGS}
|
||||
DEPENDS ${target_name} ${rsrc_files})
|
||||
add_custom_target(${target_name}_APPL ALL DEPENDS "${name}.bin")
|
||||
|
||||
elseif(CMAKE_SYSTEM_NAME MATCHES RetroPPC OR CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES RetroCarbon)
|
||||
set(REZ_TEMPLATE "${REZ_TEMPLATES_PATH}/RetroCarbonAPPL.r")
|
||||
else()
|
||||
set(REZ_TEMPLATE "${REZ_TEMPLATES_PATH}/RetroPPCAPPL.r")
|
||||
endif()
|
||||
|
||||
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME "${name}.xcoff")
|
||||
add_custom_command(
|
||||
OUTPUT "${name}.pef"
|
||||
COMMAND ${MAKE_PEF} "${name}.xcoff" -o "${name}.pef"
|
||||
DEPENDS ${target_name})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${name}.bin" "${name}.APPL" "${name}.dsk"
|
||||
COMMAND ${REZ}
|
||||
${REZ_FLAGS}
|
||||
${REZ_TEMPLATE}
|
||||
${rez_include_options}
|
||||
-DCFRAG_NAME="\\"${name}\\""
|
||||
-o "${name}.bin" --cc "${name}.dsk" --cc "${name}.APPL"
|
||||
--cc "%${name}.ad"
|
||||
-t "${ARGS_TYPE}" -c "${ARGS_CREATOR}"
|
||||
--data "${name}.pef"
|
||||
${ARGS_MAKEAPPL_ARGS}
|
||||
DEPENDS "${name}.pef" ${rsrc_files})
|
||||
add_custom_target(${target_name}_APPL ALL DEPENDS "${name}.bin")
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
cmake_policy(POP)
|
||||
+12
-11
@@ -13,14 +13,15 @@ data 'BNDL' (128) {
|
||||
};
|
||||
|
||||
data 'DITL' (128) {
|
||||
$"0002 0000 0000 003C 00DC 0050 0116 0405" /* .......<...P.... */
|
||||
$"436C 6F73 6558 0000 0000 0014 000A 0034" /* CloseX.........4 */
|
||||
$"002A 2002 0080 0000 0000 000A 0032 003A" /* .* ..Ä.......2.: */
|
||||
$"0112 8847 6762 3620 2D20 4742 2065 6D75" /* ..àGgb6 - GB emu */
|
||||
$"6C61 746F 7220 666F 7220 3638 6B20 4D61" /* lator for 68k Ma */
|
||||
$"630D 3230 3133 2D32 3032 3620 636F 6E73" /* c¬2013-2026 cons */
|
||||
$"7463 6173 740D 6874 7470 3A2F 2F63 6F6E" /* tcast¬http://con */
|
||||
$"7374 6361 7374 2E6F 7267 2F00" /* stcast.org/. */
|
||||
$"0002 0000 0000 0041 00F0 0055 012C 0405" /* .......A...U.,.. */
|
||||
$"436C 6F73 6558 0000 0000 0013 000A 0033" /* CloseX.........3 */
|
||||
$"002A 2002 0080 0000 0000 000A 0032 003C" /* .* ..Ä.......2.< */
|
||||
$"012C 884D 4772 6179 2042 7269 636B 3A20" /* .,àMGray Brick: */
|
||||
$"4742 2065 6D75 6C61 746F 7220 666F 7220" /* GB emulator for */
|
||||
$"3638 6B20 4D61 630D 3230 3133 2D32 3032" /* 68k Mac¬2013-202 */
|
||||
$"3620 636F 6E73 7463 6173 740D 6874 7470" /* 6 constcast¬http */
|
||||
$"3A2F 2F63 6F6E 7374 6361 7374 2E6F 7267" /* ://constcast.org */
|
||||
$"2F00" /* /. */
|
||||
};
|
||||
|
||||
data 'DITL' (129) {
|
||||
@@ -94,7 +95,7 @@ data 'DITL' (132) {
|
||||
};
|
||||
|
||||
data 'DLOG' (128) {
|
||||
$"0034 007E 008E 01A0 0003 0100 0100 0000" /* .4.~.é.†........ */
|
||||
$"0034 007E 0093 01B4 0003 0100 0100 0000" /* .4.~.ì.¥........ */
|
||||
$"0000 0080 00" /* ...Ä. */
|
||||
};
|
||||
|
||||
@@ -239,8 +240,8 @@ data 'MBAR' (128) {
|
||||
|
||||
data 'MENU' (128) {
|
||||
$"0080 0000 0000 0000 0000 FFFF FFFF 0114" /* .Ä.............. */
|
||||
$"0A41 626F 7574 2067 6236 C900 0000 0001" /* .About gb6…...-. */
|
||||
$"2D00 0000 0000" /* .... */
|
||||
$"1141 626F 7574 2047 7261 7920 4272 6963" /* .About Gray Bric */
|
||||
$"6BC9 0000 0000 012D 0000 0000 00" /* k….....-..... */
|
||||
};
|
||||
|
||||
data 'MENU' (129) {
|
||||
|
||||
Reference in New Issue
Block a user