Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
mega65.h
Go to the documentation of this file.
1 /* A work-in-progess MEGA65 (Commodore-65 clone origins) emulator
2  Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
3  Copyright (C)2016-2022 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18 
19 #ifndef XEMU_MEGA65_MEGA65_H_INCLUDED
20 #define XEMU_MEGA65_MEGA65_H_INCLUDED
21 
22 // These file names used by the generic Xemu loader. That is, they are searched in
23 // different directories, ie, most notably, in rom/
24 // Real M65 would not expect to have eg the ROM, as it can be loaded from the SD-card,
25 // but it's not the case with Xemu, as you wouldn't have charset either without prior
26 // loading it (however hyppo HICKUP can overwrite "C65 ROM" anyway, later)
27 #define SDCARD_NAME "@mega65.img"
28 
29 #define NVRAM_FILE_NAME "@nvram.bin"
30 #define UUID_FILE_NAME "@uuid.bin"
31 
32 // Used by updater, etc ... base name only, no path info!
33 #define MEGA65_ROM_NAME "MEGA65.ROM"
34 #define MEGA65_ROM_SIZE 0x20000
35 #define CHAR_ROM_NAME "CHARROM.M65"
36 #define CHAR_ROM_SIZE 0x1000
37 
38 // Do *NOT* modify these, as other parts of the emulator currently depends on these values ...
39 #define TEXTURE_FORMAT SDL_PIXELFORMAT_ARGB8888
40 #define USE_LOCKED_TEXTURE 1
41 #define RENDER_SCALE_QUALITY 0
42 
43 #define C64_MHZ_CLOCK 1.0
44 #define C128_MHZ_CLOCK 2.0
45 #define C65_MHZ_CLOCK 3.5
46 // Default fast clock of M65, in MHz (can be overriden with CLI switch)
47 #define MEGA65_DEFAULT_FAST_CLOCK 40.5
48 
49 #define SID_CYCLES_PER_SEC 1000000
50 #define AUDIO_SAMPLE_FREQ 44100
51 
52 extern void m65mon_show_regs ( void );
53 extern void m65mon_dumpmem16 ( Uint16 addr );
54 extern void m65mon_dumpmem28 ( int addr );
55 extern void m65mon_setmem28 ( int addr, int cnt, Uint8* vals );
56 extern void m65mon_set_trace ( int m );
57 extern void m65mon_do_trace ( void );
58 #ifdef TRACE_NEXT_SUPPORT
59 extern void m65mon_next_command ( void );
60 #endif
61 extern void m65mon_empty_command ( void );
62 extern void m65mon_do_trace_c ( void );
63 extern void m65mon_breakpoint ( int brk );
64 
65 extern void machine_set_speed ( int verbose );
66 
67 extern void reset_mega65 ( void );
68 extern int reset_mega65_asked( void );
69 extern void reset_mega65_cpu_only ( void );
70 
71 extern int dump_memory ( const char *fn );
72 
73 extern int newhack;
75 extern Uint8 last_dd00_bits;
76 extern const char *last_reset_type;
77 extern int cpu_cycles_per_step;
78 extern const char *cpu_clock_speed_string;
79 
80 #endif
dump_memory
int dump_memory(const char *fn)
Definition: commodore_65.c:754
machine_set_speed
void machine_set_speed(int verbose)
Definition: mega65.c:101
m65mon_do_trace_c
void m65mon_do_trace_c(void)
m65mon_dumpmem16
void m65mon_dumpmem16(Uint16 addr)
newhack
int newhack
Definition: mega65.c:57
m65mon_show_regs
void m65mon_show_regs(void)
m65mon_breakpoint
void m65mon_breakpoint(int brk)
addr
int addr
Definition: dma65.c:81
fn
const char * fn
Definition: roms.c:42
m65mon_setmem28
void m65mon_setmem28(int addr, int cnt, Uint8 *vals)
reset_mega65_asked
int reset_mega65_asked(void)
Definition: mega65.c:537
Uint8
uint8_t Uint8
Definition: fat32.c:51
last_dd00_bits
Uint8 last_dd00_bits
Definition: mega65.c:85
m65mon_set_trace
void m65mon_set_trace(int m)
reset_mega65
void reset_mega65(void)
Definition: mega65.c:492
m65mon_empty_command
void m65mon_empty_command(void)
m65mon_dumpmem28
void m65mon_dumpmem28(int addr)
cpu_cycles_per_step
int cpu_cycles_per_step
Definition: mega65.c:78
cpu_clock_speed_string
const char * cpu_clock_speed_string
Definition: mega65.c:75
m65mon_do_trace
void m65mon_do_trace(void)
Uint16
uint16_t Uint16
Definition: fat32.c:50
reset_mega65_cpu_only
void reset_mega65_cpu_only(void)
Definition: mega65.c:521
registered_screenshot_request
int registered_screenshot_request
Definition: mega65.c:83
last_reset_type
const char * last_reset_type
Definition: mega65.c:86