1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** GUIX Component                                                        */
16 /**                                                                       */
17 /**   Application Interface (API)                                         */
18 /**                                                                       */
19 /**************************************************************************/
20 #include "gx_api.h"
21 #include "gx_system.h"
22 #include "gx_display.h"
23 #include "stdio.h"
24 #include "gx_dave2d_simulation_display_driver.h"
25 
26 VOID _gx_validation_display_buffer_8bit_palette_toggle(GX_CANVAS *canvas, GX_RECTANGLE *dirty);
27 UINT gx_validation_display_driver_setup_8bit_palette(GX_DISPLAY *display);
28 UINT gx_validation_display_driver_setup_8bit_palette_rotated(GX_DISPLAY *display);
29 VOID gx_validation_graphics_driver_cleanup_8bit_palette(GX_DISPLAY *display);
30 
_gx_validation_display_buffer_8bit_palette_toggle(GX_CANVAS * canvas,GX_RECTANGLE * dirty)31 VOID _gx_validation_display_buffer_8bit_palette_toggle(GX_CANVAS *canvas, GX_RECTANGLE *dirty)
32 {
33     GX_PARAMETER_NOT_USED(canvas);
34     GX_PARAMETER_NOT_USED(dirty);
35 }
36 
37 
_gx_validation_display_driver_8bit_palette_set(GX_DISPLAY * display,GX_COLOR * palette,INT count)38 VOID _gx_validation_display_driver_8bit_palette_set(GX_DISPLAY *display, GX_COLOR *palette, INT count)
39 {
40     display -> gx_display_palette = palette;
41     display -> gx_display_palette_size = count;
42 }
43 
gx_validation_display_driver_setup_8bit_palette(GX_DISPLAY * display)44 UINT gx_validation_display_driver_setup_8bit_palette(GX_DISPLAY *display)
45 {
46 
47     /* Initialize the low-level drawing function pointers
48 
49        for windows, these are always just the generic funcions,
50        but for some hardware, these will be customized,
51        optimized functions specific to that hardware
52      */
53 
54 
55     _gx_display_driver_8bit_palette_setup(display, (VOID *)1, _gx_validation_display_buffer_8bit_palette_toggle);
56     display -> gx_display_driver_palette_set = _gx_validation_display_driver_8bit_palette_set;
57 
58     return(GX_SUCCESS);
59 }
60 
gx_validation_display_driver_setup_8bit_palette_rotated(GX_DISPLAY * display)61 UINT gx_validation_display_driver_setup_8bit_palette_rotated(GX_DISPLAY *display)
62 {
63 
64     /* Initialize the low-level drawing function pointers
65 
66        for windows, these are always just the generic funcions,
67        but for some hardware, these will be customized,
68        optimized functions specific to that hardware
69      */
70 
71 
72     _gx_display_driver_8bit_palette_rotated_setup(display, (VOID *)1, _gx_validation_display_buffer_8bit_palette_toggle);
73     display -> gx_display_driver_palette_set = _gx_validation_display_driver_8bit_palette_set;
74 
75     return(GX_SUCCESS);
76 }
77 
gx_validation_graphics_driver_cleanup_8bit_palette(GX_DISPLAY * display)78 VOID gx_validation_graphics_driver_cleanup_8bit_palette(GX_DISPLAY *display)
79 {
80 
81     /* Do nothing */
82     GX_PARAMETER_NOT_USED(display);
83 }
84 
85