mirror of
https://github.com/sylverb/game-and-watch-retro-go.git
synced 2026-01-11 02:29:26 +01:00
Tamalib has been heavily changed to accommodate G&W needs. A "fast forward" option has been added to emulate "always on" mode. The emulator is currently running about 300x speed while fast forwarding. Save & load of emulator state also works. Max age for save states are 48 hours. The emulator will ignore fast forward if state is older and just continue from where it left off. Max volume is 25% as a 100% square wave at even lowest volume setting is way too loud. It also supports start_paused handling. Reload of a tama state will now re-initialize the entire emulator which eases the implementation. This is a deviation from other emulators but my hope is that it makes the code more clear and concise. Bumped all clock counters to 64 bit to avoid wrapping around every 1.5 days. Button handling is: any d-pad = left button, B is middle button and A is right button. In-game icons are taken from tamatool and scaled for G&W use. I have addedd a simple instruction decoding cache using a 4k 'map' to tamalib to increase performance from a 2456 fps base to about 8150 fps (with no gui, and no sound etc.) lcd_clear_active_buffer & lcd_clear_inactive_buffer how returns the cleared buffer
69 lines
2.0 KiB
Bash
Executable File
69 lines
2.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# Usage: ./size.sh app.elf
|
|
|
|
if [[ "${GCC_PATH}" != "" ]]; then
|
|
DEFAULT_OBJDUMP=${GCC_PATH}/arm-none-eabi-objdump
|
|
else
|
|
DEFAULT_OBJDUMP=arm-none-eabi-objdump
|
|
fi
|
|
|
|
OBJDUMP=${OBJDUMP:-$DEFAULT_OBJDUMP}
|
|
|
|
elf_file=$1
|
|
|
|
function get_symbol {
|
|
name=$1
|
|
objdump_cmd="$OBJDUMP -t $elf_file"
|
|
size=$($objdump_cmd | grep " $name" | cut -d " " -f1 | tr 'a-f' 'A-F')
|
|
printf "$((16#${size}))\n"
|
|
}
|
|
|
|
function get_section_length {
|
|
name=$1
|
|
start=$(get_symbol "__${name}_start__")
|
|
end=$(get_symbol "__${name}_end__")
|
|
echo $(( $end - $start ))
|
|
}
|
|
|
|
function print_usage {
|
|
symbol=$1
|
|
length_symbol=$2
|
|
usage=$(get_section_length $symbol)
|
|
length=$(get_symbol $length_symbol)
|
|
free=$(( $length - $usage ))
|
|
freehr=$(printf "%.3f" "$(( ($free * 1000000) / 1024 / 1024 ))e-6")
|
|
echo -e "$symbol\t$usage / $length\t($free bytes free ($freehr MB))"
|
|
}
|
|
|
|
print_usage itcram __ITCMRAM_LENGTH__
|
|
|
|
# DTCRAM is a special case
|
|
dtc_size=$(get_symbol __DTCMRAM_LENGTH__)
|
|
dtc_free=$(get_section_length dtc_padding)
|
|
dtc_usage=$(( dtc_size - dtc_free ))
|
|
echo -e "dtcram\t$dtc_usage / $dtc_size ($dtc_free bytes free)"
|
|
|
|
print_usage ram_uc __RAM_UC_LENGTH__
|
|
print_usage ram __RAM_CORE_LENGTH__
|
|
print_usage ram_emu_nes __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_nes_fceu __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_gb __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_sms __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_pce __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_gw __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_msx __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_wsv __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_md __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_a7800 __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_amstrad __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_zelda3 __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_smw __RAM_EMU_LENGTH__
|
|
print_usage ram_emu_tama __RAM_EMU_LENGTH__
|
|
print_usage ahbram __AHBRAM_LENGTH__
|
|
print_usage flash __FLASH_LENGTH__
|
|
print_usage cacheflash __CACHEFLASH_LENGTH__
|
|
print_usage extflash __EXTFLASH_LENGTH__
|
|
print_usage offsaveflash __OFFSAVEFLASH_LENGTH__
|
|
print_usage saveflash __SAVEFLASH_LENGTH__
|
|
print_usage fbflash __FBFLASH_LENGTH__
|