Skip to content

Commit

Permalink
Speed up Falcon port
Browse files Browse the repository at this point in the history
  • Loading branch information
gameblabla committed Apr 19, 2018
1 parent e8a4406 commit 66aceb9
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 11 deletions.
Binary file modified Consoles_port/Falcon_port/EVIL/ev60_dsp.prg
Binary file not shown.
Binary file modified Consoles_port/Falcon_port/EVIL/ev60_nodsp.prg
Binary file not shown.
Binary file modified Consoles_port/Falcon_port/EVIL/ev_cf.prg
Binary file not shown.
Binary file modified Consoles_port/Falcon_port/EVIL/ev_dsp.prg
Binary file not shown.
Binary file modified Consoles_port/Falcon_port/EVIL/ev_nodsp.prg
Binary file not shown.
2 changes: 1 addition & 1 deletion Consoles_port/Falcon_port/src/dma_atari.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static SOUND snd;

static void Sound_free()
{
if (snd.data) Mfree(snd.data);
if (snd.data != NULL) Mfree(snd.data);
}

void Sound_Load(unsigned char* path)
Expand Down
1 change: 1 addition & 0 deletions Consoles_port/Falcon_port/src/falcsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ void FastClear32(__reg("a0") void *dst, __reg("d0") u32 size, __reg("d1") u32 da

// Data must be 32bits (4bytes) aligned, size must be multiple of 32 bytes
void VFastCopy32(__reg("a0") void *src, __reg("a1") void *dst, __reg("d0") long size);
void VFastCopy128(__reg("a0") void *src, __reg("a1") void *dst);
void VFastClear32(__reg("a0") void *dst, __reg("d0") u32 size, __reg("d1") u32 data);

void FastCopy16Skip(__reg("a0") void *src, __reg("a1") void *dst, __reg("d0") u32 size, __reg("d1") u16 skip);
Expand Down
21 changes: 20 additions & 1 deletion Consoles_port/Falcon_port/src/falcsysa_asm.s
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
public _FastClear32
public _VFastCopy32
public _VFastClear32
public _VFastCopy128
public _FastCopy16Skip

public _IKBD_Install
Expand Down Expand Up @@ -304,14 +305,32 @@ _VFastCopy32: ; Multiple of 32
movem.l d3-d7,-(a7)
lsr.l #5,d0
subq.l #1,d0
.copy: movem.l (a0)+,d1-d7/a2
.copy:
movem.l (a0)+,d1-d7/a2
movem.l d1-d7/a2,(a1)
lea 32(a1),a1
dbra d0,.copy
movem.l (a7)+,d3-d7
rts


_VFastCopy128: ; Multiple of 32
; a0 = src
; a1 = dst
; d0 = size
move.l #19,d0
.copy:
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
dbra d0,.copy
rts

_FastClear32: ; Multiple of 8 and Not more than 500Kbytes
; a0 = dst
; d0 = size
Expand Down
2 changes: 1 addition & 1 deletion Consoles_port/Falcon_port/src/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void Notrans_DrawSprite_NoChecks_scroll(BITMAP* b, u16* scr, unsigned short scro

while (row--)
{
VFastCopy32(src+scroll, dst, 640);
VFastCopy128(src+scroll, dst);
dst += (RL_SCREEN_WIDTH);
src += b->width;
}
Expand Down
12 changes: 6 additions & 6 deletions Consoles_port/Falcon_port/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,25 +216,25 @@ void Change_game(unsigned char mode, unsigned char level)
switch(mode)
{
case 0:
Play_Music(0);
Play_GameMusic(0);
break;
case 1:
Play_Music(4);
Play_GameMusic(4);
break;
case 2:
Play_Music(5);
Play_GameMusic(5);
break;
case 3:
Play_Music(3);
Play_GameMusic(3);
break;
case 4:
case 5:
Play_Music(2);
Play_GameMusic(2);
break;
}
}

void Play_Music(unsigned char song)
void Play_GameMusic(unsigned char song)
{
char* err;
unsigned char loop, dsp;
Expand Down
4 changes: 2 additions & 2 deletions Consoles_port/Falcon_port/src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ and to permit persons to whom the Software is furnished to do so, subject to the
#define SIZE_TILE 16
//#define Put_Background(a,b) Notrans_DrawSprite_NoChecks_scroll(&bmp[0], scr, abs(scroll_x+160));

unsigned char *collision_map, *background_map;
char *collision_map, *background_map;
unsigned char game_mode;
unsigned short map_width, map_height, map_size;
short scroll_x, scroll_progress;
Expand Down Expand Up @@ -136,7 +136,7 @@ void Enemy(struct main_player* enemy, unsigned char id, struct main_player* pp);
void Put_Enemy();

void Bullets();
void Play_Music(unsigned char song);
void Play_GameMusic(unsigned char song);

/*
*http://www.strudel.org.uk/itoa/
Expand Down

0 comments on commit 66aceb9

Please sign in to comment.