This repository has been archived by the owner on May 21, 2024. It is now read-only.
forked from boriel-basic/zxbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request boriel-basic#286 from boriel/bugfix/nextbuild_cras…
…h_o3 Add tests for -O3 nextbuild crash
- Loading branch information
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |