copyright headers for AVR firmware
This commit is contained in:
parent
f6f5a64cab
commit
02e9bfb756
@ -101,7 +101,7 @@ FORMAT = ihex
|
|||||||
TARGET = $(OBJDIR)/sd2snes
|
TARGET = $(OBJDIR)/sd2snes
|
||||||
|
|
||||||
# List C source files here. (C dependencies are automatically generated.)
|
# List C source files here. (C dependencies are automatically generated.)
|
||||||
SRC = main.c ff.c utils.c timer.c led.c diskio.c sdcard.c spi.c crc7.c snes.c fpga.c memory.c crc16.c fileops.c fpga_spi.c smc.c filetypes.c
|
SRC = main.c ff.c utils.c led.c diskio.c sdcard.c spi.c crc7.c snes.c fpga.c memory.c crc16.c fileops.c fpga_spi.c smc.c filetypes.c
|
||||||
|
|
||||||
ifeq ($(CONFIG_UART_DEBUG),y)
|
ifeq ($(CONFIG_UART_DEBUG),y)
|
||||||
SRC += uart.c
|
SRC += uart.c
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb, original
|
||||||
|
disclaimer follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
# This may not look like it, but it's a -*- makefile -*-
|
# This may not look like it, but it's a -*- makefile -*-
|
||||||
|
# sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
# Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
#
|
||||||
|
# This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
# Original disclaimer follows:
|
||||||
#
|
#
|
||||||
# sd2iec - SD/MMC to Commodore serial bus interface/controller
|
# sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
# Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
# Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|||||||
@ -1,4 +1,10 @@
|
|||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
Inspiration and low-level SD/MMC access based on code from MMC2IEC
|
Inspiration and low-level SD/MMC access based on code from MMC2IEC
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,28 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
// fileops.c: convenience
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
fileops.c: simple file access functions
|
||||||
|
*/
|
||||||
|
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|||||||
@ -1,5 +1,28 @@
|
|||||||
// insert cool lenghty disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
// fileops.h
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
fileops.h: simple file access functions
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef FILEOPS_H
|
#ifndef FILEOPS_H
|
||||||
#define FILEOPS_H
|
#define FILEOPS_H
|
||||||
|
|||||||
@ -1,4 +1,28 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
filetypes.c: directory scanning and file type detection
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|||||||
@ -1,15 +1,38 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
// filetypes.h: fs scanning and file identification
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
filetypes.h: directory scanning and file type detection
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef FILETYPES_H
|
#ifndef FILETYPES_H
|
||||||
#define FILETYPES_H
|
#define FILETYPES_H
|
||||||
|
|
||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
typedef enum {
|
typedef enum {
|
||||||
TYPE_UNKNOWN = 0, /* 0 */
|
TYPE_UNKNOWN = 0, /* 0 */
|
||||||
TYPE_SMC, /* 1 */
|
TYPE_SMC, /* 1 */
|
||||||
TYPE_SRM, /* 2 */
|
TYPE_SRM, /* 2 */
|
||||||
TYPE_SPC /* 3 */
|
TYPE_SPC /* 3 */
|
||||||
} SNES_FTYPE;
|
} SNES_FTYPE;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
28
src/fpga.c
28
src/fpga.c
@ -1,7 +1,29 @@
|
|||||||
// insert cool lenghty disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
fpga.c: FPGA (re)configuration
|
||||||
|
*/
|
||||||
|
|
||||||
// fpga.c: FPGA (re)programming
|
|
||||||
// XXX TODO move SPI functions to fpga_spi.c!
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
|||||||
26
src/fpga.h
26
src/fpga.h
@ -1,6 +1,28 @@
|
|||||||
// insert cool lenghty disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
// fpga.h
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
fpga.h: FPGA (re)configuration
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef FPGA_H
|
#ifndef FPGA_H
|
||||||
#define FPGA_H
|
#define FPGA_H
|
||||||
|
|||||||
@ -1,20 +1,44 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
fpga_spi.h: functions for SPI ctrl, SRAM interfacing and feature configuration
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
fpga_spi.c: SPI functions for SRAM interfacing and mapper config
|
|
||||||
|
|
||||||
SPI commands
|
SPI commands
|
||||||
|
|
||||||
cmd param function
|
cmd param function
|
||||||
=============================================
|
=============================================
|
||||||
00 bb[hh[ll]] set address to 0xbb0000, 0xbbhh00, or 0xbbhhll
|
00 bb[hh[ll]] set address to 0xbb0000, 0xbbhh00, or 0xbbhhll
|
||||||
10 bbhhll set SNES input address mask to 0xbbhhll
|
10 bbhhll set SNES input address mask to 0xbbhhll
|
||||||
2s bbhhll set SRAM address mask for chip #s to 0xbbhhll
|
20 bbhhll set SRAM address mask to 0xbbhhll
|
||||||
3m - set mapper to m
|
3m - set mapper to m
|
||||||
0=HiROM, 1=LoROM
|
0=HiROM, 1=LoROM, 2=ExHiROM, 7=Menu
|
||||||
80 - read with increment
|
80 - read with increment
|
||||||
81 - read w/o increment
|
81 - read w/o increment
|
||||||
90 {xx}* write xx with increment
|
90 {xx}* write xx with increment
|
||||||
91 {xx}* write xx w/o increment
|
91 {xx}* write xx w/o increment
|
||||||
|
F0 - receive test token (to see if FPGA is alive)
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,28 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
fpga_spi.h: functions for SPI ctrl, SRAM interfacing and feature configuration
|
||||||
|
*/
|
||||||
|
|
||||||
#define FPGA_SS_HIGH() do {PORTC |= _BV(PC7);} while (0)
|
#define FPGA_SS_HIGH() do {PORTC |= _BV(PC7);} while (0)
|
||||||
#define FPGA_SS_LOW() do {PORTC &= ~_BV(PC7);} while (0)
|
#define FPGA_SS_LOW() do {PORTC &= ~_BV(PC7);} while (0)
|
||||||
|
|||||||
16
src/led.c
16
src/led.c
@ -1,10 +1,12 @@
|
|||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
Inspiration and low-level SD/MMC access based on code from MMC2IEC
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
by Lars Pontoppidan et al., see sdcard.c|h and config.h.
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
FAT filesystem access based on code from ChaN and Jim Brain, see ff.c|h.
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -19,9 +21,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
led.c: LED control
|
||||||
led.c: LED handling
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
|||||||
16
src/led.h
16
src/led.h
@ -1,10 +1,12 @@
|
|||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
Inspiration and low-level SD/MMC access based on code from MMC2IEC
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
by Lars Pontoppidan et al., see sdcard.c|h and config.h.
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
FAT filesystem access based on code from ChaN and Jim Brain, see ff.c|h.
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -19,9 +21,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
led.c: LED control
|
||||||
led.h: Definitions for the LEDs
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LED_H
|
#ifndef LED_H
|
||||||
|
|||||||
22
src/main.c
22
src/main.c
@ -1,10 +1,12 @@
|
|||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
Inspiration and low-level SD/MMC access based on code from MMC2IEC
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
by Lars Pontoppidan et al., see sdcard.c|h and config.h.
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
FAT filesystem access based on code from ChaN and Jim Brain, see ff.c|h.
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -19,9 +21,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
main.c: initialization and flow
|
||||||
main.c: Lots of init calls for the submodules
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
#include "diskio.h"
|
#include "diskio.h"
|
||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
#include "timer.h"
|
/* #include "timer.h" */
|
||||||
#include "fpga.h"
|
#include "fpga.h"
|
||||||
#include "uart.h"
|
#include "uart.h"
|
||||||
#include "ustring.h"
|
#include "ustring.h"
|
||||||
@ -153,11 +153,11 @@ int main(void) {
|
|||||||
spi_none();
|
spi_none();
|
||||||
snes_reset(1);
|
snes_reset(1);
|
||||||
uart_init();
|
uart_init();
|
||||||
sei(); // suspected to reset the AVR when inserting an SD card
|
sei();
|
||||||
_delay_ms(100);
|
_delay_ms(100);
|
||||||
disk_init();
|
disk_init();
|
||||||
snes_init();
|
snes_init();
|
||||||
timer_init();
|
/* timer_init(); */
|
||||||
uart_puts_P(PSTR("\nsd2snes " VERSION));
|
uart_puts_P(PSTR("\nsd2snes " VERSION));
|
||||||
uart_putcrlf();
|
uart_putcrlf();
|
||||||
|
|
||||||
|
|||||||
27
src/memory.c
27
src/memory.c
@ -1,5 +1,28 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
// memory.c: SRAM operations
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
memory.c: RAM operations
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
|||||||
27
src/memory.h
27
src/memory.h
@ -1,5 +1,28 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
// memory.h
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
memory.h: RAM operations
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef MEMORY_H
|
#ifndef MEMORY_H
|
||||||
#define MEMORY_H
|
#define MEMORY_H
|
||||||
|
|||||||
27
src/smc.c
27
src/smc.c
@ -1,5 +1,28 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
// filetypes.c: File support
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
smc.c: SMC file related operations
|
||||||
|
*/
|
||||||
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
|
|||||||
28
src/smc.h
28
src/smc.h
@ -1,8 +1,28 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
/*
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
* smc.h: data structures for SNES ROM images
|
See sdcard.c|h, config.h.
|
||||||
*/
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
smc.h: SMC file structures
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SMC_H
|
#ifndef SMC_H
|
||||||
#define SMC_H
|
#define SMC_H
|
||||||
|
|||||||
26
src/snes.c
26
src/snes.c
@ -1,6 +1,28 @@
|
|||||||
// insert cool lengthy disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
// snes.c: SNES hardware control (resetting)
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
snes.c: SNES hardware control and monitoring
|
||||||
|
*/
|
||||||
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include "avrcompat.h"
|
#include "avrcompat.h"
|
||||||
|
|||||||
26
src/snes.h
26
src/snes.h
@ -1,6 +1,28 @@
|
|||||||
// insert cool lenghty disclaimer here
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
AVR firmware portion
|
||||||
|
|
||||||
// snes.h
|
Inspired by and based on code from sd2iec, written by Ingo Korb et al.
|
||||||
|
See sdcard.c|h, config.h.
|
||||||
|
|
||||||
|
FAT file system access based on code by ChaN, Jim Brain, Ingo Korb,
|
||||||
|
see ff.c|h.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License only.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
snes.h: SNES hardware control and monitoring
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SNES_H
|
#ifndef SNES_H
|
||||||
#define SNES_H
|
#define SNES_H
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
/* sd2snes - SD card based universal cartridge for the SNES
|
||||||
|
Copyright (C) 2009-2010 Maximilian Rehkopf <otakon@gmx.net>
|
||||||
|
This file was adapted from sd2iec, written by Ingo Korb.
|
||||||
|
Original copyright header follows:
|
||||||
|
*/
|
||||||
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
/* sd2iec - SD/MMC to Commodore serial bus interface/controller
|
||||||
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
Copyright (C) 2007-2009 Ingo Korb <ingo@akana.de>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user