Commit Graph

12 Commits

Author SHA1 Message Date
Paul XPS c1b35baf06 Big ol' commit with addition of support for GBA, Genesis, & N64
cartridge reading!

have some cleanup to do:
clean up sega dumping so don't need a page0/1
implement sega single reads

Add GBA to some of the common opcodes

dumping Don't think need addrH |= of mapper, but maybe this is key to
cleaning up first note..

gba, sega, n64 has extra NOPs, remove and test.

create pinport renames for sega pins, move mask defines to pinport.h

clean up comments for genesis page reads..
2018-12-08 16:01:59 -06:00
Paul XPS e4debe5a13 Big update for firmware version v2.3.1
this is the verion getting flashed on all v2.0N NESmaker kits
v2.3.0 worked for basic functions, but was never shipped

Majority of effort revolved around testing mapper30 boards with the
smaller v2.0N INLretro with the NES connector alone for NESmaker kits.

added linear feedback shift register for test stream data generated
locally on the device.  I'm not 100% sure if this is any faster than
pushing the actual data via USB though.. :/  It's plenty fast on the
stm32 nearly instantaneous for 32KByte.  But the AVR takes a couple
sec..

Created "stuff" dictionary for things like that were I just want to add
small things and don't want to bother with a whole new dictionary.

Added file verification to the host with files.lua

Have some nes flash algos return post-written data so calling function
can decide if want to retry, fail, etc.

Changed host dictionary calls to assert instead of error because it
really shouldn't continue.  I didn't see an error when sending opcode to
wrong dict and caused head banging..

fwupdate permits bytes to be skipped, or force the update.  Found that
the fwupdater got assigned different addresses of ram depending on what
all other ram gets allocated to the main application

Some clean up of inlretro.lua

TODO:
host learn and keep track of the connected device.
Needed for ciccom right now, or knowing whether ciccom connection
is even present..
In the end maybe ciccom is better placed in firmware, but for small
transfers of only a few bytes it kinda makes sense to keep on the host.
Pinport gets quite messy with these made up pin names when really all I
want to do is toggle a specific pin on the NES connector.  So maybe some
double mappings would actually be okay, need to rethink that..

create different flash modes that either keep going, retry, or error
depending on the goal of the flash operation.  Fanout the return value
from flash algos to all of them.

have fwupdate assigned a specific area of ram so the ram pointer doesn't
change between builds.  Okay to ignore for now.

Realized can have STM32F070C6 devices execute bootloader by erasing all
the flash or perhaps even just the first word of flash according at
AN2606.  This wouldn't work for RB devices though.  This could be done
through the bootloader dict
2018-12-06 01:07:13 -06:00
Paul Win10 shuttle PC 88a2d30858 Massive commit with bunch of random junk..
Added windows driver package, just have to run InstallDriver.exe to
get drivers installed on windows 10 (and others I believe)

Created dictionaries for all remaining cart connectors.
Nothing useful there yet, just wanted to get the files created
and dictionaries working.

Added bunch of notes to shared_dictionaries to explain how to go
about creating new dictionaries and some opcode details.

Have STM8 cic communications working "CICCOM" to change between H/V
mirroring on new discrete boards.  Currently these operations are handled
entirely from the host scripts and opcode/operands are mostly hard coded.
Need to move these to more generic functions in the ciccom dictionary
which will also speed things up moving to the firmware which will speed
things up.

Some changes to mapper 30 script to eat the ines header, and test CHR-RAM
banking.

Some updates to snes flashing operations, still a work in progress to
fully support prior SNES board designs.
2018-09-06 23:01:59 -05:00
Paul Black ASUS win7 9c57f1bdb3 Massively overdue commit of several months worth of random work.
Mostly adding support for mappers as I needed it for my own hardware
builds:
-MMC1
-mapper 30
-easy NSF (still need to update for mapper verilog fix)
-action53 (still need to update for mapper verilog fix)
-dual port board flashing
-colordreams, not sure if I actually got this working
-color ninja, just a special CPLD version of colordreams for ninja boards

Just started working on SNES code.  slowly getting things up and working
outside of main inlretro.lua script similar to how NES has been handling
everything with it's own script.  Able to flash v3 boards fine.  v1 boards
flash without errors, but still having some mapping problems where it
verifies but won't boot.  v2 prototype flashes most bytes but not all,
seems v2 boards are much slower to output valid data..  But that may just
be the manufacturer ID codes..?

TODO next:
-bootloader dictionary that jumps to bootloader so don't have to manually
close jumper on the board.
-turn on the watchdog timer for stm32
-create some sort of host timeout so reset button on programmer isn't as
useful
-allow firmware programing algos to be uploaded and executed from SRAM for
faster code that also doesn't require specific firmware builds to support
new mapers.
-Finish JTAG to simplify programing NES & SNES CPLDs
-Sort out swim issue with stm8s001 CICs
-add SWIM support for avr
2018-07-08 20:23:44 -05:00
Paul blue asus fafe706481 Another late commit from bunch of updates I made over a month ago..
Most progress was on jtag lua statemachine code.  From what I recall I
tested and verified most state change possibilities with logic analyzer.
So they should be fairly good.  Possible I didn't test all later ones,
or things are partly unfinished, but my best guess is they're good.
Appears was able to erase MachXO CPLD.  Added time delay for run test.
Did some basic testing for gameboy power switching circuit.

Also just got STM8S001 CIC programming working for discrete boards via
A0.  Pretty sure I broke EXP0 in the process for SNES boards..  So need
to go back and fix that I think due to new means of changing swim pin.
2018-02-13 14:36:43 -06:00
Paul Molloy 6eb0570335 Have stm devices activating SWIM on SNES STM8 CIC.
AVR not yet working, performing low level SWIM operations will require
decent amount of core specific code due to differences in pin driver
styles, timers, cycles per instruction, etc.  The fact that SWIM pin
changes based on the board ADDR0, DATA0, EXP0, etc multiplies this low
level code...  Thinking about executing SWIM low level drivers from SRAM.
Initialization could include loading these routines to SRAM.
For now just focusing on supporting SWIM on STM cores for SNES boards.
2017-09-02 12:38:56 -05:00
Paul Molloy 4b3c822a24 Have basic SNES cart detection and dumping working. Dumping mario paint
works on both inl6 and original kazzo just fine.  Dumping v3 prototype has
a few byte corruptions on inl6, but is fine on original kazzo.  The same
bytes often fail, but not consistently.  Tinkered with adding delay, but
that didn't help.  Also have issue with adapter not dumping properly.
Prob bug with HIGH ADDR on that board need to sort out still.  Going to
focus on erasing and dumping next then come back to some of these issues.
2017-08-21 12:30:39 -05:00
Paul Molloy 8b5650b75f Well over due commit with lots of updates..
Have separate lua modules now in scripts/app folder
Dictionary calls are now their own lua module
firmware now capable of calling multiple different dictionaries
have firmware & lua io and nes dictionaries, able to detect
NES and famicom carts.  Created expansion port abstraction so most kazzo
versions behave identically.
Created separate make file for stm adapter and inl6
added PURPLE_KAZZO and GREEN_KAZZO defines back in.  They work well enough
for sensing NES vs famicom carts so far.  GREEN_KAZZO requires
PURPLE_KAZZO to also be defined.  GREEN_KAZZO is also only compatible with
AVR_CORE due to software_AHL/AXL functions specifically written for AVR.
I think things will work if a STM_ADAPTER is placed on a PURPLE_KAZZO and
both those defines are made as only real difference is software tying of
AXL and X_OE.  But haven't tested this aside from ensuring it compiles.
Have correction to pinport_al.h that will commit immediately after this.
2017-08-05 16:04:59 -05:00
Paul Molloy ec725f7e33 Getting closer to how I'd like to handle dictionary calls with lua.
Effectively deleted old dictionary call function/files.
Created lua_usb_vend_xfr function so lua can directly send and receive
vendor setup transfers.

Dictionary calls are more like function calls now, and all args aren't
required so the LED can be turned on for example in lua like so:
dict_pinport("LED_ON")
general format is:
dict_name( opcode, operand, misc, datastring )
Also added ability to store opcode's return length in shared dict library
files with RL=number in the comments following the opcode.
Negative numbers designate OUT transfers, positive for IN.
Default value can be determined by each dictionary's calling function.
Decided pinport is 1 for SUCCESS/ERROR CODE.
Also have default return data means with second byte giving length of
return data in bytes that follows.
dictionary call function reports any errors reported by the device and
returns any return data from the device excluding error code / data len

Now time to start implementing some of these dictionaries on the device.
2017-08-01 17:17:13 -05:00
paul eeepc 497e53378b Basic cartridge detection working. NES detected with CIRAM /CE and PPU /A13N jumper. Famicom detected with audio in/out connection. SNES detected by enabling control signals and reading reset vector looking for non 0xff data. Still need to add check that would pass with blank flash cart though reading flash ID's perhaps.
Removing bad logic where TRUE == 0x00 as that's 'false' in C so that was causing more confusions than solutions.
2016-12-04 03:16:40 -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 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