Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
loading files from +3 dsk
#1
recently i was trying this
https://worldofspectrum.org/forums/discu...n-assembly
is there some more efficient way, that works?
all my examples there were totally made on ZX-Basic Compiler - i'm now stuck in the last one, i only can load one file when it was supposed to load more...
Reply
#2
(08-07-2021, 09:39 PM)nitrofurano Wrote: recently i was trying this
https://worldofspectrum.org/forums/discu...n-assembly
is there some more efficient way, that works?
all my examples there were totally made on ZX-Basic Compiler - i'm now stuck in the last one, i only can load one file when it was supposed to load more...

I see you're using just plain assembler. You should remove the
asm
  ... 
end asm
lines and assemble directly with zxbasm (bundled with the compiler) to discard it's not a bug in the assembler code. Once this works, we can debug the rest. Remember ZX Basic adds a little header when compiler. You can use also
--headerless
so no ASM prologe will be added, to discard some interaction.

Someone did a +3 Filebrowser in the past, but it's no longer online Sad
https://www.boriel.com/forum/showthread....34#pid3334

Perhaps you can contact him so we can rescue the listing?
Reply
#3
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...

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
    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:
    end asm
  end sub


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
Reply
#4
(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. Smile
Reply
#5
thanks, it works fine now, as mentioned at https://worldofspectrum.org/forums/discu...ent_979780https://drive.google.com/file/d/1vcvLSF9...sp=sharing ) - now i found a "bug" when trying to simulate a "multi-floppy game" (asking to swap the floppy and verify if the swapped floppy is correct) : https://drive.google.com/file/d/1K73rbaH...sp=sharing - the "goal" from this is, at most, there might be some dual-sided +3 games, but not truly multiple-disk games (just like those for Amiga and msx2)
Reply
#6
What would be good is to allow the above to be called in ZX Basic via new commands?
And all access to the 128K Ramdisk within ZX Basic
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)