(08-08-2021, 02:10 PM)nitrofurano Wrote: assembly was just the starting point, and that seems okay for now
the problem is on the last example, using asm..endasm inside sub..endsub, so i guess it's now more difficult to have it back as asm only...
...
the code is a "mess", but it is working a bit better than it was - it had a bug related to ix register that seems to cause some interference with +3 loading bios routines (no idea why and what caused that)
and now, that code above is only working one time, not all the times i need it to work (like a slideshow, for example) - this is the bug i was talking about
about Bch, sad that the file was deleted (and mediafire is known as crappiest file host "service" around), and the video there were also removed, so i also wonder how easily can Bch be contacted
IX register is used as Base Pointer in ZX Basic, and you have to preserve it. Basically, do PUSH IX just after ASM, and finally POP IX just before END ASM:
Code:
sub specpls3loaddskfile(tfnmad1 as uinteger,tadr1 as uinteger,tlng1 as uinteger)
poke uinteger @sp3ldfb1v1b,tfnmad1
poke uinteger @sp3ldfb1v2b,tadr1
poke uinteger @sp3ldfb1v3b,tlng1
asm
push ix
ld bc,$0501
ld de,$0001
ld hl,(sp3ldfb1v1a)
call $0106 ;- dos_open
ld de,(sp3ldfb1v3a)
ld hl,(sp3ldfb1v2a)
ld bc,$0500
call $0112 ;- dos_read
ld b,$05
call $0109 ;- dos_close
call $019C ;- dd_l_off_motor
jp sp3ldfb1e
end asm
sp3ldfb1v1b:
asm
sp3ldfb1v1a:
defb 0,0
end asm
sp3ldfb1v2b:
asm
sp3ldfb1v2a:
defb 0,0
end asm
sp3ldfb1v3b:
asm
sp3ldfb1v3a:
defb 0,0
end asm
asm
sp3ldfb1e:
pop ix
end asm
end sub
Try this and tell me.
