?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. ; only changes with V1.3 are tested here, the basic test is savenexSyntax.asm
  2.  
  3.     DEVICE ZXSPECTRUMNEXT
  4.  
  5. ;; OPEN <filename>[,<startAddress>[,<stackAddress>[,<entryBank 0..111>[,<fileVersion 2..3>]]]]
  6.     ; errors - [un]expected arguments
  7.     SAVENEX OPEN "savenexSyntaxV_1_3.nex", $8000, $FFE0,15,  2,
  8.     SAVENEX OPEN "savenexSyntaxV_1_3.nex", $8000, $FFE0,15,  2, 2
  9.     SAVENEX OPEN "savenexSyntaxV_1_3.nex", $7170, $F1F0, 0,  1 ; error fileVersion
  10.     SAVENEX OPEN "savenexSyntaxV_1_3.nex", $7170, $F1F0, 0,  4 ; error fileVersion
  11.  
  12.     ; one correct NEX file to verify simple case (but induce all sorts of warnings)
  13.     SAVENEX OPEN "savenexSyntaxV_1_3.nex", $18180, $1F1F0, 'B', 2   ; force V1.2 version
  14.  
  15.     ; error = NEX file is already open
  16.     SAVENEX     OPEN    "savenexSyntaxV_1_3.nex", $8180, $F1F0, 'B', 3
  17.  
  18.     ; few correct commands which didn't change with V1.3 support
  19.     SAVENEX     CORE    3,0,6
  20.     SAVENEX     CFG     5,  0,  1,  1
  21.  
  22. ;; CFG3 <DoCRC 0/1>[,<PreserveExpansionBus 0/1>[,<CLIbufferAdr>,<CLIbufferSize>]]
  23.     ; error because V1.2 file is enforced
  24.     SAVENEX     CFG3    0,  1,  $DF00, 2048
  25.  
  26. ;; BAR <loadBar 0/1>,<barColour 0..255>[,<startDelay 0..255>[,<bankDelay 0..255>[,<posY 0..255>]]]
  27.     ; errors - [un]expected arguments
  28.     SAVENEX     BAR     1,  'L',    'D',    'd', 0,
  29.     SAVENEX     BAR     1,  'L',    'D',    'd', 0, 0
  30.  
  31.     ; correct ones with value warnings, and omitting optional arguments
  32.     SAVENEX     BAR     1,  255, 255, 255, 256
  33.     SAVENEX     BAR     1,  'L',    'D',    'd', 123 ; one fully valid (no warning)
  34.  
  35. ;; PALETTE NONE
  36. ;; PALETTE DEFAULT
  37. ;; PALETTE MEM <palPage8kNum 0..223>,<palOffset>
  38. ;; PALETTE BMP <filename>
  39.     ; errors - [un]expected arguments
  40.     SAVENEX     PALETTE ETTELAP
  41.     SAVENEX     PALETTE MEM
  42.     SAVENEX     PALETTE MEM 100
  43.     SAVENEX     PALETTE MEM 100,
  44.     SAVENEX     PALETTE MEM 100, 0,
  45.     SAVENEX     PALETTE MEM 100, 0, 0
  46.     SAVENEX     PALETTE BMP
  47.     SAVENEX     PALETTE BMP "pal.bmp",
  48.  
  49.     ; errors - wrong values
  50.     SAVENEX     PALETTE MEM -1, 0
  51.     SAVENEX     PALETTE MEM 224, 0
  52.     SAVENEX     PALETTE MEM 10, -1
  53.     SAVENEX     PALETTE MEM 0, 1792*1024-511
  54.     SAVENEX     PALETTE BMP ""
  55.     SAVENEX     PALETTE BMP "pal.bmp"
  56.     SAVENEX     PALETTE BMP "savenexSyntaxV_1_3.asm"
  57.  
  58.     ; one correct (setting up DEFAULT palette type)
  59.     SAVENEX     PALETTE DEFAULT
  60.  
  61.     ; verify that any one-more reports error
  62.     SAVENEX     PALETTE NONE
  63.     SAVENEX     PALETTE DEFAULT
  64.     SAVENEX     PALETTE MEM 10, 0
  65.     SAVENEX     PALETTE BMP "pal.bmp"
  66.  
  67. ;; SCREEN L2_320 [<Page8kNum 0..223>,<offset>[,<palPage8kNum 0..223>,<palOffset>]]
  68. ;; SCREEN L2_640 [<Page8kNum 0..223>,<offset>[,<palPage8kNum 0..223>,<palOffset>]]
  69. ;; SCREEN TILE <NextReg $6B>,<NextReg $6C>,<NextReg $6E>,<NextReg $6F>[,<AlsoStoreBank5 0/1 = 1>]
  70.     ; errors - because V1.2 is enforced
  71.     SAVENEX     SCREEN  L2_320
  72.     SAVENEX     SCREEN  L2_640
  73.     SAVENEX     SCREEN  TILE 0, 1, 2, 3, 0
  74.  
  75.     ; errors - [un]expected arguments - possible to test for TILE screen (ahead V1.2 check)
  76.     SAVENEX     SCREEN  TILE
  77.     SAVENEX     SCREEN  TILE    0
  78.     SAVENEX     SCREEN  TILE    0,
  79.     SAVENEX     SCREEN  TILE    0,  1
  80.     SAVENEX     SCREEN  TILE    0,  1,
  81.     SAVENEX     SCREEN  TILE    0,  1,  2
  82.     SAVENEX     SCREEN  TILE    0,  1,  2,
  83.     SAVENEX     SCREEN  TILE    0,  1,  2,  3,
  84.     SAVENEX     SCREEN  TILE    0,  1,  2,  3, 0,
  85.  
  86.     ; errors - wrong values
  87.     SAVENEX     SCREEN  TILE    0,  1,  2,  3, -1
  88.     SAVENEX     SCREEN  TILE    0,  1,  2,  3, 2
  89.     SAVENEX     SCREEN  TILE    256,  1,  2,  3, 0
  90.     SAVENEX     SCREEN  TILE    0,  256,  2,  3, 0
  91.     SAVENEX     SCREEN  TILE    0,  1,  256,  3, 0
  92.     SAVENEX     SCREEN  TILE    0,  1,  2,  256, 0
  93.     SAVENEX     SCREEN  TILE    -1,  1,  2,  3, 0
  94.     SAVENEX     SCREEN  TILE    0,  -1,  2,  3, 0
  95.     SAVENEX     SCREEN  TILE    0,  1,  -1,  3, 0
  96.     SAVENEX     SCREEN  TILE    0,  1,  2,  -1, 0
  97.  
  98. ;; SCREEN BMP <filename>[,<savePalette 0/1>[,<paletteOffset 0..15>]]
  99.     ; errors - [un]expected arguments
  100.     SAVENEX     SCREEN  BMP
  101.     SAVENEX     SCREEN  BMP     ""
  102.     SAVENEX     SCREEN  BMP     "",
  103.     SAVENEX     SCREEN  BMP     "",     1,
  104.     SAVENEX     SCREEN  BMP     "",     1,  0,
  105.  
  106.     ; errors - wrong values
  107.     SAVENEX     SCREEN  BMP     "",     2
  108.     SAVENEX     SCREEN  BMP     "",     0,  -2  ; -1 is internal value for "missing" palOfs => legal
  109.     SAVENEX     SCREEN  BMP     "",     0,  16
  110.  
  111.     ; not testing correct variants, because it would make impossible to test other types
  112.  
  113. ;; COPPER <Page8kNum 0..223>,<offset>
  114.     ; errors - because V1.2 is enforced
  115.     SAVENEX     COPPER 0, 0
  116.  
  117.     SAVENEX     CLOSE       ; warning about palette defined, but no screen
  118.  
  119. ;; further syntax tests, this time with V1.3 enabled in OPEN
  120.  
  121. ;; OPEN <filename>[,<startAddress>[,<stackAddress>[,<entryBank 0..111>[,<fileVersion 2..3>]]]]
  122.     ; one correct NEX file to verify simple case
  123.     SAVENEX OPEN "savenexSyntaxV_1_3.nex"   ; start with V1.2, enable V1.3
  124.  
  125. ;; CFG3 <DoCRC 0/1>[,<PreserveExpansionBus 0/1>[,<CLIbufferAdr>,<CLIbufferSize>]]
  126.     ; errors - [un]expected arguments
  127.     SAVENEX     CFG3
  128.     SAVENEX     CFG3    0,
  129.     SAVENEX     CFG3    0,  1,
  130.     SAVENEX     CFG3    0,  1,  $DF00
  131.     SAVENEX     CFG3    0,  1,  $DF00,
  132.     SAVENEX     CFG3    0,  1,  $DF00, 2048,
  133.  
  134.     ; correct ones with value warnings, and omitting optional arguments
  135.     SAVENEX     CFG3    2
  136.     SAVENEX     CFG3    1,  2
  137.     SAVENEX     CFG3    1,  0,  $3FFF, 1
  138.     SAVENEX     CFG3    1,  0,  $FFFF, 2
  139.     SAVENEX     CFG3    1,  0,  $FF00, 0
  140.     SAVENEX     CFG3    1,  0,  $E000, 2049
  141.     SAVENEX     CFG3    1,  1,  0,  0    ; one completely correct (no warning) (+CRC)
  142.  
  143. ;; SCREEN L2_320 [<Page8kNum 0..223>,<offset>[,<palPage8kNum 0..223>,<palOffset>]]
  144. ;; SCREEN L2_640 [<Page8kNum 0..223>,<offset>[,<palPage8kNum 0..223>,<palOffset>]]
  145.     ; errors - [un]expected arguments - possible to test for TILE screen (ahead V1.2 check)
  146.     SAVENEX     SCREEN  L2_320  0
  147.     SAVENEX     SCREEN  L2_320  0,
  148.     SAVENEX     SCREEN  L2_320  0,  0,
  149.     SAVENEX     SCREEN  L2_320  0,  0,  0
  150.     SAVENEX     SCREEN  L2_320  0,  0,  0,
  151.     SAVENEX     SCREEN  L2_320  0,  0,  0,  0,
  152.  
  153.     SAVENEX     SCREEN  L2_640  0
  154.     SAVENEX     SCREEN  L2_640  0,
  155.     SAVENEX     SCREEN  L2_640  0,  0,
  156.     SAVENEX     SCREEN  L2_640  0,  0,  0
  157.     SAVENEX     SCREEN  L2_640  0,  0,  0,
  158.     SAVENEX     SCREEN  L2_640  0,  0,  0,  0,
  159.  
  160.     ; errors - wrong values
  161.     SAVENEX     SCREEN  L2_320  224,    0,      0,      0
  162.     SAVENEX     SCREEN  L2_320    0,    0,    224,      0
  163.     SAVENEX     SCREEN  L2_320    0, 1792*1024 - 80*1024 + 1,  0,  0
  164.     SAVENEX     SCREEN  L2_320    0,    0,  0,  1792*1024 - 512 + 1
  165.     SAVENEX     SCREEN  L2_320  223,    0
  166.     SAVENEX     SCREEN  L2_320    0, 1792*1024 - 80*1024 + 1
  167.  
  168.     SAVENEX     SCREEN  L2_640  224,    0,      0,      0
  169.     SAVENEX     SCREEN  L2_640    0,    0,    224,      0
  170.     SAVENEX     SCREEN  L2_640    0, 1792*1024 - 80*1024 + 1,  0,  0
  171.     SAVENEX     SCREEN  L2_640    0,    0,  0,  1792*1024 - 512 + 1
  172.     SAVENEX     SCREEN  L2_640  223,    0
  173.     SAVENEX     SCREEN  L2_640    0, 1792*1024 - 80*1024 + 1
  174.  
  175. ;; COPPER <Page8kNum 0..223>,<offset>
  176.     ; errors - [un]expected arguments
  177.     SAVENEX     COPPER
  178.     SAVENEX     COPPER 0
  179.     SAVENEX     COPPER 0,
  180.     SAVENEX     COPPER 0, 0,
  181.  
  182.     ; errors - wrong values
  183.     SAVENEX     COPPER 224, 0
  184.     SAVENEX     COPPER 0, 1792*1024 - 2048 + 1
  185.  
  186.     ; valid copper commands
  187.     SAVENEX     COPPER 0, 0
  188.     SAVENEX     COPPER 0, 0     ; can be used multiple times, it will simple overwrite old code (silently)
  189.  
  190. ;; SCREEN TILE <NextReg $6B>,<NextReg $6C>,<NextReg $6E>,<NextReg $6F>[,<AlsoStoreBank5 0/1 = 1>]
  191.     ; testing single correct variant (will block all other screens and palette)
  192.     SAVENEX     SCREEN  TILE    0, 1, 2, 3, 1      ; will also store Bank 5
  193.  
  194.     SAVENEX     PALETTE DEFAULT     ; fails because after screen
  195.  
  196.     SAVENEX     COPPER 0, 0         ; fails because bank is already saved
  197.  
  198.     ;; sjasmplus should calculate also CRC-32C value here
  199.     SAVENEX     CLOSE
  200.  
  201.  
  202. ;; create small NEX for BIN comparison, if the thing at least somewhat works
  203. ;; also verify it works twice per source (in sequential order)
  204.     SAVENEX OPEN "savenexSyntaxV_1_3.bin", $5000, $FE00, 0, 3
  205.     SAVENEX CORE 3,0,6 : SAVENEX CFG 4,0,0,0
  206.     SAVENEX CFG3 1,0,$E000,1234 : SAVENEX BAR 1,100,99,13,222
  207.     ORG $4800 : DB $45, $5F, $F5, $44
  208.     ORG $5000
  209.     nextreg $69,0               ; hide Layer 2, ULA screen
  210.     jr $                        ; infinite JR loop
  211.     MMU 7, 18
  212.     org $E000 : DS $2000, %000'111'00   ; green top 32px strip
  213.     SAVENEX PALETTE DEFAULT
  214.     SAVENEX SCREEN L2_320
  215.     SAVENEX AUTO 5, 5                       ; should store bank5
  216.     ; let it close automatically by ending source
  217.  
  218.     END $7170       ; invoke warning about different start address
  219.