줄바꿈을 LF로 통일
서버에서 바로 빌드하고 고칠 수 있게 저장소 줄바꿈을 LF로 맞췄습니다. CRLF로 들어가 있던 sh 빌드 스크립트도 이제 리눅스에서 그대로 돌아갑니다. 내용은 바뀌지 않았습니다.
This commit is contained in:
1 parent
40615838ac
commit
2d48091205
623 files changed
+501372
-501365
No files matched your search
+12
-12
@@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
# Build GBEmu for the Paradise (clang/lld, Cortex-M3). Output: ../../gb.bin
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
E=../../../emu/src/emu
|
||||
CF="--target=thumbv7m-none-eabi -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib -fno-common -Wall -Wno-unused-function -Wno-unused-variable -fno-builtin-memset -isystem ../stub -DFAST_LCD -DEXIT_KEY -DLCD_FASTCLK -DTONE_FIX -DBL_SLEEP -DPARA_BACK -DPARA_MB_KEEP -DBL_PWM -DBL_MR3RST -DGB_SOUND -DTONE_SAFE -DGB_FAST -DPGB_FAST_LINE -DGB_SKIP_ADAPT -DGB_TONE_RESTART -DGB_STATE -DGB_LINK -DPGB_SERIAL_WAIT -DGB_TRIM -DGPLAY -DSESS_FLAG $XCF"
|
||||
O=""
|
||||
for f in main.c $E/hw.c $E/flash.c $E/libc.c; do
|
||||
n=$(basename $f .c); OPT=-Os; [ "$n" = main ] && OPT=-O2; clang $CF $OPT -c $f -o $n.o; O="$O $n.o"; done
|
||||
ld.lld -T link.ld --no-rosegment $O -o gb.elf
|
||||
llvm-objcopy -O binary -j .text -j .data -j .init gb.elf gb.bin
|
||||
cp gb.bin ../../gb.bin; rm -f *.o gb.bin; [ -n "$KEEPELF" ] || rm -f gb.elf; ls -l ../../gb.bin
|
||||
#!/bin/sh
|
||||
# Build GBEmu for the Paradise (clang/lld, Cortex-M3). Output: ../../gb.bin
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
E=../../../emu/src/emu
|
||||
CF="--target=thumbv7m-none-eabi -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib -fno-common -Wall -Wno-unused-function -Wno-unused-variable -fno-builtin-memset -isystem ../stub -DFAST_LCD -DEXIT_KEY -DLCD_FASTCLK -DTONE_FIX -DBL_SLEEP -DPARA_BACK -DPARA_MB_KEEP -DBL_PWM -DBL_MR3RST -DGB_SOUND -DTONE_SAFE -DGB_FAST -DPGB_FAST_LINE -DGB_SKIP_ADAPT -DGB_TONE_RESTART -DGB_STATE -DGB_LINK -DPGB_SERIAL_WAIT -DGB_TRIM -DGPLAY -DSESS_FLAG $XCF"
|
||||
O=""
|
||||
for f in main.c $E/hw.c $E/flash.c $E/libc.c; do
|
||||
n=$(basename $f .c); OPT=-Os; [ "$n" = main ] && OPT=-O2; clang $CF $OPT -c $f -o $n.o; O="$O $n.o"; done
|
||||
ld.lld -T link.ld --no-rosegment $O -o gb.elf
|
||||
llvm-objcopy -O binary -j .text -j .data -j .init gb.elf gb.bin
|
||||
cp gb.bin ../../gb.bin; rm -f *.o gb.bin; [ -n "$KEEPELF" ] || rm -f gb.elf; ls -l ../../gb.bin
|
||||
+12
-12
@@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
# Build GBCEmu (Game Boy Color) for the Paradise. Output: ../../gbc.bin
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
E=../../../emu/src/emu
|
||||
CF="--target=thumbv7m-none-eabi -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib -fno-common -Wall -Wno-unused-function -Wno-unused-variable -fno-builtin-memset -isystem ../stub -DFAST_LCD -DEXIT_KEY -DLCD_FASTCLK -DTONE_FIX -DBL_SLEEP -DPARA_BACK -DPARA_MB_KEEP -DBL_PWM -DBL_MR3RST -DGB_SOUND -DTONE_SAFE -DGB_SKIP_ADAPT -DGB_TONE_RESTART -DGB_STATE -DGB_LINK -DPGB_SERIAL_WAIT -DGB_TRIM -DGBC -DGB_PAGES -DGPLAY -DSESS_FLAG -DPGB_BATCH -DPGB_FAST_CGB $XCF"
|
||||
O=""
|
||||
for f in main.c $E/hw.c $E/flash.c $E/libc.c; do
|
||||
n=$(basename $f .c); OPT=-Os; [ "$n" = main ] && OPT=-O2; clang $CF $OPT -c $f -o c_$n.o; O="$O c_$n.o"; done
|
||||
ld.lld -T link.ld --no-rosegment $O -o gbc.elf
|
||||
llvm-objcopy -O binary -j .text -j .data -j .init gbc.elf gbc.bin
|
||||
cp gbc.bin ../../gbc.bin; rm -f c_*.o gbc.bin; [ -n "$KEEPELF" ] || rm -f gbc.elf; ls -l ../../gbc.bin
|
||||
#!/bin/sh
|
||||
# Build GBCEmu (Game Boy Color) for the Paradise. Output: ../../gbc.bin
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
E=../../../emu/src/emu
|
||||
CF="--target=thumbv7m-none-eabi -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib -fno-common -Wall -Wno-unused-function -Wno-unused-variable -fno-builtin-memset -isystem ../stub -DFAST_LCD -DEXIT_KEY -DLCD_FASTCLK -DTONE_FIX -DBL_SLEEP -DPARA_BACK -DPARA_MB_KEEP -DBL_PWM -DBL_MR3RST -DGB_SOUND -DTONE_SAFE -DGB_SKIP_ADAPT -DGB_TONE_RESTART -DGB_STATE -DGB_LINK -DPGB_SERIAL_WAIT -DGB_TRIM -DGBC -DGB_PAGES -DGPLAY -DSESS_FLAG -DPGB_BATCH -DPGB_FAST_CGB $XCF"
|
||||
O=""
|
||||
for f in main.c $E/hw.c $E/flash.c $E/libc.c; do
|
||||
n=$(basename $f .c); OPT=-Os; [ "$n" = main ] && OPT=-O2; clang $CF $OPT -c $f -o c_$n.o; O="$O c_$n.o"; done
|
||||
ld.lld -T link.ld --no-rosegment $O -o gbc.elf
|
||||
llvm-objcopy -O binary -j .text -j .data -j .init gbc.elf gbc.bin
|
||||
cp gbc.bin ../../gbc.bin; rm -f c_*.o gbc.bin; [ -n "$KEEPELF" ] || rm -f gbc.elf; ls -l ../../gbc.bin
|
||||
+99
-99
@@ -1,99 +1,99 @@
|
||||
/* generated by gen/font.py: custom 5x7 font */
|
||||
static const unsigned char g_font[96][7]={
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x04,0x04,0x04,0x04,0x04,0x00,0x04},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x19,0x19,0x02,0x04,0x08,0x13,0x13},
|
||||
{0x0c,0x12,0x14,0x08,0x15,0x12,0x0d},
|
||||
{0x04,0x04,0x08,0x00,0x00,0x00,0x00},
|
||||
{0x02,0x04,0x08,0x08,0x08,0x04,0x02},
|
||||
{0x08,0x04,0x02,0x02,0x02,0x04,0x08},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x04,0x04,0x1f,0x04,0x04,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x0c,0x04,0x08},
|
||||
{0x00,0x00,0x00,0x1f,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x0c,0x0c},
|
||||
{0x01,0x01,0x02,0x04,0x08,0x10,0x10},
|
||||
{0x0e,0x11,0x13,0x15,0x19,0x11,0x0e},
|
||||
{0x04,0x0c,0x04,0x04,0x04,0x04,0x0e},
|
||||
{0x0e,0x11,0x01,0x02,0x04,0x08,0x1f},
|
||||
{0x1e,0x01,0x01,0x0e,0x01,0x01,0x1e},
|
||||
{0x02,0x06,0x0a,0x12,0x1f,0x02,0x02},
|
||||
{0x1f,0x10,0x1e,0x01,0x01,0x11,0x0e},
|
||||
{0x0e,0x10,0x10,0x1e,0x11,0x11,0x0e},
|
||||
{0x1f,0x01,0x02,0x04,0x08,0x08,0x08},
|
||||
{0x0e,0x11,0x11,0x0e,0x11,0x11,0x0e},
|
||||
{0x0e,0x11,0x11,0x0f,0x01,0x01,0x0e},
|
||||
{0x00,0x04,0x04,0x00,0x04,0x04,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x02,0x04,0x08,0x10,0x08,0x04,0x02},
|
||||
{0x00,0x00,0x1f,0x00,0x1f,0x00,0x00},
|
||||
{0x08,0x04,0x02,0x01,0x02,0x04,0x08},
|
||||
{0x0e,0x11,0x01,0x02,0x04,0x00,0x04},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x0e,0x11,0x11,0x1f,0x11,0x11,0x11},
|
||||
{0x1e,0x11,0x11,0x1e,0x11,0x11,0x1e},
|
||||
{0x0e,0x11,0x10,0x10,0x10,0x11,0x0e},
|
||||
{0x1e,0x11,0x11,0x11,0x11,0x11,0x1e},
|
||||
{0x1f,0x10,0x10,0x1e,0x10,0x10,0x1f},
|
||||
{0x1f,0x10,0x10,0x1e,0x10,0x10,0x10},
|
||||
{0x0e,0x11,0x10,0x17,0x11,0x11,0x0f},
|
||||
{0x11,0x11,0x11,0x1f,0x11,0x11,0x11},
|
||||
{0x0e,0x04,0x04,0x04,0x04,0x04,0x0e},
|
||||
{0x07,0x02,0x02,0x02,0x02,0x12,0x0c},
|
||||
{0x11,0x12,0x14,0x18,0x14,0x12,0x11},
|
||||
{0x10,0x10,0x10,0x10,0x10,0x10,0x1f},
|
||||
{0x11,0x1b,0x15,0x15,0x11,0x11,0x11},
|
||||
{0x11,0x19,0x15,0x13,0x11,0x11,0x11},
|
||||
{0x0e,0x11,0x11,0x11,0x11,0x11,0x0e},
|
||||
{0x1e,0x11,0x11,0x1e,0x10,0x10,0x10},
|
||||
{0x0e,0x11,0x11,0x11,0x15,0x12,0x0d},
|
||||
{0x1e,0x11,0x11,0x1e,0x14,0x12,0x11},
|
||||
{0x0f,0x10,0x10,0x0e,0x01,0x01,0x1e},
|
||||
{0x1f,0x04,0x04,0x04,0x04,0x04,0x04},
|
||||
{0x11,0x11,0x11,0x11,0x11,0x11,0x0e},
|
||||
{0x11,0x11,0x11,0x11,0x11,0x0a,0x04},
|
||||
{0x11,0x11,0x11,0x15,0x15,0x15,0x0a},
|
||||
{0x11,0x11,0x0a,0x04,0x0a,0x11,0x11},
|
||||
{0x11,0x11,0x0a,0x04,0x04,0x04,0x04},
|
||||
{0x1f,0x01,0x02,0x04,0x08,0x10,0x1f},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x11,0x0a,0x04,0x0a,0x11},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x11,0x0e,0x11,0x1f,0x11,0x11,0x11},
|
||||
{0x11,0x0e,0x11,0x11,0x11,0x11,0x0e},
|
||||
{0x11,0x00,0x11,0x11,0x11,0x11,0x0e},
|
||||
};
|
||||
/* generated by gen/font.py: custom 5x7 font */
|
||||
static const unsigned char g_font[96][7]={
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x04,0x04,0x04,0x04,0x04,0x00,0x04},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x19,0x19,0x02,0x04,0x08,0x13,0x13},
|
||||
{0x0c,0x12,0x14,0x08,0x15,0x12,0x0d},
|
||||
{0x04,0x04,0x08,0x00,0x00,0x00,0x00},
|
||||
{0x02,0x04,0x08,0x08,0x08,0x04,0x02},
|
||||
{0x08,0x04,0x02,0x02,0x02,0x04,0x08},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x04,0x04,0x1f,0x04,0x04,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x0c,0x04,0x08},
|
||||
{0x00,0x00,0x00,0x1f,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x0c,0x0c},
|
||||
{0x01,0x01,0x02,0x04,0x08,0x10,0x10},
|
||||
{0x0e,0x11,0x13,0x15,0x19,0x11,0x0e},
|
||||
{0x04,0x0c,0x04,0x04,0x04,0x04,0x0e},
|
||||
{0x0e,0x11,0x01,0x02,0x04,0x08,0x1f},
|
||||
{0x1e,0x01,0x01,0x0e,0x01,0x01,0x1e},
|
||||
{0x02,0x06,0x0a,0x12,0x1f,0x02,0x02},
|
||||
{0x1f,0x10,0x1e,0x01,0x01,0x11,0x0e},
|
||||
{0x0e,0x10,0x10,0x1e,0x11,0x11,0x0e},
|
||||
{0x1f,0x01,0x02,0x04,0x08,0x08,0x08},
|
||||
{0x0e,0x11,0x11,0x0e,0x11,0x11,0x0e},
|
||||
{0x0e,0x11,0x11,0x0f,0x01,0x01,0x0e},
|
||||
{0x00,0x04,0x04,0x00,0x04,0x04,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x02,0x04,0x08,0x10,0x08,0x04,0x02},
|
||||
{0x00,0x00,0x1f,0x00,0x1f,0x00,0x00},
|
||||
{0x08,0x04,0x02,0x01,0x02,0x04,0x08},
|
||||
{0x0e,0x11,0x01,0x02,0x04,0x00,0x04},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x0e,0x11,0x11,0x1f,0x11,0x11,0x11},
|
||||
{0x1e,0x11,0x11,0x1e,0x11,0x11,0x1e},
|
||||
{0x0e,0x11,0x10,0x10,0x10,0x11,0x0e},
|
||||
{0x1e,0x11,0x11,0x11,0x11,0x11,0x1e},
|
||||
{0x1f,0x10,0x10,0x1e,0x10,0x10,0x1f},
|
||||
{0x1f,0x10,0x10,0x1e,0x10,0x10,0x10},
|
||||
{0x0e,0x11,0x10,0x17,0x11,0x11,0x0f},
|
||||
{0x11,0x11,0x11,0x1f,0x11,0x11,0x11},
|
||||
{0x0e,0x04,0x04,0x04,0x04,0x04,0x0e},
|
||||
{0x07,0x02,0x02,0x02,0x02,0x12,0x0c},
|
||||
{0x11,0x12,0x14,0x18,0x14,0x12,0x11},
|
||||
{0x10,0x10,0x10,0x10,0x10,0x10,0x1f},
|
||||
{0x11,0x1b,0x15,0x15,0x11,0x11,0x11},
|
||||
{0x11,0x19,0x15,0x13,0x11,0x11,0x11},
|
||||
{0x0e,0x11,0x11,0x11,0x11,0x11,0x0e},
|
||||
{0x1e,0x11,0x11,0x1e,0x10,0x10,0x10},
|
||||
{0x0e,0x11,0x11,0x11,0x15,0x12,0x0d},
|
||||
{0x1e,0x11,0x11,0x1e,0x14,0x12,0x11},
|
||||
{0x0f,0x10,0x10,0x0e,0x01,0x01,0x1e},
|
||||
{0x1f,0x04,0x04,0x04,0x04,0x04,0x04},
|
||||
{0x11,0x11,0x11,0x11,0x11,0x11,0x0e},
|
||||
{0x11,0x11,0x11,0x11,0x11,0x0a,0x04},
|
||||
{0x11,0x11,0x11,0x15,0x15,0x15,0x0a},
|
||||
{0x11,0x11,0x0a,0x04,0x0a,0x11,0x11},
|
||||
{0x11,0x11,0x0a,0x04,0x04,0x04,0x04},
|
||||
{0x1f,0x01,0x02,0x04,0x08,0x10,0x1f},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x11,0x0a,0x04,0x0a,0x11},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00},
|
||||
{0x11,0x0e,0x11,0x1f,0x11,0x11,0x11},
|
||||
{0x11,0x0e,0x11,0x11,0x11,0x11,0x0e},
|
||||
{0x11,0x00,0x11,0x11,0x11,0x11,0x0e},
|
||||
};
|
||||
+83
-83
@@ -1,83 +1,83 @@
|
||||
/* GBEmu link (GB_LINK, 1.6.11 test2): the Game Boy's serial port between two Paradise, as with a link cable.
|
||||
* The side that clocks (SC = 0x81) sends its byte ('M') and waits; the other side answers with its own byte ('R') as
|
||||
* soon as its game is ready to receive (SC = 0x80); until then it keeps the byte. Both clocking at once: each answers
|
||||
* 'B' (busy) and both get 0xFF, as with two clocks on a real cable. Without a partner (no hello for 2 s) everything
|
||||
* is as before: a clocking side gets 0xFF, a receiving side waits.
|
||||
* The transport and the clock come from the includer:
|
||||
* GL_SEND(kind, byte) send one frame to the other side
|
||||
* GL_POLL() take in what arrived (calls gl_got)
|
||||
* GL_NOW() milliseconds
|
||||
* GL_PARTNER() 1 when the other side is there
|
||||
* Header only, one link. Author: mameise */
|
||||
#ifndef GB_LINK_H
|
||||
#define GB_LINK_H
|
||||
|
||||
#define GL_WAIT_MAX 400u /* ms the clocking side waits for an answer, then 0xFF */
|
||||
#define GL_PEND_MAX 600u /* ms a received byte waits for the game to get ready, then 'B' */
|
||||
|
||||
typedef struct GlState {
|
||||
uint8_t waiting, got, reply; /* clocking side: waiting for the answer, it came, its byte */
|
||||
uint8_t pend, pend_byte; /* receiving side: a byte of the other side waits */
|
||||
uint32_t t0, pend_t;
|
||||
uint32_t n_tx, n_rx; /* bytes (for the tests) */
|
||||
} GlState;
|
||||
#ifndef GL_S /* the PC test runs two: it points GL_S at the one running */
|
||||
static GlState g_gl_one;
|
||||
#define GL_S g_gl_one
|
||||
#endif
|
||||
|
||||
/* a frame from the other side */
|
||||
static void gl_got(uint8_t kind, uint8_t b)
|
||||
{
|
||||
if (kind == 'M') {
|
||||
if (GL_S.waiting) { GL_SEND('B', 0xFF); return; } /* both clocking */
|
||||
GL_S.pend = 1; GL_S.pend_byte = b; GL_S.pend_t = GL_NOW();
|
||||
} else if (kind == 'R' || kind == 'B') {
|
||||
if (GL_S.waiting) { GL_S.got = 1; GL_S.reply = kind == 'R' ? b : 0xFF; }
|
||||
}
|
||||
}
|
||||
|
||||
/* Peanut-GB: a transfer starts */
|
||||
static void gl_tx(struct gb_s *gb, const uint8_t tx)
|
||||
{
|
||||
if (!GL_PARTNER()) return;
|
||||
if (!(gb->hram_io[IO_SC] & 1u)) { /* receiving side gets ready */
|
||||
GL_S.waiting = 0; /* (a clocking try of this side is over) */
|
||||
GL_POLL();
|
||||
if (GL_S.pend) { /* the other side clocked already: done at once */
|
||||
GL_SEND('R', tx); GL_S.pend = 0; GL_S.n_rx++;
|
||||
gb->hram_io[IO_SB] = GL_S.pend_byte;
|
||||
gb->hram_io[IO_SC] &= 0x01;
|
||||
gb->hram_io[IO_IF] |= SERIAL_INTR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (GL_S.pend) { GL_SEND('B', 0xFF); GL_S.pend = 0; } /* the other one clocked too */
|
||||
GL_S.waiting = 1; GL_S.got = 0; GL_S.t0 = GL_NOW();
|
||||
GL_SEND('M', tx); GL_S.n_tx++;
|
||||
}
|
||||
/* Peanut-GB: the transfer's 8 bits are through (called again and again while it returns GB_SERIAL_RX_WAIT) */
|
||||
static enum gb_serial_rx_ret_e gl_rx(struct gb_s *gb, uint8_t *rx)
|
||||
{
|
||||
GL_POLL();
|
||||
if (gb->hram_io[IO_SC] & 1u) { /* clocking side */
|
||||
if (!GL_S.waiting) return GB_SERIAL_RX_NO_CONNECTION; /* no partner: 0xFF */
|
||||
if (GL_S.got) { GL_S.waiting = 0; *rx = GL_S.reply; GL_S.n_rx++; return GB_SERIAL_RX_SUCCESS; }
|
||||
if (GL_NOW() - GL_S.t0 > GL_WAIT_MAX) { GL_S.waiting = 0; *rx = 0xFF; return GB_SERIAL_RX_SUCCESS; }
|
||||
return GB_SERIAL_RX_WAIT;
|
||||
}
|
||||
/* receiving side: done when the other side's byte is there */
|
||||
if (GL_S.pend) {
|
||||
GL_SEND('R', gb->hram_io[IO_SB]); GL_S.pend = 0;
|
||||
*rx = GL_S.pend_byte; GL_S.n_rx++;
|
||||
return GB_SERIAL_RX_SUCCESS;
|
||||
}
|
||||
return GB_SERIAL_RX_NO_CONNECTION; /* keeps waiting, SB stays */
|
||||
}
|
||||
/* from the main loop: a byte nobody took for long is refused (the other side goes on with 0xFF) */
|
||||
static void gl_tick(void)
|
||||
{
|
||||
GL_POLL();
|
||||
if (GL_S.pend && GL_NOW() - GL_S.pend_t > GL_PEND_MAX) { GL_SEND('B', 0xFF); GL_S.pend = 0; }
|
||||
}
|
||||
#endif
|
||||
/* GBEmu link (GB_LINK, 1.6.11 test2): the Game Boy's serial port between two Paradise, as with a link cable.
|
||||
* The side that clocks (SC = 0x81) sends its byte ('M') and waits; the other side answers with its own byte ('R') as
|
||||
* soon as its game is ready to receive (SC = 0x80); until then it keeps the byte. Both clocking at once: each answers
|
||||
* 'B' (busy) and both get 0xFF, as with two clocks on a real cable. Without a partner (no hello for 2 s) everything
|
||||
* is as before: a clocking side gets 0xFF, a receiving side waits.
|
||||
* The transport and the clock come from the includer:
|
||||
* GL_SEND(kind, byte) send one frame to the other side
|
||||
* GL_POLL() take in what arrived (calls gl_got)
|
||||
* GL_NOW() milliseconds
|
||||
* GL_PARTNER() 1 when the other side is there
|
||||
* Header only, one link. Author: mameise */
|
||||
#ifndef GB_LINK_H
|
||||
#define GB_LINK_H
|
||||
|
||||
#define GL_WAIT_MAX 400u /* ms the clocking side waits for an answer, then 0xFF */
|
||||
#define GL_PEND_MAX 600u /* ms a received byte waits for the game to get ready, then 'B' */
|
||||
|
||||
typedef struct GlState {
|
||||
uint8_t waiting, got, reply; /* clocking side: waiting for the answer, it came, its byte */
|
||||
uint8_t pend, pend_byte; /* receiving side: a byte of the other side waits */
|
||||
uint32_t t0, pend_t;
|
||||
uint32_t n_tx, n_rx; /* bytes (for the tests) */
|
||||
} GlState;
|
||||
#ifndef GL_S /* the PC test runs two: it points GL_S at the one running */
|
||||
static GlState g_gl_one;
|
||||
#define GL_S g_gl_one
|
||||
#endif
|
||||
|
||||
/* a frame from the other side */
|
||||
static void gl_got(uint8_t kind, uint8_t b)
|
||||
{
|
||||
if (kind == 'M') {
|
||||
if (GL_S.waiting) { GL_SEND('B', 0xFF); return; } /* both clocking */
|
||||
GL_S.pend = 1; GL_S.pend_byte = b; GL_S.pend_t = GL_NOW();
|
||||
} else if (kind == 'R' || kind == 'B') {
|
||||
if (GL_S.waiting) { GL_S.got = 1; GL_S.reply = kind == 'R' ? b : 0xFF; }
|
||||
}
|
||||
}
|
||||
|
||||
/* Peanut-GB: a transfer starts */
|
||||
static void gl_tx(struct gb_s *gb, const uint8_t tx)
|
||||
{
|
||||
if (!GL_PARTNER()) return;
|
||||
if (!(gb->hram_io[IO_SC] & 1u)) { /* receiving side gets ready */
|
||||
GL_S.waiting = 0; /* (a clocking try of this side is over) */
|
||||
GL_POLL();
|
||||
if (GL_S.pend) { /* the other side clocked already: done at once */
|
||||
GL_SEND('R', tx); GL_S.pend = 0; GL_S.n_rx++;
|
||||
gb->hram_io[IO_SB] = GL_S.pend_byte;
|
||||
gb->hram_io[IO_SC] &= 0x01;
|
||||
gb->hram_io[IO_IF] |= SERIAL_INTR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (GL_S.pend) { GL_SEND('B', 0xFF); GL_S.pend = 0; } /* the other one clocked too */
|
||||
GL_S.waiting = 1; GL_S.got = 0; GL_S.t0 = GL_NOW();
|
||||
GL_SEND('M', tx); GL_S.n_tx++;
|
||||
}
|
||||
/* Peanut-GB: the transfer's 8 bits are through (called again and again while it returns GB_SERIAL_RX_WAIT) */
|
||||
static enum gb_serial_rx_ret_e gl_rx(struct gb_s *gb, uint8_t *rx)
|
||||
{
|
||||
GL_POLL();
|
||||
if (gb->hram_io[IO_SC] & 1u) { /* clocking side */
|
||||
if (!GL_S.waiting) return GB_SERIAL_RX_NO_CONNECTION; /* no partner: 0xFF */
|
||||
if (GL_S.got) { GL_S.waiting = 0; *rx = GL_S.reply; GL_S.n_rx++; return GB_SERIAL_RX_SUCCESS; }
|
||||
if (GL_NOW() - GL_S.t0 > GL_WAIT_MAX) { GL_S.waiting = 0; *rx = 0xFF; return GB_SERIAL_RX_SUCCESS; }
|
||||
return GB_SERIAL_RX_WAIT;
|
||||
}
|
||||
/* receiving side: done when the other side's byte is there */
|
||||
if (GL_S.pend) {
|
||||
GL_SEND('R', gb->hram_io[IO_SB]); GL_S.pend = 0;
|
||||
*rx = GL_S.pend_byte; GL_S.n_rx++;
|
||||
return GB_SERIAL_RX_SUCCESS;
|
||||
}
|
||||
return GB_SERIAL_RX_NO_CONNECTION; /* keeps waiting, SB stays */
|
||||
}
|
||||
/* from the main loop: a byte nobody took for long is refused (the other side goes on with 0xFF) */
|
||||
static void gl_tick(void)
|
||||
{
|
||||
GL_POLL();
|
||||
if (GL_S.pend && GL_NOW() - GL_S.pend_t > GL_PEND_MAX) { GL_SEND('B', 0xFF); GL_S.pend = 0; }
|
||||
}
|
||||
#endif
|
||||
+23
-23
@@ -1,23 +1,23 @@
|
||||
ENTRY(Reset_Handler)
|
||||
MEMORY {
|
||||
PRAM (rwx) : ORIGIN = 0x00000000, LENGTH = 0x10000
|
||||
SRAM (rw) : ORIGIN = 0x18000000, LENGTH = 0x1F000
|
||||
}
|
||||
SECTIONS {
|
||||
.text : {
|
||||
KEEP(*(.vectors))
|
||||
KEEP(*(.pmxcfg))
|
||||
*(.text*)
|
||||
*(.rodata*)
|
||||
. = ALIGN(4);
|
||||
__pdata_start = .;
|
||||
} > PRAM
|
||||
.bss (NOLOAD) : { __bss_start = .; *(.bss*) *(COMMON) . = ALIGN(4); __bss_end = .; } > SRAM
|
||||
/* mutable data in SRAM (initial values in PRAM, copied at startup), as in TamaEmu */
|
||||
.data : { __data_start = .; *(.data*) . = ALIGN(4); __data_end = .; } > SRAM AT > PRAM
|
||||
__data_load = LOADADDR(.data);
|
||||
.init : { . = ALIGN(4); KEEP(*(.initcode)) KEEP(*(.initdata*)) KEEP(*(.initcode_z)) . = ALIGN(4); __prog_end = .; } > PRAM
|
||||
ASSERT(__prog_end <= 0x10000, "program too big for PRAM")
|
||||
ASSERT(__bss_end <= 0x1801F000, "RAM full")
|
||||
/DISCARD/ : { *(.comment) *(.ARM.*) *(.note*) }
|
||||
}
|
||||
ENTRY(Reset_Handler)
|
||||
MEMORY {
|
||||
PRAM (rwx) : ORIGIN = 0x00000000, LENGTH = 0x10000
|
||||
SRAM (rw) : ORIGIN = 0x18000000, LENGTH = 0x1F000
|
||||
}
|
||||
SECTIONS {
|
||||
.text : {
|
||||
KEEP(*(.vectors))
|
||||
KEEP(*(.pmxcfg))
|
||||
*(.text*)
|
||||
*(.rodata*)
|
||||
. = ALIGN(4);
|
||||
__pdata_start = .;
|
||||
} > PRAM
|
||||
.bss (NOLOAD) : { __bss_start = .; *(.bss*) *(COMMON) . = ALIGN(4); __bss_end = .; } > SRAM
|
||||
/* mutable data in SRAM (initial values in PRAM, copied at startup), as in TamaEmu */
|
||||
.data : { __data_start = .; *(.data*) . = ALIGN(4); __data_end = .; } > SRAM AT > PRAM
|
||||
__data_load = LOADADDR(.data);
|
||||
.init : { . = ALIGN(4); KEEP(*(.initcode)) KEEP(*(.initdata*)) KEEP(*(.initcode_z)) . = ALIGN(4); __prog_end = .; } > PRAM
|
||||
ASSERT(__prog_end <= 0x10000, "program too big for PRAM")
|
||||
ASSERT(__bss_end <= 0x1801F000, "RAM full")
|
||||
/DISCARD/ : { *(.comment) *(.ARM.*) *(.note*) }
|
||||
}
|
||||
+737
-737
File diff suppressed because it is too large.
Load diff
+4167
-4167
File diff suppressed because it is too large.
Load diff
+4881
-4881
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
||||
/* freestanding stubs for Peanut-GB on the Paradise */
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
void abort(void) __attribute__((noreturn));
|
||||
/* freestanding stubs for Peanut-GB on the Paradise */
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
void abort(void) __attribute__((noreturn));
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
void *memset(void *d, int c, size_t n);
|
||||
void *memcpy(void *d, const void *s, size_t n);
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
void *memset(void *d, int c, size_t n);
|
||||
void *memcpy(void *d, const void *s, size_t n);
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
#pragma once
|
||||
struct tm { int tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year, tm_wday, tm_yday, tm_isdst; };
|
||||
#pragma once
|
||||
struct tm { int tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year, tm_wday, tm_yday, tm_isdst; };
|
||||
Reference in new issue
Block a user