Skip to content

Commit 2eec97f

Browse files
committed
Cleaning up some warnings and errors
1 parent 070b1e0 commit 2eec97f

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

mos-platform/pce-common/libpce/include/pce/vdc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void pce_sgx_vdc_set(uint8_t id);
280280
/**
281281
* @brief SuperGrafx: Get the current VDC's index port location.
282282
*/
283-
volatile uint8_t *pce_sgx_vdc_get_index(void);
283+
volatile uint16_t *pce_sgx_vdc_get_index(void);
284284

285285
/**
286286
* @brief SuperGrafx: Get the current VDC's data port location.

mos-platform/pce-common/libpce/src/vce.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ void pce_vce_set_color(uint16_t index, uint16_t value) {
2222

2323
void pce_vce_copy_palette(uint8_t index, const void *source, uint8_t count) {
2424
*IO_VCE_COLOR_INDEX = ((uint16_t)index) << 4;
25-
pce_memop(IO_VCE_COLOR_DATA, source, ((uint16_t)count) << 5,
25+
pce_memop((void *)IO_VCE_COLOR_DATA, source, ((uint16_t)count) << 5,
2626
PCE_MEMOP_INCR_ALT);
2727
}
2828

2929
void pce_vce_copy_palette_to_ram(void *dest, uint8_t index, uint8_t count) {
3030
*IO_VCE_COLOR_INDEX = ((uint16_t)index) << 4;
31-
pce_memop(dest, IO_VCE_COLOR_DATA, ((uint16_t)count) << 5,
31+
pce_memop(dest, (const void *)IO_VCE_COLOR_DATA, ((uint16_t)count) << 5,
3232
PCE_MEMOP_ALT_INCR);
3333
}

mos-platform/pce-common/libpce/src/vdc.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ void pce_vdc_copy_to_vram(uint16_t dest, const void *source, uint16_t length) {
6666
PCE_VDC_INDEX_CONST(VDC_REG_VRAM_WRITE_ADDR);
6767
*IO_VDC_DATA = dest;
6868
PCE_VDC_INDEX_CONST(VDC_REG_VRAM_DATA);
69-
pce_memop(IO_VDC_DATA, source, length, PCE_MEMOP_INCR_ALT);
69+
pce_memop((void *)IO_VDC_DATA, source, length, PCE_MEMOP_INCR_ALT);
7070
}
7171

7272
void pce_vdc_copy_from_vram(void *dest, uint16_t source, uint16_t length) {
7373
PCE_VDC_INDEX_CONST(VDC_REG_VRAM_READ_ADDR);
7474
*IO_VDC_DATA = source;
7575
PCE_VDC_INDEX_CONST(VDC_REG_VRAM_DATA);
76-
pce_memop(dest, IO_VDC_DATA, length, PCE_MEMOP_ALT_INCR);
76+
pce_memop(dest, (const void *)IO_VDC_DATA, length, PCE_MEMOP_ALT_INCR);
7777
}
7878

7979
void pce_vdc_dma_start(uint8_t mode, uint16_t source, uint16_t dest,
@@ -222,7 +222,9 @@ void pce_sgx_vdc_set(uint8_t id) {
222222
*IO_VPC_PORT = id;
223223
}
224224

225-
volatile uint8_t *pce_sgx_vdc_get_index() { return IO_VDC_INDEX; }
225+
volatile uint8_t *pce_sgx_vdc_get_index() {
226+
return (volatile uint8_t *)IO_VDC_INDEX;
227+
}
226228

227229
volatile uint16_t *pce_sgx_vdc_get_data() { return IO_VDC_DATA; }
228230

@@ -284,4 +286,4 @@ void pce_vdc_irq_vblank_enable(void) { pce_vdc_enable(VDC_CONTROL_IRQ_VBLANK); }
284286

285287
void pce_vdc_irq_vblank_disable(void) {
286288
pce_vdc_disable(VDC_CONTROL_IRQ_VBLANK);
287-
}
289+
}

utils/sim/mos-sim.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <inttypes.h>
12
#include <stdbool.h>
23
#include <stdint.h>
34
#include <stdio.h>
@@ -73,12 +74,12 @@ int8_t read6502(uint16_t address) {
7374

7475
void finish(void) {
7576
if (shouldPrintCycles)
76-
fprintf(stderr, "%llu cycles\n", clockticks6502);
77+
fprintf(stderr, PRIu64 " cycles\n", clockticks6502);
7778

7879
if (shouldProfile)
7980
for (int addr = 0; addr < 65536; ++addr)
8081
if (clockTicksAtAddress[addr])
81-
fprintf(stderr, "%04x %llu\n", addr, clockTicksAtAddress[addr]);
82+
fprintf(stderr, "%04x " PRIu64 "\n", addr, clockTicksAtAddress[addr]);
8283
}
8384

8485
void write6502(uint16_t address, uint8_t value) {

0 commit comments

Comments
 (0)