BACKENDS: ATARI: Add support for -mfastcall

This commit is contained in:
Thorsten Otto 2024-05-17 12:21:31 +02:00 committed by Miro Kropacek
parent 7dabb755dd
commit 30670e0a46
4 changed files with 79 additions and 0 deletions

View File

@ -35,9 +35,15 @@
| void asm_c2p1x1_8(const byte *pChunky, const byte *pChunkyEnd, byte *pScreen);
SYM(asm_c2p1x1_8):
#ifdef __FASTCALL__
| a0: chunky
move.l a1,d0 | chunky end
move.l 4(sp),a1 | screen
#else
move.l (4,sp),a0 | chunky
move.l (8,sp),d0 | chunky end
move.l (12,sp),a1 | screen
#endif
movem.l d2-d7/a2-a6,-(sp)
move.l d0,a2
move.l #0x0f0f0f0f,d4
@ -234,10 +240,17 @@ c2p1x1_8_start:
SYM(asm_c2p1x1_8_tt):
movem.l d2-d7/a2-a6,-(sp) | 6 + 5 = 11 longs
#ifdef __FASTCALL__
| a0: chunky
move.l a1,a2 | a2: chunky end
move.l (11*4+4,sp),a1 | a1: screen
| d0.l: screen pitch (double width)
#else
move.l (11*4+4,sp),a0 | a0: chunky
move.l (11*4+8,sp),a2 | a2: chunky end
move.l (11*4+12,sp),a1 | a1: screen
move.l (11*4+16,sp),d0 | d0.l: screen pitch (double width)
#endif
move.l sp,old_sp
@ -449,12 +462,21 @@ c2p1x1_8_tt_start:
SYM(asm_c2p1x1_8_rect):
movem.l d2-d7/a2-a6,-(sp) | 6 + 5 = 11 longs
#ifdef __FASTCALL__
| a0: chunky
move.l a1,chunky_end
| d0.l: chunky width
move.l (11*4+4,sp),a1 | a1: screen
exg d1,d2 | d2.l: chunky pitch
| d1.l: screen pitch
#else
move.l (11*4+4,sp),a0 | a0: chunky
move.l (11*4+8,sp),chunky_end
move.l (11*4+12,sp),d0 | d0.l: chunky width
move.l (11*4+16,sp),d2 | d2.l: chunky pitch
move.l (11*4+20,sp),a1 | a1: screen
move.l (11*4+24,sp),d1 | d1.l: screen pitch
#endif
move.l sp,old_sp
@ -679,9 +701,15 @@ c2p1x1_8_rect_done:
| void asm_c2p1x1_4(const byte *pChunky, const byte *pChunkyEnd, byte *pScreen);
SYM(asm_c2p1x1_4):
#ifdef __FASTCALL__
| a0: chunky
move.l a1,d0 | chunky end
move.l 4(sp),a1 | screen
#else
move.l (4,sp),a0 | chunky
move.l (8,sp),d0 | chunky end
move.l (12,sp),a1 | screen
#endif
movem.l d2-d7/a2-a6,-(sp)
move.l d0,a2
move.l #0x0f0f0f0f,d4
@ -785,12 +813,21 @@ c2p1x1_4_start:
SYM(asm_c2p1x1_4_rect):
movem.l d2-d7/a2-a6,-(sp) | 6 + 5 = 11 longs
#ifdef __FASTCALL__
| a0: chunky
move.l a1,chunky_end
| d0.l: chunky width
move.l (11*4+4,sp),a1 | a1: screen
exg d1,d2 | d2.l: chunky pitch
| d1.l: screen pitch
#else
move.l (11*4+4,sp),a0 | a0: chunky
move.l (11*4+8,sp),chunky_end
move.l (11*4+12,sp),d0 | d0.l: chunky width
move.l (11*4+16,sp),d2 | d2.l: chunky pitch
move.l (11*4+20,sp),a1 | a1: screen
move.l (11*4+24,sp),d1 | d1.l: screen pitch
#endif
move.l sp,old_sp

View File

@ -32,6 +32,18 @@
SYM(asm_draw_4bpl_sprite):
movem.l d0-d7/a0-a2,-(sp) | 11 longs
#ifdef __FASTCALL__
move.l a0,a2 | a2: dstBuffer
| a1: srcBuffer
move.l (4+11*4,sp),a0 | a0: srcMask
| d0.w: destX
| d1.w: destY
move.l d2,d3 | d3.w: dstPitch
ext.l d3 | d3.l: dstPitch
move.l (8+11*4,sp),d6 | d6.w: w
lsr.w #4,d6 | d6.w: w/16
move.l (12+11*4,sp),d7 | d7.w: h
#else
move.l (4+11*4,sp),a2 | a2: dstBuffer
move.l (8+11*4,sp),a1 | a1: srcBuffer
move.l (12+11*4,sp),a0 | a0: srcMask
@ -42,6 +54,7 @@ SYM(asm_draw_4bpl_sprite):
move.l (28+11*4,sp),d6 | d6.w: w
lsr.w #4,d6 | d6.w: w/16
move.l (32+11*4,sp),d7 | d7.w: h
#endif
| Draws a 4 bitplane sprite at any position on screen.
| (c) 1999 Pieter van der Meer (EarX)
@ -130,6 +143,18 @@ sprite4_xloop:
SYM(asm_draw_8bpl_sprite):
movem.l d0-d7/a0-a2,-(sp) | 11 longs
#ifdef __FASTCALL__
move.l a0,a2 | a2: dstBuffer
| a1: srcBuffer
move.l (4+11*4,sp),a0 | a0: srcMask
| d0.w: destX
| d1.w: destY
move.l d2,d3 | d3.w: dstPitch
ext.l d3 | d3.l: dstPitch
move.l (8+11*4,sp),d6 | d6.w: w
lsr.w #4,d6 | d6.w: w/16
move.l (12+11*4,sp),d7 | d7.w: h
#else
move.l (4+11*4,sp),a2 | a2: dstBuffer
move.l (8+11*4,sp),a1 | a1: srcBuffer
move.l (12+11*4,sp),a0 | a0: srcMask
@ -140,6 +165,7 @@ SYM(asm_draw_8bpl_sprite):
move.l (28+11*4,sp),d6 | d6.w: w
lsr.w #4,d6 | d6.w: w/16
move.l (32+11*4,sp),d7 | d7.w: h
#endif
move.w d0,d2 | / Calculate the
andi.w #0b111111110000,d0 | | number of bits

View File

@ -7,12 +7,20 @@ mkdir -p build-release
cd build-release
PLATFORM=m68k-atari-mintelf
FASTCALL=false
export ASFLAGS="-m68020-60"
export CXXFLAGS="-m68020-60 -DUSE_MOVE16 -DUSE_SUPERVIDEL -DUSE_SV_BLITTER"
export LDFLAGS="-m68020-60 -Wl,--msuper-memory"
export PKG_CONFIG_LIBDIR="$(${PLATFORM}-gcc -print-sysroot)/usr/lib/m68020-60/pkgconfig"
if $FASTCALL
then
ASFLAGS="$ASFLAGS -mfastcall"
CXXFLAGS="$CXXFLAGS -mfastcall"
LDFLAGS="$LDFLAGS -mfastcall"
fi
if [ ! -f config.log ]
then
../configure \

View File

@ -7,12 +7,20 @@ mkdir -p build-release030
cd build-release030
PLATFORM=m68k-atari-mintelf
FASTCALL=false
export ASFLAGS="-m68030"
export CXXFLAGS="-m68030 -DDISABLE_FANCY_THEMES"
export LDFLAGS="-m68030 -Wl,--msuper-memory"
export PKG_CONFIG_LIBDIR="$(${PLATFORM}-gcc -print-sysroot)/usr/lib/m68020-60/pkgconfig"
if $FASTCALL
then
ASFLAGS="$ASFLAGS -mfastcall"
CXXFLAGS="$CXXFLAGS -mfastcall"
LDFLAGS="$LDFLAGS -mfastcall"
fi
if [ ! -f config.log ]
then
../configure \