|
Xemu [doxygen]
hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
|
Go to the documentation of this file.
42 static int bigmult_valid_result = 0;
46 static const Uint8 fpga_firmware_version[] = {
'X',
'e',
'm',
'u' };
47 static const Uint8 cpld_firmware_version[] = {
'N',
'o',
'w',
'!' };
50 #define RETURN_ON_IO_READ_NOT_IMPLEMENTED(func, fb) \
51 do { DEBUG("IO: NOT IMPLEMENTED read (emulator lacks feature), %s $%04X fallback to answer $%02X" NL, func, addr, fb); \
52 return fb; } while (0)
53 #define RETURN_ON_IO_WRITE_NOT_IMPLEMENTED(func) \
54 do { DEBUG("IO: NOT IMPLEMENTED write (emulator lacks feature), %s $%04X with data $%02X" NL, func, addr, data); \
58 static XEMU_INLINE void update_hw_multiplier (
void )
60 register const Uint32 input_a = xemu_u8p_to_u32le(
D7XX + 0x70);
61 register const Uint32 input_b = xemu_u8p_to_u32le(
D7XX + 0x74);
65 bigmult_valid_result = 1;
67 xemu_u64le_to_u8p(
D7XX + 0x78, (Uint64)input_a * (Uint64)input_b);
72 xemu_u64le_to_u8p(
D7XX + 0x68, (Uint64)((Uint64)input_a << 32) / (Uint64)input_b);
79 memset(
D7XX + 0x68, 0xFF, 8);
143 switch (
addr & 0x5F) {
156 if ((
addr & 0xF0) == 0xE0)
164 "Not upgraded yet, it can do it|Already upgraded, I test hicked state",
165 "HICKUP asks hypervisor upgrade state. What do you want Xemu to answer?\n"
166 "(don't worry, it won't be asked again without RESET)"
193 return fpga_firmware_version[
addr - 0x32];
198 return cpld_firmware_version[
addr - 0x2C];
215 update_hw_multiplier();
268 case 0x20:
case 0x21:
case 0x22:
case 0x23:
case 0x24:
case 0x25:
case 0x26:
case 0x27:
269 case 0x28:
case 0x29:
case 0x2A:
case 0x2B:
case 0x2C:
case 0x2D:
case 0x2E:
case 0x2F:
272 FATAL(
"Xemu internal error: undecoded I/O area reading for address $(%X)%03X",
addr >> 8,
addr & 0xFFF);
288 DEBUG(
"RMW: I/O internal addr %04X old data %02X new data %02X" NL,
addr, old_data,
data);
358 if ((
addr & 0xFF) == 0x07) {
383 if ((
addr & 0xF0) == 0xE0) {
408 DEBUG(
"MEGA65: enhanced opcodes have been turned %s." NL,
data & 2 ?
"ON" :
"OFF");
412 DEBUG(
"MEGA65: ROM protection has been turned %s." NL,
data & 4 ?
"ON" :
"OFF");
418 DEBUG(
"MEGA65: Writing already-hicked register $%04X!" NL,
addr);
426 if (
ARE_YOU_SURE(
"FPGA reconfiguration request. System must be reset.\nIs it OK to do now?\nAnswering NO may crash your program requesting this task though,\nor can result in endless loop of trying.",
ARE_YOU_SURE_DEFAULT_YES)) {
432 DEBUG(
"MEGA65: this I/O port is not emulated in Xemu yet: $D6%02X (tried to be written with $%02X)" NL,
addr,
data);
446 else if (
addr >= 0x68 &&
addr <= 0x7F)
447 bigmult_valid_result = 0;
516 case 0x20:
case 0x21:
case 0x22:
case 0x23:
case 0x24:
case 0x25:
case 0x26:
case 0x27:
517 case 0x28:
case 0x29:
case 0x2A:
case 0x2B:
case 0x2C:
case 0x2D:
case 0x2E:
case 0x2F:
520 FATAL(
"Xemu internal error: undecoded I/O area writing for address $(%X)%03X and data $%02X",
addr >> 8,
addr & 0xFFF,
data);
Uint8 vic_read_reg(int unsigned addr)
Uint8 cia_read(struct Cia6526 *cia, int addr)
void io_dma_writer(int addr, Uint8 data)
Uint8 fdc_read_reg(int addr)
void eth65_write_reg(int addr, Uint8 data)
void io_write(unsigned int addr, Uint8 data)
void vic4_write_palette_reg_green(unsigned int num, Uint8 data)
void sdcard_write_register(int reg, Uint8 data)
void vic3_write_palette_reg_blue(unsigned int num, Uint8 data)
void vic3_write_palette_reg_green(unsigned int num, Uint8 data)
#define RETURN_ON_IO_READ_NOT_IMPLEMENTED(func, fb)
Uint8 vic4_read_palette_reg_green(unsigned int num)
Uint8 io_dma_reader(int addr)
Uint8 vic4_read_palette_reg_red(unsigned int num)
Uint8 * disk_buffer_io_mapped
void hypervisor_leave(void)
void matrix_mode_toggle(int status)
void hypervisor_debug_invalidate(const char *reason)
struct configdb_st configdb
void fdc_write_reg(int addr, Uint8 data)
void dma_write_reg(int addr, Uint8 data)
Uint8 sdcard_read_register(int reg)
#define RETURN_ON_IO_WRITE_NOT_IMPLEMENTED(func)
void vic_write_reg(unsigned int addr, Uint8 data)
void hypervisor_serial_monitor_push_char(Uint8 chr)
Uint8 dma_read_reg(int addr)
Uint8 D6XX_registers[0x100]
void vic4_write_palette_reg_blue(unsigned int num, Uint8 data)
void vic4_write_palette_reg_red(unsigned int num, Uint8 data)
void audio65_sid_write(const int addr, const Uint8 data)
#define QUESTION_WINDOW(items, msg)
Uint8 vic4_read_palette_reg_blue(unsigned int num)
void vic3_write_palette_reg_red(unsigned int num, Uint8 data)
Uint8 io_read(unsigned int addr)
void hypervisor_enter_via_write_trap(int trapno)
Uint8 vic_registers[0x80]
Uint8 eth65_read_reg(int addr)
void cia_write(struct Cia6526 *cia, int addr, Uint8 data)