Changes

Jump to: navigation, search

Caruh

2,833 bytes added, 14:44, 1 November 2023
/* III.2. Memory allocation of the Caruh application in the central RAM */
* &BE03 (TTNS3): Temporary buffer for a Task number memory at &BE03. Stores the number of a task (2-255) for subroutines
=== The Task Table ===
The Task Table starts mathematically at &4000 in the main memory.
An entry in the Task Table is 16 bytes long.
Accordingly, it extends from &4000 to &4FFF in the central RAM (&7FC0).
 
However, the first element of the task table with number '0' has a special assignment:
Since there is no task with the number &00, the bytes &4000-&400F are available for the task variables (see above under 'Task variables').
 
The first real element therefore starts at &4010 for the first task (#1).
 
'''Each element consists of 16 bytes: '''
* 0: Task number (= number of the task managed by this entry)
* 1: Priority: How many 1/300 seconds are waited until the task will be called again. The value 0 is interpreted as 256. The smaller the value, the higher the task priority.
* 2: Reload value for the Priority byte, used as soon as the Priority byte has reached the value &00 (see previous byte 1)
* 3-4: These 16 bits contain the E-RAM select in which the task is located (16 bit, physical I/O address: &7FC4-&78FF, covers 4 MB)
* 5-15: The name of the Task, it corresponds to the file name (11 letters)
 
The data for Task #2 follows at address &4020, on &4030 for task #3, to &4040 for task #4 and so on ...
 
'''The VRAM / multi-screen table'''
 
As long as Caruh is active as a Foreground Task, other tasks can only use parts of the general screen. That's the screen that appears after starting Caruh with its menu system.
 
As long as the 'General Screen' is used, the following is possible:
 
* Each Task can reserve parts of the VRAM / general screen or itself.
* Each Task may write, draw or output data in any way on parts of the general screen (previously) reserved for it.
- No chaotic, overlapping windows are used!
 
This way it's possible for all Tasks to output data on the main screen.
This is the multi-screen mode.
 
The VRAM or multi-screen table is used to divide the screen (80 characters on 25 lines). This table comprises 2000 bytes (= 80 * 25).
 
The Table is located in the main memory from &7800 to &7FCF.
The bytes from &7FD0 to &7FFF are therefore NOT part of the Task Table.
 
Each byte of the VRAM (multi-screen) table corresponds to one character on the screen.
 
The VRAM Table begins with the first character in the top line on the far left.
That's followed by 'character by character' on the first line (left to right).
This is followed by 'line by line' from 'top to bottom'.
 
'''What's the meaning of the bytes in the VRAM table?'''
 
A zero byte in the VRAM Table defines an available/free screen position and is therefore available for Tasks.
 
If a byte in the Table is occupied by a value (1-255), then the corresponding position on the screen is already occupied by a Task.
 
Caruh occupies the top four lines and the bottom line of the screen for his own menu system and the lower Task Bar.
1,988
edits