-
Notifications
You must be signed in to change notification settings - Fork 0
/
u2plus-open-api-spec.yaml
2644 lines (2614 loc) · 86.2 KB
/
u2plus-open-api-spec.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: U2+ REST API
description: Starting from Ultimate firmware 3.11, the application supports
API calls by means of the HTTP protocol. <br>This simplifies the
integration of remote control functionality in external
applications, as it follows a well defined standard.
version: 0.1.0
servers:
- url: http://{host}/{basePath}
description: U2+ REST API
variables:
host:
default: 192.168.64.176
description: Enter the host name or IP-address of your Ultimate device.
basePath:
default: v1
paths:
/version:
get:
operationId: getVersion
summary: About
description: Returns the current version of the REST API.
tags:
- About
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
example:
value: |-
{
"version": "0.1",
"errors": [ ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
type: object
properties:
version:
type: string
'404':
description: Not Found
'504':
description: Gateway Timeout
/machine:reset:
put:
operationId: resetMachine
summary: Reset machine
description: Reset to the machine. The current configuration is not changed.
tags:
- Machine operations
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
/machine:reboot:
put:
operationId: rebootMachine
summary: Reboot machine
description: Restart the machine. Re-initializes the cartridge configuration and sends a reset to the machine.
tags:
- Machine operations
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
/machine:pause:
put:
operationId: pauseMachine
summary: Pause machine
description: |-
Pausing machine by pulling the DMA line low at a safe moment. This stops the CPU. Note that this does not
stop any timers.
tags:
- Machine operations
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
/machine:resume:
put:
operationId: resumeMachine
summary: Resume machine
description: Resumes the machine from the paused state, releasing the DMA line to continue CPU execution.
tags:
- Machine operations
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
content:
application/json: { }
/machine:poweroff:
put:
operationId: powerOffMachine
summary: Power off machine
description: |-
This U64-only command causes the machine to power off. Note that it is likely that you won’t receive a
valid response.
tags:
- Machine operations
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
/machine:readmem:
get:
operationId: readMemory
summary: Read data from memory
description: |
This command performs a DMA read action on the cartridge bus and returns the result as a binary attachment.
* The address argument specifies the memory location in hexadecimal format.
* The optional argument length specifies the number of bytes being read.
* When the length is not specified, 256 bytes are returned.
* The length specified should not exceed memory address location $FFFF
tags:
- Machine operations
parameters:
- in: query
description: |
Memory address to read data from.
name: address
required: true
schema:
type: string
example: "1000"
- in: query
description: |
Length of the data to read.
name: length
required: false
schema:
type: integer
default: 256
minimum: 0
example: 128
responses:
'200':
description: Successful operation.
content:
application/octet-stream: {}
'400':
description: Bad request
content:
application/json:
examples:
"Invalid address":
value: |-
{
"errors": [ "Invalid address" ]
}
"Invalid length":
value: |-
{
"errors": [ "Invalid length" ]
}
"Exceeds memory location $FFFF":
value: |-
{
"errors" : [ "Memory read exceeds location $FFFF" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
/machine:writemem:
put:
operationId: writeDataToMemoryPut
summary: Write data to memory
description: |-
With this command, data can be written to C64 memory. To be more exact: this command writes data through DMA,
so the memory map that is currently selected is used. Writing to the I/O registers of the 6510 is not
possible.
Data bytes are written in consecutive memory locations. The address argument specifies the memory location in
hexadecimal format. The data argument contains a string of bytes in hexadecimal format. The maximum number of
bytes written with this method is 128.
Example: "PUT /v1/machine:writemem?address=D020&data=0'504'" the values result in 05 being written to $D020 and
04 being written to $D021. In other words: the border will be green and the main screen will turn purple.
tags:
- Machine operations
parameters:
- in: query
description: |
Memory address to write data.
name: address
required: true
schema:
type: string
example: "D020"
- in: query
description: |-
Data to be written to the memory address. A maximum of 128 bytes can be written.
name: data
required: true
schema:
type: string
example: "1024"
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
"data written to $D020":
value: |-
{
"address": "D020-D021",
"errors": [ ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'400':
description: Bad request
content:
application/json:
examples:
"invalid address":
value: |-
{
"errors": [ "Invalid address" ]
}
"exceeded data length":
value: |-
{
"errors" : [ "Maximum length of 128 bytes exceeded. Consider using POST method with attachment." ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
post:
operationId: writeManyDataToMemoryPost
summary: Write data to memory
description: |-
With this command, data can be written to C64 memory. The data, passed as a binary attachment, will be written
to memory starting from the location indicated by the address argument, which shall be formatted in hexadecimal.
The data should not wrap around $FFFF.
tags:
- Machine operations
parameters:
- in: query
description: |
Memory address to write data.
name: address
required: true
schema:
type: string
example: "1000"
requestBody:
content:
application/octet-stream:
schema: {}
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
"data written to address $1000":
value: |-
{
"address": "1000-18f9",
"errors": [ ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'400':
description: Bad request
content:
application/json:
examples:
"invalid address":
value: |-
{
"errors": [ "Invalid address" ]
}
"exceeded data length":
value: |-
{
"errors" : [ "Maximum length of 128 bytes exceeded. Consider using POST method with attachment." ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
/machine:debugreg:
get:
operationId: readDebugRegister
summary: Read debug register
description: |
This command reads the debug register ($D7FF) and returns it in the “value” field of the JSON response.
The value is in hexadecimal format. This is currently an U64-only call.
tags:
- Machine operations
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
"Invalid address":
value: |-
{
"value": "00",
"errors": []
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
put:
operationId: writeDebugRegister
summary: Write to debug register
description: |
This command writes the value specified by the value argument (in hexadecimal) into the debug register ($D7FF),
and then reads the debug register ($D7FF) and returns it in the “value” field of the JSON response.
This is currently an U64-only call.
tags:
- Machine operations
parameters:
- in: query
description: |
Write hexadecimal value into debug register
name: value
required: true
schema:
type: string
example: "3F"
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
"Invalid address":
value: |-
{
"value": "3F",
"errors": []
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
/runners:sidplay:
put:
operationId: putSidPlay
summary: Play SID file located on device
description: |
This command requests the Ultimate to play a SID file. The file argument points to an existing file in the file
system of the Ultimate. It plays the default song, unless the optional songnr argument is given. The player will
attempt to open the song lengths file in the subdirectory ‘SONGLENGTHS’.
tags:
- Runners
parameters:
- in: query
description: |
Location of the SID file on the device
name: file
required: true
schema:
type: string
example: /Temp/Music/Sams_Journey.sid
- in: query
description: |
Song number
name: songnr
required: false
schema:
type: string
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
OK:
value: |-
{
"errors": [ ]
}
"Invalid parameter name":
value: |-
{
"errors" : [ "Function sidplay does not have parameter invalidParameterName", "Function sidplay requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
post:
operationId: postSidPlay
summary: Send and play SID file
description: |
This command requests the Ultimate to play a SID file. The file argument points to an existing file in the file
system of the Ultimate. It plays the default song, unless the optional songnr argument is given. The player will
attempt to open the song lengths file in the subdirectory ‘SONGLENGTHS’.
tags:
- Runners
parameters:
- in: query
description: |
Song number
name: songnr
required: false
schema:
type: string
requestBody:
content:
application/octet-stream:
schema: {}
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
OK:
value: |-
{
"errors": [ ]
}
"Invalid parameter name":
value: |-
{
"errors" : [ "Function sidplay does not have parameter invalidParameterName", "Function sidplay requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
/runners:modplay:
put:
operationId: putModPlay
summary: Play an Amiga MOD file from Ultimate's storage
description: |
This command requests the Ultimate to play an Amiga MOD file. The file argument points to an existing file in
the file system of the Ultimate.
tags:
- Runners
parameters:
- in: query
description: |
Location and name of the AMIGA mod file on your Ultimate device's storage
name: file
required: true
schema:
type: string
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
OK:
value: |-
{
"errors": [ ]
}
"Invalid parameter name":
value: |-
{
"errors" : [ "Function modplay does not have parameter invalidParameterName", "Function modplay requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
post:
operationId: postModplay
summary: Send and play Amiga MOD file
description: |
This command requests the Ultimate to play the Amiga MOD file that is attached as a file to the request.
tags:
- Runners
requestBody:
content:
application/octet-stream:
schema: {}
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
OK:
value: |-
{
"errors": [ ]
}
"Invalid parameter name":
value: |-
{
"errors" : [ "Function modplay does not have parameter invalidParameterName", "Function modplay
requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
/runners:load_prg:
put:
operationId: putLoadPrg
summary: Load a programme file from the local file system
description: |
With this command a progam can be loaded into memory. The file argument points to an existing file in the file
system of the Ultimate. The machine resets, and loads the designated program into memory using DMA. Then it
automatically runs the program.
tags:
- Runners
parameters:
- in: query
description: |
Location and name of the programme file on your Ultimate device's storage
name: file
required: true
schema:
type: string
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
OK:
value: |-
{
"errors": [ ]
}
"Invalid parameter name":
value: |-
{
"errors" : [ "Function loadprg does not have parameter invalidParameterName", "Function loadprg requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
post:
operationId: postRunPrg
summary: Send and run a programme file
description: |
With this command a progam can be loaded into memory. The machine resets, and loads the attached program into
memory using DMA. Then it automatically runs the program.
tags:
- Runners
requestBody:
content:
application/octet-stream:
schema: {}
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
OK:
value: |-
{
"errors": [ ]
}
"Invalid parameter name":
value: |-
{
"errors" : [ "Function loadprg does not have parameter invalidParameterName", "Function loadprg
requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
/runners:run_prg:
put:
operationId: putRunPrg
summary: Load a programme file from the U2+'s file system
description: |
With this command a program can be loaded into memory. The file argument points to an existing
file in the file system of the Ultimate. The machine resets, and loads the designated program
into memory using DMA. Then it automatically runs the program.
tags:
- Runners
parameters:
- in: query
description: |
Location and name of the programme file on your Ultimate device's storage
name: file
required: true
schema:
type: string
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
"Invalid parameter name":
value: |-
{
"errors" : [ "Function run_prg does not have parameter invalidParameterName", "Function run_prg
requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
post:
operationId: postLoadPrg
summary: Send and load a programme file
description: |
With this command a program can be loaded into memory. The machine resets, and loads the attached program into
memory using DMA. It does not automatically run the program.
tags:
- Runners
requestBody:
content:
application/octet-stream:
schema: { }
responses:
'200':
description: Successful operation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Errors'
examples:
OK:
value: |-
{
"errors": [ ]
}
"Invalid parameter name":
value: |-
{
"errors" : [ "Function run_prg does not have parameter invalidParameterName", "Function run_prg requires parameter file" ]
}
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]x
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
/runners:run_crt:
put:
operationId: putRunCrt
summary: Load and run cartridge image file from the U2+'s file system
description: |
With this command a program can be loaded into memory. The file argument points to an existing file in the file
system of the Ultimate. The machine resets, and loads the designated program into memory using DMA. It does not
automatically run the program.
tags:
- Runners
parameters:
- in: query
description: |
Location and name of the cartridge image file on your Ultimate device's storage
name: file
required: true
schema:
type: string
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
"Invalid parameter name":
value: |-
{
"errors" : [ "Function loadprg does not have parameter invalidParameterName" ]
}
"Requires parameter file":
value: |-
{
"errors" : [ "Function run_crt requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
post:
operationId: postRunCrt
summary: Send, load and run cartridge image
description: |
This command starts a supplied cartridge file. The ‘crt’ file is attached to the POST request. The machine
resets, with the attached cartridge active. It does not alter the configuration of the Ultimate.
tags:
- Runners
requestBody:
content:
application/octet-stream:
schema: { }
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
OK:
value: |-
{
"errors": [ ]
}
"Invalid parameter name":
value: |-
{
"errors" : [ "Function run_crt does not have parameter invalidParameterName", "Function run_crt
requires parameter file" ]
}
schema:
allOf:
- $ref: '#/components/schemas/Errors'
'404':
description: Not Found
'500':
description: Internal server error
content:
application/json:
examples:
Undefined subsystem command:
value: |-
{
"errors" : [ "Undefined subsystem command" ]
}
'507':
description: Unknown
content:
application/json:
examples:
Out of memory:
value: |-
{
"errors": [ "Out of memory" ]
}
/drives:
get:
operationId: getDrivesConfig
summary: Load the drives configuration
description: |
With this command, the information about all the (internal) drives on the IEC bus is returned.
In addition to the presence, it also shows the image files and paths of the mounted disks or
referenced paths. An example follows:
tags:
- Floppy drives
responses:
'200':
description: Successful operation.
content:
application/json:
examples:
OK:
value: |-
{
"drives": [
{
"a": {
"enabled": true,
"bus_id": 8,
"type": "1581",
"rom": "1581.rom",
"image_file": "",
"image_path": ""
}
},
{
"b": {
"enabled": false,
"bus_id": 9,
"type": "1541",
"rom": "1541.rom",
"image_file": "",
"image_path": ""
}
},
{
"IEC Drive": {
"bus_id": 11,
"enabled": false,
"type": "DOS emulation",
"last_error": "73,U64IEC ULTIMATE DOS V1.1,00,00",
"partitions": [
{