Update memoryMap.md
This commit is contained in:
		
							
								
								
									
										41
									
								
								memoryMap.md
									
									
									
									
									
								
							
							
						
						
									
										41
									
								
								memoryMap.md
									
									
									
									
									
								
							| @@ -1,36 +1,45 @@ | |||||||
| ## Boot ROM | ## Boot ROM | ||||||
| Execution starts here, at address `$0000`. | Execution starts here, at address `$0000`.<br> | ||||||
| The OS bootloader is located here. | The main program is located here, or the OS bootloader if an OS is present. | ||||||
|  |  | ||||||
| ## GPIO | ## GPIO | ||||||
| Contains hardware multiplication (`$0400`-`$0401`) and division (`$0402`-`$0403`), popcount (`$0404`), and a timer (`$0405`). | Contains hardware multiplication (`$0400 * $0401 -> $0400`) and division (`$0402 / $0403 -> $0402 r $0403`), popcount (`$0404 -> $0404`), and a timer (`$0405`).<br> | ||||||
|  | Value written to timer register = number of game ticks (32 ms) between interrupt triggers.<br> | ||||||
|  | Write 0 to disable. | ||||||
|  |  | ||||||
| ## Keyboard | ## Keyboard | ||||||
| Read address `$0500` to get the next key event (7-bit Windows VKey code, MSB on indicates press/release). Returns 0 if empty. | Read address `$0500` to get the next key event<br> | ||||||
| Write 1 to `$0500` to enable interrupts. | 7-bit Windows VKey code, MSB 1 = press, 0 = release<br> | ||||||
|  | Returns 0 if buffer is empty. | ||||||
|  | Write 1 to `$0500` to enable keyboard interrupts, 0 to disable. | ||||||
|  |  | ||||||
| ## Serial Peripheral Interface | ## Serial Peripheral Interface | ||||||
| Not yet implemented. | Not yet implemented. | ||||||
|  |  | ||||||
| ## Robot Controller | ## Robot Controller | ||||||
| Not directly mentioned in the provided code snippets, but if it follows a similar addressing scheme, it would have a specific range not covered here. | Write to `$0701` to control the robot. Each bit is an action - MSB to LSB: Plant brick, destroy brick, move forward, backward, left, right, up, down.<br> | ||||||
|  | Write a 6-bit color ID to `$0700` to set the color of the bricks the robot plants.<br> | ||||||
|  | Read `$0700` to get the color of the brick the robot is on. MSB = brick exists. Returns 0 if no brick. | ||||||
|  |  | ||||||
|  |  | ||||||
| ## Text Display | ## Text Display | ||||||
| Write ASCII values to addresses `$0800` to `$0FFF` to display characters at certain positions on the screen. | Write ASCII values to `$0800` to `$0BFF` to display characters at certain positions on screen.<br> | ||||||
| `$0800` is the top left, `$0FFF` would be the bottom right, considering the character display dimensions and memory layout. | `$0800` is top left, `$0BFF` is bottom right, rows are 64 bytes. | ||||||
|  |  | ||||||
| ## Text Display Color | ## Text Display Color | ||||||
| Write 6-bit color IDs to addresses `$0800` to `$0FFF` to set the color of characters on screen. | Write 6-bit color IDs to `$0C00` to `$0FFF` to set the color of characters on screen.<br> | ||||||
| MSB = whether to invert character mask (i.e., for highlighting). This might need clarification or correction based on the actual implementation, as it seems to overlap with the Text Display's address range. | MSB = whether to invert character mask (i.e. for highlighting). | ||||||
|  |  | ||||||
| ## System RAM | ## System RAM | ||||||
| The OS may use this memory for the stack, system variables, etc., located at `$1000` to `$1FFF`. | The OS may use this memory for the stack, system variables, etc.<br> | ||||||
|  | If no OS is present, this memory can be used for any purpose, etc.<br> | ||||||
|  | Located at `$1000` to `$1FFF`. | ||||||
|  |  | ||||||
| ## User ROM | ## User ROM | ||||||
| Your program and data go here, located at `$2000` to `$2FFF`. | User program and data can go here.<br> | ||||||
|  | If no OS is present, the boot ROM will need to jump into this code.<br> | ||||||
|  | Located at `$2000` to `$2FFF`. | ||||||
|  |  | ||||||
| ## User RAM | ## User RAM | ||||||
| Your code can use this memory for variables, arrays, a heap, etc., located at `$3000` to `$3FFF`. | Your code can use this memory for variables, arrays, a heap, etc.<br> | ||||||
|  | Located at `$3000` to `$3FFF`. | ||||||
| ## Video Display |  | ||||||
| Not directly mentioned in the provided snippets for addressing, but based on the peripheral configuration, it would be addressed from `$8000` to `$FFFF` for direct pixel manipulation or other video-related functions. |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user