Mercurial > repos > blastem
comparison m68k_util.c @ 2645:620f30af9fdc
Fix warnings in m68k_util.c
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 28 Feb 2025 23:26:44 -0800 |
parents | c5314c0779c2 |
children | 1072cc337822 |
comparison
equal
deleted
inserted
replaced
2644:c5c9498ff279 | 2645:620f30af9fdc |
---|---|
1 #include <string.h> | 1 #include <string.h> |
2 | 2 |
3 void m68k_read_8(m68k_context *context) | 3 void m68k_read_8(m68k_context *context) |
4 { | 4 { |
5 context->cycles += 4 * context->opts->gen.clock_divider; | 5 context->cycles += 4 * context->opts->gen.clock_divider; |
6 context->scratch1 = read_byte(context->scratch1, context->mem_pointers, &context->opts->gen, context); | 6 context->scratch1 = read_byte(context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); |
7 } | 7 } |
8 | 8 |
9 #ifdef DEBUG_DISASM | 9 #ifdef DEBUG_DISASM |
10 #include "68kinst.h" | 10 #include "68kinst.h" |
11 static uint16_t debug_disasm_fetch(uint32_t address, void *vcontext) | 11 static uint16_t debug_disasm_fetch(uint32_t address, void *vcontext) |
12 { | 12 { |
13 m68k_context *context = vcontext; | 13 m68k_context *context = vcontext; |
14 return read_word(address, context->mem_pointers, &context->opts->gen, context); | 14 return read_word(address, (void**)context->mem_pointers, &context->opts->gen, context); |
15 } | 15 } |
16 #endif | 16 #endif |
17 void m68k_read_16(m68k_context *context) | 17 void m68k_read_16(m68k_context *context) |
18 { | 18 { |
19 context->cycles += 4 * context->opts->gen.clock_divider; | 19 context->cycles += 4 * context->opts->gen.clock_divider; |
20 #ifdef DEBUG_DISASM | 20 #ifdef DEBUG_DISASM |
21 uint32_t tmp = context->scratch1; | 21 uint32_t tmp = context->scratch1; |
22 #endif | 22 #endif |
23 context->scratch1 = read_word(context->scratch1, context->mem_pointers, &context->opts->gen, context); | 23 context->scratch1 = read_word(context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); |
24 #ifdef DEBUG_DISASM | 24 #ifdef DEBUG_DISASM |
25 if (tmp == context->pc) { | 25 if (tmp == context->pc) { |
26 m68kinst inst; | 26 m68kinst inst; |
27 m68k_decode(debug_disasm_fetch, context, &inst, tmp); | 27 m68k_decode(debug_disasm_fetch, context, &inst, tmp); |
28 static char disasm_buf[256]; | 28 static char disasm_buf[256]; |
35 } | 35 } |
36 | 36 |
37 void m68k_write_8(m68k_context *context) | 37 void m68k_write_8(m68k_context *context) |
38 { | 38 { |
39 context->cycles += 4 * context->opts->gen.clock_divider; | 39 context->cycles += 4 * context->opts->gen.clock_divider; |
40 write_byte(context->scratch2, context->scratch1, context->mem_pointers, &context->opts->gen, context); | 40 write_byte(context->scratch2, context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); |
41 } | 41 } |
42 | 42 |
43 void m68k_write_16(m68k_context *context) | 43 void m68k_write_16(m68k_context *context) |
44 { | 44 { |
45 context->cycles += 4 * context->opts->gen.clock_divider; | 45 context->cycles += 4 * context->opts->gen.clock_divider; |
46 write_word(context->scratch2, context->scratch1, context->mem_pointers, &context->opts->gen, context); | 46 write_word(context->scratch2, context->scratch1, (void**)context->mem_pointers, &context->opts->gen, context); |
47 } | 47 } |
48 | 48 |
49 void m68k_sync_cycle(m68k_context *context, uint32_t target_cycle) | 49 void m68k_sync_cycle(m68k_context *context, uint32_t target_cycle) |
50 { | 50 { |
51 context->sync_cycle = target_cycle; //why? | 51 context->sync_cycle = target_cycle; //why? |