hardware:flashcarts
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| hardware:flashcarts [2023/08/18 22:11] – clyde | hardware:flashcarts [2025/11/16 03:25] (current) – dewbrite | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Flash Cartridges ====== | ====== Flash Cartridges ====== | ||
| - | {{ : | + | Cartridges connect to the GameTank' |
| + | |||
| + | ===== Pinout ===== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | |1. +5V | 19. A13| | ||
| + | |2. VIA PA2 | 20. _WRITE | | ||
| + | |3. VIA PA7 | 21. _IRQ | | ||
| + | |4. VIA PA1 | 22. A8 | | ||
| + | |5. VIA PA0 | 23. A9 | | ||
| + | |6. A12 | 24. A11 | | ||
| + | |7. A7 | 25. _READ | | ||
| + | |8. A6 | 26. A10 | | ||
| + | |9. A5 | 27. _SEL | | ||
| + | |10. A4 | 28. D7 | | ||
| + | |11. A3 | 29. D6 | | ||
| + | |12. A2 | 30. D5 | | ||
| + | |13. A1 | 31. D4 | | ||
| + | |14. A0 | 32. D3 | | ||
| + | |15. D0 | 33. A14 | | ||
| + | |16. D1 | 34. READY | | ||
| + | |17. D2 | 35. _RESET | | ||
| + | |18. CLK | 36. GND | | ||
| + | |||
| + | ==== Pinout Overview ==== | ||
| + | |||
| + | |||
| + | Cartridge memory is expected to be accessible through the address and data pins (A//x//, D//x//). These correspond _mostly_ to the CPU's address and data lines, notably for addresses 0x8000..=0xFFFF. | ||
| + | |||
| + | The most significant bit is used for pin 27 (Cartridge Select), and as such, the cartridge perceives the aforementioned address space in the range of 0x0000..=0x7FFF through pins A0..=A14 | ||
| + | |||
| + | Pin 27 (Cartridge Select, active low) corresponds to the CPU's most significant address bit, NOT. | ||
| + | |||
| + | Pins 25 and 20 (Read and Write, active low) corresponds to the CPU's r/w signals. | ||
| + | |||
| + | Pin 21 (IRQ, active low) corresponds to the CPU's IRQ line. | ||
| + | |||
| + | Pin 34 (Ready) is connected to the CPU's Ready line. | ||
| + | |||
| + | Pin 18 (Clock) is connected to the CPU clock (~3.5MHz) | ||
| + | |||
| + | Pins 2 to 5 correspond to VIA pins PA0, PA1, PA2, and PA7, and are expected to be customized per-cartridge. | ||
| + | |||
| + | The truth of the matter is, you can kind of do //whatever you want// with most of these pins, so, go wild, but, there are a number of well-supported cartridges that you may find useful. | ||
| + | |||
| + | |||
| + | ====== 2M Cartridge (J.21) ====== | ||
| + | |||
| + | {{ : | ||
| - | This page covers information about the 2MB Flash Cartridge for the GameTank. | ||
| The cartridge is built around a M29F160FT55N3E2 parallel NOR flash, which has 2 megabytes of storage capacity. | The cartridge is built around a M29F160FT55N3E2 parallel NOR flash, which has 2 megabytes of storage capacity. | ||
| Line 12: | Line 60: | ||
| Alongside the flash memory, the chip has a shift register connected to pins 2, 4, and 5 on the cartridge. This shift register may control the 7 most significant address bits on the flash. Specifically, | Alongside the flash memory, the chip has a shift register connected to pins 2, 4, and 5 on the cartridge. This shift register may control the 7 most significant address bits on the flash. Specifically, | ||
| + | |||
| + | ===== Writing to the flash chip ===== | ||
| + | |||
| + | |||
| ===== Interfacing with the shift register from software ===== | ===== Interfacing with the shift register from software ===== | ||
| Line 108: | Line 160: | ||
| RTS | RTS | ||
| </ | </ | ||
| + | |||
| + | ===== Reading from banked memory ===== | ||
| + | |||
| + | Any data that you want to access with the movable window should be referenced by its address relative to the start of its bank plus the cartridge port offset. So if you have data to access at $0, $4000, and $C000 bytes into your game binary you'd read from $8000 after setting the bank number to 0, 1, and 3 respectively. | ||
| + | |||
| + | The last 16KB of your game binary are always accessible at $C000-$FFFF, | ||
| + | |||
| + | Some toolchains like cc65 have features that can assign addresses in seemingly overlapping ranges depending on the linker configuration. | ||
| + | |||
| + | ===== Creating ROM files ===== | ||
| + | |||
| + | Both the GameTankEmulator and GameTankFlashingOverhauled will assume a file with a size of exactly 2^21 bytes is a ROM file for the 2MB flash cartridge. In this file all of the banks are concatenated together in the order of their bank number, including empty banks. | ||
| + | |||
| + | GameTankFlashingOverhauled will also treat any 16384-byte file with an extension like .bankXX (where XX is a hexadecimal number) as a single bank from the flashcart so that less time can be spent flashing empty banks. | ||
hardware/flashcarts.1692396716.txt.gz · Last modified: 2023/08/18 22:11 by clyde
