Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
allkern committed May 11, 2024
1 parent ac0b5b3 commit 6e692ec
Show file tree
Hide file tree
Showing 29 changed files with 40 additions and 36 deletions.
3 changes: 2 additions & 1 deletion frontend/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "config.h"
#include "common.h"

#include "psx/log.h"
#include "log.h"
// #include "psx/log.h"

static const char* g_version_text =
#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion frontend/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef struct {
const char* exp_path;
} psxe_config_t;

psxe_config_t* psxe_cfg_create();
psxe_config_t* psxe_cfg_create(void);
void psxe_cfg_init(psxe_config_t*);
void psxe_cfg_load_defaults(psxe_config_t*);
void psxe_cfg_load(psxe_config_t*, int, const char**);
Expand Down
16 changes: 9 additions & 7 deletions frontend/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "psx/psx.h"
#include "psx/input/sda.h"
#include "psx/disc/cue.h"
#include "psx.h"
#include "input/sda.h"
#include "disc/cue.h"
// #include "psx/psx.h"
// #include "psx/input/sda.h"
// #include "psx/disc/cue.h"

#include "screen.h"
#include "config.h"
Expand All @@ -16,8 +19,8 @@ void audio_update(void* ud, uint8_t* buf, int size) {
for (int i = 0; i < (size >> 2); i++) {
uint32_t sample = psx_spu_get_sample(spu);

int16_t left = (int16_t)(sample & 0xffff) * 1.5f;
int16_t right = (int16_t)(sample >> 16) * 1.5f;
int16_t left = (int16_t)(sample & 0xffff);
int16_t right = (int16_t)(sample >> 16);

*(int16_t*)(&buf[(i << 2) + 0]) += left;
*(int16_t*)(&buf[(i << 2) + 2]) += right;
Expand Down Expand Up @@ -84,9 +87,8 @@ int main(int argc, const char* argv[]) {
psx_pad_attach_mcd(psx->pad, 1, "slot2.mcd");

if (cfg->exe) {
while (psx->cpu->pc != 0x80030000) {
while (psx->cpu->pc != 0x80030000)
psx_update(psx);
}

psx_load_exe(psx, cfg->exe);
}
Expand Down
5 changes: 3 additions & 2 deletions frontend/screen.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef SCREEN_H
#define SCREEN_H

#include "psx/psx.h"
#include "psx.h"
// #include "psx/psx.h"
#include "common.h"

#include <string.h>
Expand Down Expand Up @@ -33,7 +34,7 @@ typedef struct {
SDL_GameController* controller;
} psxe_screen_t;

psxe_screen_t* psxe_screen_create();
psxe_screen_t* psxe_screen_create(void);
void psxe_screen_init(psxe_screen_t*, psx_t*);
void psxe_screen_reload(psxe_screen_t*);
int psxe_screen_is_open(psxe_screen_t*);
Expand Down
2 changes: 1 addition & 1 deletion psx/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct psx_bus_t;

typedef struct psx_bus_t psx_bus_t;

psx_bus_t* psx_bus_create();
psx_bus_t* psx_bus_create(void);
void psx_bus_init(psx_bus_t*);
uint32_t psx_bus_read32(psx_bus_t*, uint32_t);
uint16_t psx_bus_read16(psx_bus_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ struct __attribute__((__packed__)) psx_cpu_t {
#define SR_CU2 0x40000000
#define SR_CU3 0x80000000

psx_cpu_t* psx_cpu_create();
psx_cpu_t* psx_cpu_create(void);
void psx_cpu_init(psx_cpu_t*, psx_bus_t*);
void psx_cpu_destroy(psx_cpu_t*);
void psx_cpu_cycle(psx_cpu_t*);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/bios.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ typedef struct {
uint8_t* buf;
} psx_bios_t;

psx_bios_t* psx_bios_create();
psx_bios_t* psx_bios_create(void);
void psx_bios_init(psx_bios_t*);
void psx_bios_load(psx_bios_t*, const char*);
uint32_t psx_bios_read32(psx_bios_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/cdrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ typedef struct {
int cd_type;
} psx_cdrom_t;

psx_cdrom_t* psx_cdrom_create();
psx_cdrom_t* psx_cdrom_create(void);
void psx_cdrom_init(psx_cdrom_t*, psx_ic_t*);
uint32_t psx_cdrom_read32(psx_cdrom_t*, uint32_t);
uint16_t psx_cdrom_read16(psx_cdrom_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef struct {
uint32_t dicr;
} psx_dma_t;

psx_dma_t* psx_dma_create();
psx_dma_t* psx_dma_create(void);
void psx_dma_init(psx_dma_t*, psx_bus_t*, psx_ic_t*);
void psx_dma_do_mdec_in(psx_dma_t*);
void psx_dma_do_mdec_out(psx_dma_t*);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/exp1.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef struct {
uint8_t* rom;
} psx_exp1_t;

psx_exp1_t* psx_exp1_create();
psx_exp1_t* psx_exp1_create(void);
void psx_exp1_init(psx_exp1_t*, psx_mc1_t*, const char*);
void psx_exp1_load(psx_exp1_t*, const char*);
uint32_t psx_exp1_read32(psx_exp1_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/exp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef struct {
uint8_t atc_rx;
} psx_exp2_t;

psx_exp2_t* psx_exp2_create();
psx_exp2_t* psx_exp2_create(void);
void psx_exp2_init(psx_exp2_t*, exp2_tty_tx atcons_tx, exp2_tty_tx duart_tx);
void psx_exp2_atcons_put(psx_exp2_t*, char);
void psx_exp2_duart_put(psx_exp2_t*, char);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ struct psx_gpu_t {
psx_gpu_event_callback_t event_cb_table[8];
};

psx_gpu_t* psx_gpu_create();
psx_gpu_t* psx_gpu_create(void);
void psx_gpu_init(psx_gpu_t*, psx_ic_t*);
uint32_t psx_gpu_read32(psx_gpu_t*, uint32_t);
uint16_t psx_gpu_read16(psx_gpu_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/ic.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef struct {
psx_cpu_t* cpu;
} psx_ic_t;

psx_ic_t* psx_ic_create();
psx_ic_t* psx_ic_create(void);
void psx_ic_init(psx_ic_t*, psx_cpu_t*);
uint32_t psx_ic_read32(psx_ic_t*, uint32_t);
uint16_t psx_ic_read16(psx_ic_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct psx_input_t {
psx_input_query_fifo_t query_fifo_func;
};

psx_input_t* psx_input_create();
psx_input_t* psx_input_create(void);
void psx_input_init(psx_input_t*);
void psx_input_set_write_func(psx_input_t*, psx_input_write_t);
void psx_input_set_read_func(psx_input_t*, psx_input_read_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/mc1.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef struct {
int seq;
} psx_access_delay_t;

psx_mc1_t* psx_mc1_create();
psx_mc1_t* psx_mc1_create(void);
void psx_mc1_init(psx_mc1_t*);
uint32_t psx_mc1_read32(psx_mc1_t*, uint32_t);
uint16_t psx_mc1_read16(psx_mc1_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/mc2.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef struct {
uint32_t ram_size;
} psx_mc2_t;

psx_mc2_t* psx_mc2_create();
psx_mc2_t* psx_mc2_create(void);
void psx_mc2_init(psx_mc2_t*);
uint32_t psx_mc2_read32(psx_mc2_t*, uint32_t);
uint16_t psx_mc2_read16(psx_mc2_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/mc3.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef struct {
uint32_t cache_control;
} psx_mc3_t;

psx_mc3_t* psx_mc3_create();
psx_mc3_t* psx_mc3_create(void);
void psx_mc3_init(psx_mc3_t*);
uint32_t psx_mc3_read32(psx_mc3_t*, uint32_t);
uint16_t psx_mc3_read16(psx_mc3_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/mcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef struct {
uint8_t checksum;
} psx_mcd_t;

psx_mcd_t* psx_mcd_create();
psx_mcd_t* psx_mcd_create(void);
void psx_mcd_init(psx_mcd_t*, const char*);
uint8_t psx_mcd_read(psx_mcd_t*);
void psx_mcd_write(psx_mcd_t*, uint8_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/mdec.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ typedef struct {
uint32_t status;
} psx_mdec_t;

psx_mdec_t* psx_mdec_create();
psx_mdec_t* psx_mdec_create(void);
void psx_mdec_init(psx_mdec_t*);
uint32_t psx_mdec_read32(psx_mdec_t*, uint32_t);
uint16_t psx_mdec_read16(psx_mdec_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/pad.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ typedef struct {
uint16_t mode, ctrl, baud, stat;
} psx_pad_t;

psx_pad_t* psx_pad_create();
psx_pad_t* psx_pad_create(void);
void psx_pad_init(psx_pad_t*, psx_ic_t*);
uint32_t psx_pad_read32(psx_pad_t*, uint32_t);
uint16_t psx_pad_read16(psx_pad_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/ram.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ typedef struct {
uint8_t* buf;
} psx_ram_t;

psx_ram_t* psx_ram_create();
psx_ram_t* psx_ram_create(void);
void psx_ram_init(psx_ram_t*, psx_mc2_t*);
uint32_t psx_ram_read32(psx_ram_t*, uint32_t);
uint16_t psx_ram_read16(psx_ram_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/scratchpad.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ typedef struct {
uint8_t* buf;
} psx_scratchpad_t;

psx_scratchpad_t* psx_scratchpad_create();
psx_scratchpad_t* psx_scratchpad_create(void);
void psx_scratchpad_init(psx_scratchpad_t*);
uint32_t psx_scratchpad_read32(psx_scratchpad_t*, uint32_t);
uint16_t psx_scratchpad_read16(psx_scratchpad_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/spu.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ typedef struct __attribute__((__packed__)) {
} data[24];
} psx_spu_t;

psx_spu_t* psx_spu_create();
psx_spu_t* psx_spu_create(void);
void psx_spu_init(psx_spu_t*);
uint32_t psx_spu_read32(psx_spu_t*, uint32_t);
uint16_t psx_spu_read16(psx_spu_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/dev/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ typedef struct {
} timer[3];
} psx_timer_t;

psx_timer_t* psx_timer_create();
psx_timer_t* psx_timer_create(void);
void psx_timer_init(psx_timer_t*, psx_ic_t*);
uint32_t psx_timer_read32(psx_timer_t*, uint32_t);
uint16_t psx_timer_read16(psx_timer_t*, uint32_t);
Expand Down
2 changes: 1 addition & 1 deletion psx/disc.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef struct {
disc_destroy_t destroy_func;
} psx_disc_t;

psx_disc_t* psx_disc_create();
psx_disc_t* psx_disc_create(void);
int psx_disc_seek(psx_disc_t*, msf_t);
int psx_disc_read_sector(psx_disc_t*, void*);
int psx_disc_get_track_addr(psx_disc_t*, msf_t*, int);
Expand Down
2 changes: 1 addition & 1 deletion psx/disc/bin.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ typedef struct {
msf_t end;
} psxd_bin_t;

psxd_bin_t* psxd_bin_create();
psxd_bin_t* psxd_bin_create(void);
void psxd_bin_init(psxd_bin_t*);
int psxd_bin_load(psxd_bin_t*, const char*);
void psxd_bin_init_disc(psxd_bin_t*, psx_disc_t*);
Expand Down
2 changes: 1 addition & 1 deletion psx/disc/cue.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ typedef struct {
msf_t end;
} psxd_cue_t;

psxd_cue_t* psxd_cue_create();
psxd_cue_t* psxd_cue_create(void);
void psxd_cue_init(psxd_cue_t*);
int psxd_cue_load(psxd_cue_t*, const char*);
void psxd_cue_init_disc(psxd_cue_t*, psx_disc_t*);
Expand Down
2 changes: 1 addition & 1 deletion psx/input/sda.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ typedef struct {
uint8_t adc3;
} psxi_sda_t;

psxi_sda_t* psxi_sda_create();
psxi_sda_t* psxi_sda_create(void);
void psxi_sda_init(psxi_sda_t*, uint16_t);
void psxi_sda_init_input(psxi_sda_t*, psx_input_t*);
void psxi_sda_destroy(psxi_sda_t*);
Expand Down
2 changes: 1 addition & 1 deletion psx/psx.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typedef struct {
psx_mdec_t* mdec;
} psx_t;

psx_t* psx_create();
psx_t* psx_create(void);
void psx_init(psx_t*, const char*, const char*);
void psx_load_expansion(psx_t*, const char*);
void psx_load_bios(psx_t*, const char*);
Expand Down

0 comments on commit 6e692ec

Please sign in to comment.