# Core commands

## How to use

To send json requests, use the tool sendSocket.exe. Example with getStatus request

```
/home/roudoudou/code/assemblia/sendSocket.exe 127.0.0.1 6128 "{ \"cmd\": \"getStatus\" }"
```

#### `getStatus`

Returns all Z80 registers as a flat object. Used to populate the Variables panel.

**Request:**
```json
{ "cmd": "getStatus" }
```

**Response:**
```json
 {
	"running":true,
	"nopCount":30886019,
	"z80": {
		"registers": {
			"AF":66 ,"BC":0 ,"DE":0 ,"HL":46728 ,"AF'":68 ,"BC'":32649 ,"DE'":46655 ,"HL'":47295, "PC":56 ,"SP":49118, "IX":65535 ,"IY":0, "I":0 ,"R":249,"WZ":56
		},
		"states": {
	"IM":1 ,"cycleCount":20 , "nmiIssued":false 
		}
	},
	"crtc": {
			"type":3,
		"registers": {
"regSelect":13,"R0":63, "R1":40, "R2":46, "R3":142, "R4":38, "R5":0, "R6":25, "R7":30, "R8":0, "R9":7, "R10":0, "R11":0, "R12":48, "R13":0,"R14":0,"R15":0
		},
		"states": {
 "C0":3, "C4":30, "C9":2, "C5":0, "C3H":0, "C3V":2, "hSync":false, "vSync":true
		}
	},
	"gateArray": {
 "version":2, "penSelect":15, "ink0":4, "ink1":10, "ink2":19, "ink3":12, "ink4":11, "ink5":20, "ink6":21, "ink7":13, "ink8":6, "ink9":30, "ink10":31, "ink11":7, "ink12":18, "ink13":25, "ink14":10, "ink15":7, "ink16":4, "currentMode":1, "requestedMode":1,"blanking":true, "vSync":true,"hSync":false, "intLineCount":0, "intPending":0
, "romUpperNum":0, "RMR":136	},
	"asic": {
		"registers": {
"pri":0, "split":0, "ssaR12":0, "ssaR13":0, "sscrX":0, "sscrY":0, "sscrMask":false, "ivr":24, "dedicatedAck":true, "sar0":0, "sar1":0, "sar2":0, "ppr0":0, "ppr1":0, "ppr2":0, "dcsr":128, "RMR2":160 
		},
		"backgroundPalette": {
 "ink0":6, "ink1":4080, "ink2":3855, "ink3":240, "ink4":4095, "ink5":0, "ink6":15, "ink7":255, "ink8":1542, "ink9":1632, "ink10":1647, "ink11":1782, "ink12":3840, "ink13":3942, "ink14":4080, "ink15":1782, "ink16":6		},
		"spritePalette": {
 "ink1":1539, "ink2":3788, "ink3":3791, "ink4":595, "ink5":2114, "ink6":464, "ink7":4071, "ink8":1642, "ink9":2984, "ink10":2711, "ink11":1368, "ink12":4029, "ink13":2846, "ink14":3890, "ink15":1325		},
		"states": {
 "rasterIntPending":false, "shadowInt":false, "dmaCurrent":3, "dmaGlobalPhase":0, "dmaInstruction0":0, "dmaInstruction1":0, "dmaInstruction2":0,"dmaPhase0":64, "dmaPhase1":64, "dmaPhase":64, "dmaLoop0":0, "dmaLoop1":0, "dmaLoop2":0, "dmaRepeat0":0, "dmaRepeat1":0, "dmaRepeat2":0, "dmaPause0":0, "dmaPause1":0, "dmaPause2":0, "dmaWait0":0, "dmaWait1":0, "dmaWait2":0, "dmaBusRequest":false, "currentLine":242, "currentPixel":32, "currentChar":2, "delockValid":false 
		},
		"sprites": {
			"sprite0": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 9,6,7,9,13,7,3,2,12,12,0,11,10,0,0,11,0,6,13,4,12,7,14,3,13,8,0,5,12,0,11,6,0,6,0,15,13,3,4,5,7,0,7,1,2,3,4,0,13,10,4,10,0,14,10,9,7,0,8,9,8,14,10,8,7,6,15,0,6,10,4,9,0,0,0,4,8,9,3,12,7,8,11,7,6,4,8,9,11,7,5,6,6,3,9,2,10,9,3,6,10,7,2,0,9,14,11,0,11,9,10,8,13,9,10,13,3,6,3,6,3,1,15,3,6,0,12,7,12,13,6,15,0,3,4,8,1,9,0,12,14,13,9,8,8,3,8,11,11,2,12,10,12,2,5,6,4,5,0,9,11,13,6,12,11,4,0,12,5,8,5,4,13,9,11,7,7,11,0,0,0,10,3,14,10,11,11,8,13,4,8,1,4,0,12,4,6,15,9,7,3,6,5,11,3,13,3,2,2,0,5,0,8,9,14,8,5,7,12,0,10,3,0,12,0,8,4,7,9,0,7,12,7,11,10,11,12,9,10,1,3,0,1,6,0,5,0,7,5,0,0,7,10,11,12,0 ]
		},
			"sprite1": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 9,13,13,12,15,6,6,11,2,13,3,7,11,6,6,9,9,2,0,9,6,0,0,7,5,13,11,12,9,1,14,4,9,5,11,13,12,0,9,7,0,0,12,11,8,9,0,0,9,8,3,13,5,4,11,3,0,12,6,8,10,8,5,10,0,11,10,9,10,0,12,4,14,0,14,5,14,5,10,9,4,3,3,14,4,6,4,4,3,9,14,12,4,2,4,0,7,10,6,0,10,0,7,4,7,10,4,1,0,10,5,4,3,14,9,11,5,7,0,9,0,0,0,3,11,6,14,4,11,0,0,1,7,9,10,0,9,8,5,12,12,3,4,0,8,12,15,4,12,12,4,8,0,9,0,5,15,8,3,5,0,10,2,6,4,10,4,9,10,13,11,8,0,12,0,6,7,0,6,9,14,9,12,12,8,3,3,0,0,11,1,0,5,6,7,0,8,11,11,1,4,9,4,0,12,5,0,13,11,7,5,12,5,12,4,8,5,6,0,12,4,0,13,12,0,15,0,7,8,10,4,15,11,5,0,10,11,10,8,1,0,1,0,6,3,12,10,4,4,1,3,13,12,7,1,0 ]
		},
			"sprite2": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 0,4,0,14,2,11,4,4,15,0,5,1,7,13,12,0,2,0,8,12,9,9,14,13,7,0,0,6,0,4,3,9,12,0,10,0,9,12,14,4,14,6,9,5,3,11,0,0,4,3,1,9,4,6,1,7,7,0,0,0,3,9,3,5,0,9,0,4,13,4,11,1,0,6,12,3,6,9,0,4,9,5,3,14,7,3,2,4,0,6,7,0,0,15,10,0,5,14,4,0,0,13,0,11,4,14,0,13,9,0,3,9,11,5,7,14,13,15,1,0,14,5,0,2,2,1,6,0,10,8,0,7,5,12,3,1,1,3,0,0,10,9,3,12,2,0,13,0,3,12,1,11,11,10,7,0,1,9,3,8,12,12,8,12,0,6,13,9,4,8,5,4,1,2,6,2,10,12,0,0,8,7,12,0,11,2,0,11,13,13,12,10,4,11,6,9,4,3,4,7,0,4,4,4,0,8,7,11,0,0,7,9,13,0,9,9,2,10,0,12,6,5,14,15,11,9,0,1,8,4,12,12,0,9,11,11,13,5,4,14,8,9,0,7,0,12,0,0,0,8,0,0,3,0,11,0 ]
		},
			"sprite3": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 5,15,10,0,5,11,3,7,7,2,5,0,11,7,0,0,5,0,6,10,0,3,9,14,2,0,4,7,5,13,8,10,13,13,0,5,7,6,11,4,8,11,9,4,0,5,0,9,0,5,4,0,7,15,14,3,12,6,1,7,10,0,0,12,8,0,11,11,8,4,0,11,13,6,12,2,9,7,5,11,3,12,15,5,8,12,9,7,0,3,13,8,1,6,6,4,0,12,0,9,0,6,5,0,13,4,0,4,0,13,0,0,9,3,0,9,6,11,0,0,0,12,5,9,0,9,0,7,12,12,10,2,6,0,10,11,11,0,12,4,7,0,0,5,7,0,8,10,1,10,3,8,0,0,11,11,12,9,11,12,0,8,3,7,1,3,14,2,13,12,13,12,13,8,5,10,6,0,10,0,0,3,7,13,11,0,9,1,5,14,0,4,0,3,1,5,12,4,0,9,3,8,6,3,10,8,0,9,6,9,5,2,10,10,11,10,0,0,5,9,9,0,4,7,9,9,2,4,5,11,4,7,0,2,11,8,3,1,2,9,0,8,4,8,14,1,12,15,3,5,4,9,8,3,10,7 ]
		},
			"sprite4": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 0,1,3,0,0,8,0,0,12,6,7,9,0,11,9,6,10,4,9,0,14,11,0,4,5,0,0,3,9,10,9,1,0,0,0,4,9,0,0,12,7,8,9,10,0,10,12,11,9,4,13,12,11,3,7,2,11,9,12,13,11,2,7,2,11,10,5,2,8,0,8,13,7,11,9,0,3,15,7,13,15,0,6,10,10,14,4,10,5,0,4,10,4,4,14,0,0,3,6,1,12,5,0,0,12,9,4,10,0,7,3,9,14,7,0,7,0,6,0,6,0,0,7,0,6,7,7,0,4,12,7,9,3,11,14,5,5,1,0,8,0,5,8,11,0,4,13,0,1,11,0,12,8,13,7,7,9,15,8,0,4,2,10,5,5,13,4,4,0,12,11,0,4,13,9,6,8,2,1,0,10,2,10,1,12,6,5,0,7,5,12,5,10,7,6,10,9,7,10,4,13,1,6,0,3,9,7,12,13,0,0,11,14,13,2,2,0,6,10,10,2,5,6,0,8,14,1,0,0,13,6,4,6,3,8,6,8,11,1,8,4,6,3,10,11,7,11,13,0,8,4,8,2,0,4,7 ]
		},
			"sprite5": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 1,4,8,14,9,7,9,7,7,1,6,8,4,5,3,8,11,1,13,10,9,13,8,0,12,10,3,0,14,3,3,9,10,9,0,3,7,1,13,13,8,11,9,2,5,12,7,0,8,0,13,9,11,2,0,1,9,3,0,0,2,3,6,2,12,12,12,0,3,3,6,0,8,6,15,0,3,0,11,0,11,9,2,6,0,0,5,5,3,6,5,9,0,10,0,6,8,11,11,8,0,3,7,3,6,2,2,12,6,0,2,6,12,12,6,8,2,11,7,12,13,0,0,2,4,3,0,7,4,9,0,2,0,4,5,10,9,1,13,6,12,11,7,11,0,9,10,6,1,3,1,12,2,7,8,5,10,9,10,3,11,11,14,0,7,13,8,7,10,12,0,0,9,13,0,0,0,3,5,0,12,10,9,6,7,13,11,0,6,10,0,2,0,0,0,7,0,11,10,2,12,8,14,0,11,12,12,2,10,4,7,15,1,8,14,13,12,1,3,0,1,2,0,14,12,11,3,4,4,3,8,12,11,0,5,2,0,11,11,15,0,2,4,13,5,13,7,3,10,9,8,14,1,8,4,15 ]
		},
			"sprite6": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 4,13,12,0,0,3,11,2,0,13,10,0,6,0,6,7,5,3,2,5,8,0,1,0,0,11,13,13,14,2,0,3,0,11,0,8,9,1,0,2,3,2,0,7,0,6,6,13,0,11,9,0,0,4,10,4,7,0,12,10,1,1,12,0,6,0,3,8,8,5,6,3,7,13,12,3,14,11,5,8,14,1,0,6,10,2,12,6,0,11,1,0,8,9,14,3,0,12,3,15,2,5,9,9,4,9,8,12,12,5,11,6,0,0,9,7,0,0,10,7,0,12,4,0,6,13,3,0,8,10,0,7,0,0,2,0,0,0,11,7,7,5,11,1,10,12,3,0,14,1,0,6,3,10,6,0,10,0,15,0,3,7,1,0,0,4,5,7,4,6,11,0,0,3,2,9,0,2,15,9,4,0,11,5,0,0,7,5,2,9,12,0,6,4,9,7,11,12,4,11,4,0,15,5,0,8,5,10,0,6,11,11,8,3,0,0,14,2,12,0,10,9,4,0,5,5,4,14,0,9,4,5,0,0,6,9,11,8,13,13,14,7,8,0,10,8,6,5,12,3,9,11,5,11,12,9 ]
		},
			"sprite7": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 11,0,12,0,8,9,11,12,8,1,2,9,5,10,12,0,9,2,0,0,0,14,15,9,12,11,13,10,11,6,15,7,5,13,0,5,11,12,0,0,3,0,3,9,2,8,9,8,12,10,7,12,5,11,5,2,0,0,0,6,9,5,5,8,11,0,8,7,11,2,5,14,0,12,7,8,8,10,1,0,11,6,1,4,10,3,4,10,0,9,12,12,1,1,0,7,6,5,5,0,7,3,8,5,3,4,3,10,9,0,3,11,13,9,0,0,1,11,4,5,7,14,14,2,6,8,14,11,6,12,2,3,8,3,2,7,6,7,11,0,2,0,15,14,3,3,14,0,11,5,15,10,0,10,2,1,6,7,0,13,2,11,10,9,0,5,14,6,8,12,2,2,6,0,4,0,1,10,12,3,8,0,0,7,0,11,8,0,13,10,0,12,6,4,4,3,7,6,0,8,5,4,3,0,6,11,5,0,5,5,5,5,3,11,13,7,9,2,6,5,12,10,12,3,3,8,7,8,1,0,13,8,6,11,0,11,5,6,4,5,5,3,6,6,7,14,0,11,2,2,14,6,4,11,9,4 ]
		},
			"sprite8": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 5,0,12,3,0,6,10,6,14,4,12,3,13,0,0,7,2,3,0,0,11,5,0,4,10,12,9,15,0,0,6,12,1,9,5,9,7,11,13,8,0,0,8,3,0,13,0,6,7,10,0,6,6,7,9,10,4,8,0,8,2,11,6,10,8,0,12,7,12,9,13,0,6,4,7,7,11,5,11,5,8,15,1,10,3,11,10,9,11,8,7,4,9,9,9,11,5,13,0,15,0,10,9,0,13,11,0,9,10,4,0,12,9,4,3,3,0,6,14,3,2,0,0,2,12,6,10,11,0,4,7,12,0,3,10,10,8,6,7,7,6,4,3,8,4,12,12,3,9,10,4,7,4,4,10,0,12,4,6,10,0,8,0,12,9,0,0,10,9,0,0,11,8,7,0,0,6,14,7,5,5,0,1,12,0,9,0,6,8,0,0,13,12,0,6,10,12,5,13,4,0,6,6,0,9,10,2,2,6,9,11,14,5,0,5,5,5,13,7,12,0,0,4,7,9,14,6,4,0,1,12,0,4,12,0,4,5,7,10,8,2,0,6,10,13,7,4,14,9,12,11,10,6,0,3,8 ]
		},
			"sprite9": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 3,4,0,10,0,13,13,3,11,6,4,9,9,14,7,9,2,11,3,6,14,0,4,5,5,12,4,6,3,12,14,12,10,10,4,5,13,0,13,3,7,2,7,11,0,13,1,2,4,0,5,10,0,6,8,6,12,14,5,8,0,8,0,2,0,0,13,6,9,15,9,4,0,0,10,13,0,3,7,4,10,10,3,10,3,5,0,7,10,8,5,6,0,7,2,14,5,10,3,11,0,6,8,5,12,0,6,5,1,15,12,9,9,12,11,7,11,1,2,13,8,2,6,6,12,1,1,12,2,11,7,3,7,12,0,11,11,10,0,0,4,11,1,4,8,8,9,5,7,14,0,1,0,12,14,0,3,12,5,14,7,4,8,4,0,9,3,11,9,7,11,14,8,6,13,2,0,9,2,10,6,4,0,0,9,7,6,7,14,4,9,0,0,5,0,7,0,3,13,12,2,3,8,11,11,6,7,0,6,13,3,0,3,9,0,11,0,0,8,7,0,11,6,4,3,7,5,0,3,13,5,10,10,3,9,12,6,6,6,0,11,6,4,12,4,9,4,3,3,3,0,11,11,11,15,4 ]
		},
			"sprite10": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 7,0,3,3,10,0,6,0,13,8,11,12,9,2,10,2,0,5,5,11,14,3,6,0,0,4,1,9,2,5,2,5,0,11,8,8,9,15,4,2,13,6,0,11,11,4,11,8,14,5,0,0,10,9,0,5,13,14,14,6,0,0,10,10,1,3,14,0,3,7,0,2,10,15,0,9,3,12,5,13,13,12,3,4,13,0,0,10,6,9,0,7,12,7,2,8,7,0,7,8,5,0,0,5,9,4,3,0,2,0,0,12,4,3,4,0,8,6,0,3,12,5,6,0,5,5,0,14,14,0,5,0,0,11,2,0,13,3,0,0,10,10,9,0,0,0,0,5,7,9,3,13,0,3,8,7,0,13,0,7,13,6,9,0,0,15,5,2,12,11,2,10,11,4,7,3,9,8,8,5,5,13,5,5,15,10,6,5,0,3,8,1,3,6,8,9,7,14,9,0,3,11,4,13,0,4,6,14,2,6,7,10,5,11,14,13,9,9,0,7,6,0,1,8,6,4,0,11,13,14,3,12,8,14,3,0,0,12,0,15,8,4,8,2,10,0,0,0,12,7,4,0,9,14,5,5 ]
		},
			"sprite11": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 3,7,0,0,0,12,4,13,0,2,2,3,1,10,0,10,14,0,2,10,3,6,13,11,0,9,6,1,0,5,4,6,4,0,6,0,7,7,4,6,11,7,11,13,0,14,5,8,12,7,9,3,3,11,7,13,4,3,3,13,5,10,4,10,0,3,11,0,7,12,0,1,5,5,11,0,5,0,0,9,13,11,8,14,13,3,8,3,0,8,3,0,8,4,10,11,0,3,10,0,0,4,3,7,9,0,10,10,1,0,3,10,7,7,2,11,2,12,11,12,6,7,0,10,8,3,8,5,14,6,7,8,5,1,11,13,10,9,9,3,2,0,8,4,6,8,0,8,8,0,13,13,5,9,0,7,8,4,5,9,6,10,6,2,3,10,4,9,4,3,3,15,9,10,11,11,13,13,15,9,9,5,0,0,9,14,0,7,0,10,12,2,15,0,6,0,0,4,11,6,7,0,1,2,0,7,5,11,0,0,5,10,14,4,4,0,1,9,14,13,11,0,0,2,5,10,12,5,10,7,10,13,12,3,5,11,9,0,6,14,12,15,4,6,0,12,7,8,3,12,0,11,5,8,6,0 ]
		},
			"sprite12": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 2,0,5,4,8,0,0,5,8,0,12,5,13,7,7,10,11,3,2,6,0,13,0,8,7,2,12,11,12,0,0,4,7,13,2,8,12,5,15,8,13,12,13,5,1,4,0,0,0,5,3,6,9,1,12,0,15,5,12,9,2,3,5,0,4,13,5,9,2,9,12,11,11,6,4,12,1,0,10,2,3,5,6,9,0,13,4,6,0,10,4,14,9,2,13,6,11,0,0,0,2,13,10,9,4,0,13,2,0,0,4,2,3,3,0,8,4,9,9,8,9,10,11,0,9,12,12,13,3,10,10,7,8,0,6,0,8,9,10,4,0,0,0,0,4,8,10,4,6,3,0,0,3,12,7,3,5,6,4,10,0,13,8,1,3,12,3,11,12,3,0,1,12,11,4,11,0,8,10,7,6,8,4,3,3,10,0,11,12,0,0,9,9,10,3,8,11,11,7,6,8,1,0,7,6,0,11,13,1,14,0,5,9,2,0,2,0,1,4,0,8,7,0,0,0,14,6,0,10,11,0,5,4,0,7,6,8,10,5,0,9,5,4,10,9,10,2,9,10,6,0,8,15,5,0,9 ]
		},
			"sprite13": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 4,3,7,14,2,0,11,1,8,14,6,8,8,14,5,6,10,4,9,4,0,6,1,9,6,8,0,10,2,8,0,1,11,14,0,6,12,0,15,13,6,7,11,1,13,5,15,10,7,5,13,10,15,10,5,5,2,3,4,14,5,0,1,2,5,1,6,4,10,7,11,3,14,14,2,6,3,3,11,0,3,11,4,1,0,6,7,12,3,12,10,0,4,6,11,4,3,11,14,13,11,15,0,0,10,10,7,6,4,0,5,1,6,4,3,7,7,5,3,0,12,5,11,6,9,2,0,11,11,11,7,12,9,12,0,0,10,2,2,7,4,3,5,10,6,13,12,0,2,8,12,1,1,10,0,8,0,8,13,7,12,0,3,5,0,12,10,4,9,7,4,0,0,7,0,4,4,9,11,0,0,9,0,8,0,5,9,7,2,7,2,4,3,5,3,10,7,12,8,2,15,0,3,2,11,0,8,11,10,0,6,0,5,10,7,12,13,0,5,10,0,0,3,13,11,9,10,6,6,4,1,9,12,0,14,5,5,11,3,8,8,3,12,11,14,4,0,0,5,2,13,4,0,0,0,5 ]
		},
			"sprite14": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 9,3,6,11,12,7,0,0,9,0,0,0,11,5,0,10,7,4,10,5,2,9,8,14,4,0,7,8,10,1,11,5,11,7,0,3,12,11,10,13,8,4,4,5,0,11,9,5,0,1,0,4,4,8,12,4,4,10,13,6,0,13,6,7,3,9,0,4,4,14,1,12,0,1,12,10,0,12,0,2,0,12,0,10,0,8,15,0,0,10,0,11,3,11,0,0,13,1,6,5,11,0,8,11,6,10,2,10,4,3,7,3,5,4,10,5,13,1,10,6,6,10,10,5,0,2,12,0,0,0,0,3,3,11,6,2,1,7,12,13,5,6,13,7,10,9,4,0,6,9,11,15,0,15,7,8,0,5,8,14,10,5,12,10,3,5,0,0,13,12,14,8,11,0,1,14,7,2,12,9,0,0,0,5,2,6,14,0,0,0,0,2,6,0,3,5,8,10,7,13,5,0,8,0,7,14,3,3,11,14,0,12,10,10,10,3,0,10,6,2,0,7,7,0,2,10,0,0,0,0,5,0,9,2,10,0,11,1,7,14,2,0,0,0,0,13,9,0,9,4,15,5,2,0,13,6 ]
		},
			"sprite15": {
 "magX":0, "magY":0, "posX":0, "posY":0,
"bitmap": [ 8,4,12,9,14,5,7,12,13,8,11,10,7,10,0,7,14,4,10,10,8,1,10,6,8,8,0,8,2,0,9,13,11,5,3,0,6,1,5,0,8,8,0,4,5,8,0,12,10,0,3,4,8,0,3,0,11,10,9,0,3,0,2,2,0,2,8,1,0,0,1,2,8,7,14,2,6,12,3,14,4,9,11,4,0,4,7,2,6,3,10,9,13,14,8,4,12,0,12,13,11,4,11,8,7,8,4,1,12,2,14,4,8,9,15,6,7,0,4,9,6,14,11,0,6,14,11,2,12,10,5,9,9,6,3,11,4,7,0,10,11,11,0,13,12,12,10,5,0,8,13,0,5,5,0,0,8,8,13,7,4,0,8,5,0,15,9,1,8,4,6,7,5,13,12,0,8,0,8,12,8,8,11,0,8,0,0,4,0,7,6,0,10,6,9,0,5,9,10,10,2,8,9,9,0,9,13,14,0,2,14,2,3,10,5,3,2,15,11,10,13,8,5,11,0,4,4,4,3,4,6,3,9,11,0,5,0,11,9,0,3,13,0,0,7,0,3,10,11,9,14,11,0,7,12,11 ]
		}
		}
	},
	"fdc": {
"status":128,"motor":0,		"internal": {
"R0":0,"R1":0,"R2":0,"R3":214,"R4":135,"R5":239,"R6":247,"track drive 0":0,"track drive 1":0,"track drive 2":0,"track drive 3":0		}
	},
	"ay": {
		"registers": {
"regSelect":14,"R0":0, "R1":0, "R2":0, "R3":0, "R4":0, "R5":0, "R6":0, "R7":63, "R8":0, "R9":0, "R10":0, "R11":0, "R12":0, "R13":0,"R14":0,"R15":0
	},
	"ppi": {
 "printerPortData":127, "printerPortStrobe":true, "ppiControl":130, "ppiPortA":14, "ppiPortB":0, "ppiPortC":0, "keyboardLine":0, "ppiCurrentAccess":0 
	}
}
}

```

Note : "asic" block with all registers, status, sprites info and content is outputed when using CRTC-3 machine and only CRTC-3.

Keys are case-insensitive (the extension lowercases them internally).


#### `getEmulatorSettings`

Returns all settings available for the emulator

**Request:**
```json
{ "cmd": "getEmulatorSettings" }
```

**Response:**
```json
{
 "status":"ok",
 "settings":[
 {"HspHighlight":1},
 {"IntHighlight":0},
 {"RealTimeGrid":1},
 {"DebugGrid":1},
 {"PlasticCover":1}
 ]
}

```
Obviously there will be more settings available than this documentation

---

#### `setEmulatorSettings`

Returns all settings available for the emulator

**Request:**
```json
{ "cmd":"setEmulatorSetting","setting":"RealTimeGrid", "value":1 }
```

**Response:**
```json
{
 "status":"ok",
}

```
Obviously there will be more settings available than this documentation

---

#### `readRegisters`

Returns all Z80 registers as a flat object. Used to populate the Variables panel.

**Request:**
```json
{ "cmd": "readRegisters" }
```

**Response:**
```json
{
  "AF": 4660, "BC": 1, "DE": 2, "HL": 3,
  "AF'": 0, "BC'": 0, "DE'": 0, "HL'": 0,
  "PC": 49152, "SP": 65408,
  "IX": 0, "IY": 0, "I": 0, "R": 0
}
```

---

#### `setRegisters`

Writes one or more register values.

**Request:**
```json
{ "cmd": "setRegisters", "hl": 16384, "pc": 49152 }
```

Register names are lowercase. Any subset of registers may be included. Supported registers are a,af,bc,de,hl,a',af',bc',de',hl',ix,iy,pc,sp,i,r.

**Response:**
```json
{ "status": "ok" }
```

---


#### `sendIO`

Send a byte value in the IO port address

**Request:**
```json
{ "cmd": "sendIO", "address": 16384, "value": 49 }
```

**Response:**
```json
{ "status": "ok" }
```

---



#### `readMemory`

Reads a contiguous block of memory.

**Request:**
```json
{
  "cmd": "readMemory",
  "address": 16384,
  "size": 256,
  "memType": "ram",
  "bank": -1
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `address` | number | — | Start address (0–65535) |
| `size` | number | — | Number of bytes to read |
| `memType` | string | `"read"` | Memory source: `"mapped"`,`"ram"`, `"rom"`, `"cart"` |
| `bank` | number | `-1` | Bank index (−1 = currently mapped bank) |

**Response:**
```json
{ "bytes": [0, 1, 2, 3, ...] }
```

`bytes` is an array of unsigned integers (0–255), length = `size`.

---

#### `writeMemory`

Writes a contiguous block of memory.

**Request:**
```json
{
  "cmd": "writeMemory",
  "address": 16384,
  "bytes": [0, 1, 2, 3]
  "memType": "ram",
  "bank": -1
}
```
- when writing to ram, you can use absolute address and more than 64K of data

- optional memType must be ram or rom (default:ram)

- bank must be set if memType is rom (-1:lower 0-255:upper)


**Response:**
```json
{ "status": "ok" }
```

---
 
#### `clearBreakpoints`

**Request:**
```json
{
  "cmd": "clearBreakpoints"
}
```

Reset all defined breakpoints and specialised breakpoints.

**Response:**
```json
{ "status": "ok" }
```

---


#### `listBreakpoints`

**Request:**
```json
{
  "cmd": "listBreakpoints"
}
```

List all exec,memory and IO breakpoints

**Response:**
```json
{
"breakpoints": [
"id|type|address|addressMask|value|valueMask|size|accessMode|count|runMode|condition",
"256|exec|#0000||||||0|stopper|",
"512|memory|#0000|#FFFF|#00|#00|1|RW|0|stopper|",
"513|memory|#0000|#FFFF|#00|#00|1|W|0|stopper|",
"514|memory|#0000|#FFFF|#00|#00|1|R|0|stopper|",
"1024|IO|#0000|#FFFF|#00|#00|1|RW|0|stopper|"
]
}
```

---

#### `removeBreakpoint`

**Request:**
```json
{
  "cmd": "removeBreakpoint", "id":513
}
```
Remove the breakpoint with his ``id`` and list again all active breakpoints (because id may change)

**Response:**
```json
{ "status": "ok" , "information" : "after removing a breakpoint, all breakpoints ID may change!",
"breakpoints": [
"id|type|address|addressMask|value|valueMask|size|accessMode|count|runMode|condition",
"256|exec|#0000||||||0|stopper|",
"512|memory|#0000|#FFFF|#00|#00|1|RW|0|stopper|",
"513|memory|#0000|#FFFF|#00|#00|1|R|0|stopper|",
"1024|IO|#0000|#FFFF|#00|#00|1|RW|0|stopper|"
]
}

```

---
#### `setSpecialisedBreakpoints`


**Request:**
```json
{
  "cmd": "setSpecialisedBreakpoints",
  "breakpoints": [
    { "FDC": "calibration" },
    { "Winape": 1 },
    { "Maxam": 1 },
    { "badVBL": 1 },
    { "int": 1 }
  ]
}
```

FDC breaks available are version, specify, sensedrive, calibration,seek,senseint,getid,readdata,readdiag,write,format,scandata,status,timeout,resultread,motorchange and weak
Other breakpoints available are Winape, Maxam, VBL, BadVBL, badHBL, INT (set to 1)

**Response:**
```json
{ "status": "ok" }
```

---

#### `setBreakpoint`

Add a full ACE breakpoint. Existing breakpoints wont be removed.

Execution breakpoint will break **before** the opcode and stop at the address.
**Request:**
```json
{
  "cmd": "setBreakpoint",
  "breakpointType": "exec",
  "runMode": "stopper",
  "address": 12345,
  "condition": "IX = 0x100"
}
```

Memory breakpoint will break **after** any opcode had triggered the target. Note : You might stop elsewhere in the code after a jump/return if you want to trace the code with memory breakpoint.
**Request:**
```json
{
  "cmd": "setBreakpoint",
  "breakpointType": "memory",
  "runMode": "watcher",
  "accessMode" : "RW",
  "value": 123,
  "valueMask": 255,
  "address": 12345,
  "addressMask": 65535,
  "size": 123,
  "condition": "IX = 0x100"
}
```

**Request:**
```json
{
  "cmd": "setBreakpoint",
  "breakpointType": "IO",
  "runMode": "stopper",
  "accessMode" : "W",
  "value": 123,
  "valueMask": 255,
  "address": 12345,
  "addressMask": 65535,
  "condition": "IX = 0x100"
}
```

ACE breakpoints definition :
- breakpointType : exec, memory, IO

- runMode : watcher, stopper

- accessMode : R, W, RW

- condition : see ``@docs/breakpointCondition.html``

- for mask and value, defaults will apply if not provided

watcher does not break but update internal counter

**Response:**
```json
{ "status": "ok" }
```

---



#### `continue`

Resume CPU execution.

**Request:** `{ "cmd": "continue" }`

**Response:** `{ "status": "ok" }`

The emulator sends a `stopped` event when execution halts again (breakpoint, error, etc.).

**Note:** `continue` is also called by the extension on `disconnectRequest` before closing the TCP connection, to leave the emulator running after the debug session ends.

---

#### `halt`

Pause CPU execution immediately.

**Request:** `{ "cmd": "halt" }`

**Response:** `{ "status": "ok" }`

---


#### `step` or `stepOver`

Execute one instruction (Step Over). Handles `CALL`, `RST`, and block instructions without stepping into them.

**Request:** `{ "cmd": "step" }`

**Response:** `{ "status": "ok" }`

---

#### `stepIn`

Execute one instruction (Step Into). Enters `CALL` and `RST`.

**Request:** `{ "cmd": "stepIn" }`

**Response:** `{ "status": "ok" }`

---

#### `stepOut`

Run until the current subroutine returns. Typically implemented by placing a temporary breakpoint on the return address read from the stack.

**Request:** `{ "cmd": "stepOut" }`

**Response:** `{ "status": "ok" }`

---

#### `reset` or `resetHard`

Reset the CPU and machine to their initial state.

**Request:** `{ "cmd": "reset" }`

**Response:** `{ "status": "ok" }`

---

#### `resetSoft`

Soft reset the CPU, not memory and some hardware

**Request:** `{ "cmd": "reset" }`

**Response:** `{ "status": "ok" }`

---

#### `loadFile`

**Request:**
```json
{
  "cmd": "loadFile",
  "filename": "path to the file"
}
```

**Response (success):**
```json
{ "status": "ok" }
```

---


#### `getMemBanks`

Returns the list of addressable memory sources, only ROM (as memory can be seen as a pure linear array)

**Request:** `{ "cmd": "getMemBanks" }`

**Response:**
```json
{
  "sources": [
    { "type": "rom",   "bank": -1, "label": "Lower ROM"    },
    { "type": "rom",   "bank":  0, "label": "Rom" },
    { "type": "cart",  "bank":  0, "label": "Cartridge" },
    { "type": "cart",  "bank":  0, "label": "dandanator Cartridge" }
  ]
}
```


---

#### `getScreen`

Returns a single snapshot of the currently displayed CPC screen, cropped to the visible window and de-interlaced (i.e. what a real monitor would show).

**Request:** `{ "cmd": "getScreen" }`

**Response:**
```json
{
  "format": "png",
  "width": 768,
  "height": 544,
  "data": "<base64-encoded PNG bytes>"
}
```

width or height may change depending on CRTC used!

---


### Unknown commands

Return `{ "error": "unknown command" }` for any unrecognised `cmd`. The extension checks for `result?.error` and handles it without throwing.

### Concurrency

The extension sends one command at a time. The emulator does not need to handle concurrent requests. However, events (`stopped`, `mediaChanged`) may arrive while a command response is being written — this is safe because the extension dispatches events independently from the command queue.
