cnvstowによるBOFで音もなく落ちるHSP君

#include "HSP3utf.as" #include "kernel32 […]

#include "HSP3utf.as" #include "kernel32 […]

#include "HSP3utf.as"
#include "kernel32.as"
#define WM_MOUSEMOVE 0x0200
screen 0, 1600, 900
font "", 13
randomize
oncmd gosub *WM_MOUSEMOVE_, WM_MOUSEMOVE
count = 0
stop
/*
WM_MOUSEMOVE
DA★
*/
*WM_MOUSEMOVE_
//64128
utf8 = makeRandomString()
//UTF-16
wideLen = MultiByteToWideChar(65001, 0, varptr(utf8), strlen(utf8), 0, 0)
//UTF-1612Byte(Byte)
sdim wide, wideLen*2+2
//
mes utf8
//HSPUTF-8→UTF-16
cnvstow wide, utf8
if (count\50==0):cls
count++
return
#module
#defcfunc makeRandomString
sdim output, 1024
sdim t
outIdx = 0
repeat 64+rnd(64)
switch rnd(5)
case 0
t = "!"
poke t, 0, peek(t,0)+rnd(93)
poke output, outIdx, peek(t, 0)
outIdx++
swbreak
case 1
t = ""
poke t, 2, peek(t,2)+rnd(63)
wpoke output, outIdx, wpeek(t, 0)
poke output, outIdx+2, peek(t, 2)
outIdx += 3
swbreak
case 2
t = ""
poke t, 2, peek(t,2)+rnd(23)
wpoke output, outIdx, wpeek(t, 0)
poke output, outIdx+2, peek(t, 2)
outIdx += 3
swbreak
case 3
t = ""
poke t, 2, peek(t,2)+rnd(31)
wpoke output, outIdx, wpeek(t, 0)
poke output, outIdx+2, peek(t, 2)
outIdx += 3
swbreak
case 4
t = ""
poke t, 2, peek(t,2)+rnd(59)
wpoke output, outIdx, wpeek(t, 0)
poke output, outIdx+2, peek(t, 2)
outIdx += 3
swbreak
swend
loop
return output
#global
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX