Update config_file.c, amiga-platform.c, and 3 more files...

This commit is contained in:
beeanyew
2021-05-06 21:26:58 +02:00
parent 51dbac7618
commit d09a3356ce
5 changed files with 8 additions and 8 deletions

View File

@@ -235,6 +235,8 @@ void add_mapping(struct emulator_config *cfg, unsigned int type, unsigned int ad
fread(cfg->map_data[index], cfg->rom_size[index], 1, in);
fclose(in);
displayRomInfo(cfg->map_data[index]);
if (cfg->map_size[index] == cfg->rom_size[index])
m68k_add_rom_range(cfg->map_offset[index], cfg->map_high[index], cfg->map_data[index]);
break;
case MAPTYPE_REGISTER:
default:
@@ -242,8 +244,6 @@ void add_mapping(struct emulator_config *cfg, unsigned int type, unsigned int ad
}
printf("[CFG] [MAP %d] Added %s mapping for range %.8lX-%.8lX ID: %s\n", index, map_type_names[type], cfg->map_offset[index], cfg->map_high[index] - 1, cfg->map_id[index] ? cfg->map_id[index] : "None");
if (cfg->map_size[index] == cfg->rom_size[index])
m68k_add_rom_range(cfg->map_offset[index], cfg->map_high[index], cfg->map_data[index]);
return;

View File

@@ -379,7 +379,7 @@ void setvar_amiga(struct emulator_config *cfg, char *var, char *val) {
cdtv_mode = 1;
}
if (strcmp(var, "rtg") == 0 && !rtg_enabled) {
if (init_rtg_data()) {
if (init_rtg_data(cfg)) {
printf("[AMIGA] RTG Enabled.\n");
rtg_enabled = 1;
adjust_ranges_amiga(cfg);

View File

@@ -209,7 +209,7 @@ void handle_pistorm_dev_write(uint32_t addr_, uint32_t val, uint8_t type) {
case PI_CMD_RTGSTATUS:
DEBUG("[PISTORM-DEV] Write to RTGSTATUS: %d\n", val);
if (val == 1 && !rtg_enabled) {
init_rtg_data();
init_rtg_data(cfg);
rtg_enabled = 1;
pi_cmd_result = PI_RES_OK;
} else if (val == 0 && rtg_enabled) {

View File

@@ -6,8 +6,8 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "rtg.h"
#include "config_file/config_file.h"
#include "rtg.h"
uint8_t rtg_u8[4];
uint16_t rtg_x[8], rtg_y[8];
@@ -52,7 +52,7 @@ static const char *rtg_format_names[RTGFMT_NUM] = {
"15BPP RGB (555)",
};
*/
int init_rtg_data() {
int init_rtg_data(struct emulator_config *cfg_) {
rtg_mem = calloc(1, 40 * SIZE_MEGA);
if (!rtg_mem) {
printf("Failed to allocate RTG video memory.\n");
@@ -60,7 +60,7 @@ int init_rtg_data() {
}
m68k_add_ram_range(PIGFX_RTG_BASE + PIGFX_REG_SIZE, PIGFX_RTG_SIZE - PIGFX_REG_SIZE, rtg_mem);
add_mapping(cfg, MAPTYPE_RAM_NOALLOC, PIGFX_RTG_BASE + PIGFX_REG_SIZE, PIGFX_RTG_SIZE - PIGFX_REG_SIZE, -1, rtg_mem, "rtg_mem");
add_mapping(cfg_, MAPTYPE_RAM_NOALLOC, PIGFX_RTG_BASE + PIGFX_REG_SIZE, PIGFX_RTG_SIZE - PIGFX_REG_SIZE, -1, (char *)rtg_mem, "rtg_mem");
return 1;
}

View File

@@ -19,7 +19,7 @@ void rtg_shutdown_display();
unsigned int rtg_get_fb();
int init_rtg_data();
int init_rtg_data(struct emulator_config *cfg);
void shutdown_rtg();
void rtg_fillrect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t color, uint16_t pitch, uint16_t format, uint8_t mask);