Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
commodore_65.h
Go to the documentation of this file.
1 /* Test-case for simple, work-in-progress Commodore 65 emulator.
2 
3  Part of the Xemu project, please visit: https://github.com/lgblgblgb/xemu
4  Copyright (C)2016-2022 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
5 
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
19 
20 #ifndef XEMU_C65_COMMODORE_65_H_INCLUDED
21 #define XEMU_C65_COMMODORE_65_H_INCLUDED
22 
23 /* Do *NOT* modify these, as other parts of the emulator currently depends on these values ...
24  You can try RENDER_SCALE_QUALITY though with values 0, 1, 2 */
25 #define SCREEN_FORMAT SDL_PIXELFORMAT_ARGB8888
26 #define USE_LOCKED_TEXTURE 1
27 #define RENDER_SCALE_QUALITY 0
28 
29 #define FAST_CPU_CYCLES_PER_SCANLINE 227
30 #define SLOW_CPU_CYCLES_PER_SCANLINE 64
31 
32 #define SID_CYCLES_PER_SEC 1000000
33 #define AUDIO_SAMPLE_FREQ 44100
34 
35 #define DEFAULT_ROM_FILE "#c65-system.rom"
36 
37 // Note: this is a hack, maybe not standard! No REC (Ram Expansion Controller) emulation is involved here ...
38 // it's merely just that the upper 512K of the 1Mbyte addressing space is "free" and can be handled (maybe in a non standard way!) as RAM too ...
39 // It may cause incompatibilities (ie: real REC would allow VIC3 to access REC as well, I think ... It's not the case here. And it's just one example I know about)
40 #define ALLOW_512K_RAMEXP
41 
42 // It's *another* entity like the above, but now at the place where "expansion *ROM*" should be ... It's maybe even *worse* ... [??]
43 // Combined with the 512K, the total RAM size would be 128K (base) + 512K + 256K = 896K, quite nice from a 8 bit machine
44 // Enable only at your own risk!
45 //#define ALLOW_256K_RAMEXP
46 
47 
48 extern Uint8 memory[0x100000];
49 extern char emulator_speed_title[];
51 extern char current_rom_filepath[];
52 
53 extern void apply_memory_config ( void );
54 extern Uint8 io_read ( int addr );
55 extern void io_write ( int addr, Uint8 data );
56 extern void write_phys_mem ( int addr, Uint8 data );
57 extern Uint8 read_phys_mem ( int addr );
58 extern void c65_reset ( void );
59 extern int c65_reset_asked ( void );
60 extern int dump_memory ( const char *fn );
61 extern int c65_load_rom ( const char *fn, unsigned int dma_rev );
62 
63 #endif
memory
Uint8 memory[0x100000]
Definition: commodore_65.c:43
c65_reset_asked
int c65_reset_asked(void)
Definition: commodore_65.c:783
io_write
void io_write(int addr, Uint8 data)
Definition: commodore_65.c:546
emulator_speed_title
char emulator_speed_title[]
Definition: commodore_65.c:78
register_screenshot_request
int register_screenshot_request
Definition: enterprise128.c:54
addr
int addr
Definition: dma65.c:81
fn
const char * fn
Definition: roms.c:42
m65-memcontent-generator.data
data
Definition: m65-memcontent-generator.py:119
Uint8
uint8_t Uint8
Definition: fat32.c:51
write_phys_mem
void write_phys_mem(int addr, Uint8 data)
Definition: commodore_65.c:656
c65_reset
void c65_reset(void)
Definition: commodore_65.c:792
dump_memory
int dump_memory(const char *fn)
Definition: commodore_65.c:754
current_rom_filepath
char current_rom_filepath[]
Definition: commodore_65.c:51
read_phys_mem
Uint8 read_phys_mem(int addr)
Definition: commodore_65.c:692
apply_memory_config
void apply_memory_config(void)
Definition: commodore_65.c:94
c65_load_rom
int c65_load_rom(const char *fn, unsigned int dma_rev)
Definition: commodore_65.c:304
io_read
Uint8 io_read(int addr)
Definition: commodore_65.c:472