?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1.   LUA ALLPASS
  2.     assert("NONE" == sj.get_device())
  3.     assert("NONE" == sj.get_device(1))    -- extra argument doesn't matter with LuaBridge2.6
  4.  
  5.    sj.set_device("ZXSPECTRUM48")         -- zx48, default ramtop
  6.    assert("ZXSPECTRUM48" == sj.get_device())
  7.  
  8.    sj.set_device("ZXSPECTRUM128",0xFEDC) -- zx128, specific ramtop
  9.    assert("ZXSPECTRUM128" == sj.get_device())
  10.  
  11.    sj.set_device("ZXSPECTRUM128",0xEDCB) -- warning about different ramtop value
  12.  
  13.    sj.set_device("NONE")
  14.    assert("NONE" == sj.get_device())
  15.  ENDLUA
  16.  
  17.  DEVICE ZXSPECTRUM48
  18.  ORG 0x1234 : DB 48
  19.  DEVICE ZXSPECTRUM128, 0xEDCB
  20.  ORG 0x1234 : DB 128
  21.  
  22.  LUA PASS3
  23.    sj.set_device("ZXSPECTRUM48")
  24.    assert(48 == sj.get_byte(0x1234))
  25.    assert("ZXSPECTRUM48" == sj.get_device())
  26.  
  27.    assert(false == sj.set_device("invalid"))
  28.    assert("NONE" == sj.get_device())   -- invalid id does cause switch to NONE
  29.  
  30.    sj.set_device("ZXSPECTRUM128",0xFEDC)
  31.    assert(128 == sj.get_byte(0x1234))
  32.  
  33.    assert(true == sj.set_device()) -- default id is "NONE"
  34.    assert("NONE" == sj.get_device())
  35.  ENDLUA
  36.