Commit Graph

9 Commits

Author SHA1 Message Date
Paul Black ASUS win7 3e2bcea7e8 Added quick support to flash HH85 on BNROM.
Dumped/flashed MMX on SNES v3 boards.
created discrete_exp0_mapper_wr to try and write to mapper but not flash
for discrete boards but doesn't seem to work for some reason so commented
out for now.
2018-04-12 11:21:04 -05:00
Paul Molloy 7e8ad86d3a Big update, have PRG-ROM dumping on NROM working for all devices!
tested and verified on purple, green, and yellow/orange avr kazzos and
stm32 inlretro6 proto, and stm32 adapter with yellow kazzo board

AVR takes ~17.5sec to dump 256KB -> 1:10 for 1MByte = 14.6KBps
STM takes  ~8.5sec to dump 1MByte = 120KBps
STM32 usb driver is far from optimal as it's setup to be minimal with only
8byte endpoint0 to make an effort to align avr and stm.  Larger endpoints
and bulk transfers should greatly speed up stm usb transfers

refactored firmware buffer.c and implemented most of the required opcodes
added check that should cover if device isn't ready for a IN/OUT
transfer.  Does this by usbFunctionSetup returning zero which causes the
device to ignore the host.  Don't think I've got the stm32 usb driver
setup properly to handle this not sure I fully understand Vusb driver
either.  Anyway, hopefully it works well enough for now and keep this in
mind if issues crop up in future.

Still haven't implemented usbFunctionWrite, not sure stm usb driver is
setup properly yet either..

build sizes:
avr yellow/orange: avr-size build_avr/avr_kazzo.elf
   text    data     bss     dec     hex filename
   5602       6     674    6282    188a build_avr/avr_kazzo.elf

previous builds of avr code size was ~6.4KB when flashing and dumping was working.
AVR bootloader is 1.7KB taking up majority of 2KB boot sector.
So AVR has 16KB - 2KB boot = 14KB available, using ~44% of non-boot sector
available flash Have 4 buffers defined, and 512B of raw buffer defined so using
~65% SRAM Making pretty good use of the chip just for basic framework.
Not a ton of room for board/mapper specific routines, so will have to keep this
in mind.  Creating more generic routines to save flash will come with a speed
hit, but perhaps we shouldn't worry too much about that as devices below
really boost speed without even trying.  There is some sizable amount of
SRAM available could perhaps load temporary routines into SRAM and execute
Also have ability to decrease buffer sizes/allocation.  Perhaps routines
could actually be store *IN* the raw buffers.. ;)

stm adapter: arm-none-eabi-size -t build_stm/inlretro_stm.elf
   text    data     bss     dec     hex filename
   7324       0     680    8004    1f44 build_stm/inlretro_stm.elf
Currently targetting STM32F070C6 which has 32KB flash, 6KB SRAM
Could upgrade to STM32F070CB in same LQFP-48 package w/ 128KB/16KB
Don't think that'll be of much value though especially with limitation
on connectors for adapter.
So currently don't have user bootloader, only built in ones.
8KB of 32KB avaiable flash = 25% utilization
680B of 6KB available sram = 11% utilization
32KB device doubles amount of available flash compared to AVR, although
stm32 code isn't quite a condensed compared to AVR.

stm inlretro6: arm-none-eabi-size -t build_stm/inlretro_stm.elf
   text    data     bss     dec     hex filename
   6932       0     680    7612    1dbc build_stm/inlretro_stm.elf
Mostly limited to STM32F070RB as choosing device requiring XTAL, and
desire large number of i/o.  This device provides 128KB flash, 16KB SRAM
Currently using 7.6KB/128KB flash = 6% utilization
Currently using 680B/16KB SRAM = 4.1% utilization
LOTS of room for growth in this device!!  Part of why I choose it over
crystalless 072 version, as it came with more flash for less cost.

Also hardly making use of 1KB of USB dedicated SRAM:
32B buffer table entries
16B endpoint0 IN/OUT
48B of 1024B available = 4.6% utilization
2017-08-07 16:06:23 -05:00
Paul Molloy 895bd6a737 Completely trimmed avr build down to bare bones, only completing
enumeration with host, no vendor/class requests handled.
move avr builds into avr_release dir
move original source files into source/old for future reference.

avr-size avr_kazzo.elf
text    data     bss     dec     hex filename
1496       2      43    1541     605 avr_kazzo.elf
2017-07-22 14:30:03 -05:00
Paul Molloy 876b526e8c Some timing tests on windows machine. Double buffering was pretty
successful only 1KBps speed drop when actually dumping real cart data.
2016-12-12 22:31:46 -06:00
paul eeepc c2359e67a5 Dumps offically working for PRG-ROM on NROM!!!
Found bug with setting map_n_part due to >/< instead of >=/<= for setting called_buff...
Was also setting mem_type and part backwards in dump.c
The had issues with usb timing out for more than 1 buffer read back
Problem was due to lack of usbPoll while dumping during double buffering
Adding usbPoll to page read to correct issue

Appears to be issue with dumping first byte of this choplifter cart I'm testing with.
Not so certain it's my bug though..  No matter what I do the first byte reads
back 0x78 and copy I downloaded has 0x00.  Setting my first byte to 0x00 also
creates proper CRC32 according to bootgod's database.  So need to look into this more
to figure out what's going on.
2016-12-12 00:38:01 -06:00
paul eeepc 4db2929c3b Big overdue commit of past few days effort..
Detecting mirroring code working and tested
Started working on buffer operations from host
Current code compiles but not yet at point where can start testing
Adding cpu page read to nes.c to have faster dumping operations.
moving enums to shared as gets used quite a bit communicating between device and host.
2016-12-11 01:06:41 -06:00
Paul Molloy c6a68c679f Adding EXP0_PULLUP_TEST should probably verify pullup on EXP0 provides
logic 1 if relying on it.  Seems to work fine on NES discrete and
INLXO-ROM boards where planning to utilize it.  SNES can't pull up due to
pulldown and original famicom cart can't either perhaps because of
EXP6 EXP FF output being too much of a load..?
2016-11-27 17:47:40 -06:00
paul eeepc cd6378b8c5 SNES dictionary creation, addition of NES cpu/ppu read/writes
cleaned up firmware pinport.h used PURPLE/GREEN KAZZO for all #ifdef's

AVR Memory Usage
----------------
Device: atmega164a

Program:    3404 bytes (20.8% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)

final kazzo design hex commited as comparable build to the past two commits of green/purple.
So this .hex commit is apples to apples with recently commited purple/green .hex commits.
2016-11-27 15:32:36 -06:00
Paul Molloy 7d00145431 Big step in confirmation of pin manipulations working on kazzo.
Able to read PRG-ROM flash chip's manf and device ID from commandline.

New dictionaries io and nes along with firmware files to support.
now have io_reset, nes_init, and snes_init io.c functions
nes.c functions including discrete_exp0_prgrom_wr and emulate_nes_cpu_rd.

New dictionary.c/.h for host to make dictionary calls easier including
setting proper return data lengths based on opcode.

adding nop command to pinport.h

AVR Memory Usage
----------------
Device: atmega164a

Program:    2960 bytes (18.1% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)
2016-11-27 00:18:46 -06:00