diff --git a/snesram.tmproj b/snesram.tmproj index 556e873..b1ae0af 100644 --- a/snesram.tmproj +++ b/snesram.tmproj @@ -2,6 +2,8 @@ + currentDocument + avr/usbload/main.c documents @@ -19,6 +21,194 @@ 271 metaData + avr/usbload/commandline/snesuploader.c + + caret + + column + 0 + line + 200 + + columnSelection + + firstVisibleColumn + 0 + firstVisibleLine + 172 + selectFrom + + column + 0 + line + 195 + + selectTo + + column + 0 + line + 200 + + + avr/usbload/config.h + + caret + + column + 40 + line + 18 + + firstVisibleColumn + 0 + firstVisibleLine + 0 + + avr/usbload/dump.c + + caret + + column + 1 + line + 50 + + firstVisibleColumn + 0 + firstVisibleLine + 0 + + avr/usbload/dump.h + + caret + + column + 0 + line + 2 + + columnSelection + + firstVisibleColumn + 0 + firstVisibleLine + 0 + selectFrom + + column + 0 + line + 0 + + selectTo + + column + 0 + line + 2 + + + avr/usbload/fifo.h + + caret + + column + 0 + line + 0 + + firstVisibleColumn + 0 + firstVisibleLine + 0 + + avr/usbload/main.c + + caret + + column + 22 + line + 25 + + firstVisibleColumn + 0 + firstVisibleLine + 29 + + avr/usbload/requests.h + + caret + + column + 0 + line + 26 + + columnSelection + + firstVisibleColumn + 0 + firstVisibleLine + 0 + selectFrom + + column + 34 + line + 33 + + selectTo + + column + 0 + line + 26 + + + avr/usbload/sram.c + + caret + + column + 0 + line + 0 + + firstVisibleColumn + 0 + firstVisibleLine + 0 + + avr/usbload/watchdog.c + + caret + + column + 20 + line + 0 + + firstVisibleColumn + 0 + firstVisibleLine + 0 + + avr/usbload/watchdog.h + + caret + + column + 0 + line + 19 + + firstVisibleColumn + 0 + firstVisibleLine + 0 + poc/avr_sdcard/fat.h caret @@ -75,7 +265,50 @@ firstVisibleLine 211 + tools/ucon64/2.0/src/backup/snesram.c + + caret + + column + 53 + line + 204 + + firstVisibleColumn + 0 + firstVisibleLine + 164 + + tools/ucon64/2.0/src/backup/snesram.h + + caret + + column + 0 + line + 32 + + firstVisibleColumn + 0 + firstVisibleLine + 19 + + openDocuments + + avr/usbload/dump.c + avr/usbload/sram.c + avr/usbload/main.c + avr/usbload/watchdog.h + avr/usbload/dump.h + avr/usbload/watchdog.c + avr/usbload/config.h + avr/usbload/requests.h + tools/ucon64/2.0/src/backup/snesram.h + avr/usbload/commandline/snesuploader.c + tools/ucon64/2.0/src/backup/snesram.c + avr/usbload/fifo.h + showFileHierarchyDrawer showFileHierarchyPanel @@ -123,7 +356,39 @@ isExpanded subItems - + + ucon64 + + isExpanded + + subItems + + 2.0 + + isExpanded + + subItems + + src + + isExpanded + + subItems + + backup + + isExpanded + + subItems + + + + + + + + + diff --git a/tools/ucon64/2.0/src/backup/snesram.c b/tools/ucon64/2.0/src/backup/snesram.c index 21f11f9..8d05d72 100644 --- a/tools/ucon64/2.0/src/backup/snesram.c +++ b/tools/ucon64/2.0/src/backup/snesram.c @@ -33,13 +33,18 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #endif #include "misc/getopt2.h" // st_getopt2_t #include "misc/file.h" +#include "misc/opendevice.h" + + #include "ucon64.h" #include "ucon64_misc.h" #include "ffe.h" #include "smc.h" #include "snesram.h" -#include "../misc/opendevice.h" +#include "console/snes.h" + +#define SNES_HEADER_LEN (sizeof (st_snes_header_t)) const st_getopt2_t snesram_usage[] = { @@ -85,8 +90,9 @@ snesram_write_rom (const char *filename) uint8_t bank_cnt = 0; uint16_t bank_shift; uint32_t bank_size; - uint32_t hirom; + uint32_t hirom = 0; uint8_t byte = 0; + st_rominfo_t rominfo; usb_init(); @@ -111,15 +117,19 @@ snesram_write_rom (const char *filename) fprintf (stderr, ucon64_msg[FILE_BUFFER_ERROR], READ_BUFFER_SIZE); exit (1); } + + snes_init (&rominfo); + printf(rominfo.misc); + printf("\n"); - if (UCON64_ISSET (ucon64.snes_hirom)) { + if (UCON64_ISSET (ucon64.snes_hirom)) hirom = ucon64.snes_hirom ? 1 : 0; - } else { - fseek (file, 0x00ffd5, SEEK_SET); - fread(&byte, 1, 1, file); - hirom = ((byte & 1 && byte != 0x23) || byte == 0x3a) ? 1 : 0; // & 1 => 0x21, 0x31, 0x35 + else { + hirom = snes_get_snes_hirom (); } - printf("Hirom: %i\n",hirom); + + + if (hirom) { bank_shift = SNES_HIROM_SHIFT; bank_size = 1 << SNES_HIROM_SHIFT; diff --git a/tools/ucon64/2.0/src/console/snes.c b/tools/ucon64/2.0/src/console/snes.c index de2bc87..0bc21fc 100644 --- a/tools/ucon64/2.0/src/console/snes.c +++ b/tools/ucon64/2.0/src/console/snes.c @@ -3261,6 +3261,7 @@ snes_init (st_rominfo_t *rominfo) snes_hirom = 0; if (UCON64_ISSET (ucon64.snes_hirom)) // see snes_set_hirom() snes_hirom = ucon64.snes_hirom; + //ucon64.snes_hirom = snes_hirom; snes_hirom_ok = 1; rominfo->interleaved = 0;