Changeset 4c71d39 in buchla-emu
- Timestamp:
- 07/20/2017 11:37:13 PM (7 years ago)
- Branches:
- master
- Children:
- 9674f1a
- Parents:
- ebc8f69
- Location:
- emu
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
emu/all.h
rebc8f69 r4c71d39 31 31 #define err(...) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); 32 32 33 #define _ver(_v, _t, ...) { \ 34 if (_v > _t) { \ 35 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 36 } \ 37 } 38 33 39 #define fail(...) { \ 34 40 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ … … 38 44 #define ARRAY_COUNT(_a) (int32_t)(sizeof (_a) / sizeof (_a)[0]) 39 45 40 extern boolsdl_verbose;41 extern boolcpu_verbose;42 extern boolfpu_verbose;43 extern boolvid_verbose;44 extern booltim_verbose;45 extern boollcd_verbose;46 extern boolser_verbose;47 extern boolmid_verbose;48 extern boolfdd_verbose;49 extern boolsnd_verbose;50 extern boolled_verbose;51 extern boolkbd_verbose;46 extern int32_t sdl_verbose; 47 extern int32_t cpu_verbose; 48 extern int32_t fpu_verbose; 49 extern int32_t vid_verbose; 50 extern int32_t tim_verbose; 51 extern int32_t lcd_verbose; 52 extern int32_t ser_verbose; 53 extern int32_t mid_verbose; 54 extern int32_t fdd_verbose; 55 extern int32_t snd_verbose; 56 extern int32_t led_verbose; 57 extern int32_t kbd_verbose; 52 58 53 59 extern void sdl_init(void); -
emu/cpu.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (cpu_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 25 26 bool cpu_verbose = false; 20 #define ver(...) _ver(cpu_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(cpu_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(cpu_verbose, 2, __VA_ARGS__) 23 24 int32_t cpu_verbose = 0; 27 25 28 26 #define CPU_FREQ 7000000 … … 195 193 uint32_t m68k_read_memory_8(uint32_t addr) 196 194 { 197 ver ("mem rd 0x%08x:8", addr);195 ver3("mem rd 0x%08x:8", addr); 198 196 199 197 if (addr >= ram_ro_beg && addr <= ram_ro_end - 1) { … … 229 227 uint32_t m68k_read_memory_16(uint32_t addr) 230 228 { 231 ver ("mem rd 0x%08x:16", addr);229 ver3("mem rd 0x%08x:16", addr); 232 230 233 231 if (addr >= ram_ro_beg && addr <= ram_ro_end - 2) { … … 273 271 uint32_t m68k_read_memory_32(uint32_t addr) 274 272 { 275 ver ("mem rd 0x%08x:32", addr);273 ver3("mem rd 0x%08x:32", addr); 276 274 277 275 if (reset) { … … 341 339 void m68k_write_memory_8(uint32_t addr, uint32_t val) 342 340 { 343 ver ("mem wr 0x%08x:8 0x%02x", addr, val);341 ver3("mem wr 0x%08x:8 0x%02x", addr, val); 344 342 345 343 if (addr >= ram_rw_beg && addr <= ram_rw_end - 1) { … … 371 369 void m68k_write_memory_16(uint32_t addr, uint32_t val) 372 370 { 373 ver ("mem wr 0x%08x:16 0x%04x", addr, val);371 ver3("mem wr 0x%08x:16 0x%04x", addr, val); 374 372 375 373 if (addr >= ram_rw_beg && addr <= ram_rw_end - 2) { … … 404 402 void m68k_write_memory_32(uint32_t addr, uint32_t val) 405 403 { 406 ver ("mem wr 0x%08x:32 0x%08x", addr, val);404 ver3("mem wr 0x%08x:32 0x%08x", addr, val); 407 405 408 406 if (addr >= ram_rw_beg && addr <= ram_rw_end - 4) { -
emu/fdd.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (fdd_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(fdd_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(fdd_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(fdd_verbose, 2, __VA_ARGS__) 25 23 26 bool fdd_verbose = false;24 int32_t fdd_verbose = 0; 27 25 28 26 void fdd_init(void) … … 38 36 void fdd_exec(void) 39 37 { 40 ver ("fdd exec");38 ver3("fdd exec"); 41 39 } 42 40 43 41 uint32_t fdd_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("fdd rd %u:%d", off, sz * 8);43 ver2("fdd rd %u:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void fdd_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("fdd wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("fdd wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/fpu.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (fpu_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(fpu_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(fpu_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(fpu_verbose, 2, __VA_ARGS__) 25 23 26 bool fpu_verbose = false;24 int32_t fpu_verbose = 0; 27 25 28 26 void fpu_init(void) … … 38 36 void fpu_exec(void) 39 37 { 40 ver ("fpu exec");38 ver3("fpu exec"); 41 39 } 42 40 43 41 uint32_t fpu_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("fpu rd 0x%04x:%d", off, sz * 8);43 ver2("fpu rd 0x%04x:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void fpu_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("fpu wr 0x%04x:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("fpu wr 0x%04x:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/kbd.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (kbd_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(kbd_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(kbd_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(kbd_verbose, 2, __VA_ARGS__) 25 23 26 bool kbd_verbose = false;24 int32_t kbd_verbose = 0; 27 25 28 26 void kbd_init(void) … … 38 36 void kbd_exec(void) 39 37 { 40 ver ("kbd exec");38 ver3("kbd exec"); 41 39 } 42 40 43 41 uint32_t kbd_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("kbd rd %u:%d", off, sz * 8);43 ver2("kbd rd %u:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void kbd_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("kbd wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("kbd wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/lcd.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (lcd_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(lcd_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(lcd_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(lcd_verbose, 2, __VA_ARGS__) 25 23 26 bool lcd_verbose = false;24 int32_t lcd_verbose = 0; 27 25 28 26 void lcd_init(void) … … 38 36 void lcd_exec(void) 39 37 { 40 ver ("lcd exec");38 ver3("lcd exec"); 41 39 } 42 40 43 41 uint32_t lcd_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("lcd rd %u:%d", off, sz * 8);43 ver2("lcd rd %u:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void lcd_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("lcd wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("lcd wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/led.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (led_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(led_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(led_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(led_verbose, 2, __VA_ARGS__) 25 23 26 bool led_verbose = false;24 int32_t led_verbose = 0; 27 25 28 26 void led_init(void) … … 38 36 void led_exec(void) 39 37 { 40 ver ("led exec");38 ver3("led exec"); 41 39 } 42 40 43 41 uint32_t led_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("led rd %u:%d", off, sz * 8);43 ver2("led rd %u:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void led_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("led wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("led wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/main.c
rebc8f69 r4c71d39 20 20 typedef struct { 21 21 const char *name; 22 bool*flag;22 int32_t *flag; 23 23 } verb_flag_t; 24 24 … … 82 82 if (strcmp(argv[i], "all") == 0) { 83 83 for (k = 0; k < ARRAY_COUNT(verb_flags); ++k) { 84 *verb_flags[k].flag = true;84 ++*verb_flags[k].flag; 85 85 } 86 86 … … 90 90 for (k = 0; k < ARRAY_COUNT(verb_flags); ++k) { 91 91 if (strcmp(argv[i], verb_flags[k].name) == 0) { 92 *verb_flags[k].flag = true;92 ++*verb_flags[k].flag; 93 93 break; 94 94 } -
emu/mid.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (mid_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(mid_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(mid_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(mid_verbose, 2, __VA_ARGS__) 25 23 26 bool mid_verbose = false;24 int32_t mid_verbose = 0; 27 25 28 26 void mid_init(void) … … 38 36 void mid_exec(void) 39 37 { 40 ver ("mid exec");38 ver3("mid exec"); 41 39 } 42 40 43 41 uint32_t mid_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("mid rd %u:%d", off, sz * 8);43 ver2("mid rd %u:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void mid_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("mid wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("mid wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/sdl.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 boolsdl_verbose = false;20 int32_t sdl_verbose = false; 21 21 22 #define ver(...) { \ 23 if (sdl_verbose) { \ 24 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 25 } \ 26 } 22 #define ver(...) _ver(sdl_verbose, 0, __VA_ARGS__) 23 #define ver2(...) _ver(sdl_verbose, 1, __VA_ARGS__) 24 #define ver3(...) _ver(sdl_verbose, 2, __VA_ARGS__) 27 25 28 26 void sdl_init(void) -
emu/ser.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (ser_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(ser_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(ser_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(ser_verbose, 2, __VA_ARGS__) 25 23 26 bool ser_verbose = false;24 int32_t ser_verbose = 0; 27 25 28 26 void ser_init(void) … … 38 36 void ser_exec(void) 39 37 { 40 ver ("ser exec");38 ver3("ser exec"); 41 39 } 42 40 43 41 uint32_t ser_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("ser rd %u:%d", off, sz * 8);43 ver2("ser rd %u:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void ser_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("ser wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("ser wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/snd.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (snd_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(snd_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(snd_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(snd_verbose, 2, __VA_ARGS__) 25 23 26 bool snd_verbose = false;24 int32_t snd_verbose = 0; 27 25 28 26 void snd_init(void) … … 38 36 void snd_exec(void) 39 37 { 40 ver ("snd exec");38 ver3("snd exec"); 41 39 } 42 40 43 41 uint32_t snd_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("snd rd %u:%d", off, sz * 8);43 ver2("snd rd %u:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void snd_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("snd wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("snd wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/tim.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (tim_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(tim_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(tim_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(tim_verbose, 2, __VA_ARGS__) 25 23 26 bool tim_verbose = false;24 int32_t tim_verbose = 0; 27 25 28 26 void tim_init(void) … … 38 36 void tim_exec(void) 39 37 { 40 ver ("tim exec");38 ver3("tim exec"); 41 39 } 42 40 43 41 uint32_t tim_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("tim rd %u:%d", off, sz * 8);43 ver2("tim rd %u:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void tim_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("tim wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("tim wr %u:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 } -
emu/vid.c
rebc8f69 r4c71d39 18 18 #include <all.h> 19 19 20 #define ver(...) { \ 21 if (vid_verbose) { \ 22 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \ 23 } \ 24 } 20 #define ver(...) _ver(vid_verbose, 0, __VA_ARGS__) 21 #define ver2(...) _ver(vid_verbose, 1, __VA_ARGS__) 22 #define ver3(...) _ver(vid_verbose, 2, __VA_ARGS__) 25 23 26 bool vid_verbose = false;24 int32_t vid_verbose = 0; 27 25 28 26 void vid_init(void) … … 38 36 void vid_exec(void) 39 37 { 40 ver ("vid exec");38 ver3("vid exec"); 41 39 } 42 40 43 41 uint32_t vid_read(uint32_t off, int32_t sz) 44 42 { 45 ver ("vid rd 0x%05x:%d", off, sz * 8);43 ver2("vid rd 0x%05x:%d", off, sz * 8); 46 44 return 0; 47 45 } … … 49 47 void vid_write(uint32_t off, int32_t sz, uint32_t val) 50 48 { 51 ver ("vid wr 0x%05x:%d 0x%0*x", off, sz * 8, sz * 2, val);49 ver2("vid wr 0x%05x:%d 0x%0*x", off, sz * 8, sz * 2, val); 52 50 }
Note:
See TracChangeset
for help on using the changeset viewer.