Commit graph

11751 commits

Author SHA1 Message Date
Hendiadyoin1 dea86f511c LibC: Use FlatPtr for malloced char* address storage
This would break with the next commit, after which char* will always be
treated as c-strings.
2021-12-15 13:09:49 +03:30
Linus Groh 5f993eecdb LibWeb: Replace incorrect empty Optional return with ByteBuffer
This function initially returned a ByteBuffer, so `return {}` was fine.
It was then changed to return Optional<ByteBuffer>, so we accidentally
started returning an empty Optional instead. Explicitly specify the
constructor name to fix this.

Thanks to DexesTTP for catching this!
2021-12-14 19:49:15 +00:00
Linus Groh 69fe4c2aca LibWeb: Remove dbgln() left from debugging :^) 2021-12-14 08:58:13 +00:00
Linus Groh 4daf07e69f LibWeb: Implement SubtleCrypto.digest()
This is a simple implementation of SubtleCrypto.digest() using LibCrypto
under the hood, so it supports all the required hash functions:
SHA-1, SHA-256, SHA-384, SHA-512.

Two FIXMEs remain: doing the hashing "in parallel", and supporting an
object argument instead of a plain string.
2021-12-14 09:01:06 +01:00
Linus Groh 5e06d5e9e5 LibWeb: Implement "get a copy of the bytes held by the buffer source" 2021-12-14 09:01:06 +01:00
Linus Groh 841bd680fa LibJS: Add ArrayBuffer::create() for ByteBuffer passed by value 2021-12-14 09:01:06 +01:00
Linus Groh 615be9eb7c LibWeb: Add the SubtleCrypto interface
Just some boilerplate code to get started :^)
This adds both the SubtleCrypto constructor to the window object, as
well as the crypto.subtle instance attribute.
2021-12-14 09:01:06 +01:00
Timothy Flynn 62ff029890 LibUnicode: Generate CalendarSymbols in a predetermined order
Similar to commit 2a7f36b392, this change moves the generated
CalendarSymbol enumeration to the public LibUnicode/NumberFormat.h
header with a pre-defined set of symbols that we need. This is to
prepare for uniquely generating the CalendarSymbols structure.
2021-12-13 21:28:56 -08:00
Ali Mohammad Pur 6bf50bc40b Shell: Make the Join operation respect nodes that have a next chain
This would show up when resolving aliases, when an alias contains a
sequence.
Fixes #11219.
2021-12-13 16:26:10 +03:30
Michel Hermier 18f053ac31 Shell: Remove sigpipe.sh.out artefact after failure
Helps to avoid to erroneously add the file to git.
2021-12-13 16:20:29 +03:30
Daniel Bertalan 8dd11ae717 Kernel+SystemServer: Add /dev/tty
This file refers to the controlling terminal associated with the current
process. It's specified by POSIX, and is used by ports like openssh to
interface with the terminal even if the standard input/output is
redirected to somewhere else.

Our implementation leverages ProcFS's existing facilities to create
process-specific symbolic links. In our setup, `/dev/tty` is a symbolic
link to `/proc/self/tty`, which itself is a symlink to the appropriate
`/dev/pts` entry. If no TTY is attached, `/dev/tty` is left dangling.
2021-12-12 22:32:35 +01:00
Jelle Raaijmakers 212334eaef LibGL: Simplify Texture2D reading; add support for RGB565 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 12c4491cca LibGL: Prevent limbo state if glEnd does not support drawing mode
If an unsupported drawing mode was configured, `glEnd` would not reach
the line where `m_in_draw_state` was set to `false`. This caused all
subsequent invocations to `glBegin` to fail.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 52d6ae36cb LibGL: Do not exclude points on the clip planes
Most resources seem to suggest that points on the clip planes are also
inside the frustum, e.g.: https://www.cubic.org/docs/3dclip.htm

This seems to resolve some rendering issues in Grim Fandango in OpenGL
mode where the screen remained black. This was because of quads being
drawn with their vertex positions exactly on the clip planes.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 4a2a68cd94 LibGL: Remove unused method from SoftwareRasterizer 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 46c564dd1a LibGL: Invoke own methods when drawing arrays or elements
Instead of calling the public API, call our own internal API.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers b79642ef74 LibGL: Support missing context in glGetError and glGetIntegerv
In its current state, ScummVM seems to invoke these methods just after
destroying the current GL context. According to the OpenGL spec:

    "Issuing GL commands when the program does not have a current
     context results in undefined behavior, up to and including program
     termination."

Our old behavior was to deref a `nullptr`, which isn't that great. For
now, protect these two methods. If other ports seem to misbehave as
well, we can always expand the check to other methods.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers a06b69c5b5 LibGL: Implement the GL_DITHER parameter 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers b89524c981 LibGL: Implement the GL_LIGHTING parameter 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers b1ac181537 LibGL: Centralize all context parameters
The `glGet*` family of functions requires that all parameters of
different types are transparently converted into each other. For
example, you can request a boolean parameter as a float or a list of
double values as an integer. It might be considered bad practice to
request parameters through the wrongly-typed function, but to be spec-
compliant we need to implement this.

Introduce a new `::get_context_parameter()` to obtain a parameter
value, which is then converted to the right type by the respective
`::gl_get_*()` functions.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 2af9b625e8 LibGL: Implement GL_*_BITS and GL_DOUBLEBUFFER parameters 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 033f224966 LibGL: Add GL_SHADING_LANGUAGE_VERSION to glGetString 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 6643775999 LibGL: Add stub for glCopyTexImage2D 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 401472c9a4 LibGL: Implement glDrawPixels and add stub for glBitmap 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers c2960e68a8 LibGL: Implement glLightModelf and glLightModelfv 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 0453cad46c LibGL: Add stubs for glPushAttrib and glPopAttrib 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers fbed7a5ba8 LibGL: Implement glLineWidth 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 22f8294a57 LibGL: Implement glLoadMatrixd 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 506abf2a61 LibGL: Implement glIsList 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 17c109f5d7 LibGL: Implement glTranslated 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 9c9fa33495 LibGL: Implement glClearStencil 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 07bf37be75 LibGL: Implement glScaled 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 9dbc8d7e3c LibGL: Add stubs for glMaterialf and glMaterialfv 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 4eb6295a57 LibGL: Implement glRasterPos2i 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 78d0674228 LibGL: Implement glNormal3f and glNormal3fv 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers ea6bcda79c LibGL: Implement glStencil* functions
This implements the context state for stencil testing functions and
operations. No rasterization is implemented.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 729349ce78 LibGL: Implement GL_STENCIL_TEST
Only the state is implemented; not the rasterization phase.
2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 11fea6b597 LibGL: Implement glListBase 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 1056bac49a LibGL: Implement glCallLists 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 651ea89094 LibGL: Implement glTexCoord2fv 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 315973e73c LibGL: Implement glColor3ub 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers d38c4ac8b5 LibGL: Add stubs for glLightf and glLightfv 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 7ac8cd057e LibGL: Implement glMultMatrixf 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 40724a426f LibGL: Implement glGetDoublev 2021-12-12 21:51:08 +01:00
Jelle Raaijmakers 6d4a5a40a0 LibGL: Define GL_ES_VERSION_2_0
GLES 2.0 is a subset of OpenGL, so we allow applications to compile
against LibGL as if it fully supports GLES 2.0.

Additionally, we set the definitions to an integer value of `1` so
applications that check for availability like this...

    int main() { return GL_ES_VERSION_2_0; }

...can actually compile. At least ScummVM uses this, and Mesa defines
their constants in the same way:

44b9e11ddb/include/GL/gl.h (L105)
2021-12-12 21:51:08 +01:00
Jean-Baptiste Boric dc83fd5ee8 strace: Remove formatting support for SC_select 2021-12-12 21:48:50 +01:00
Jean-Baptiste Boric e486d23c3f strace: Add formatting support for SC_poll 2021-12-12 21:48:50 +01:00
Jean-Baptiste Boric 809855be57 strace: Sort syscalls formatters in alphabetic order 2021-12-12 21:48:50 +01:00
Jean-Baptiste Boric ee34340c6a UserspaceEmulator: Remove support for SC_select syscall 2021-12-12 21:48:50 +01:00
Jean-Baptiste Boric 012d8d7f74 UserspaceEmulator: Add support for SC_poll syscall 2021-12-12 21:48:50 +01:00