-
Notifications
You must be signed in to change notification settings - Fork 0
/
c2p_carddeltaasm.asm
79 lines (73 loc) · 2.88 KB
/
c2p_carddeltaasm.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
* :ts=4 c2p_carddeltaasm.asm
*
* cp4 - Commodore C+4 emulator
* Copyright (C) 1999 Gáti Gergely
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* e-mail: [email protected]
*
xdef _carddelta
xref _GfxBase
include "lvos/graphics_lib.i"
LIBCALL MACRO ;FunctionName
jsr _LVO\1(a6)
ENDM
SCRHEIGHT EQU 283
SCRWIDTH EQU 352
* IN: a0: rp
* a1: temprp
* d0: chunky
* d1: delta
_carddelta movem.l d2-d4/a2-a6,-(sp)
move.l #(SCRHEIGHT-1)*SCRWIDTH,d3
add.l d3,d0
add.l d3,d1
move.l d0,a2 ; WritePixelLine8()-nak (chunky)
move.l d1,a3 ; delta buffer
move.l _GfxBase,a6
move.l #SCRHEIGHT-1,d3 ; ciklus érték (ystart)
move.l #SCRWIDTH,d2 ; width
move.l d2,d4
lsr.l #4,d4 ; width/16
subq.l #1,d4
move.l a0,a4 ; rp
move.l a1,a5 ; temprp
.cik move.l d4,d0 ; (width/16)-1
move.l a2,a0 ; chunky save
move.l a3,a1 ; delta save
.delta cmp.l (a0)+,(a1)+
bne .cnv
cmp.l (a0)+,(a1)+
bne .cnv
cmp.l (a0)+,(a1)+
bne .cnv
cmp.l (a0)+,(a1)+
bne .cnv
dbra d0,.delta
sub.l d2,a2 ; egy sorral feljebb... (chunky)
sub.l d2,a3 ; deltában is
dbra d3,.cik
bra .end
.cnv move.l d3,d1 ; ystart
clr.l d0 ; xstart
move.l a4,a0 ; rp
move.l a5,a1 ; temprp
LIBCALL WritePixelLine8
sub.l d2,a2 ; egy sorral feljebb... (chunky)
sub.l d2,a3 ; deltában is
dbra d3,.cik
.end movem.l (sp)+,d2-d4/a2-a6
rts