This commit is contained in:
Paul XPS 2019-08-06 15:51:50 -05:00
commit 16f4f55ab2
3 changed files with 94 additions and 59 deletions

View File

@ -1,5 +1,15 @@
Table of Contents:
===================================
* [Installing Device Drivers](#INSTALLING-DEVICE-DRIVERS)
* [Easy Rippings](#EASY-RIPPINGS)
* [Running the Host Application](#RUNNING-THE-HOST-APPLICATION)
* [Updating Device Firmware](#UPDATING-DEVICE-FIRMWARE)
* [STM32 ARM based device versions "INLretro" V2.0 and later](#STM32-ARM-BASED-DEVICE-VERSIONS-"INLRETRO"-v2.0-AND-LATER)
* [AVR based devices versions "KAZZO" V1.4 and eariler](#AVR-based-devices-versions-"KAZZO"-V1.4-and-eariler)
* [Software & Firmware Building](#SOFTWARE-&-FIRMWARE-BUILDING)
* [Linux/Mac](#Linux/Mac)
* [Windows](#Windows)
INSTALLING DEVICE DRIVERS:
===================================
@ -20,9 +30,13 @@ If it worked properly you'll get a "install successful" page, click FINISH.
In windows you should be able to see "INLretro-prog" listed in "devices and printers" from
the control panel.
Easy Rippings
-----------------------------------
If you're only looking to rip your own carts, you can stop here and look at the [EasyRipping](./docs/EasyRippingGuide.md) guide.
If you recently bought your INL-Retro, you shouldn't have to update firmware, but below are steps to update the firmware when future versions are released. If you have an older version, it's recommended you update the firmware first.
===================================
RUNNING THE HOST APPLICATION:
===================================
@ -50,14 +64,13 @@ USB connector on the INLretro programmer/dumper to reset the device, and try aga
===================================
UPDATING DEVICE FIRMWARE
===================================
----------------------------------------------------------
STM32 ARM based device versions "INLretro" V2.0 and later
----------------------------------------------------------
-----------------------------------
If you purchased your device in 2018 or later you have this version
This includes devices aquired with NESmaker kits.
@ -304,10 +317,9 @@ LINUX DFU-UTIL STEPS:
sudo dfu-util -d 0483:* -a 0 -D INLretro6_PCBv2_0_FWv2_03_01.dfu
----------------------------------------------------------
AVR based devices versions "KAZZO" V1.4 and eariler
----------------------------------------------------------
-----------------------------------
If you purchased your device in 2017 or earlier you have this version
This should also apply if you made your own kazzo based on the open
source design. Although I can't assure this software works with
@ -397,14 +409,12 @@ and the device should be running the latest firmware ready to use the latest sof
===================================
SOFTWARE & FIRMWARE BUILDING
===================================
Some build instructions follow, but they shouldn't be needed if you're running the
released firmware on Windows.
===================
Linux/Mac
===================
@ -464,37 +474,38 @@ STM32 FIRMWARE:
Need arm-none-eabi-gcc
===================
Windows
===================
HOST APPLICATION:
Install minGW:
download: http://www.mingw.org/wiki/Getting_Started
launch: Installation manager default settings
select: mingw32-base
(primary need is gcc)
select: msys-base
(primary need is make, basic unix commands are nice to have)
optional: msys-openssh
(helpful if using gitlab to pull updates)
lua for host app dev
minGW utilities can be easily added or removed at any time with minGW installation manager.
Add C:\MinGW\bin & C:\MinGW\msys\1.0\bin to your PC's enviroment PATH variable
-control panel search: "edit system environment variables
-System properties window, Advanced tab, click Environment Variables...
-System Variables pane: Select and edit "PATH"
-Add new entries below assuming you used default location for minGW
C:\MinGW\bin
C:\MinGW\msys\1.0\bin
-I had troubles once with cp (copy) commands in Makefile
* download: http://www.mingw.org/wiki/Getting_Started
* launch: Installation manager default settings
* select: mingw32-base
* (primary need is gcc)
* select: msys-base
* (primary need is make, basic unix commands are nice to have)
* optional: msys-openssh
* (helpful if using gitlab to pull updates)
* lua for host app dev
* minGW utilities can be easily added or removed at any time with minGW installation manager.
* Add C:\MinGW\bin & C:\MinGW\msys\1.0\bin to your PC's enviroment PATH variable
* -control panel search: "edit system environment variables
* -System properties window, Advanced tab, click Environment Variables...
* -System Variables pane: Select and edit "PATH"
* -Add new entries below assuming you used default location for minGW
* C:\MinGW\bin
* C:\MinGW\msys\1.0\bin
* -I had troubles once with cp (copy) commands in Makefile
causing a crash, even though the commands works outside of make. Bumping the
mingw path variables to the top of all my path variables corrected this issue.
So that might help if you have similar issues...
Now host app can be built from windows command prompt command make when in host directory
-go to host
-make all
* go to host
* make all
If you want to build your own AVR FIRMWARE:
Download and Install WinAVR

21
docs/EasyRippingGuide.md Normal file
View File

@ -0,0 +1,21 @@
# Table of Contents
1. [Basic Installation](#BASIC-INSTALLATION)
2. [NES](#NES)
# Basic Installation
Follow the steps in the [README](../README.md) to update the frimware if needed and install the device drivers. You will only need the drivers if you're on Windows.
If you just recieved your device, you probably won't need to update the firmware, but please check the readme if something changes.
# NES
1. First, go ahead and connect your INL-retro to your PC
1. Next you're going to need is NES game. Go ahead and plug that into the correct slot of your INL-retro board. Word of advice: when removing the game, use your index fingers to pull the game up and push on the board with your thumbs.
1. After that you'll need to grab some parameters from another git repository [http://tuxnes.sourceforge.net/nesmapper.txt](Cartridge Mappings). These are the cartridge mappings will help you rip your game. Look for it in the list. What you need is the PRG size, CHR size and the Mapper. Take note of those for your game. Some of the Mappers listed may not yet be supported, so be aware of that if you get any errors.
1. Next, clone/download this repository
1. Navigate to the INL-retro-progdump/host folder in a command prompt or terminal. This might help you [How to Open Command Prompt at Current Location](http://www.ilovefreesoftware.com/25/windows-10/open-command-prompt-folder-windows-10.html)
1. The command you're going to run is
>```inlretro -s scripts/inlretro2.lua -c NES -x 64 -y 16 -d C:/User/YOU/Documents/GAME.nes```
1. Notice the -x and -y flags. The numbers that follow them correspond to PRG size and CHR size in the previous step. The -c flag is the mapper. Replace those with the parameters for your game. The flag -d is the destination, replace that with whatever folder path you feel like.
1. Finally run it! You should get a success message and you should be able to play your new rom file! If you run into any errors, remember not every mapper is supported. It is possible the Mapping listing is incorrect. Play with the flags if you want and see if you can get to work.

View File

@ -64,6 +64,7 @@ local ram_size_tbl = {
[0x01] = "16 kilobits",
[0x02] = "32 kilobits",
[0x03] = "64 kilobits",
[0x05] = "256 kilobits"
}
-- Translates ram size in header to KBytes.
@ -72,6 +73,7 @@ local ram_size_kb_tbl = {
[0x01] = 2,
[0x02] = 4,
[0x03] = 8,
[0x05] = 32
}
local destination_code = {
@ -288,7 +290,7 @@ end
function print_header(internal_header)
local map_mode_str = lorom_name
if (internal_header["map_mode"] & 1) == 1 then map_mode_str = hirom_name end
-- For each field, default to showing hex value so program doesn't crash if a value is unexpected.
local rom_type_str = "UNKNOWN - " .. hexfmt(internal_header["rom_type"])
if hardware_type[internal_header["rom_type"]] then rom_type_str = hardware_type[internal_header["rom_type"]] end
@ -308,7 +310,7 @@ function print_header(internal_header)
if developer_code[internal_header["developer_code"]] then
developer_code_str = developer_code[internal_header["developer_code"]]
end
print("Rom Title:\t\t" .. internal_header["rom_name"])
print("Map Mode:\t\t" .. map_mode_str .. " - " .. hexfmt(internal_header["map_mode"]))
print("Hardware Type:\t\t" .. rom_type_str)
@ -338,7 +340,7 @@ function get_header(map_adjust)
local addr_destination_code = 0xFFD9 - map_adjust -- 1 byte
local addr_developer_code = 0xFFDA - map_adjust -- 1 byte (This is actually manufacturer ID)
local addr_version = 0xFFDB - map_adjust -- 1 byte
local addr_compliment_check = 0xFFDC - map_adjust -- 2 bytes
local addr_compliment_check = 0xFFDC - map_adjust -- 2 bytes
local addr_checksum = 0xFFDD - map_adjust -- 2 bytes
local internal_header = {
@ -368,13 +370,11 @@ function isvalidheader(internal_header)
-- Spot check a few fields.
-- TODO: Check more/all fields, look for printable name?
local valid_rom_type = hardware_type[internal_header["rom_type"]]
local valid_rom_size = rom_ubound[internal_header["rom_size"]]
local valid_sram_size = ram_size_tbl[internal_header["sram_size"]]
local valid_destination_code = destination_code[internal_header["destination_code"]]
return valid_rom_type and valid_rom_size and valid_sram_size and valid_destination_code
return valid_rom_type and internal_header["rom_size"] and internal_header["sram_size"] and valid_destination_code
end
function test()
function test()
local hirom_header = get_header(0x0000)
local lorom_header = get_header(0x8000)
local internal_header = nil
@ -396,7 +396,7 @@ end
-- local functions
-- Desc: attempt to read flash rom ID
-- Desc: attempt to read flash rom ID
-- Pre: snes_init() been called to setup i/o
-- Post:Address left on bus memories disabled
-- Rtn: true if proper flash ID found
@ -536,6 +536,7 @@ local function dump_ram( file, start_bank, ram_size_KB, mapping, debug )
local num_banks
--determine how much ram to read per bank
if ram_size_KB == nil then ram_size_KB = 0 end
if (ram_size_KB < KB_per_bank) then
num_banks = 1
KB_per_bank = ram_size_KB
@ -650,7 +651,7 @@ local function flash_rom(file, rom_size_KB, mapping, debug)
--program the entire bank's worth of data
--[[ This version of the code programs a single byte at a time but doesn't require
--[[ This version of the code programs a single byte at a time but doesn't require
-- board specific functions in the firmware
print("This is slow as molasses, but gets the job done")
byte_num = 0 --current byte within the bank
@ -703,7 +704,7 @@ local function wr_ram(file, first_bank, ram_size_KB, mapping, debug)
--last of 512KB
-- dict.snes("SNES_SET_BANK", 0x0F) wr_flash_byte(0x8000, 0xF5, true) wr_flash_byte(0xFFFF, 0xFA, true)
local base_addr
local base_addr
local bank_size
local buff_size = 1 --number of bytes to write at a time
local cur_bank = 0
@ -750,7 +751,7 @@ local function wr_ram(file, first_bank, ram_size_KB, mapping, debug)
--program the entire bank's worth of data
---[[ This version of the code programs a single byte at a time but doesn't require
---[[ This version of the code programs a single byte at a time but doesn't require
-- board specific functions in the firmware
print("This is slow as molasses, but gets the job done")
byte_num = 0 --current byte within the bank
@ -794,18 +795,18 @@ end
--Cart should be in reset state upon calling this function
--Cart should be in reset state upon calling this function
--this function processes all user requests for this specific board/mapper
local function process(process_opts, console_opts)
local rv = nil
local file
local file
--initialize device i/o for SNES
dict.io("IO_RESET")
dict.io("SNES_INIT")
local internal_header = nil
-- Use specified mapper if provided, otherwise autodetect.
local snes_mapping = console_opts["mapper"]
if (snes_mapping == lorom_name) then
@ -825,12 +826,12 @@ local function process(process_opts, console_opts)
-- Use specified ram size if provided, otherwise autodetect.
local ram_size = console_opts["wram_size_kb"]
-- Use specified rom size if provided, otherwise autodetect.
local rom_size = console_opts["rom_size_kbyte"]
-- TODO: Put this in a function.
-- SNES memory map banking
@ -839,8 +840,8 @@ local function process(process_opts, console_opts)
-- A23 splits the map in half
-- A22 splits it in quarters (between what's typically low half and high half)
-- b 7 6 5 4 : 3 2 1 0
-- A23 22 21 20 : 19 18 17 16
-- A23 22 21 20 : 19 18 17 16
local rombank --first bank of rom byte that contains A23-16
local rambank --first bank of ram
@ -852,8 +853,8 @@ local function process(process_opts, console_opts)
print_header(internal_header)
-- Autodetect any missing parameters.
if isempty(snes_mapping) then
snes_mapping = internal_header["mapping"]
if isempty(snes_mapping) then
snes_mapping = internal_header["mapping"]
print("Mapping not provided, " .. snes_mapping .. " detected.")
if (snes_mapping == lorom_name) then
-- LOROM typically sees the upper half (A15=1) of the first address 0b0000:1000_0000
@ -865,16 +866,18 @@ local function process(process_opts, console_opts)
rombank = 0xC0
--rombank = 0x40 --second HiROM bank (slow)
rambank = 0x30
end
end
end
if ram_size == 0 then
if (ram_size == 0) or (ram_size == nil) then
ram_size = ram_size_kb_tbl[internal_header["sram_size"]]
print("RAM Size not provided, " .. ram_size_tbl[internal_header["sram_size"]] .. " detected.")
assert(ram_size, "SRAM Size unknown and not provided, please add ram size to console_opts")
print("SRAM Size not provided, " .. ram_size_tbl[internal_header["sram_size"]] .. " detected.")
end
if rom_size == 0 then
if (rom_size == 0) or (rom_size == nil) then
rom_size = rom_size_kb_tbl[internal_header["rom_size"]]
assert(rom_size, "ROM Size unknown and not provided, please add rom size to console_opts")
print("ROM Size not provided, " .. rom_ubound[internal_header["rom_size"]] .. " detected.")
end
@ -887,7 +890,7 @@ local function process(process_opts, console_opts)
end
--dump the ram to file
--dump the ram to file
if dumpram then
print("\nDumping SAVE RAM...")
@ -950,7 +953,7 @@ local function process(process_opts, console_opts)
--open file
file = assert(io.open(flashfile, "rb"))
--determine if auto-doubling, deinterleaving, etc,
--determine if auto-doubling, deinterleaving, etc,
--needs done to make board compatible with rom
--flash cart