Commit Graph

69 Commits

Author SHA1 Message Date
Paul Molloy 3326c2fb34 payload buffers working with some early testing.
Had a good lesson on what static means... :/
everything working now as previously designed
speed testing on windows10 PC yeilded ~21KBps when transferring 128-512KB
payloads and 128Byte transfer size.  Going to bump to 256 and see how that
does after 128KB speed tests on linux machine.

created host test.c/.h file for general testing of new features.
that way I can start working on erase/write.h files and just use test.c as
scratch code space for tinkering and still call with -t flag on command
line.

modified dictionary calls to include pointers to data and lengths.
2016-11-29 18:27:54 -06:00
paul eeepc cb0941e86c usbFunctionWrite support loading incoming write/OUT data to buffer objects.
Still untested, need to write some host code to test things out.
2016-11-29 15:27:31 -06:00
Paul Molloy 80943f7f62 firmware buffer.c reorganization and some intitial testing complete.
moved all buffer operations out of usb.c with new bridge function between
the two files.  Lots of pointing going on and lessons learned..
Thankfully everything seems to be working if you actually call the
functions as I designed them..  Gotta love trouble shooting bugs that
don't exist..  Helped updating allocate output to get returned as error
back to the host.

Moved typedef structs to firmware type.h file as seemed to cause
compilation issues being contained in the files .h file when other .c
files needed those types.

Fixed casting warnings with usbMsgPtr ended up looking at usbdrv.c figured
out how close I got, just shouldn't have been putting the * in there..
2016-11-28 22:16:35 -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
paul eeepc 94ea3fd474 modified: host/source/inlprog.c
new file:   host/source/erase.c
new file:   host/source/erase.h
	creating erase files called from main with e_flag

modified:   firmware/source/usb.c
	introducing switch statement with range of values of opcode type detection.

modified:   host/source/usb_operations.h
	turning off debug

modified:   shared/shared_errors.h
	renumbering some error codes
	thinking I'll have codes which can come from avr set to 128+
2016-11-26 14:17:34 -06:00
paul eeepc dae63f73b0 Tons of edits...
rearranged some of the .h files, created dictionary file to list all dictionaries of opcodes.
        moved error codes to shared file so host can interpret firmware error codes.
        created firmware usb.c/h to handle usb operations (didn't move as git seems to think..)
	cleaned up fw main function and file.
	host usb_operations, created USBrequest struct type to more easily handle all transfer info.

Currently able to send pinport commands and read back return values from retro prog.
Just need to start writting functions to send opcodes and start actually preforming some cartridge operations.
2016-11-25 19:50:43 -06:00
Paul Molloy 31678bacfe renamed: host/source/pinport.h -> shared/shared_pinport.h
modified:   firmware/source/pinport.c
modified:   firmware/source/pinport.h
	-creating shared_pinport.h which is effectively a dictionary for
	pinport opcodes
	-file gets copied to host and firmware source dirs when compilied.
	-hardware macros had to be renamed to include underscore to
	differentiate opcode name from hardware macro.
	-pinport.c now is a nice clean switch between opcode name and
	macro with all literal numbers removed.
	-now don't have to manually track/update opcode numbers between
	multiple locations.

modified:   firmware/source/io.c
modified:   firmware/source/main.c
	-updates to add underscore pre-fix to hardware macros.
2016-11-23 18:12:50 -06:00
Paul Molloy 27cca679d5 new file: pinport.h
-created from firmware/source/pinport.c
	-macros to create opcodes which will get sent as commands over USB
	-they will then get interpreted by pinport.c in firmware.
2016-11-23 03:05:29 -06:00
paul eeepc 70e700c7e8 Prepending 'shared' to files in shared folder to make more clear that these files should only be edited from the shared folder as they're copied into source folder at compile time. Any edits from source folder will get stopped, and committing shared files outside of shared folder is not desired. 2016-11-22 00:52:06 -06:00
Paul Molloy b8be4b768a new file: shared/usb_commands.h
-shared .h files used in both firmware and host app
modified:   firmware/Makefile
modified:   host/Makefile
	-added shared dependency to copy shared files to source prior to
	building
modified:   host/source/usb_operations.h
modified:   firmware/source/main.c
	-removing usb commands (now in shared)
modified:   host/include/dbg.h
	-adding SUCCESS defintion
modified:   host/source/inlprog.c
	-calling write file if write arg sent
new file:   host/source/write_operations.c
new file:   host/source/write_operations.h
	-creation of write operations files
	-opens file and reads header
	-some skeleton comments
	-lots of work left to do here
new file:   roms/nrom_v_test.nes
	-adding NROM test rom file
2016-11-20 23:57:09 -06:00
paul eeepc cfffe554be modified: source/inlprog.c
-introducing getopt to obtain commandline args
modified:   source/usb_operations.c
	-moving USB defn comments in from main
2016-11-20 15:43:11 -06:00
paul eeepc 4cbeff1ecf modified: source/inlprog.c
- removing compile errors
	- fixing request/command for off (was always sending on copy paste error)
modified:   source/usb_operations.c
	- Adding checks beyond VID/PID pair
	- Now check Manufacturer, Product, and build version
	- Give Warnings/Error if device is not supported
	- Don't blindly accept and try to write to non-supported devices.
	- Cleared up confusion on ENDPOINT direction.
2016-11-19 23:58:47 -06:00
Paul Molloy 49c9876770 modified: source/inlprog.c
modified:   source/usb_operations.c
modified:   source/usb_operations.h
	-moving usb transfer operation to usb_operations
2016-11-19 21:32:54 -06:00
Paul Molloy 782ed343f7 modified: source/inlprog.c
-moved usb device operations into usb_operations module
new file:   source/usb_operations.c
new file:   source/usb_operations.h
	-creation of usb_operations module
	-currently handles libusb open/close and retrieving INL retro-prog
	usb handle.
2016-11-19 19:10:13 -06:00
paul eeepc 37c79429ea modified: source/inlprog.c
-moving returnvalue "rv" declaration/init earlier to ensure initization.
	-adding notes to user if LIBUSB_ERROR_ACCESS as it's expected on linux.

modified:   udev-rule-help/Readme.txt
	-including expected libusb error if user doesn't have access.
2016-11-19 17:38:12 -06:00
Paul Molloy b1e60a35df host\Makefile: fixing make debug, Zed's logic seems backwards to me.
host\include\dbg.h: reversing DEBUG logic.
host\source\inlprog.c: working through making code more robust with proper
error checking via "Zed's AWESOME debug macros" ;)
2016-11-19 16:51:50 -06:00
paul eeepc ad1037b694 First commit for Makefile and main inlretro program.
Makefile copied from the Makefile I came up with during Zed Shaw's LCTHW
inlretro.c basic usb functionality using libusb 1.0
	-searches through usb devices and opens matching VID/PID
	-sends vendor xfr command for LED ON/OFF
	-closes out usb device prior to exit
	-lots of messy comments as notes while learning libusb
2016-11-19 01:20:20 -06:00