Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request boriel-basic#286 from boriel/bugfix/nextbuild_cras…
Browse files Browse the repository at this point in the history
…h_o3

Add tests for -O3 nextbuild crash
  • Loading branch information
boriel committed May 8, 2020
2 parents b0560fd + b46183b commit 6c080fa
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
78 changes: 78 additions & 0 deletions tests/functional/opt3_nextbuild.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
org 32768
__START_PROGRAM:
di
push ix
push iy
exx
push hl
exx
ld hl, 0
add hl, sp
ld (__CALL_BACK__), hl
ei
ld hl, 2
push hl
ld a, 16
push af
xor a
push af
push af
push hl
push af
ld hl, 49152
push hl
call _TileMap
xor a
push af
push af
push af
push af
ld a, 100
push af
ld hl, 100
push hl
call _UpdateSprite
ld bc, 0
__END_PROGRAM:
di
ld hl, (__CALL_BACK__)
ld sp, hl
exx
pop hl
pop iy
pop ix
exx
ei
ret
__CALL_BACK__:
DEFW 0
_UpdateSprite:
push ix
ld ix, 0
add ix, sp
_UpdateSprite__leave:
exx
ld hl, 12
__EXIT_FUNCTION:
ld sp, ix
pop ix
pop de
add hl, sp
ld sp, hl
push de
exx
ret
_TileMap:
push ix
ld ix, 0
add ix, sp
_TileMap__leave:
exx
ld hl, 14
jp __EXIT_FUNCTION
ZXBASIC_USER_DATA:
; Defines DATA END --> HEAP size is 0
ZXBASIC_USER_DATA_END:
; Defines USER DATA Length in bytes
ZXBASIC_USER_DATA_LEN EQU ZXBASIC_USER_DATA_END - ZXBASIC_USER_DATA
END
14 changes: 14 additions & 0 deletions tests/functional/opt3_nextbuild.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


sub UpdateSprite(ByVal x AS uinteger,ByVal y AS UBYTE,ByVal spriteid AS UBYTE,ByVal pattern AS UBYTE, _
ByVal mflip as ubyte,ByVal anchor as ubyte)
end sub


sub TileMap(byval address as uinteger, byval blkoff as ubyte, byval numberoftiles as uinteger,byval x as ubyte, _
byval y as ubyte, byval width as ubyte, byval mapwidth as uinteger)
END SUB


TileMap($c000,0,2,0,0,16,2)
UpdateSprite(100,100,0,0,0,0)

0 comments on commit 6c080fa

Please sign in to comment.