Most things working on STM_NES now with more complete pinport_al.h

definitions.  Still work left on the expansion port though..
Created *_CONN definitions so code doesn't get included for connectors
that aren't present.
Added a NES CPU write that doesn't toggle M2 but not sure if this will
really be needed for MMC2 or not..
This commit is contained in:
Paul XPS 2018-11-25 22:17:36 -06:00
parent 9a963e06b1
commit 2013efe253
14 changed files with 271 additions and 137 deletions

View File

@ -12,7 +12,7 @@ uint8_t dump_buff( buffer *buff ) {
uint8_t bank;
switch ( buff->mem_type ) {
// #ifdef NES_CONN
#ifdef NES_CONN
case NESCPU_4KB:
//mapper lower nibble specifies NES CPU A12-15
if (buff->mapper > 0x0F) {
@ -54,9 +54,9 @@ uint8_t dump_buff( buffer *buff ) {
buff->cur_byte = nes_ppu_page_rd_poll( buff->data, addrH, buff->id,
buff->last_idx, ~FALSE );
break;
// #endif
#endif
// #ifdef SNES_CONN
#ifdef SNES_CONN
case SNESROM_PAGE: //ROMSEL is always taken low
//mapper byte specifies SNES CPU A15-8
addrH |= (buff->mapper); //no shift needed
@ -72,9 +72,9 @@ uint8_t dump_buff( buffer *buff ) {
//id contains MSb of page when <256B buffer
buff->last_idx, ~FALSE );
break;
// #endif
#endif
// #ifdef NES_CONN
#ifdef NES_CONN
case PRGROM:
addrH |= 0x80; //$8000
if (buff->mapper == MAP30) {
@ -138,9 +138,9 @@ uint8_t dump_buff( buffer *buff ) {
buff->cur_byte = nes_cpu_page_rd_poll( buff->data, addrH, buff->id,
buff->last_idx, ~FALSE );
break;
// #endif
#endif
// #ifdef SNES_CONN
#ifdef SNES_CONN
case SNESROM:
if (buff->mapper == LOROM) {
addrH |= 0x80; //$8000 LOROM space
@ -163,7 +163,7 @@ uint8_t dump_buff( buffer *buff ) {
//id contains MSb of page when <256B buffer
buff->last_idx, ~FALSE );
break;
// #endif
#endif
default:
return ERR_BUFF_UNSUP_MEM_TYPE;

View File

@ -385,7 +385,7 @@ uint8_t flash_buff( buffer *buff ) {
uint8_t bank;
switch ( buff->mem_type ) {
// #ifdef NES_CONN
#ifdef NES_CONN
case PRGROM: //$8000
//Latest method used here!
@ -508,9 +508,9 @@ uint8_t flash_buff( buffer *buff ) {
case PRGRAM:
write_page( addrH+0x60, buff, nes_cpu_wr);
break;
//#endif
#endif
//#ifdef SNES_CONN
#ifdef SNES_CONN
case SNESROM:
if (buff->mapper == LOROM_5VOLT) {
//LOROM banks start at $XX:8000
@ -554,7 +554,7 @@ uint8_t flash_buff( buffer *buff ) {
case SNESRAM:
//warn addrX = ((buff->page_num)>>8);
break;
// #endif
#endif
default:
return ERR_BUFF_UNSUP_MEM_TYPE;

View File

@ -1,5 +1,8 @@
#include "gameboy.h"
//only need this file if connector is present on the device
#ifdef GB_CONN
//=================================================================================================
//
// GAMEBOY operations
@ -57,3 +60,6 @@ void dmg_wr( uint16_t addr, uint8_t data )
{
return;
}
#endif //GB_CONN

View File

@ -1,5 +1,8 @@
#include "gba.h"
//only need this file if connector is present on the device
#ifdef GB_CONN
//=================================================================================================
//
// GBA operations
@ -57,3 +60,5 @@ void gba_wr( uint16_t addr, uint8_t data )
{
return;
}
#endif //GB_CONN

View File

@ -27,12 +27,22 @@ uint8_t io_call( uint8_t opcode, uint8_t miscdata, uint16_t operand, uint8_t *rd
#define HWORD_LEN 2
switch (opcode) {
case IO_RESET: io_reset(); break;
#ifdef NES_CONN
case NES_INIT: nes_init(); break;
#endif
#ifdef SNES_CONN
case SNES_INIT: snes_init(); break;
#endif
#ifdef GB_CONN
case GAMEBOY_INIT: gameboy_init(); break;
// case GBA_INIT: gba_init(); break;
#endif
#ifdef SEGA_CONN
case SEGA_INIT: sega_init(); break;
#endif
#ifdef N64_CONN
// case N64_INIT: n64_init(); break;
#endif
case SWIM_INIT:
return swim_init(operand); break;
case JTAG_INIT:
@ -128,6 +138,7 @@ void io_reset()
//set outputs as required
//latch address of $0000
//disable NES cart memories
#ifdef NES_CONN
void nes_init()
{
//start with a reset
@ -167,7 +178,7 @@ void nes_init()
ADDR_SET(0x0000);
}
#endif
//SNES cartridge interfacing setup
//set outputs as required
@ -176,6 +187,7 @@ void nes_init()
//reset high disables SRAM and puts INL carts in PRGM mode
//Excersize caution calling this while NES/FC cart inserted on old kazzo versions
//probably won't work if FC inserted due to EXP0-EXP6 short due to audio jumper on cart
#ifdef SNES_CONN
void snes_init()
{
//start with a reset
@ -212,11 +224,13 @@ void snes_init()
HADDR_SET(0x00);
}
#endif
//GAMEBOY cartridge interfacing setup
//set outputs as required
//latch address of $0000
//disable cart memories
#ifdef GB_CONN
void gameboy_init()
{
//start with a reset
@ -255,12 +269,14 @@ void gameboy_init()
#endif
}
#endif
//GBA cartridge interfacing setup
//set outputs as required
//latch address of $0000
//disable cart memories
#ifdef GB_CONN
void gba_init()
{
//start with a reset
@ -294,12 +310,14 @@ void gba_init()
ADDR_SET(0x0000);
}
#endif
//SEGA Genesis/MegaDrive cartridge interfacing setup
//set outputs as required
//latch address of $00:0000
//disable cart memories
#ifdef SEGA_CONN
void sega_init()
{
//start with a reset
@ -338,7 +356,7 @@ void sega_init()
HADDR_SET(0x00);
}
#endif
//Initialization of SWIM "single wire interface module" communications
//the SWIM pin depends on INL board design.

View File

@ -1,5 +1,8 @@
#include "n64.h"
//only need this file if connector is present on the device
#ifdef N64_CONN
//=================================================================================================
//
// N64 operations
@ -57,3 +60,6 @@ void n64_wr( uint16_t addr, uint8_t data )
{
return;
}
#endif //N64_CONN

View File

@ -1,5 +1,8 @@
#include "nes.h"
//only need this file if connector is present on the device
#ifdef NES_CONN
//=================================================================================================
//
// NES operations
@ -47,6 +50,9 @@ uint8_t nes_call( uint8_t opcode, uint8_t miscdata, uint16_t operand, uint8_t *r
case NES_CPU_WR:
nes_cpu_wr( operand, miscdata );
break;
case NES_M2_LOW_WR:
nes_m2_low_wr( operand, miscdata );
break;
case NES_DUALPORT_WR:
nes_dualport_wr( operand, miscdata );
break;
@ -453,6 +459,62 @@ void nes_cpu_wr( uint16_t addr, uint8_t data )
}
/* Desc:NES CPU Write, but M2 remains low
* Allows writes to flash, but not memory if M2 must be high for mapper to latch the write
* A15 decoded to enable /ROMSEL
* Note:addrH bit7 has no effect (ends up on PPU /A13)
* EXP0 as-is
* Pre: nes_init() setup of io pins
* Post:data latched by anything listening on the bus
* address left on bus
* data left on bus, but pullup only
* Rtn: None
*/
void nes_m2_low_wr( uint16_t addr, uint8_t data )
{
//Float EXP0 as it should be in NES
//EXP0_IP_FL();
//need for whole function
//_DATA_OP();
//set addrL
//ADDR_OUT = addrL;
//latch addrH
//DATA_OUT = addrH;
//_AHL_CLK();
ADDR_SET(addr);
//PRG R/W LO
PRGRW_LO();
//put data on bus
DATA_OP();
DATA_SET(data);
//set M2 and /ROMSEL
// M2_HI();
if( addr >= 0x8000 ) { //addressing cart rom space
ROMSEL_LO(); //romsel trails M2 during CPU operations
}
//give some time
NOP();
NOP();
//latch data to cart memory/mapper
// M2_LO();
ROMSEL_HI();
//retore PRG R/W to default
PRGRW_HI();
//Free data bus
DATA_IP();
}
/* Desc:NES PPU Read
* decode A13 from addrH to set /A13 as expected
* Pre: nes_init() setup of io pins
@ -1237,3 +1299,6 @@ void cdream_chrrom_flash_wr( uint16_t addr, uint8_t data )
return;
}
#endif //NES_CONN

View File

@ -14,6 +14,7 @@ void disc_push_exp0_prgrom_wr( uint16_t addr, uint8_t data );
uint8_t emulate_nes_cpu_rd( uint16_t addr );
uint8_t nes_cpu_rd( uint16_t addr );
void nes_cpu_wr( uint16_t addr, uint8_t data );
void nes_m2_low_wr( uint16_t addr, uint8_t data );
uint8_t nes_ppu_rd( uint16_t addr );
void nes_ppu_wr( uint16_t addr, uint8_t data );
uint8_t nes_dualport_rd( uint16_t addr );

View File

@ -406,9 +406,11 @@ uint8_t pinport_call( uint8_t opcode, uint8_t miscdata, uint16_t operand, uint8_
//opcode: type of operation
//operand: value to place on bus
//============================
#ifndef STM_NES //HADDR not present when there's no 16bit console connector
case HADDR_ENABLE_: HADDR_ENABLE(); break;
case HADDR_DISABLE_: HADDR_DISABLE(); break;
case HADDR_SET_: HADDR_SET(operand); break;
#endif
default:
//macro doesn't exist or isn't on this PCB version

View File

@ -8,6 +8,25 @@
//#define STM_INL6
//#define STM_NES
//define the connectors present on each device
//these are used to exclude unecessary code from devices which don't have the connectors present
#if defined(AVR_KAZZO) || defined(STM_ADAPTER)
#define NES_CONN //includes famicom as definitions are effectively the same
#define SNES_CONN
#endif
#ifdef STM_NES
#define NES_CONN //famicom isn't actually present but a pin adapter should work
#endif
#if defined(STM_INL6) || defined(STM_INL6_PROTO)
#define NES_CONN //includes famicom as definitions are effectively the same
#define SNES_CONN
#define SEGA_CONN
#define GB_CONN
#define N64_CONN
#endif
#ifdef AVR_CORE
#include "avr_gpio.h"
#include <avr/wdt.h>
@ -298,11 +317,27 @@ void software_AXL_CLK();
//
//
// STM32F070C6T6 "INL RETRO NES" V2.0N NESmaker edition
// Orange solder mask
// Labeled "INL RETRO PROGRAMMER DUMPER V2.0N"
// Dated AUG 2018
// Comparable to INL6, but only has NES connector
// uses Flipflop for io expansion for A8-15 similar to original kazzos
// this device is setup very similarly to STM_ADAPTER
// AHL/AHLOE, AXL, EXP port, and CIC port are main differences
//
// AHL_OEn controls AHL flipflop clock and /OE
// -also tied to CIC RESET, but this creates problems with CICs that wire OR RESET and DOUT
// Only viable solution is to cut AHL_OEn away from CIC RESET
// Don't have any reason that CIC RESET is needed at this point, and in reality it's the same
// CIC mcu pin for stm8s001 CICs.. Perhaps I should have used stm32 pin PA1 shared with EXP1 (JTAG TDI)
// CIC CLK connected to A0
// CIC KEY DIN shared with NTSC 24Mhz
// CIC KEY DOUT is also SWCLK
// AXL does not exist
// EXP0-3,6 has dedicated mcu pin
// EXP4-5,7-8 connect to A4-7
// EXP9 is shared with LED
//
@ -602,109 +637,23 @@ void software_AXL_CLK();
#endif //STM_INL6 & PROTO
#ifdef STM_NES
// PC0 "M2" mcupinA3
#define C0bank GPIOA
#define C0 (3U)
// PC1 "ROMSEL" mcupinA4
#define C1bank GPIOA
#define C1 (4U)
// PC2 "PRGRW" mcupinA5
#define C2bank GPIOA
#define C2 (5U)
// PC3 "FREE" mcupinA6
#define C3bank GPIOA
#define C3 (6U)
// PC4 "CSRD" mcupinA7
#define C4bank GPIOA
#define C4 (7U)
// PC5 "CSWR" mcupinB0
#define C5bank GPIOB
#define C5 (0U)
// PC6 "CICE" mcupinA10
#define C6bank GPIOA
#define C6 (10U)
// PC7 "AHL" mcupinB1
// THIS IS FLIPFLOP /OE pin as well!
#define C7bank GPIOB
#define C7 (1U)
// PC8 "EXP0" mcupinA0
#define C8bank GPIOA
#define C8 (0U)
// PC9 "LED" mcupinC13
#define C9bank GPIOC
#define C9 (13U)
// PC10 "IRQ" mcupinA15
#define C10bank GPIOA
#define C10 (15U)
// PC11 "CIA10" mcupinA13
#define C11bank GPIOA
#define C11 (13U)
// PC12 "BL"
// Not defined
#define C12nodef
// PC13 "AXL"
// Not present on STM_NES
#define C13nodef
// PC14 "AUDL"
// Not defined
#define C14nodef
// PC15 "AUDR"
// Not defined
#define C15nodef
// PC16 "GBP"
// Not defined
#define C16nodef
// PC17 "SWD" mcupinA13
// Not defined due to shared with CIRAM A10
#define C17nodef
// PC18 "SWC" mcupinA14
#define C18bank GPIOA
#define C18 (14U)
// PC19 "AFL"
// Not defined
#define C19nodef
// PC20 "COUT"
// Not defined
#define C20nodef
// PC21 "FCAPU" double mapping of EXP0
#define C21bank C8bank
#define C21 C8
#define RCC_AHBENR_CTL (RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_GPIOCEN)
#define RCC_AHBENR_ADDR (RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN)
#define RCC_AHBENR_DATA RCC_AHBENR_GPIOBEN
#endif //STM_NES
//TODO combine STM_NES & STM_ADAPTER, they're predominantly the same
//STM_NES & STM_ADAPTER, they're predominantly the same
//AHL-AHLOE, AXL, EXP port, and CIC port are only differences
//The recommended wiring for STM_ADAPTER to CIC pins brings them even closer together..
#ifdef STM_ADAPTER
// PC13 "AXL" mcupinA2
#define C13bank GPIOA
#define C13 (2U)
#endif
#ifdef STM_NES
// PC13 "AXL"
// Not present on STM_NES, it uses this pin for EXP6 instead
#define C13nodef
#endif
#if defined (STM_ADAPTER) || defined(STM_NES)
// PC0 "M2" mcupinA3
#define C0bank GPIOA
@ -719,6 +668,8 @@ void software_AXL_CLK();
#define C2 (5U)
// PC3 "FREE" mcupinA6
// No connection on kazzo/stm adapter (recommend wire connection to CIC KEY DIN (pin34)
// STM NES connects to CIC KEY DIN (pin34) & NTSC 24Mhz Clock
#define C3bank GPIOA
#define C3 (6U)
#ifdef PURPLE_KAZZO
@ -738,6 +689,8 @@ void software_AXL_CLK();
#define C6 (10U)
// PC7 "AHL" mcupinB1
// AH Flipflop /OE is grounded on kazzo/stmadapter
// AH Flipflop /OE is tied to CLK with this "AHL_OEN" signal
#define C7bank GPIOB
#define C7 (1U)
@ -746,6 +699,7 @@ void software_AXL_CLK();
#define C8 (0U)
// PC9 "LED" mcupinC13
// This is also EXP9 on kazzo, stm adapter, and stm NES
#define C9bank GPIOC
#define C9 (13U)
@ -754,16 +708,16 @@ void software_AXL_CLK();
#define C10 (15U)
// PC11 "CIA10" mcupinA13
// This is also SWDIO pin
#define C11bank GPIOA
#define C11 (13U)
// PC12 "BL"
// Not defined
// Not defined because it's an MCU dedicated pin44 "BOOT0"
#define C12nodef
// PC13 "AXL" mcupinA2
#define C13bank GPIOA
#define C13 (2U)
// PC13 "AXL"
// Differs between STM_ADAPTER and STM_NES so defined above
// PC14 "AUDL"
// Not defined
@ -782,6 +736,9 @@ void software_AXL_CLK();
#define C17nodef
// PC18 "SWC" mcupinA14
// This has no connection on STM_ADAPTER, recommended wire connection to CIC KEY DOUT (pin35)
// STM_NES connects this to CIC KEY DOUT
// PROBLEM... INL STM8 CIC cuts mcu pins by wire ORing RESET & DOUT...
#define C18bank GPIOA
#define C18 (14U)
@ -790,7 +747,7 @@ void software_AXL_CLK();
#define C19nodef
// PC20 "COUT"
// Not defined
// Not defined but maybe it should be in place of SWC..
#define C20nodef
// PC21 "FCAPU" double mapping of EXP0
@ -802,7 +759,7 @@ void software_AXL_CLK();
#define RCC_AHBENR_ADDR (RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN)
#define RCC_AHBENR_DATA RCC_AHBENR_GPIOBEN
#endif //STM_ADAPTER
#endif //STM_ADAPTER & STM_NES
#ifdef AVR_KAZZO
@ -1072,7 +1029,7 @@ void software_AXL_CLK();
#elif defined PURPLE_KAZZO
#define AHL_CLK() CTL_SET_HI(AHLbank, AHL); CTL_SET_LO(AHLbank, AHL)
#define AXL_CLK() CTL_SET_HI(FREEbank, FREE); CTL_SET_LO(FREEbank, FREE)
#else
#else //STM_NES ties AHL to the flipflop's /OE pin as well, so default should be low when address bus is enabled
#define AHL_CLK() CTL_SET_HI(AHLbank, AHL); CTL_SET_LO(AHLbank, AHL)
#define AXL_CLK() CTL_SET_HI(AXLbank, AXL); CTL_SET_LO(AXLbank, AXL)
#endif
@ -1266,6 +1223,9 @@ void software_AXL_CLK();
// INL6 has direct pin access
// -these pins also act as Data8-15 for Sega Genesis
// -has separate pins dedicated to A16-23
// STM_NES doesn't use a flipflop, has direct access or dual purposed pinning
// EXP1-3,6 has dedicated mcu pin
// EXP4-5,7-8 connect to A4-7
// Directionality: All pins are forced output, or tristate. This maintains compatability
// between all devices
// Driver: All pins are push-pull, AVR & STM ADAPTER drive with 5v signals, INL6 drives with 3.3v
@ -1307,21 +1267,38 @@ void software_AXL_CLK();
#define E68bank GPIOA
//TODO this is not complete!!! it's still a copy paste from the prototype
#define EXP_PU() E157bank->PUPDR |= (PUPDR_PU_ALL & 0xFFF00000); E68bank->PUPDR |= (PUPDR_PU_ALL & 0x30000300)
#define EXP_IP() E157bank->MODER &=~(MODER_OP_ALL & 0xFFF00000); E68bank->MODER &=~(MODER_OP_ALL & 0x30000300)
#define EXP_OP() E157bank->MODER |= (MODER_OP_ALL & 0xFFF00000); E68bank->MODER |= (MODER_OP_ALL & 0x30000300)
#define EXP_PU() //E157bank->PUPDR |= (PUPDR_PU_ALL & 0xFFF00000); E68bank->PUPDR |= (PUPDR_PU_ALL & 0x30000300)
#define EXP_IP() //E157bank->MODER &=~(MODER_OP_ALL & 0xFFF00000); E68bank->MODER &=~(MODER_OP_ALL & 0x30000300)
#define EXP_OP() //E157bank->MODER |= (MODER_OP_ALL & 0xFFF00000); E68bank->MODER |= (MODER_OP_ALL & 0x30000300)
//not sure these bit shift accesses will work if the value passed in is a uint8_t variable...
#define EXP_SET(val) E157bank->ODR = ((E157bank->ODR & 0x03FF) | (val<<10 & 0x7C00) | (val<<9 & 0x8000)); E68bank->ODR = ((E68bank->ODR & 0xBFEF) | (val>>1 & 0x0010) | (val<<7 & 0x4000))
#define EXP_SET(val) //E157bank->ODR = ((E157bank->ODR & 0x03FF) | (val<<10 & 0x7C00) | (val<<9 & 0x8000)); E68bank->ODR = ((E68bank->ODR & 0xBFEF) | (val>>1 & 0x0010) | (val<<7 & 0x4000))
#define EXP_EN_CLK() RCC->AHBENR |= RCC_AHBENR_EXP
#define EXP_ENABLE() ADDR_EN_CLK(); EXP_OP()
#define EXP_DISABLE() EXP_PU(); EXP_IP()
#define EXP_EN_CLK() //RCC->AHBENR |= RCC_AHBENR_EXP
#define EXP_ENABLE() //ADDR_EN_CLK(); EXP_OP()
#define EXP_DISABLE() //EXP_PU(); EXP_IP()
#endif //STM_INL6
#ifdef STM_NES
//TODO
//EXP1-3,6 has dedicated mcu pin
// EXP1:PA1, EXP2:PC14, EXP3:PC15, EXP6:PA2
//EXP4-5,7-8 connect to A4-7
// EXP4:A4->PB6, EXP5:A5->PB7, EXP7:A6->PA8, EXP8:A7->PA9
#define E1678bank GPIOA
#define E45bank GPIOB
#define E23bank GPIOC
//TODO
#define EXP_PU()// E157bank->PUPDR |= (PUPDR_PU_ALL & 0xFFF00000); E68bank->PUPDR |= (PUPDR_PU_ALL & 0x30000300)
#define EXP_IP()// E157bank->MODER &=~(MODER_OP_ALL & 0xFFF00000); E68bank->MODER &=~(MODER_OP_ALL & 0x30000300)
#define EXP_OP()// E157bank->MODER |= (MODER_OP_ALL & 0xFFF00000); E68bank->MODER |= (MODER_OP_ALL & 0x30000300)
//not sure these bit shift accesses will work if the value passed in is a uint8_t variable...
#define EXP_SET(val)// E157bank->ODR = ((E157bank->ODR & 0x03FF) | (val<<10 & 0x7C00) | (val<<9 & 0x8000)); E68bank->ODR = ((E68bank->ODR & 0xBFEF) | (val>>1 & 0x0010) | (val<<7 & 0x4000))
#define EXP_EN_CLK()// RCC->AHBENR |= RCC_AHBENR_EXP
#define EXP_ENABLE()// ADDR_EN_CLK(); EXP_OP()
#define EXP_DISABLE()// EXP_PU(); EXP_IP()
#endif //STM_NES
@ -1385,7 +1362,7 @@ void software_AXL_CLK();
// ---------------------------------------------------------------------------------------
// HIGH ADDRESS PORT 8bits A16-23
//
// This port is present on all devices
// This port is present on all devices with SNES connector
// Restrictions: CANNOT be used when EXPANSION PORT is enabled
// CIRAM_A10 & CIRAM /CE cannot be used on CONTROL PORT
// Directionality: All pins are forced output
@ -1401,7 +1378,7 @@ void software_AXL_CLK();
//
// ---------------------------------------------------------------------------------------
#if defined STM_INL6_PROTO
#ifdef STM_INL6_PROTO
//A16-21 are on PB10-15 these also map to EXP1-5, & 7
//A22-23 are on PA9-10 these also map to CIRAM A10 & CIRAM /CE respectively
@ -1418,7 +1395,9 @@ void software_AXL_CLK();
#define HADDR_ENABLE() HADDR_EN_CLK(); HADDR_OP()
#define HADDR_DISABLE() HADDR_PU(); HADDR_IP()
#elif defined STM_INL6
#endif //STM_INL6_PROTO
#ifdef STM_INL6
//A16-21 are on PB2-7 these also map to EXP1-5, & 7 (changed from prototype)
//A22-23 are on PA9-10 these also map to CIRAM A10 & CIRAM /CE respectively
@ -1435,12 +1414,15 @@ void software_AXL_CLK();
#define HADDR_ENABLE() HADDR_EN_CLK(); HADDR_OP()
#define HADDR_DISABLE() HADDR_PU(); HADDR_IP()
//end STM_INL6 & PROTO
//TODO STM_NES
#endif //STM_INL6
#else //AVR_KAZZO or STM_ADAPTER
#ifdef STM_NES
//HADDR is NOT PRESENT!
#endif
//#else //AVR_KAZZO or STM_ADAPTER
#if defined(AVR_KAZZO) || defined(STM_ADAPTER)
// ADDR16-23 are behind AXL flipflop
@ -1506,7 +1488,32 @@ void software_AXL_CLK();
#endif //STM_INL6 & PROTO
//TODO STM_NES
#ifdef STM_NES
//TODO BLINDLY COPIED FROM STM6, will not work AS-IS
// PE0 "A0" mcupinC0
// TODO!!!
#define E0bank //GPIOC
#define E0 //(0U)
// PE1 "D0" //mcupinB2
#define E1bank //GPIOB
#define E1 //(2U)
// PE2 "D8" //mcupinB10
#define E2bank //GPIOB
#define E2 //(10U)
// PE3 "D9" //mcupinB11
#define E3bank //GPIOB
#define E3 //(11U)
// PE4 "D10" //mcupinB12
#define E4bank //GPIOB
#define E4 //(12U)
#endif
#ifdef STM_ADAPTER

View File

@ -1,5 +1,8 @@
#include "sega.h"
//only need this file if connector is present on the device
#ifdef SEGA_CONN
//=================================================================================================
//
// SEGA operations
@ -57,3 +60,6 @@ void sega_wr( uint16_t addr, uint8_t data )
{
return;
}
#endif //SEGA_CONN

View File

@ -1,5 +1,8 @@
#include "snes.h"
//only need this file if connector is present on the device
#ifdef SNES_CONN
//=================================================================================================
//
// SNES operations
@ -335,3 +338,5 @@ void snes_3v_flash_wr( uint16_t addr, uint8_t data )
return;
}
#endif //SNES_CONN

View File

@ -109,14 +109,19 @@ uint16_t usbFunctionSetup(uint8_t data[8]) {
rv[RETURN_ERR_IDX] = io_call( spacket->opcode, spacket->miscdata, spacket->operand, &rv[RETURN_LEN_IDX] );
break;
#ifdef NES_CONN
case DICT_NES:
rv[RETURN_ERR_IDX] = nes_call( spacket->opcode, spacket->miscdata, spacket->operand, &rv[RETURN_LEN_IDX] );
break;
#endif
#ifdef SNES_CONN
case DICT_SNES:
rv[RETURN_ERR_IDX] = snes_call( spacket->opcode, spacket->miscdata, spacket->operand, &rv[RETURN_LEN_IDX] );
break;
#endif
#ifdef GB_CONN
case DICT_GAMEBOY:
rv[RETURN_ERR_IDX] = gameboy_call( spacket->opcode, spacket->miscdata, spacket->operand, &rv[RETURN_LEN_IDX] );
break;
@ -124,14 +129,19 @@ uint16_t usbFunctionSetup(uint8_t data[8]) {
case DICT_GBA:
rv[RETURN_ERR_IDX] = gba_call( spacket->opcode, spacket->miscdata, spacket->operand, &rv[RETURN_LEN_IDX] );
break;
#endif
#ifdef SEGA_CONN
case DICT_SEGA:
rv[RETURN_ERR_IDX] = sega_call( spacket->opcode, spacket->miscdata, spacket->operand, &rv[RETURN_LEN_IDX] );
break;
#endif
#ifdef N64_CONN
case DICT_N64:
rv[RETURN_ERR_IDX] = n64_call( spacket->opcode, spacket->miscdata, spacket->operand, &rv[RETURN_LEN_IDX] );
break;
#endif
case DICT_SWIM:
rv[RETURN_ERR_IDX] = swim_call( spacket->opcode, spacket->miscdata, spacket->operand, &rv[RETURN_LEN_IDX] );

View File

@ -63,6 +63,9 @@
#define SET_CUR_BANK 0x20
#define SET_BANK_TABLE 0x21
#define NES_M2_LOW_WR 0x22 //like CPU WR, but M2 stays low
//=============================================================================================
// OPCODES WITH OPERAND AND RETURN VALUE plus SUCCESS/ERROR_CODE
//=============================================================================================