Don't use "pre made" EEPROM content, just fill it with 0, it works fine for now.

Also set the "system" at a proper time
And set the correct (?) size for EEPROM
This commit is contained in:
Godzil 2019-09-04 15:11:26 +01:00
parent 80253e2cd6
commit ea6bfacb66
5 changed files with 29 additions and 15 deletions

View File

@ -778,11 +778,11 @@ int main(int argc, char *argv[])
if (ws_rom_path)
{
ws_set_system(ws_system);
if (ws_init(ws_rom_path))
{
app_rotated=ws_rotated();
app_gameRunning=1;
ws_set_system(ws_system);
if (ws_system == WS_SYSTEM_COLOR)
{

View File

@ -932,6 +932,10 @@ void cpu_writeport(DWORD port,BYTE value)
iee_Databuffer = internalEeprom[address];
printf(" Data : %04X\n", iee_Databuffer);
}
else
{
printf(" Unknown value: %02X\n", value);
}
fflush(stdout);
}
break;

View File

@ -27,7 +27,6 @@
#include "gpu.h"
#include "audio.h"
#include "memory.h"
#include "ieeprom.h"
////////////////////////////////////////////////////////////////////////////////
//
@ -42,7 +41,6 @@
////////////////////////////////////////////////////////////////////////////////
#define IO_ROM_BANK_BASE_SELECTOR 0xC0
uint8 *ws_rom;
uint8 *ws_staticRam;
uint8 *internalRam;
@ -264,10 +262,12 @@ char *load_file(char *filename)
//
//
////////////////////////////////////////////////////////////////////////////////
char *create_file(char *filename, uint32_t size, uint8_t *data)
char *create_file(char *filename, uint32_t size)
{
int fd;
uint32_t i;
char *ret_ptr;
char buf[] = { 0 };
printf("Trying to create %s, size = %u...\n",filename, size);
fd = open(filename, O_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH | O_TRUNC);
@ -277,7 +277,11 @@ char *create_file(char *filename, uint32_t size, uint8_t *data)
fd = open(filename, O_RDWR);
write(fd, data, size);
for(i = 0; i < size; i++)
{
write(fd, buf, 1);
}
close(fd);
sync();
@ -324,13 +328,13 @@ void ws_memory_init(uint8 *rom, uint32 wsRomSize)
internalBWEeprom = load_file("ws_ieeprom.bin");
if ( internalBWEeprom == NULL )
{
internalBWEeprom = create_file("ws_ieeprom.bin", BW_IEEPROM_SIZE, DefaultBWEEprom);
internalBWEeprom = create_file("ws_ieeprom.bin", BW_IEEPROM_SIZE);
}
internalColorEeprom = load_file("wsc_ieeprom.bin");
if ( internalColorEeprom == NULL )
{
internalColorEeprom = create_file("wsc_ieeprom.bin", COLOR_IEEPROM_SIZE, DefaultColorEEprom);
internalColorEeprom = create_file("wsc_ieeprom.bin", COLOR_IEEPROM_SIZE);
}
internalEeprom = (uint16_t *)internalBWEeprom;

View File

@ -30,8 +30,8 @@ void ws_sram_save(char *path);
void dump_memory();
#define BW_IEEPROM_SIZE (1024)
#define COLOR_IEEPROM_SIZE (1024)
#define BW_IEEPROM_SIZE (128)
#define COLOR_IEEPROM_SIZE (2048)
#endif

View File

@ -55,6 +55,8 @@ uint32 vblank_count=0;
char *ws_sram_path = NULL;
extern int ws_sram_dirty;
extern int ws_gpu_forceColorSystemBool;
extern int ws_gpu_forceMonoSystemBool;
////////////////////////////////////////////////////////////////////////////////
//
@ -118,13 +120,17 @@ int ws_init(char *rompath)
return(0);
}
if (rompath[strlen(rompath)-1]=='c')
if ((ws_gpu_forceColorSystemBool == 0) && (ws_gpu_forceMonoSystemBool == 0))
{
ws_gpu_operatingInColor=1;
}
else
{
ws_gpu_operatingInColor=0;
/* Nothing forced try to "auto detect" */
if (rompath[strlen(rompath)-1]=='c')
{
ws_gpu_operatingInColor=1;
}
else
{
ws_gpu_operatingInColor=0;
}
}
ws_memory_init(rom,romSize);