From 08ca71f289cd63090edea06ce9fe1803c20d799b Mon Sep 17 00:00:00 2001 From: Xavi Del Campo Date: Fri, 31 Jan 2020 11:14:51 +0100 Subject: Solved const-correctness issues --- libpsx/include/psxgpu.h | 8 ++++---- libpsx/include/psxspu.h | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'libpsx/include') diff --git a/libpsx/include/psxgpu.h b/libpsx/include/psxgpu.h index 770754a..4548d4d 100644 --- a/libpsx/include/psxgpu.h +++ b/libpsx/include/psxgpu.h @@ -664,9 +664,9 @@ typedef struct /** Height of image in framebuffer */ int h; /** Pointer to CLUT data */ - void *clut_data; + const void *clut_data; /** Pointer to image data */ - void *data; + const void *data; }GsImage; /** @@ -796,7 +796,7 @@ void MoveImage(int src_x, int src_y, int dst_x, int dst_y, int w, int h); * @param h Height of image data */ -void LoadImage(void *img, int x, int y, int w, int h); +void LoadImage(const void *img, int x, int y, int w, int h); /** * Draws a rectangle in the framebuffer, without considering drawing @@ -859,7 +859,7 @@ void gpu_data_ctrl(unsigned int command, unsigned int param); * Puts information about a TIM image passed in a buffer in a GsImage structure. */ -int GsImageFromTim(GsImage *image, void *timdata); +int GsImageFromTim(GsImage *image, const void *timdata); /** * Uploads an image described by a GsImage structure to video memory. diff --git a/libpsx/include/psxspu.h b/libpsx/include/psxspu.h index 0de3656..2268500 100644 --- a/libpsx/include/psxspu.h +++ b/libpsx/include/psxspu.h @@ -30,7 +30,7 @@ /** Start address of sound data in Sound RAM */ #define SPU_DATA_BASE_ADDR 0x1010 /** Maximum volume. */ -#define SPU_MAXVOL 0x3FFF +#define SPU_MAXVOL 0x3FFF /** VAG file */ @@ -45,7 +45,7 @@ typedef struct /** Name */ unsigned char name[16]; /** Pointer to sound data */ - void *data; + const void *data; /** Address in Sound RAM where the sound data was uploaded */ unsigned int spu_addr; /** [Runtime] Voice this VAG is currently being played on */ @@ -113,7 +113,7 @@ void SsKeyOff(int voice); * Set the voices specified by the bitmask to 'on'. Like SsKeyOn() * @param mask Bitmask */ - + void SsKeyOnMask(int mask); /** @@ -142,7 +142,7 @@ void SsInit(void); * @param spu_addr Destination address in Sound RAM (multiplier of 8). */ -void SsUpload(void *addr, int size, int spu_addr); +void SsUpload(const void *addr, int size, int spu_addr); /** * Converts a sampling rate in hertz to PlayStation pitch rate used by the SPU. @@ -158,7 +158,7 @@ unsigned short SsFreqToPitch(int hz); * @param data Pointer to VAG file data */ -int SsReadVag(SsVag *vag, void *data); +int SsReadVag(SsVag *vag, const void *data); /** * Uploads the sound data specified by a SsVag structure to the specified address in Sound RAM. @@ -186,7 +186,7 @@ void SsUploadVag(SsVag *vag); * @param vr Right channel volume */ -void SsPlayVag(SsVag *vag, unsigned char voice, unsigned short vl, +void SsPlayVag(SsVag *vag, unsigned char voice, unsigned short vl, unsigned short vr); /** @@ -205,13 +205,13 @@ void SsResetVagAddr(void); /** * Enable CD Audio. */ - + void SsEnableCd(void); /** * Enable External audio. (???) */ - + void SsEnableExt(void); /** @@ -220,6 +220,6 @@ void SsEnableExt(void); * @param right Right channel volume */ -void SsCdVol(unsigned short left, unsigned short right); +void SsCdVol(unsigned short left, unsigned short right); #endif -- cgit v1.2.3