Peter,
To show SB compatibility with O2, I took the converted game to SB and tried to make that code run under O2. Other than a few minor changes the code compiles and almost runs. I'm getting a Bass_StreamPlay error dialog which seems to be the only problem. Can you see if you can get the following code to work under O2? I'm getting the same error with Bass using the stock O2 version.
BTW: I had to declare a couple of variables you forgot and I'm surprise it compiled at all with the missing + operators to concatenate the remaining part of the map file names.
Missing variable declares: sc w5
Missing + operator LoadBytes("maps/map" + m "-1.txt",map1)
' A Game by PETER WIRBELAUER
' <START O2>
include "sw.inc"
include "bass.inc"
indexbase 0
InitBass
'variables
sys xBoy,yBoy,zBoy,rBoy,xExit,yExit,zExit,aExit,xShrink,yShrink,zShrink,play
sys ras,pills,yPill,xPill,zPill,x,y,z,p,rx,zAtom,yStar,xStar,zStar,eras
sys xExp,yExp,zExp,iExp,s1,s2,s3,s4,s5,s6,s7,s8,s9,sa,sb,sc,w1,w2,w3,w4,w5,m=1
Byte map1[1200]
Byte map2[1200]
Byte map3[1200]
sys xEny[4]
sys yEny[4]
sys rEny[4]
sys zEny[4]
single vEny[4]
' <END O2>
' Game Routines
SUB BoyBumm
static single vExp
IF yExp > 0 THEN
Sprite s9, xExp, yExp, zExp
IF play = 0 THEN
PlaySound w4
play = 1
END IF
vExp += .2
IF vExp >= 1 THEN
vExp = 0
zExp += 1
IF zExp = 16 THEN
yExp = 0
iExp = 1
END IF
END IF
END IF
END SUB
SUB InitEny
P = 0
FOR y = 0 TO 29
FOR x = 0 TO 39
z = y * 40 + x
IF map3[z] = 62 THEN
xEny[p] = x * 64
yEny[p] = y * 64
rEny[p] =- 1
p += 1
ELSE IF map3[z] = 63 THEN
xEny[p] = x * 64
yEny[p] = y * 64
rEny[p] =- 1
p += 1
ELSE IF map3[z] = 64 THEN
xEny[p] = x * 64
yEny[p] = y * 64
rEny[p] = -1
p += 1
ELSE IF map3[z] = 65 THEN
xEny[p] = x * 64
yEny[p] = y * 64
rEny[p] = -1
p += 1
END IF
IF p = 4 THEN EXIT SUB
NEXT
NEXT
END SUB
SUB ScanEnemy
IF eras > 0 THEN EXIT SUB
FOR x = 0 TO 3
z = (yEny[x] * 40 + xEny[x]) / 64
IF map3[z] = 62 AND map3[z+1] = 111 THEN
map3[z] = 32
map3[z + 1] = 62
rEny[x] = 1
ELSE IF map3[z] = 63 AND map3[z - 1] = 111 THEN
map3[z] = 32
map3[z - 1] = 63
rEny[x]=2
ELSE IF map3[z] = 64 AND map3[z - 40] = 111 THEN
map3[z] = 32
map3[z - 40] = 64
rEny[x] = 3
ELSE IF map3[z] = 65 AND map3[z + 40] = 111 THEN
map3[z] = 32
map3[z + 40] = 65
rEny[x]=4
ELSE IF (map3[z] = 62 AND map3[z + 40] = 111) OR (map3[z] = 63 AND map3[z + 40] = 111) THEN
map3[z] = 32
map3[z + 40] = 65
rEny[x] = 4
ELSE IF (map3[z] = 62 AND map3[z - 40] = 111) OR (map3[z] = 63 AND map3[z - 40] = 111) THEN
map3[z] = 32
map3[z - 40] = 64
rEny[x] = 3
ELSE IF (map3[z] = 64 AND map3[z - 1] = 111) OR (map3[z] = 65 AND map3[z - 1] = 111) THEN
map3[z] = 32
map3[z - 1] = 63
rEny[x] = 2
ELSE IF (map3[z] = 64 AND map3[z + 1] = 111) OR (map3[z] = 65 AND map3[z + 1] = 111) THEN
map3[z] = 32
map3[z + 1] = 62
rEny[x] = 1
ELSE IF map3[z] = 62 THEN
IF map1[z]=105 AND map3[z + 1] = 32 AND map3[z + 40] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 1
map3[z] = 32
map3[z + 1] = 62
ELSE IF rx = 2 THEN
rEny[x] = 4
map3[z] = 32
map3[z + 40] = 65
END IF
ELSE IF map1[z] = 105 AND map3[z + 1] = 32 AND map3[z - 40] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 1
map3[z] = 32
map3[z + 1] = 62
ELSE IF rx = 2 THEN
rEny[x] = 3
map3[z] = 32
map3[z - 40] = 64
END IF
ELSE IF map1[z] = 105 AND map3[z + 40] = 32 AND map3[z - 40] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 4
map3[z] = 32
map3[z + 40] = 64
ELSE IF rx = 2 THEN
rEny[x] = 3
map3[z] = 32
map3[z - 40] = 64
END IF
ELSE IF map3[z + 40] = 32 AND map3[z + 1] > 32 THEN
map3[z] = 32
map3[z + 40] = 65
rEny[x] = 4
ELSE IF map3[z - 40] = 32 AND map3[z + 1] > 32 THEN
map3[z] = 32
map3[z - 40] = 64
rEny[x] = 3
ELSE IF map3[z + 1] > 32 AND map3[z + 40] > 32 AND map3[z - 40] > 32 AND map3[z - 1] = 32 THEN
map3[z] = 32
map3[z - 1] = 63
rEny[x] = 2
ELSE IF map3[z + 1] > 32 AND map3[z + 40] > 32 AND map3[z - 40] > 32 THEN
rEny[x] = -1
ELSE IF map3[z] = 62 AND map3[z + 1] = 32 THEN
map3[z] = 32
map3[z + 1] = 62
rEny[x] = 1
END IF
ELSE IF map3[z] = 63 THEN
IF map1[z] = 105 AND map3[z - 1] = 32 AND map3[z - 40] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 2
map3[z] = 32
map3[z - 1] = 63
ELSE IF rx = 2 THEN
rEny[x] = 3
map3[z] = 32
map3[z - 40] = 64
END IF
ELSE IF map1[z] = 105 AND map3[z + 40] = 32 AND map3[z - 40] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 4
map3[z] = 32
map3[z + 40] = 64
ELSE IF rx = 2 THEN
rEny[x] = 3
map3[z] = 32
map3[z - 40] = 64
END IF
ELSE IF map1[z] = 105 AND map3[z - 1] = 32 AND map3[z + 40] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 2
map3[z] = 32
map3[z - 1] = 63
ELSE IF rx = 2 THEN
rEny[x] = 4
map3[z] = 32
map3[z + 40] = 65
END IF
ELSE IF map3[z + 40] = 32 AND map3[z - 1] > 32 THEN
map3[z] = 32
map3[z + 40] = 65
rEny[x] = 4
ELSE IF map3[z - 40] = 32 AND map3[z - 1] > 32 THEN
map3[z] = 32
map3[z - 40] = 64
rEny[x] = 3
ELSE IF map3[z - 1] > 32 AND map3[z + 40] > 32 AND map3[z - 40] > 32 AND map3[z + 1] = 32 THEN
map3[z] = 32
map3[z + 1] = 62
rEny[x] = 1
ELSE IF map3[z - 1] > 32 AND map3[z + 40] > 32 AND map3[z - 40] > 32 THEN
rEny[x] = -1
ELSE IF map3[z] = 63 AND map3[z - 1] = 32 THEN
map3[z] = 32
map3[z - 1] = 63
rEny[x] = 2
END IF
ELSE IF map3[z] = 64 THEN
IF map1[z] = 105 AND map3[z - 40] = 32 AND map3[z + 1] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 3
map3[z] = 32
map3[z - 40] = 64
ELSE IF rx = 2 THEN
rEny[x] = 1
map3[z] = 32
map3[z + 1] = 62
END IF
ELSE IF map1[z] = 105 AND map3[z - 40] = 32 AND map3[z - 1] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 3
map3[z] = 32
map3[z - 40] = 64
ELSE IF rx = 2 THEN
rEny[x] = 2
map3[z] = 32
map3[z - 1] = 63
END IF
ELSE IF map1[z] = 105 AND map3[z - 1] = 32 AND map3[z + 1] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 1
map3[z] = 32
map3[z + 1] = 62
ELSE IF rx = 2 THEN
rEny[x] = 2
map3[z] = 32
map3[z - 1] = 63
END IF
ELSE IF map3[z - 40] > 32 AND map3[z - 1] = 32 THEN
map3[z] = 32
map3[z - 1] = 63
rEny[x] = 2
ELSE IF map3[z - 40] > 32 AND map3[z + 1] = 32 THEN
map3[z] = 32
map3[z + 1] = 62
rEny[x] = 1
ELSE IF map3[z - 40] > 32 AND map3[z + 1] > 32 AND map3[z - 1] > 32 AND map3[z + 40] = 32 THEN
map3[z] = 32
map3[z + 40] = 65
rEny[x] = 4
ELSE IF map3[z - 40] > 32 AND map3[z + 1] > 32 AND map3[z - 1] > 32 THEN
rEny[x] = -1
ELSE IF map3[z] = 64 AND map3[z - 40] = 32 THEN
map3[z] = 32
map3[z - 40] = 64
rEny[x] = 3
ELSE
rEny[x] = -1
END IF
ELSE IF map3[z] = 65 THEN
IF map1[z] = 105 AND map3[z + 40] = 32 AND map3[z + 1] = 32 THEN
rx= Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 4
map3[z] = 32
map3[z + 40] = 65
ELSE IF rx = 2 THEN
rEny[x] = 1
map3[z] = 32
map3[z + 1] = 62
END IF
ELSE IF map1[z] = 105 AND map3[z + 40] = 32 AND map3[z - 1] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 4
map3[z] = 32
map3[z + 40] = 65
ELSE IF rx = 2 THEN
rEny[x] = 2
map3[z] = 32
map3[z - 1] = 63
END IF
ELSE IF map1[z] = 105 AND map3[z + 1] = 32 AND map3[z - 1] = 32 THEN
rx = Rnd(1, 2)
IF rx = 1 THEN
rEny[x] = 1
map3[z] = 32
map3[z + 1] = 62
ELSE IF rx = 2 THEN
rEny[x] = 2
map3[z]=32
map3[z-1]=63
END IF
ELSE IF map3[z + 40] > 32 AND map3[z - 1] = 32 THEN
map3[z] = 32
map3[z - 1] = 63
rEny[x] = 2
ELSE IF map3[z + 40] > 32 AND map3[z + 1] = 32 THEN
map3[z] = 32
map3[z + 1] = 62
rEny[x] = 1
ELSE IF map3[z + 40] > 32 AND map3[z + 1] > 32 AND map3[z - 1] > 32 AND map3[z -40] = 32 THEN
map3[z] = 32
map3[z - 40] = 64
rEny[x] = 3
ELSE IF map3[z + 40] > 32 AND map3[z + 1] > 32 AND map3[z - 1] > 32 THEN
rEny[x] = -1
ELSE IF map3[z + 40] = 32 THEN
map3[z] = 32
map3[z + 40] = 65
rEny[x] = 4
END IF
END IF
NEXT
END SUB
SUB SetEny(e)
vEny[e] += .2
IF vEny[e] >= 1 THEN
vEny[e] = 0
zEny[e] += 1
IF zEny[e] = 16 THEN zEny[e] = 0
END IF
END SUB
SUB ShowEnemy
FOR z = 0 TO 3
IF rEny[z] = -1 THEN
Sprite(sc, xEny[z], yEny[z], zEny[z])
SetEny(z)
ELSE IF rEny[z] = 1 THEN
xEny[z] += 1
Sprite(sc, xEny[z], yEny[z], zEny[z])
SetEny(z)
ELSE IF rEny[z] = 2 THEN
xEny[z] -= 1
Sprite(sc, xEny[z], yEny[z], zEny[z])
SetEny(z)
ELSE IF rEny[z] = 3 THEN
yEny[z] -= 1
Sprite(sc, xEny[z], yEny[z], zEny[z])
SetEny(z)
ELSE IF rEny[z] = 4 THEN
yEny[z] += 1
Sprite(sc, xEny[z], yEny[z], zEny[z])
SetEny(z)
END IF
NEXT
eras += 1
IF eras = 64 THEN eras = 0
END SUB
SUB ShowMaps
static float vAtom
FOR y = 0 TO 29
FOR x = 0 TO 39
z = y * 40 + x
IF map1[z] = 34 THEN Sprite(s1, x * 64, y * 64, 1)
IF map1[z] = 107 THEN Sprite(s1, x * 64, y * 64, 2)
IF map1[z] = 105 THEN Sprite(s1, x * 64, y * 64, 2)
IF map2[z] = 91 THEN Sprite(s2, x * 64, y * 64, zAtom)
IF map2[z] = 121 THEN Sprite(s7, x * 64, y * 64, 0)
IF map2[z] = 81 THEN Sprite(sa, x * 64, y * 64, zAtom)
NEXT
NEXT
vAtom += .2
IF vAtom >= 1 THEN
vAtom = 0
zAtom += 1
IF zAtom = 16 THEN zAtom = 0
END IF
END SUB
SUB InitBoy
FOR y = 0 TO 29
FOR x = 0 TO 39
z = y * 40 + x
IF map3[z] = 111 THEN
xBoy = x * 64
yBoy = y * 64
END IF
IF map2[z] = 91 OR map2[z] = 81 THEN
pills += 1
END IF
IF map2[z] = 121 THEN
xExit = x * 64
yExit = y * 64
END IF
NEXT
NEXT
END SUB
SUB CheckBoy
IF ras > 0 OR rBoy >= 5 THEN EXIT SUB
z = (yBoy * 40 + xBoy) / 64
IF map3[z] >= 62 AND map3[z] <= 65 THEN
rBoy = 6
xExp = xBoy
yExp = yBoy
ELSE IF map2[z] = 121 AND aExit = 1 THEN
xShrink = xBoy
yShrink = yBoy
map3[z] = 32
rBoy = 5
ELSE IF map2[z] = 91 THEN
xPill = xBoy
yPill = yBoy
Pills -= 1
map2[z] = 32
map3[z] = 32
rBoy = 0
PlaySound w2
ELSE IF map2[z] = 81 THEN
xStar = xBoy
yStar = yBoy
Pills -= 1
map2[z] = 32
map3[z] = 32
rBoy = 0
PlaySound w5
ELSE IF Key(39) < 0 AND map3[z + 1] = 32 THEN
map3[z] = 32
map3[z + 1] = 111
rBoy = 1
ELSE IF Key(37) < 0 AND map3[z - 1] = 32 THEN
map3[z] = 32
map3[z - 1] = 111
rBoy = 2
ELSE IF Key(38) < 0 AND map3[z - 40] = 32 THEN
map3[z] = 32
map3[z - 40] = 111
rBoy = 3
ELSE IF Key(40) < 0 AND map3[z + 40] = 32 THEN
map3[z] = 32
map3[z + 40] = 111
rBoy = 4
ELSE
rBoy = 0
END IF
END SUB
SUB DrawBoy
LOCAL vBoy
IF rBoy = 0 THEN
Sprite s3, xBoy, yBoy, 0
ELSE IF rBoy = 1 THEN
xBoy += 1
Sprite s5,xBoy,yBoy,zBoy
vBoy += .2
IF vBoy >= 1 THEN
vBoy = 0
zBoy += 1
IF zBoy = 16 THEN zBoy = 0
END IF
ras += 1
IF ras = 64 THEN ras = 0
ELSE IF rBoy = 2 THEN
xBoy -= 1
Sprite s6, xBoy, yBoy, zBoy
vBoy += .2
IF vBoy >= 1 THEN
vBoy = 0
zBoy += 1
IF zBoy = 16 THEN zBoy = 0
END IF
ras += 1
IF ras = 64 THEN ras = 0
ELSE IF rBoy = 3 THEN
yBoy -= 1
Sprite s4, xBoy, yBoy, zBoy
vBoy += .2
IF vBoy >= 1 THEN
vBoy = 0
zBoy += 1
IF zBoy = 16 THEN zBoy = 0
END IF
ras += 1
IF ras = 64 THEN ras = 0
ELSE IF rBoy = 4 THEN
yBoy +=1
Sprite s3, xBoy, yBoy, zBoy
vBoy += .2
IF vBoy >= 1 THEN
vBoy = 0
zBoy += 1
IF zBoy = 16 THEN zBoy = 0
END IF
ras += 1
IF ras = 64 THEN ras = 0
END IF
END SUB
SUB PillsAni
static float vPill
IF ypill > 0 THEN
Sprite s8, xpill, yPill, zPill
vPill += .2
IF vPill >= 1 THEN
vPill = 0
zPill += 1
IF zPill = 8 THEN
zPill = 0
yPill = 0
END IF
END IF
END IF
END SUB
SUB NoPills
IF Pills = 0 THEN
IF pills = 0 AND aExit = 0 THEN PlaySound(w1)
aExit = 1
END IF
END SUB
SUB ExitActiv
static float vExit
IF aExit = 1 THEN
Sprite s7, xExit, yExit, zExit
vExit += .2
IF vExit >= 1 THEN
vExit = 0
zExit += 1
IF zExit = 16 THEN zExit=0
END IF
END IF
END SUB
SUB BoyShrink
static float vShrink
IF yShrink > 0 THEN
Sprite s9, xShrink, yShrink, zShrink
vShrink +=.2
IF vShrink >= 1 THEN
vShrink = 0
zShrink += 1
IF zShrink = 16 THEN
yShrink = 0
PlaySound w4
END IF
END IF
END IF
END SUB
SUB StarShrink
static float vStar
IF yStar > 0 THEN
Sprite sb, xStar, yStar, zStar
vStar += .4
IF vStar >= 1 THEN
vStar=0
zStar += 1
IF zStar = 16 THEN
zStar = 0
yStar = 0
vStar = 0
END IF
END IF
END IF
END SUB
SUB InitDat
FOR x = 0 TO 4
xEny[x] = 0
yEny[x] = 0
rEny[x] = 0
zEny[x] = 0
vEny[x] = 0
NEXT
xBoy = 0
yBoy = 0
zBoy = 0
rBoy = 0
xExit = 0
yExit = 0
zExit = 0
aExit = 0
xShrink = 0
yShrink = 0
zShrink = 0
ras = 0
pills = 0
yPill = 0
xPill = 0
zPill = 0
x = 0
y = 0
z = 0
p = 0
rx = 0
zAtom = 0
yStar = 0
xStar = 0
zStar=0
xExp = 0
yExp = 0
zExp = 0
iExp = 0
eras = 0
play = 0
END SUB
SUB NewGame
LoadBytes("maps/map" + m + "-1.txt",map1)
LoadBytes("maps/map" + m + "-2.txt",map2)
LoadBytes("maps/map" + m + "-3.txt",map3)
InitDat
InitEny
InitBoy
END SUB
' Main
Window 768,708,1
' Load Bitmaps
s1 = LoadBmp("gfx/char.bmp", 60)
s2 = LoadBmp("gfx/atom.bmp", 16)
s3 = LoadBmp("gfx/boyd.bmp", 16)
s4 = LoadBmp("gfx/boyu.bmp", 16)
s5 = LoadBmp("gfx/boyr.bmp", 16)
s6 = LoadBmp("gfx/boyl.bmp", 16)
s7 = LoadBmp("gfx/exitani.bmp", 16)
s8 = LoadBmp("gfx/pillani.bmp", 16)
s9 = LoadBmp("gfx/bummani.bmp", 16)
sa = LoadBmp("gfx/starani.bmp", 16)
sb = LoadBmp("gfx/shrani.bmp", 16)
sc = LoadBmp("gfx/fire.bmp", 16)
' Assign Sound Files
w1= LoadSound "gfx/success.wav"
w2= LoadSound "gfx/caim.wav"
w3= LoadSound "gfx/drown.wav"
w4= LoadSound "gfx/hit.wav"
w5= LoadSound "gfx/grab.wav"
'loadmaps
m = 1
LoadBytes("maps/map" + m + "-1.txt",map1)
LoadBytes("maps/map" + m + "-2.txt",map2)
LoadBytes("maps/map" + m + "-3.txt",map3)
InitDat
InitEny
InitBoy
SetFps(140)
WHILE Key(27) = 0
SetCaption "PILLS: " + pills + " MAP " + m
IF GetKey() = 32 THEN NewGame()
IF GetKey() = 110 AND rBoy = 5 THEN
m += 1
IF m = 12 THEN m = 1
NewGame
END IF
ShowMaps
ExitActiv
BoyShrink
BoyBumm
ScanEnemy
ShowEnemy
CheckBoy
DrawBoy
PillsAni
NoPills
Starshrink
IF rBoy = 5 THEN
BmpText s1, 140, 340, "NEXT MAP PRESS N", 32, 64
END IF
IF rBoy = 6 THEN
BmpText s1, 140, 340, "YOU WERE NABBED", 32, 64
END IF
Redraw
WEND
Quit()