Clean up compilation warnings
Various functions dropped a void declaration (lazy), which is added. Removed an unused variable in unix_main.
This commit is contained in:
parent
5d23667c8e
commit
83ca8a1cfe
8 changed files with 27 additions and 28 deletions
|
|
@ -47,12 +47,12 @@
|
||||||
extern uint8_t *_ram_base;
|
extern uint8_t *_ram_base;
|
||||||
extern uint8_t *_rom_base;
|
extern uint8_t *_rom_base;
|
||||||
|
|
||||||
static inline uint8_t *ram_get_base()
|
static inline uint8_t *ram_get_base(void)
|
||||||
{
|
{
|
||||||
return _ram_base;
|
return _ram_base;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint8_t *rom_get_base()
|
static inline uint8_t *rom_get_base(void)
|
||||||
{
|
{
|
||||||
return _rom_base;
|
return _rom_base;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,24 +30,24 @@
|
||||||
#include "machw.h"
|
#include "machw.h"
|
||||||
|
|
||||||
int umac_init(void *_ram_base, void *_rom_base, disc_descr_t discs[DISC_NUM_DRIVES]);
|
int umac_init(void *_ram_base, void *_rom_base, disc_descr_t discs[DISC_NUM_DRIVES]);
|
||||||
int umac_loop();
|
int umac_loop(void);
|
||||||
void umac_reset();
|
void umac_reset(void);
|
||||||
void umac_opt_disassemble(int enable);
|
void umac_opt_disassemble(int enable);
|
||||||
void umac_mouse(int deltax, int deltay, int button);
|
void umac_mouse(int deltax, int deltay, int button);
|
||||||
void umac_kbd_event(uint8_t scancode, int down);
|
void umac_kbd_event(uint8_t scancode, int down);
|
||||||
|
|
||||||
static inline void umac_vsync_event()
|
static inline void umac_vsync_event(void)
|
||||||
{
|
{
|
||||||
via_caX_event(2);
|
via_caX_event(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void umac_1hz_event()
|
static inline void umac_1hz_event(void)
|
||||||
{
|
{
|
||||||
via_caX_event(1);
|
via_caX_event(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the offset into RAM of the current display buffer */
|
/* Return the offset into RAM of the current display buffer */
|
||||||
static inline unsigned int umac_get_fb_offset()
|
static inline unsigned int umac_get_fb_offset(void)
|
||||||
{
|
{
|
||||||
/* FIXME: Implement VIA RA6/vid.pg2 */
|
/* FIXME: Implement VIA RA6/vid.pg2 */
|
||||||
return RAM_SIZE - 0x5900;
|
return RAM_SIZE - 0x5900;
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@
|
||||||
struct via_cb {
|
struct via_cb {
|
||||||
void (*ra_change)(uint8_t val);
|
void (*ra_change)(uint8_t val);
|
||||||
void (*rb_change)(uint8_t val);
|
void (*rb_change)(uint8_t val);
|
||||||
uint8_t (*ra_in)();
|
uint8_t (*ra_in)(void);
|
||||||
uint8_t (*rb_in)();
|
uint8_t (*rb_in)(void);
|
||||||
void (*sr_tx)(uint8_t val);
|
void (*sr_tx)(uint8_t val);
|
||||||
void (*irq_set)(int status);
|
void (*irq_set)(int status);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#define DERR(...) fprintf(stderr, __VA_ARGS__)
|
#define DERR(...) fprintf(stderr, __VA_ARGS__)
|
||||||
|
|
||||||
extern void umac_disc_ejected();
|
extern void umac_disc_ejected(void);
|
||||||
|
|
||||||
// B2 decls:
|
// B2 decls:
|
||||||
static int16_t SonyOpen(uint32_t pb, uint32_t dce, uint32_t status);
|
static int16_t SonyOpen(uint32_t pb, uint32_t dce, uint32_t status);
|
||||||
|
|
|
||||||
18
src/main.c
18
src/main.c
|
|
@ -79,7 +79,7 @@ static int disassemble = 0;
|
||||||
|
|
||||||
#define UMAC_EXECLOOP_QUANTUM 5000
|
#define UMAC_EXECLOOP_QUANTUM 5000
|
||||||
|
|
||||||
static void update_overlay_layout();
|
static void update_overlay_layout(void);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
@ -169,7 +169,7 @@ static void via_rb_changed(uint8_t val)
|
||||||
(void)val;
|
(void)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t via_ra_in()
|
static uint8_t via_ra_in(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -178,7 +178,7 @@ static uint8_t via_ra_in()
|
||||||
static uint8_t via_quadbits = 0;
|
static uint8_t via_quadbits = 0;
|
||||||
static uint8_t via_mouse_pressed = 0;
|
static uint8_t via_mouse_pressed = 0;
|
||||||
|
|
||||||
static uint8_t via_rb_in()
|
static uint8_t via_rb_in(void)
|
||||||
{
|
{
|
||||||
uint8_t v = via_quadbits;
|
uint8_t v = via_quadbits;
|
||||||
// Mouse not pressed!
|
// Mouse not pressed!
|
||||||
|
|
@ -250,7 +250,7 @@ static void kbd_rx(uint8_t data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kbd_check_work()
|
static void kbd_check_work(void)
|
||||||
{
|
{
|
||||||
/* Process a keyboard command a little later than the transmit
|
/* Process a keyboard command a little later than the transmit
|
||||||
* time (i.e. not immediately, which makes the mac feel rushed
|
* time (i.e. not immediately, which makes the mac feel rushed
|
||||||
|
|
@ -484,7 +484,7 @@ void FAST_FUNC(cpu_write_long)(unsigned int address, unsigned int value)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update function pointers for memory accessors based on overlay state/memory map layout */
|
/* Update function pointers for memory accessors based on overlay state/memory map layout */
|
||||||
static void update_overlay_layout()
|
static void update_overlay_layout(void)
|
||||||
{
|
{
|
||||||
if (overlay) {
|
if (overlay) {
|
||||||
cpu_read_instr = cpu_read_instr_overlay;
|
cpu_read_instr = cpu_read_instr_overlay;
|
||||||
|
|
@ -624,7 +624,7 @@ void umac_mouse(int deltax, int deltay, int button)
|
||||||
via_mouse_pressed = button;
|
via_mouse_pressed = button;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_tick()
|
static void mouse_tick(void)
|
||||||
{
|
{
|
||||||
/* Periodically, check if the mouse X/Y deltas are non-zero.
|
/* Periodically, check if the mouse X/Y deltas are non-zero.
|
||||||
* If a movement is required, encode one step in X and/or Y
|
* If a movement is required, encode one step in X and/or Y
|
||||||
|
|
@ -682,14 +682,14 @@ static void mouse_tick()
|
||||||
scc_set_dcd(dcd_a, dcd_b);
|
scc_set_dcd(dcd_a, dcd_b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void umac_reset()
|
void umac_reset(void)
|
||||||
{
|
{
|
||||||
overlay = 1;
|
overlay = 1;
|
||||||
m68k_pulse_reset();
|
m68k_pulse_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called by the disc code when an eject op happens. */
|
/* Called by the disc code when an eject op happens. */
|
||||||
void umac_disc_ejected()
|
void umac_disc_ejected(void)
|
||||||
{
|
{
|
||||||
#ifdef SIM
|
#ifdef SIM
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
@ -701,7 +701,7 @@ void umac_disc_ejected()
|
||||||
/* Run the emulator for about a frame.
|
/* Run the emulator for about a frame.
|
||||||
* Returns 0 for not-done, 1 when an exit/done condition arises.
|
* Returns 0 for not-done, 1 when an exit/done condition arises.
|
||||||
*/
|
*/
|
||||||
int umac_loop()
|
int umac_loop(void)
|
||||||
{
|
{
|
||||||
setjmp(main_loop_jb);
|
setjmp(main_loop_jb);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ static uint8_t scc_dcd_pins = 0; // 0 = A, 1 = B
|
||||||
static uint8_t scc_dcd_a_changed = 0;
|
static uint8_t scc_dcd_a_changed = 0;
|
||||||
static uint8_t scc_dcd_b_changed = 0;
|
static uint8_t scc_dcd_b_changed = 0;
|
||||||
|
|
||||||
static void scc_assess_irq();
|
static void scc_assess_irq(void);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
@ -118,6 +118,7 @@ static void scc_wr2(uint8_t data)
|
||||||
// WR3: Receive Parameters & Control
|
// WR3: Receive Parameters & Control
|
||||||
static void scc_wr3(int AnB, uint8_t data)
|
static void scc_wr3(int AnB, uint8_t data)
|
||||||
{
|
{
|
||||||
|
(void)AnB;
|
||||||
// Keep an eye out for bit 0x10 (enter hunt mode), and external/status is asserted
|
// Keep an eye out for bit 0x10 (enter hunt mode), and external/status is asserted
|
||||||
|
|
||||||
if (data & 0x10) {
|
if (data & 0x10) {
|
||||||
|
|
@ -223,7 +224,7 @@ static uint8_t scc_rr15(int AnB)
|
||||||
|
|
||||||
// Call after a state change: checks MIE, interrupt enables,
|
// Call after a state change: checks MIE, interrupt enables,
|
||||||
// and (de)asserts IRQ output if necessary
|
// and (de)asserts IRQ output if necessary
|
||||||
static void scc_assess_irq()
|
static void scc_assess_irq(void)
|
||||||
{
|
{
|
||||||
if (scc_dcd_a_changed && (scc_ie[1] & SCC_IE_DCD)) {
|
if (scc_dcd_a_changed && (scc_ie[1] & SCC_IE_DCD)) {
|
||||||
scc_irq_pending |= SCC_IP_A_EXT;
|
scc_irq_pending |= SCC_IP_A_EXT;
|
||||||
|
|
|
||||||
|
|
@ -274,7 +274,6 @@ int main(int argc, char *argv[])
|
||||||
// Main loop
|
// Main loop
|
||||||
|
|
||||||
int done = 0;
|
int done = 0;
|
||||||
uint64_t loops = 0;
|
|
||||||
int mouse_button = 0;
|
int mouse_button = 0;
|
||||||
uint64_t last_vsync = 0;
|
uint64_t last_vsync = 0;
|
||||||
uint64_t last_1hz = 0;
|
uint64_t last_1hz = 0;
|
||||||
|
|
@ -283,7 +282,6 @@ int main(int argc, char *argv[])
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
int mousex = 0;
|
int mousex = 0;
|
||||||
int mousey = 0;
|
int mousey = 0;
|
||||||
loops++;
|
|
||||||
|
|
||||||
if (SDL_PollEvent(&event)) {
|
if (SDL_PollEvent(&event)) {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
|
|
|
||||||
10
src/via.c
10
src/via.c
|
|
@ -145,7 +145,7 @@ static void via_update_sr(uint8_t data)
|
||||||
* transmit callback action -- the response then cannot race with the
|
* transmit callback action -- the response then cannot race with the
|
||||||
* IRQ showing the TX has completed.
|
* IRQ showing the TX has completed.
|
||||||
*/
|
*/
|
||||||
static void via_sr_done()
|
static void via_sr_done(void)
|
||||||
{
|
{
|
||||||
if (sr_tx_pending >= 0) {
|
if (sr_tx_pending >= 0) {
|
||||||
uint8_t data = (uint8_t)sr_tx_pending;
|
uint8_t data = (uint8_t)sr_tx_pending;
|
||||||
|
|
@ -163,7 +163,7 @@ static void via_sr_done()
|
||||||
// 1 CA2: Vertical blanking interrupt
|
// 1 CA2: Vertical blanking interrupt
|
||||||
// 0 CA1: One-second interrupt
|
// 0 CA1: One-second interrupt
|
||||||
|
|
||||||
static void via_assess_irq()
|
static void via_assess_irq(void)
|
||||||
{
|
{
|
||||||
int irq = 0;
|
int irq = 0;
|
||||||
static uint8_t last_active = 0;
|
static uint8_t last_active = 0;
|
||||||
|
|
@ -233,13 +233,13 @@ void via_write(unsigned int address, uint8_t data)
|
||||||
via_assess_irq();
|
via_assess_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t via_read_ifr()
|
uint8_t via_read_ifr(void)
|
||||||
{
|
{
|
||||||
uint8_t active = irq_enable & irq_active & 0x7f;
|
uint8_t active = irq_enable & irq_active & 0x7f;
|
||||||
return irq_active | (active ? 0x80 : 0);
|
return irq_active | (active ? 0x80 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t via_read_rega()
|
static uint8_t via_read_rega(void)
|
||||||
{
|
{
|
||||||
uint8_t data = (via_callbacks.ra_in) ? via_callbacks.ra_in() : 0;
|
uint8_t data = (via_callbacks.ra_in) ? via_callbacks.ra_in() : 0;
|
||||||
uint8_t ddr = via_regs[VIA_DDRA];
|
uint8_t ddr = via_regs[VIA_DDRA];
|
||||||
|
|
@ -247,7 +247,7 @@ static uint8_t via_read_rega()
|
||||||
return (ddr & via_regs[VIA_RA]) | (~ddr & data);
|
return (ddr & via_regs[VIA_RA]) | (~ddr & data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t via_read_regb()
|
static uint8_t via_read_regb(void)
|
||||||
{
|
{
|
||||||
uint8_t data = (via_callbacks.rb_in) ? via_callbacks.rb_in() : 0;
|
uint8_t data = (via_callbacks.rb_in) ? via_callbacks.rb_in() : 0;
|
||||||
uint8_t ddr = via_regs[VIA_DDRB];
|
uint8_t ddr = via_regs[VIA_DDRB];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue