Skip to content

Commit 6c080fa

Browse files
authored
Merge pull request #286 from boriel/bugfix/nextbuild_crash_o3
Add tests for -O3 nextbuild crash
2 parents b0560fd + b46183b commit 6c080fa

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
org 32768
2+
__START_PROGRAM:
3+
di
4+
push ix
5+
push iy
6+
exx
7+
push hl
8+
exx
9+
ld hl, 0
10+
add hl, sp
11+
ld (__CALL_BACK__), hl
12+
ei
13+
ld hl, 2
14+
push hl
15+
ld a, 16
16+
push af
17+
xor a
18+
push af
19+
push af
20+
push hl
21+
push af
22+
ld hl, 49152
23+
push hl
24+
call _TileMap
25+
xor a
26+
push af
27+
push af
28+
push af
29+
push af
30+
ld a, 100
31+
push af
32+
ld hl, 100
33+
push hl
34+
call _UpdateSprite
35+
ld bc, 0
36+
__END_PROGRAM:
37+
di
38+
ld hl, (__CALL_BACK__)
39+
ld sp, hl
40+
exx
41+
pop hl
42+
pop iy
43+
pop ix
44+
exx
45+
ei
46+
ret
47+
__CALL_BACK__:
48+
DEFW 0
49+
_UpdateSprite:
50+
push ix
51+
ld ix, 0
52+
add ix, sp
53+
_UpdateSprite__leave:
54+
exx
55+
ld hl, 12
56+
__EXIT_FUNCTION:
57+
ld sp, ix
58+
pop ix
59+
pop de
60+
add hl, sp
61+
ld sp, hl
62+
push de
63+
exx
64+
ret
65+
_TileMap:
66+
push ix
67+
ld ix, 0
68+
add ix, sp
69+
_TileMap__leave:
70+
exx
71+
ld hl, 14
72+
jp __EXIT_FUNCTION
73+
ZXBASIC_USER_DATA:
74+
; Defines DATA END --> HEAP size is 0
75+
ZXBASIC_USER_DATA_END:
76+
; Defines USER DATA Length in bytes
77+
ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA
78+
END
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
sub UpdateSprite(ByVal x AS uinteger,ByVal y AS UBYTE,ByVal spriteid AS UBYTE,ByVal pattern AS UBYTE, _
4+
ByVal mflip as ubyte,ByVal anchor as ubyte)
5+
end sub
6+
7+
8+
sub TileMap(byval address as uinteger, byval blkoff as ubyte, byval numberoftiles as uinteger,byval x as ubyte, _
9+
byval y as ubyte, byval width as ubyte, byval mapwidth as uinteger)
10+
END SUB
11+
12+
13+
TileMap($c000,0,2,0,0,16,2)
14+
UpdateSprite(100,100,0,0,0,0)

0 commit comments

Comments
 (0)