83Plus:Software:usb8x/Asm Interface/MSD/MSD ImportVariable

From WikiTI
Jump to: navigation, search

Synopsis

Name: MSD_ImportVariable

Minimum usb8x version: 0.10

Imports *.8x* file from specified directory and stores in RAM/Flash.

Inputs

  • HL points to an ASCIIZ string of *.8x* file (path included)
  • B is flags byte
Bit 0 Set if existing variable should be deleted if duplicate is found
Bit 1 Set if variable should be created in Flash; reset if in RAM

Outputs

  • Variable is created in RAM or Flash
  • C set if problems
  • Returns C set if duplicate variable was found

Destroys

  • AF, BC, DE, HL

Notes

Example code to import "game.8xp" in the root directory to RAM:

ld hl,sFilename
ld b,0 ;do not overwrite existing variable and create in RAM
U_CALL MSD_ImportVariable
...
sFilename: DB "/game.8xp",0

If you are writing an application, you must copy the strings you use to RAM first, or else usb8x will not be able to see them.

See Also

  • [[../MSD_ExportVariable|MSD_ExportVariable]] - Export variable in RAM/Flash to specified directory as *.8x* file