mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
107 lines
2.7 KiB
Plaintext
107 lines
2.7 KiB
Plaintext
1 byte = 2 pixels
|
|
|
|
560x448@4bpp = 125 440 bytes
|
|
560x448@8bpp = 250 880 bytes
|
|
|
|
-> 262144 bytes (256 kB)
|
|
|
|
[USER AREA | HW AREA]
|
|
|
|
Number of pheripherals = 8, of which the computer itself is considered as
|
|
a peripheral.
|
|
|
|
HW AREA = [Peripherals | MMIO | INTVEC]
|
|
|
|
User area: 8 MB, hardware area: 8 MB
|
|
|
|
8192 kB
|
|
User Space
|
|
1024 kB
|
|
Peripheral #8
|
|
1024 kB
|
|
Peripheral #7
|
|
...
|
|
1024 kB
|
|
MMIO and Interrupt Vectors
|
|
128 kB
|
|
MMIO for Peri #8
|
|
128 kB
|
|
MMIO for Peri #7
|
|
...
|
|
128 kB
|
|
MMIO for the computer
|
|
130816 bytes
|
|
MMIO for Ports, etc.
|
|
256 bytes
|
|
Vectors for 64 interrupts
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
VRAM Bank 0 (256 kB)
|
|
|
|
Endianness: little
|
|
|
|
From the start of the memory space:
|
|
250880 bytes
|
|
Framebuffer
|
|
3 bytes
|
|
*reserved for future use*
|
|
1 byte
|
|
command (writing to this memory address changes the status)
|
|
1: reset palette to default
|
|
2: fill framebuffer with given colour (arg1)
|
|
2 bytes
|
|
argument for "command" (arg1: Byte, arg2: Byte)
|
|
write to this address FIRST and then write to "command" to execute the command
|
|
86 bytes
|
|
*Unused*
|
|
IF graphics_mode THEN
|
|
(41 sprites : 260 bytes each -> 10660 bytes)
|
|
0th sprite is always the GUI cursor
|
|
2 bytes
|
|
Ob hv0000xy yyyyyyyy (h: horizontal flip, v: vertical flip, x: show/hide, y: y-position)
|
|
2 bytes
|
|
0b rr0000xx xxxxxxxx (r: rotation, x: x-position)
|
|
256 bytes
|
|
16x16 texture for the sprite
|
|
ELSE
|
|
2978 bytes
|
|
*Unused*
|
|
2 bytes
|
|
Cursor position in: (y*32 + x)
|
|
2560 bytes
|
|
Text foreground colours
|
|
2560 bytes
|
|
Text background colours
|
|
2560 bytes
|
|
Text buffer of 70x32 (8x14 character size, and yes: actual character data is on the bottom)
|
|
FI
|
|
512 bytes
|
|
Palette stored in following pattern: 0b rrrr gggg, 0b bbbb aaaa, ....
|
|
Palette number 255 is always full transparent (bits being all zero)
|
|
|
|
MMIO
|
|
|
|
2 bytes RO
|
|
Framebuffer width in pixels
|
|
2 bytes RO
|
|
Framebuffer height in pixels
|
|
1 bytes RO
|
|
Text mode columns
|
|
1 bytes RO
|
|
Text mode rows
|
|
1 bytes RW
|
|
Text-mode attributes
|
|
0b kkkk 00rc (k: currently using character rom, r: TTY Raw mode, c: Cursor blink)
|
|
1 bytes RW
|
|
Graphics-mode attributes
|
|
0b 0000 000g (g: Use sprites(wipes out text buffer))
|
|
1 bytes RO
|
|
Last used colour (set by poking at the framebuffer)
|
|
1 bytes RW
|
|
current TTY foreground colour (useful for print() function)
|
|
1 bytes RW
|
|
current TTY background colour (useful for print() function)
|
|
|
|
Text-mode-font-ROM is immutable and does not belong to VRAM
|
|
Even in the text mode framebuffer is still being drawn onto the screen, and the texts are drawn on top of it |