Giter Site home page Giter Site logo

virtualmc's Introduction

Quick notes:

This project is no longer in development, I have moved my efforts to the ESP32: https://github.com/johnbaumann/OpenMC

Check out the just_the_card branch for a stripped down version of the project which removes everything but the memory card functionality, hopefully this makes the code easier to digest. The self-write call is commented out, so the stock arduino bootloader can be used.

VirtualMC

Experimental implementation of an Arduino as a Playstation 1 Memory Card(and now game pad) - This is still a work in progress, updates are mostly stable but may have unexpected results

Game save data is stored in program memory, with space for 3 blocks = Directory + 2 save files -Plans to adapt the code for MEGA2560 to expand storage

Read/Write functions working on console

Read/Write working over serial using memcarduino protocol, compatible with MemcardRex

Device can function as a digital pad. Pad state is sent over serial, accurate timing requires a pin for RTS/CTS flow control

Serial commands can be used to set pad/card SIO interfaces to active/inactive

Memory Card and Pad are enabled by default

ISSUES

Directory entries past 3rd block not suppressed, though the sectors themselves are.

If device is powered externally and disconnected from a console, serial commands are unavailable unless the slave select pin is pulled high.

To-do

Write a program or python script for mapping inputs and sending them over serial

Suppress directory entries beyond available blocks.

Sleep SIO if ATT+SCK stay low - i.e. if not connected to console

Fix up platformio.ini

Rewrite code for flash memory page sizes + far memory access for future Mega 2560 support

Connections / Hardware

Arduino Pro Mini 328P 8Mhz @ 3.3V w/ Minicore by MCUDude - https://github.com/MCUdude/MiniCore/

FTDI TTL

PS Side to Arduino digital as follows

1 -> 12 // DATA/MISO

2 -> 11 // CMND/MOSI

3 -> RAW // 7.6V to regulated input

4 -> GND // Ground to ground

5 -> Unused

6 -> 10 // ATT/SS

7 -> 13 // Clock/CLK/SCK

8 -> 9 // ACK/Acknowledge

FTDI to Arduino

TXD -> RXD

RXD -> TXD

GND -> GND

CTS ->2

RTS ->3 //Not monitored by arduino atm, keeping here for future compatibility.

Various code and snippets from the following sources

https://github.com/ShendoXT/memcarduino

https://github.com/taka-tuos/memcarduinoplus

https://problemkaputt.de/psx-spx.htm

virtualmc's People

Contributors

johnbaumann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

virtualmc's Issues

SPM_PAGESIZE between platforms

SPM_PAGESIZE varies between platforms; 328p = 128, 2560 = 256.

Memory is currently read byte per byte, but no such functionality exists for writes, instead writes are per page. On the 328p this is straightforward as page sizes match the PS1 memory card at 128bytes per frame. The 2560 would require a more advanced scheme.

A page buffer could be used, assuming that each sector write would occur in sequential order.
In the event of a timeout or non-sequential write, one part of the buffer is filled with the missing frame, written, and committed, repeat for other frame? Store address for both frames etc.

Read code must also be adapted for address space beyond 64Kb:
far_away
far_far_away
far_far_far_away

Maximum array sizes are 0x7FFF, need to split data between const arrays and align with page sizes.

Supress Directory Entries

Directory entries for blocks outside of the writable range are not being prevented. Test data currently provides empty directory entries. For 328p, need to prevent writing Block 0 Frames 4-15. Mega 2560 will support a full card image.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.