Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
9489cb6
added amiga files
Samuel-DEVULDER Dec 2, 2019
286e308
fixed Configure.readme script
Samuel-DEVULDER Dec 2, 2019
a3aafa7
1st successfull compilation
Samuel-DEVULDER Dec 2, 2019
b34601a
fixed palette + intro-movie
Samuel-DEVULDER Dec 2, 2019
cffcdbc
moved fps to the right in case screen truncate left column
Samuel-DEVULDER Dec 2, 2019
4b5d064
added asm version of render
Samuel-DEVULDER Dec 2, 2019
f05cbc3
SAGA started to work!
Samuel-DEVULDER Dec 4, 2019
f7bcc01
AMMX speedup
Samuel-DEVULDER Dec 4, 2019
97d0b67
fixed random crashes due to SDL_library data being trashed
Samuel-DEVULDER Dec 8, 2019
d8cee8c
oops a file was missing
Samuel-DEVULDER Dec 8, 2019
2d8fe3d
Speedup of render2 with Mask
Samuel-DEVULDER Dec 10, 2019
dc37d09
now uses E4/E5 in place of D4/D5 by usage of BANK prefix
Samuel-DEVULDER Dec 10, 2019
1ecbd0f
made an AMMX version of memcpy
Samuel-DEVULDER Dec 12, 2019
403efe2
fixed compilation issue
Samuel-DEVULDER Dec 12, 2019
81c0c97
now decodes smk bitstream with a faster algorithm ==> video at intros…
Samuel-DEVULDER Dec 13, 2019
ad9fd9f
code cleanup
Samuel-DEVULDER Dec 13, 2019
217bd59
cleanup
Samuel-DEVULDER Dec 13, 2019
b248352
fixed random crash in intro-video
Samuel-DEVULDER Dec 14, 2019
89acfd3
speedup smk with a bit of 68k asm.
Samuel-DEVULDER Dec 14, 2019
db032d3
at least a working SAGA version that doesn't modify internal SDL data…
Samuel-DEVULDER Dec 15, 2019
4d9005c
added AMMX replacement for memcpy/memset.
Samuel-DEVULDER Dec 15, 2019
514fbed
Better handling of .gitignore to include amiga asm files
Samuel-DEVULDER Dec 15, 2019
8cbf955
more asm optim + support for profiling in smk
Samuel-DEVULDER Dec 15, 2019
4a2963f
improved branch prediction in RenderTile_RT_TRANSPARENT
Samuel-DEVULDER Dec 16, 2019
c975363
added asm replacement for memcmp().
Samuel-DEVULDER Dec 16, 2019
88fb5be
speedup
Samuel-DEVULDER Dec 16, 2019
6952e39
fixed typo
Samuel-DEVULDER Dec 16, 2019
75d25de
fixed typo
Samuel-DEVULDER Dec 16, 2019
413081d
fixed typo
Samuel-DEVULDER Dec 16, 2019
bcac248
now uses dbmalloc()/dbfree() in smk resulting in faster video-intro
Samuel-DEVULDER Dec 16, 2019
d91ad38
Merge branch 'malloc-replacement'
Samuel-DEVULDER Dec 16, 2019
b816892
now uses a 16bits buffer ==> works even faster
Samuel-DEVULDER Dec 16, 2019
4421e53
get rid of SDL clipping when rendering video
Samuel-DEVULDER Dec 17, 2019
2d4dc84
typo
Samuel-DEVULDER Dec 17, 2019
ffef61b
slight speedup in smk
Samuel-DEVULDER Dec 17, 2019
1ef3c13
Ctrl-C now should work even when menus are active
Samuel-DEVULDER Dec 17, 2019
3faf020
improved ctrl-c support when in character selection menu
Samuel-DEVULDER Dec 17, 2019
cc46520
make StormLib use dlmalloc
Samuel-DEVULDER Dec 17, 2019
ff3dc3f
Now automatically check that stack is at least 128kb (experimental mi…
Samuel-DEVULDER Dec 17, 2019
8282761
speedup: now usess regparm(2) for smk bitstreams fcn
Samuel-DEVULDER Dec 18, 2019
e3ba799
speedup WastBit (most used fcn in there) with a bit of inline asm
Samuel-DEVULDER Dec 18, 2019
a6489d4
asm + ammx speedup
Samuel-DEVULDER Dec 18, 2019
7e826dc
restored removed atexit
Samuel-DEVULDER Dec 20, 2019
ada2cdb
made change amiga-specific
Samuel-DEVULDER Dec 20, 2019
aaf4d3f
made change amiga-specific
Samuel-DEVULDER Dec 20, 2019
5ecfae6
Merge branch 'master' of https://github.com/AmigaPorts/devilutionX
Samuel-DEVULDER Dec 21, 2019
623cd3c
more amiga / mc68k improvements
Samuel-DEVULDER Dec 22, 2019
980339a
bug https://github.com/Samuel-DEVULDER/devilutionX/issues/1 fixed
Samuel-DEVULDER Dec 23, 2019
a01cffd
better handling of 'copy_pane_mask'
Samuel-DEVULDER Dec 24, 2019
4b2a2cc
bank corrections
Samuel-DEVULDER Dec 24, 2019
ff0a017
disable VAAPIRE_2 by default (slower code)
Samuel-DEVULDER Dec 24, 2019
f7491a4
Merge branch 'master' into master
Samuel-DEVULDER Dec 24, 2019
92cd704
Merge branch 'Samuel-DEVULDER-master'
Samuel-DEVULDER Dec 24, 2019
09e1d6b
removed BANK which didn't work (got garbage on screen when it is on)
Samuel-DEVULDER Dec 24, 2019
fb74448
fixed cr/lf
Samuel-DEVULDER Dec 25, 2019
37b6df0
faster vampire_SurfaceFlip()
Samuel-DEVULDER Dec 26, 2019
6c74404
Update SourceS/sdl_compat.h
Samuel-DEVULDER Dec 27, 2019
e0c6f57
just in case
Samuel-DEVULDER Dec 29, 2019
b8dfd75
ok this one works
Samuel-DEVULDER Dec 29, 2019
679cb41
fastest ever!
Samuel-DEVULDER Dec 29, 2019
bb0d7cf
Merge branch 'master' of https://github.com/Samuel-DEVULDER/devilutionX
Samuel-DEVULDER Dec 29, 2019
2fc192e
faster version of bitstream
Samuel-DEVULDER Dec 30, 2019
2f3b672
faster version of bitstream
Samuel-DEVULDER Dec 30, 2019
dff3fde
faster version of bitstream
Samuel-DEVULDER Dec 30, 2019
e8e7a0b
added comment
Samuel-DEVULDER Dec 31, 2019
4199d20
fixed video not being vertically centered
Samuel-DEVULDER Dec 31, 2019
7f0e216
made fps round to closest integer + better C code for gcc/68k in rend…
Samuel-DEVULDER Dec 31, 2019
af5542f
fixed new EA macro
Samuel-DEVULDER Dec 31, 2019
55b566a
Merge branch 'master' of https://github.com/Samuel-DEVULDER/devilutio…
Samuel-DEVULDER Dec 31, 2019
5d940dc
fixed code format
Samuel-DEVULDER Dec 31, 2019
db7e893
first successfull compil
Samuel-DEVULDER Jan 2, 2020
4e2d9f6
works under uae, need to test on real machine
Samuel-DEVULDER Jan 2, 2020
5710229
simplified screen-bounds checking code
Samuel-DEVULDER Jan 2, 2020
9daa5a7
fixed some transparent tiles not being transparent
Samuel-DEVULDER Jan 2, 2020
12e8af1
improved multithreading in smk_bs_read_1
Samuel-DEVULDER Jan 2, 2020
2c74728
better handling of selection of RenderLineX functions. Simplified set…
Samuel-DEVULDER Jan 2, 2020
0c5ab35
fixed typo in memcpy/ammx resulting in possible mem-override
Samuel-DEVULDER Jan 2, 2020
a380379
improved scheduling
Samuel-DEVULDER Jan 3, 2020
4c8d546
now uses a 5sec basetime to get a more stable & accurate fps
Samuel-DEVULDER Jan 3, 2020
3bbbc2e
improved end of mask handling
Samuel-DEVULDER Jan 3, 2020
c26c9fc
improved end of mask handling
Samuel-DEVULDER Jan 3, 2020
854146e
possibly fixed progress without background
Samuel-DEVULDER Jan 6, 2020
e57b0c2
code reorg for m68k
Samuel-DEVULDER Jan 12, 2020
b6685e1
removed valid flag now gcc has been fixed
Samuel-DEVULDER Jan 12, 2020
94c6152
lock/unlock earlier only when running saga
Samuel-DEVULDER Jan 12, 2020
6069c4b
// change the palette the closest to screen wap, otherwise since deco…
Samuel-DEVULDER Jan 12, 2020
5d9ebb5
reintroduced valid-flag
Samuel-DEVULDER Jan 17, 2020
8809b2a
fixed savefile.
Samuel-DEVULDER Jan 17, 2020
23691bf
Merge branch 'byteorder-fix-tmp'
Samuel-DEVULDER Jan 17, 2020
cb50895
fixed Abort() when dtartign mutliplayer.
Samuel-DEVULDER Jan 17, 2020
75b82ff
fixed gold at 5000
Samuel-DEVULDER Jan 18, 2020
5464f56
fixed right side of pillars being displayed at full intensity in dung…
Samuel-DEVULDER Jan 18, 2020
5974e96
fixed endianess issue in SetMapMonsters (which created enforcer hits …
Samuel-DEVULDER Jan 19, 2020
e1bae9e
removed the 'valid' flag
Samuel-DEVULDER Jan 22, 2020
c42cdce
now uses dlmalloc/dlfree on the global level. This might help finding…
Samuel-DEVULDER Jan 27, 2020
1f53f3d
mertged with upstream
Samuel-DEVULDER Jan 29, 2020
97ad9f3
merged with upstream
Samuel-DEVULDER Jan 29, 2020
1fed5fb
fixed invisible cursor in-game
Samuel-DEVULDER Jan 30, 2020
8cc8311
fixed '-x' cmdline flag (force windowed mode) not working on saga
Samuel-DEVULDER Jan 30, 2020
16ee36d
added assert_failed() to compile NDEBUG mode
Samuel-DEVULDER Feb 6, 2020
fd079d6
speedup of Cl2BlitSafe() with AMMX & 68k asm. Cpu usage of this fcn d…
Samuel-DEVULDER Feb 6, 2020
776601f
reformat source code a bit
Samuel-DEVULDER Feb 8, 2020
5782c4a
fixed modulo type
Samuel-DEVULDER Feb 8, 2020
e978034
fixed modulo type
Samuel-DEVULDER Feb 8, 2020
ea759ff
fixed stupid erro making the exe crahs on non-vamp amigas
Samuel-DEVULDER Feb 15, 2020
5d2eaf1
removed bank with makes vampire freeze
Samuel-DEVULDER Feb 15, 2020
c7a78fc
added ascii-art for aros
Samuel-DEVULDER Feb 17, 2020
e8d23db
added ascii-art for aros
Samuel-DEVULDER Feb 17, 2020
a248ebc
increased fps why using AMMX version of SDL_MixAudio_m68k_S16MSB
Samuel-DEVULDER Feb 17, 2020
b763cb3
software saturation add now works
Samuel-DEVULDER Feb 18, 2020
b8f03c1
added ascii-art for aros
Samuel-DEVULDER Feb 18, 2020
bebd534
made aros use 320240 screen in place of 320x200 wich seem buggy
Samuel-DEVULDER Feb 18, 2020
4b4b610
added ascii-art for aros
Samuel-DEVULDER Feb 18, 2020
a2f5717
faster asm implem of vaddssw. might fix click noise when walking with…
Samuel-DEVULDER Feb 19, 2020
04d3458
another attempt at removeing stripes on polish version
Samuel-DEVULDER Feb 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion 3rdParty/PKWare/explode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ static char CopyrightPkware[] = "PKWARE Data Compression Library for Win32\r\n"
"PKWARE Data Compression Library Reg. U.S. Pat. and Tm. Off.\r\n"
"Version 1.11\r\n";

#ifdef __AMIGA__
// pass values in d0/d1 regs for speedup
#define static static __attribute__ ((regparam(2)))
#endif

//-----------------------------------------------------------------------------
// Tables

Expand Down Expand Up @@ -227,9 +232,43 @@ static void PKWAREAPI GenAscTabs(TDcmpStruct * pWork)
// Returns: PKDCL_OK: Operation was successful
// PKDCL_STREAM_END: There are no more bits in the input buffer

static int PKWAREAPI WasteBits(TDcmpStruct * pWork, unsigned int nBits)
static int PKWAREAPI WasteBits(TDcmpStruct * const pWork, unsigned int const nBits)
{
#ifdef __mc68000__
unsigned int m; int t = pWork->extra_bits;

// If number of bits required is less than number of (bits in the buffer) ?
if((t -= nBits)<0) {
const TDcmpStruct *zero = 0;
m = 1; // should be 0 but causes a gcc bug
pWork->extra_bits = (t+=8); t += nBits;

// Load input buffer if necessary
if(pWork->in_pos == pWork->in_bytes)
{
pWork->in_pos = sizeof(pWork->in_buff);
if((pWork->in_bytes = pWork->read_buf(pWork->in_buff, &pWork->in_pos, pWork->param)) == 0)
return PKDCL_STREAM_END;
pWork->in_pos = 0;
}
// Update bit buffer
__asm__ __volatile__ (
" move.b (%5,%4,%1.l),%0 \n"
" addq.l #1,%1 \n"
" lsl.l %2,%0 \n"
" or.l %3,%0 \n"
: "+d" (m), "+r" (pWork->in_pos)
: "d" (t), "m" (pWork->bit_buff),
"a" (pWork), "m" (zero->in_buff) );
} else {
pWork->extra_bits = t;
m = pWork->bit_buff;
}
end:
pWork->bit_buff = m >> nBits;
return PKDCL_OK;
#else
// If number of bits required is less than number of (bits in the buffer) ?
if(nBits <= pWork->extra_bits)
{
pWork->extra_bits -= nBits;
Expand All @@ -252,6 +291,7 @@ static int PKWAREAPI WasteBits(TDcmpStruct * pWork, unsigned int nBits)
pWork->bit_buff >>= (nBits - pWork->extra_bits);
pWork->extra_bits = (pWork->extra_bits - nBits) + 8;
return PKDCL_OK;
#endif
}

//-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions 3rdParty/Storm/Source/storm.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct CCritSect {
{
DeleteCriticalSection(&m_critsect);
}

void Enter()
{
EnterCriticalSection(&m_critsect);
Expand Down
123 changes: 105 additions & 18 deletions 3rdParty/StormLib/src/SBaseCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ DWORD HashStringLower(const char * szFileName, DWORD dwHashType)
// If the value is already a power of two, returns the same value
DWORD GetNearestPowerOfTwo(DWORD dwFileCount)
{
#ifdef __mc68000__
DWORD ret = 1;
__asm__ __volatile__(
" bfffo %1{0:31},%1 \n"
" bfins %0,%0{0:%1} \n"
: "+d" (ret), "+d" (dwFileCount) : );
return ret;
#else
dwFileCount --;

dwFileCount |= dwFileCount >> 1;
Expand All @@ -322,6 +330,7 @@ DWORD GetNearestPowerOfTwo(DWORD dwFileCount)
dwFileCount |= dwFileCount >> 16;

return dwFileCount + 1;
#endif
}
/*
DWORD GetNearestPowerOfTwo(DWORD dwFileCount)
Expand Down Expand Up @@ -416,6 +425,56 @@ void EncryptMpqBlock(void * pvDataBlock, DWORD dwLength, DWORD dwKey1)

void DecryptMpqBlock(void * pvDataBlock, DWORD dwLength, DWORD dwKey1)
{
#ifdef __mc68000__

#define _DataBlock "a0"
#define _StormBuffer "a1"
#define _dwLength "d0"
#define _dwKey1 "d1"
#define _dwKey2 "d2"
#define _dwValue32 "d3"
#define _dwTmp "d4"

register DWORD dwLength_ asm(_dwLength);

if(dwLength_ = dwLength>>2) {
register LPDWORD DataBlock asm(_DataBlock) = (LPDWORD)pvDataBlock;
register LPDWORD StormBuffer_ asm(_StormBuffer) = &StormBuffer[MPQ_HASH_KEY2_MIX];
register DWORD dwKey1_ asm(_dwKey1) = dwKey1;
register DWORD dwKey2 asm(_dwKey2) = 0xEEEEEEEE;
register DWORD dwValue32 asm(_dwValue32);
register DWORD dwTmp asm(_dwTmp);
__asm__ __volatile__ (
"\n"
".loop%=:\n"
" move.l ("_DataBlock"),"_dwTmp" \n"
" moveq #0,"_dwValue32" \n"
" move.b "_dwKey1","_dwValue32" \n"
" add.l ("_StormBuffer","_dwValue32".l*4),"_dwKey2" \n"
" move.l "_dwKey1","_dwValue32" \n"
" add.l "_dwKey2","_dwValue32" \n"
" eor.l "_dwTmp","_dwValue32" \n"
" move.l "_dwValue32",("_DataBlock")+ \n"
" add.l "_dwKey2","_dwValue32" \n"
" lsl.l #5,"_dwKey2" \n"
" addq.l #3,"_dwValue32" \n"
" add.l "_dwValue32","_dwKey2" \n"
" moveq #0x15,"_dwValue32" \n"
" rol.l "_dwValue32","_dwKey1" \n"
" move.l "_dwKey1","_dwValue32" \n"
" not.l "_dwKey1" \n"
" and.l #-1<<0x15,"_dwKey1" \n"
" and.l #~(-1<<0x15),"_dwValue32" \n"
" add.l #0x11111111,"_dwKey1" \n"
" or.l "_dwValue32","_dwKey1" \n"
" subq.l #1,"_dwLength" \n"
" bne.b .loop%= \n"
: "+r" (dwKey1_), "+r" (dwKey2), "=r" (dwValue32), "+r" (dwLength_), "+r" (DataBlock), "=r" (dwTmp)
: "r" (StormBuffer_)
: "cc", "memory"
);
}
#else
LPDWORD DataBlock = (LPDWORD)pvDataBlock;
DWORD dwValue32;
DWORD dwKey2 = 0xEEEEEEEE;
Expand All @@ -435,6 +494,7 @@ void DecryptMpqBlock(void * pvDataBlock, DWORD dwLength, DWORD dwKey1)
dwKey1 = ((~dwKey1 << 0x15) + 0x11111111) | (dwKey1 >> 0x0B);
dwKey2 = dwValue32 + dwKey2 + (dwKey2 << 5) + 3;
}
#endif
}

/**
Expand Down Expand Up @@ -1813,42 +1873,69 @@ uint64_t SwapUInt64( uint64_t val )
}
#endif

#ifdef __AMIGA__
extern "C" {
extern char ac68080_ammx;
extern void ConvertUInt16BufferAMMX(void * ptr, size_t length);
extern void ConvertUInt32BufferAMMX(void * ptr, size_t length);
extern void ConvertUInt64BufferAMMX(void * ptr, size_t length);
};
#endif

// Swaps array of unsigned 16-bit integers
void ConvertUInt16Buffer(void * ptr, size_t length)
{
uint16_t * buffer = (uint16_t *)ptr;
uint32_t nElements = (uint32_t)(length / sizeof(uint16_t));

while(nElements-- > 0)
#ifdef __AMIGA__
if(ac68080_ammx) ConvertUInt16BufferAMMX(ptr, length);
else
#endif
{
*buffer = SwapUInt16(*buffer);
buffer++;
uint16_t * buffer = (uint16_t *)ptr;
uint32_t nElements = (uint32_t)(length / sizeof(uint16_t));

while(nElements-- > 0)
{
*buffer = SwapUInt16(*buffer);
buffer++;
}
}
}

// Swaps array of unsigned 32-bit integers
void ConvertUInt32Buffer(void * ptr, size_t length)
{
uint32_t * buffer = (uint32_t *)ptr;
uint32_t nElements = (uint32_t)(length / sizeof(uint32_t));

while(nElements-- > 0)
#ifdef __AMIGA__
if(ac68080_ammx) ConvertUInt32BufferAMMX(ptr, length);
else
#endif
{
*buffer = SwapUInt32(*buffer);
buffer++;
uint32_t * buffer = (uint32_t *)ptr;
uint32_t nElements = (uint32_t)(length / sizeof(uint32_t));

while(nElements-- > 0)
{
*buffer = SwapUInt32(*buffer);
buffer++;
}
}
}

// Swaps array of unsigned 64-bit integers
void ConvertUInt64Buffer(void * ptr, size_t length)
{
uint64_t * buffer = (uint64_t *)ptr;
uint32_t nElements = (uint32_t)(length / sizeof(uint64_t));

while(nElements-- > 0)
#ifdef __AMIGA__
if(ac68080_ammx) ConvertUInt64BufferAMMX(ptr, length);
else
#endif
{
*buffer = SwapUInt64(*buffer);
buffer++;
uint64_t * buffer = (uint64_t *)ptr;
uint32_t nElements = (uint32_t)(length / sizeof(uint64_t));

while(nElements-- > 0)
{
*buffer = SwapUInt64(*buffer);
buffer++;
}
}
}

Expand Down
11 changes: 11 additions & 0 deletions 3rdParty/StormLib/src/StormCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ typedef struct _MPQ_SIGNATURE_INFO
//#define STORM_FREE(ptr) HeapFree(GetProcessHeap(), 0, ptr)
//
//#else

#ifdef __AMIGA__
#define malloc dlmalloc
#define realloc dlrealloc
#define free dlfree
extern "C" {
void *malloc(size_t len);
void *realloc(void *ptr, size_t len);
void free(void *ptr);
}
#endif

#define STORM_ALLOC(type, nitems) (type *)malloc((nitems) * sizeof(type))
#define STORM_REALLOC(type, ptr, nitems) (type *)realloc(ptr, ((nitems) * sizeof(type)))
Expand Down
Loading