abelykh0 / esp32-z80emu

Spectrum ZX Emulator on ESP32 VGA32 board
30 stars 4 forks source link

Error loading version 1 .z80 files #2

Open fg1998 opened 3 years ago

fg1998 commented 3 years ago

I Got some errors trying to load .z80 files

1 - If you dont have the .scr file in / directory, I got an exception after press F3 key

2 - With .scr files in / (with .z80 files also) I got another exceptions after press ENTER

TTGO VGA32_V1.4

-------------------------- CUT HERE -------------------------

Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled. Core 0 register dump: PC : 0x40102b7d PS : 0x00060430 A0 : 0x800d28a6 A1 : 0x3ffb9090
A2 : 0xdd3fe600 A3 : 0x00000000 A4 : 0x00000001 A5 : 0x00000001
A6 : 0x00060220 A7 : 0x00000000 A8 : 0x8008b668 A9 : 0x3ffb90a0
A10 : 0x00000003 A11 : 0x00060423 A12 : 0x00060420 A13 : 0x00000001
A14 : 0x00060223 A15 : 0x00000000 SAR : 0x00000013 EXCCAUSE: 0x0000001c
EXCVADDR: 0xdd3fe600 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

Backtrace: 0x40102b7d:0x3ffb9090 0x400d28a3:0x3ffb90b0 0x400d5105:0x3ffb90e0 0x400d55c9:0x3ffb9110 0x400e4dd2:0x3ffb9150 0x400e30d0:0x3ffb9170 0x400e4653:0x3ffb91b0 0x400e61aa:0x3ffb91e0 0x4000bdbb:0x3ffb9200 0x40001125:0x3ffb9220 0x400594e9:0x3ffb9240 0x400e8671:0x3ffb9260 0x400e86e1:0x3ffb9290 0x400fc487:0x3ffb92b0 0x40102617:0x3ffb92d0 0x400d70f9:0x3ffb92f0 0x400d1fbd:0x3ffb9340 0x400d268f:0x3ffb9390 0x4008a799:0x3ffb93b0

Rebooting... in setup() ]

----------------------------------- CUT HERE -----------------------------

PC: 0x40102b7d: std::find_if > >(unsigned int , unsigned int , __gnu_cxx::ops::_Iter_pred >, std::random_access_iterator_tag) at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h line 133 EXCVADDR: 0xdd3fe600

Decoding stack results 0x40102b7d: std::find_if > >(unsigned int , unsigned int , __gnu_cxx::ops::_Iter_pred >, std::random_access_iterator_tag) at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h line 133 0x400d28a3: SPIClass::transfer(unsigned char) at C:\users\fgarcia.platformio\packages\framework-arduinoespressif32\libraries\SPI\src\SPI.cpp line 158 0x400d5105: sdDeselectCard(unsigned char) at C:\users\fgarcia.platformio\packages\framework-arduinoespressif32\libraries\SD\src\sd_diskio.cpp line 85 0x400d55c9: sdWriteSector(unsigned char, char const, unsigned long long) at C:\users\fgarcia.platformio\packages\framework-arduinoespressif32\libraries\SD\src\sd_diskio.cpp line 275 0x400e4dd2: get_fattime at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/fatfs/src/diskio.c line 92 0x400e30d0: f_write at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/fatfs/src/ff.c line 3848 0x400e4653: vfs_fat_link at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/fatfs/src/vfs_fat.c line 521 0x400e61aa: esp_vfs_close at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/vfs/vfs.c line 464 0x400e8671: fseek at ../../../.././newlib/libc/stdio/fseek.c line 126 0x400e86e1: _fseeko_r at ../../../.././newlib/libc/stdio/fseeko.c line 154 0x400fc487: VFSFileImpl::VFSFileImpl(VFSImpl, char const, char const) at C:\users\fgarcia.platformio\packages\framework-arduinoespressif32\libraries\FS\src\vfs_api.cpp line 236 0x400d70f9: zx::LoadZ80Snapshot(fs::File, unsigned char, unsigned char) at lib\Emulator\z80snapshot.cpp line 343 0x400d1fbd: loadSnapshotLoop() at src\FileSystem.cpp line 492 0x400d268f: EmulatorTaskMain(void*) at src\emulator.cpp line 338 0x4008a799: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143

abelykh0 commented 3 years ago

Can you send me all the files (minimum needed to replicate) you have on the SD Card somewhere (Google Drive), please?

fg1998 commented 3 years ago

Andrey, thanks for replying

As you request: https://1drv.ms/u/s!Ak5SrLl32GGRjexs2a1S8j9GKIadGQ?e=zoZSQt

There are 2 files - files.zip (only the files i´m using) and img.rar (an 8Gb disk image created with win32img)

[]´s

abelykh0 commented 3 years ago

Thanks! I was able to replicate. Will work on the fix tomorrow.

abelykh0 commented 3 years ago

I did a bunch of fixes. All of the files you sent me work now. There is one use case that is not covered, I would appreciate if you could try some more files in this format to get an error. My emulator only saves as version 3.