Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling non-ZXB code with RANDOMIZE USR
#7
Hi Boriel!

Sorry for vanishing for a while there, life got... complicated. :-(

Anyway, did you have any further thoughts on this problem? I've tried the new build (1.2.8-706) and I'm still getting the same issue. I've attached a file to this post called MusicTest.zip which contains an example of this in action. Load 'musictest-full.tap' to try it out, 'maketest.bat' will build it, 'musictest.bas' is the source.

Code:
cls
print "press any key"
pause 0
print "test 1"
randomize usr 64000
print "success"
pause 0
print "test 2"
go sub 9000
print "success"
pause 0
print "test 3"
test()
print "success"
print "done"

stop

SUB test()
    randomize usr 64000
END SUB

9000 RANDOMIZE USR 64000
9010 RETURN

There is a Music Box jingle (created with Beepola) loaded into memory at 64000 which is set up to play once then return control to the calling program. The test code calls this three times - from outside a sub/function, as part of a GO SUB and as a sub call. The sub call will fail (the music player does not return properly once the tune has finished and crashes the Spectrum) even though the others succeed.

Any ideas greatly appreciated! Smile


Attached Files
.zip   MusicTest.zip (Size: 5.88 KB / Downloads: 612)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)