Skip to content

Commit 50060fc

Browse files
authored
Merge pull request #1043 from boriel-basic/refact/link_zxnext_arch_duplicated_files
refact: use #include [arch:zx48k] for duplicated zxnext lib files
2 parents 8ac4975 + ff6d739 commit 50060fc

146 files changed

Lines changed: 1080 additions & 8117 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,8 @@
1+
; ----------------------------------------------------------------
2+
; This file is released under the MIT License
13
;
2-
; CharLeft
3-
; Alvin Albrecht 2002
4-
;
5-
6-
;INCLUDE "SPconfig.def"
7-
;XLIB SPCharLeft
8-
9-
; Char Left
10-
;
11-
; Adjusts screen address HL to move one character to the left
12-
; on the display. Start of line wraps to the previous row.
13-
;
14-
; enter: HL = valid screen address
15-
; Carry reset
16-
; exit : Carry = moved off screen
17-
; HL = moves one character left, with line wrap
18-
; used : AF, HL
19-
20-
;IF !DISP_HIRES
21-
22-
push namespace core
23-
24-
SP.CharLeft:
25-
ld a,l
26-
dec l
27-
or a
28-
ret nz
29-
ld a,h
30-
sub $08
31-
ld h,a
32-
cp $40
33-
ret
34-
35-
pop namespace
36-
37-
38-
;ELSE
39-
40-
;.SPCharLeft
41-
; ld a,h
42-
; xor $20
43-
; ld h,a
44-
; cp $58
45-
; ccf
46-
; ret nc
47-
; ld a,l
48-
; dec l
49-
; or a
50-
; ret nz
51-
; ld a,h
52-
; sub $08
53-
; ld h,a
54-
; and $18
55-
; cp $18
56-
; ccf
57-
; ret
4+
; Copyleft (k) 2008
5+
; by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
; ----------------------------------------------------------------
587

59-
; ENDIF
8+
#include once [arch:zx48k] <SP/CharLeft.asm>
Lines changed: 6 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,8 @@
1+
; ----------------------------------------------------------------
2+
; This file is released under the MIT License
13
;
2-
; CharRight
3-
; Alvin Albrecht 2002
4-
;
5-
6-
;INCLUDE "SPconfig.def"
7-
;XLIB SPCharRight
8-
9-
; Char Right
10-
;
11-
; Adjusts screen address HL to move one character to the right
12-
; on the display. End of line wraps to the next row.
13-
;
14-
; enter: HL = valid screen address
15-
; Carry reset
16-
; exit : Carry = moved off screen
17-
; HL = moves one character right, with line wrap
18-
; used : AF, HL
19-
20-
;IF !DISP_HIRES
21-
22-
push namespace core
23-
24-
SP.CharRight:
25-
inc l
26-
ret nz
27-
ld a,8
28-
add a,h
29-
ld h,a
30-
cp $58
31-
ccf
32-
ret
33-
34-
pop namespace
35-
36-
37-
;ELSE
38-
39-
;.SPCharRight
40-
; ld a,h
41-
; xor $20
42-
; ld h,a
43-
; cp $58
44-
; ret nc
45-
; inc l
46-
; ret nz
47-
; ld a,8
48-
; add a,h
49-
; ld h,a
50-
; cp $58
51-
; ccf
52-
; ret
4+
; Copyleft (k) 2008
5+
; by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
; ----------------------------------------------------------------
537

54-
; ENDIF
8+
#include once [arch:zx48k] <SP/CharRight.asm>
Lines changed: 6 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,8 @@
1+
; ----------------------------------------------------------------
2+
; This file is released under the MIT License
13
;
2-
; GetScrnAddr
3-
; Alvin Albrecht 2002
4-
;
5-
6-
; Get Screen Address
7-
;
8-
; Computes the screen address given a valid pixel coordinate.
9-
; (0,0) is located at the top left corner of the screen.
10-
;
11-
; enter: h = y coord
12-
; l = x coord
13-
; In hi-res mode, Carry is most significant bit of x coord (0..511 pixels)
14-
; exit : de = screen address, b = pixel mask
15-
; uses : af, b, de, hl
16-
17-
push namespace core
18-
PROC
19-
LOCAL rotloop, norotate
20-
21-
SPGetScrnAddr:
22-
ld a,h
23-
and $07
24-
ld d,a
25-
ld a,h
26-
rra
27-
rra
28-
rra
29-
and $18
30-
or d
31-
ld d,a
32-
33-
ld a,l
34-
and $07
35-
ld b,a
36-
ld a,$80
37-
jr z, norotate
38-
39-
rotloop:
40-
rra
41-
djnz rotloop
42-
43-
norotate:
44-
ld b,a
45-
srl l
46-
srl l
47-
srl l
48-
ld a,h
49-
rla
50-
rla
51-
and $e0
52-
or l
53-
ld e,a
54-
ld hl, (SCREEN_ADDR)
55-
add hl, de
56-
ex de, hl
57-
ret
58-
59-
ENDP
60-
pop namespace
4+
; Copyleft (k) 2008
5+
; by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
; ----------------------------------------------------------------
617

62-
#include once <sysvars.asm>
8+
#include once [arch:zx48k] <SP/GetScrnAddr.asm>
Lines changed: 6 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,8 @@
1+
; ----------------------------------------------------------------
2+
; This file is released under the MIT License
13
;
2-
; PixelDown
3-
; Alvin Albrecht 2002
4-
;
5-
6-
; Pixel Down
7-
;
8-
; Adjusts screen address HL to move one pixel down in the display.
9-
; (0,0) is located at the top left corner of the screen.
10-
;
11-
; enter: HL = valid screen address
12-
; exit : Carry = moved off screen
13-
; Carry'= moved off current cell (needs ATTR update)
14-
; HL = moves one pixel down
15-
; used : AF, HL
16-
17-
push namespace core
18-
19-
SP.PixelDown:
20-
PROC
21-
LOCAL leave
22-
23-
push de
24-
ld de, (SCREEN_ADDR)
25-
or a
26-
sbc hl, de
27-
inc h
28-
ld a,h
29-
and $07
30-
jr nz, leave
31-
scf ; Sets carry on F', which flags ATTR must be updated
32-
ex af, af'
33-
ld a,h
34-
sub $08
35-
ld h,a
36-
ld a,l
37-
add a,$20
38-
ld l,a
39-
jr nc, leave
40-
ld a,h
41-
add a,$08
42-
ld h,a
43-
cp $19 ; carry = 0 => Out of screen
44-
jr c, leave ; returns if out of screen
45-
ccf
46-
pop de
47-
ret
48-
49-
leave:
50-
add hl, de ; This always sets Carry = 0
51-
pop de
52-
ret
53-
54-
ENDP
55-
pop namespace
4+
; Copyleft (k) 2008
5+
; by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
; ----------------------------------------------------------------
567

57-
#include once <sysvars.asm>
8+
#include once [arch:zx48k] <SP/PixelDown.asm>
Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,8 @@
1+
; ----------------------------------------------------------------
2+
; This file is released under the MIT License
13
;
2-
; PixelLeft
3-
; Jose Rodriguez 2012
4-
;
5-
6-
; PixelLeft
7-
;
8-
; Adjusts screen address HL and Pixel bit A to move one pixel to the left
9-
; on the display. Start of line set Carry (Out of Screen)
10-
;
11-
; enter: HL = valid screen address
12-
; A = Bit Set
13-
; exit : Carry = moved off screen
14-
; Carry' Set if moved off current ATTR CELL
15-
; HL = moves one character left, if needed
16-
; A = Bit Set with new pixel pos.
17-
; used : AF, HL
18-
19-
20-
push namespace core
21-
22-
SP.PixelLeft:
23-
PROC
24-
25-
LOCAL leave
26-
27-
push de
28-
ld de, (SCREEN_ADDR)
29-
or a
30-
sbc hl, de ; This always sets Carry = 0
31-
32-
rlca ; Sets new pixel bit 1 to the right
33-
jr nc, leave
34-
ex af, af' ; Signal in C' we've moved off current ATTR cell
35-
ld a,l
36-
dec a
37-
ld l,a
38-
cp 32 ; Carry if in screen
39-
ccf
40-
ld a, 1
41-
42-
leave: ; Sets screen offset back again
43-
push af
44-
add hl, de
45-
pop af
46-
pop de
47-
ret
48-
49-
ENDP
50-
pop namespace
4+
; Copyleft (k) 2008
5+
; by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
; ----------------------------------------------------------------
517

52-
#include once <sysvars.asm>
8+
#include once [arch:zx48k] <SP/PixelLeft.asm>
Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,8 @@
1+
; ----------------------------------------------------------------
2+
; This file is released under the MIT License
13
;
2-
; PixelRight
3-
; Jose Rodriguez 2012
4-
;
5-
6-
7-
; PixelRight
8-
;
9-
; Adjusts screen address HL and Pixel bit A to move one pixel to the left
10-
; on the display. Start of line set Carry (Out of Screen)
11-
;
12-
; enter: HL = valid screen address
13-
; A = Bit Set
14-
; exit : Carry = moved off screen
15-
; Carry' Set if moved off current ATTR CELL
16-
; HL = moves one character left, if needed
17-
; A = Bit Set with new pixel pos.
18-
; used : AF, HL
19-
20-
21-
push namespace core
22-
23-
SP.PixelRight:
24-
PROC
25-
26-
LOCAL leave
27-
28-
push de
29-
ld de, (SCREEN_ADDR)
30-
or a
31-
sbc hl, de ; This always sets Carry = 0
32-
33-
rrca ; Sets new pixel bit 1 to the right
34-
jr nc, leave
35-
ex af, af' ; Signal in C' we've moved off current ATTR cell
36-
ld a, l
37-
inc a
38-
ld l, a
39-
cp 32 ; Carry if IN screen
40-
ccf
41-
ld a, 80h
42-
43-
leave: ; Sets screen offset back again
44-
push af
45-
add hl, de
46-
pop af
47-
pop de
48-
ret
49-
50-
ENDP
51-
pop namespace
4+
; Copyleft (k) 2008
5+
; by Jose Rodriguez-Rosa (a.k.a. Boriel) <https://www.boriel.com>
6+
; ----------------------------------------------------------------
527

53-
#include once <sysvars.asm>
8+
#include once [arch:zx48k] <SP/PixelRight.asm>

0 commit comments

Comments
 (0)