You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the type of some unsigned parameters of system calls with signed
int and treat they as int32_t internally in the emulator. Change the
name of the parameter "screen" of the "draw_frame" system call to "base"
for the sake of consistency with the "setup_queue" system call.
Copy file name to clipboardExpand all lines: docs/syscall.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -103,17 +103,17 @@ These system calls are solely for the convenience of accessing the [SDL library]
103
103
104
104
**system call number**: `0xBEEF`
105
105
106
-
**synopsis**: `void draw_frame(void *screen, int width, int height)`
106
+
**synopsis**: `void draw_frame(void *base, int width, int height)`
107
107
108
-
If a window does not already exist, one will be created with the specified `width` and `height`. The `screen` buffer will replace the content of the framebuffer, passing a different `width` or `height` compared to the size of the window is undefined behavior. This system call additionally polls events from the SDL library, and, if necessary, update the internal input specific event queue.
108
+
If a window does not already exist, one will be created with the specified `width` and `height`. The buffer pointed to by `base` will replace the content of the framebuffer, passing a different `width` or `height` compared to the size of the window is undefined behavior. This system call additionally polls events from the SDL library, and, if necessary, update the internal input specific event queue.
109
109
110
110
The width and height are merely the virutal dimensions of the screen; they are unrelated to the window's real size. The system call would deal with resizing events internally when they occurred.
**synopsis**: `void *setup_queue(void *base, int capacity, unsigned int *event_count)`
116
+
**synopsis**: `void setup_queue(void *base, size_t capacity, int *event_count)`
117
117
118
118
The user must pass a continuous memory chunk that contains two tightly packed queues, the event queue and the submission queue. And the submission queue is immediately following the last element of the event queue, which is the event queue's base address plus the size of each event element multiplied by the given capacity. If the capacity is not a power of two, it will be treated as the rounded value of the next highest power of two. Additionally, because the event counter variable serves as a notifier to the user that an event has been added to the event queue, it is critical to initialize it before passing its address to this system call.
119
119
@@ -129,7 +129,7 @@ An event entry is made up of a 32-bit value representing the event's type and a
129
129
130
130
**system call number**: `0xFEED`
131
131
132
-
**synopsis**: `void submit_queue(int count)`
132
+
**synopsis**: `void submit_queue(size_t count)`
133
133
134
134
To inform the emulator that a batch of submissions should be processed, the application code should push several submissions into the queue first, and then pass the size of the submissions batch to this system call; the submissions will be processed and executed sequentially and immediately.
0 commit comments