Mega-Cart hacking and writing the NvRAM...
Moderator: Moderators
Mega-Cart hacking and writing the NvRAM...
When I got the Mega-Cart and read about the NvRAM I decided it could be very useful for small developer tool kits.
The only problem was that all of the NvRAM was supposedly used by the menu system and would therefore interfere with normal operations.
After quite a bit of reverse-engineering I found that it was possible to use the NvRAM overlapping the control registers ($9c80-$9fff).
Here is a collection of a NvRAM writing utility and some technical information:
mega-tools-20090731.tar.gz
As a side effect of all this I got enough information to implement emulation of the Mega-Cart hardware in VICE. Available as of development version v2.1.15.
Note: Only write the NvRAM if you know what you are doing as you can easily corrupt your prefs if you write the wrong locations.
The only problem was that all of the NvRAM was supposedly used by the menu system and would therefore interfere with normal operations.
After quite a bit of reverse-engineering I found that it was possible to use the NvRAM overlapping the control registers ($9c80-$9fff).
Here is a collection of a NvRAM writing utility and some technical information:
mega-tools-20090731.tar.gz
As a side effect of all this I got enough information to implement emulation of the Mega-Cart hardware in VICE. Available as of development version v2.1.15.
Note: Only write the NvRAM if you know what you are doing as you can easily corrupt your prefs if you write the wrong locations.
Last edited by tlr on Mon Aug 03, 2009 7:49 am, edited 2 times in total.
Re: Mega-Cart hacking and writing the NvRAM...
Hey, My compliment to your brillant research work and for your excellent programming abilities.tlr wrote:Here is a collection of a NvRAM writing utility...
I've tested your Mega-inject tool for my next SJLoad patch for JiffyDos and uIEC/SD2IEC drives and it works has expected, you have "recycled" the Mega-Cart graphics by keeping the same look and feel of the menu, very great job.
As said, be careful, this programs must be used only if you know what you are doing, may be doungerous for your Mega-Cart if used improperly.
Wow, are you a Vice developer ?As a side effect of all this I got enough information to implement emulation of the Mega-Cart hardware in VICE. Available as of development version v2.1.15.
It will be nice for users to test the Mega-Cart before to buy, this is a very big thing !!!
Again my compliments for your work, do you work for CIA or something similar ?
Mega-Cart: the cartridge you plug in once and for all.
- Pedro Lambrini
- Vic 20 Scientist
- Posts: 1132
- Joined: Mon Dec 01, 2008 11:36 am
Wow! A while back I asked if it was possible to emulate the Mega-Cart and the answer seemed to be a no. It just shows that give a hacker/coder enough time and they can do anything! Well done.
PS: Is there going to be a public build of Vice available with this anytime soon?
PS: Is there going to be a public build of Vice available with this anytime soon?
"...That of the Eastern tribe being like a multitude of colours as if a rainbow had settled upon its brow..." Daniels 1:3
@tlr
I would like to see another cartridge emulation in VICE also.
We are shortly bevore releasing our final expansion v3.1: click
I could give you all information needed for this emulation of FE3.1. It would be highly appreciated to have such a emulation in VICE, but I can't so this job.
I would like to see another cartridge emulation in VICE also.
We are shortly bevore releasing our final expansion v3.1: click
I could give you all information needed for this emulation of FE3.1. It would be highly appreciated to have such a emulation in VICE, but I can't so this job.
Each Mega-cart has a custom user firmware, when the new Vice version will be out, all Mega-Cart users will may use a tool to extract their Vice Image, for the moment you may enjoy it just on real hardwareLozza wrote:and where for images of the 2 carts !?
Please be patient...
PS: Lozza, your old avatar was better
Mega-Cart: the cartridge you plug in once and for all.
Yes tlr does a very good work, my new SJLOAD patch for IO3 (based on Diddl SJLOAD routines) works very well and now we don't need to overwrite music data to add turbo support for sd2uiec and JiffyDos based drives.
This was possible only with your tool tlr, many thanks again for your work and many thanks to Diddl for his routines of course.
Btw my latest SJLOAD patch works from $9C86 to $9FFD so we need to find a new location for your Vic-Tracker patch, I suggest IO2 $9800-> $987F
PS: I wish release the final SJLOAD patch for all Mega-Cart users with a stand alone program to install the SJLOAD patch without user interaction, just LOAD and RUN, there is a standard way or do I need to hack your INJECTOR a bit ?
This was possible only with your tool tlr, many thanks again for your work and many thanks to Diddl for his routines of course.
Btw my latest SJLOAD patch works from $9C86 to $9FFD so we need to find a new location for your Vic-Tracker patch, I suggest IO2 $9800-> $987F
PS: I wish release the final SJLOAD patch for all Mega-Cart users with a stand alone program to install the SJLOAD patch without user interaction, just LOAD and RUN, there is a standard way or do I need to hack your INJECTOR a bit ?
Mega-Cart: the cartridge you plug in once and for all.
yw. I'm glad you find it useful.nbla000 wrote:This was possible only with your tool tlr, many thanks again for your work and many thanks to Diddl for his routines of course.
...or you just make your patch 34 bytes shorter...nbla000 wrote:Btw my latest SJLOAD patch works from $9C86 to $9FFD so we need to find a new location for your Vic-Tracker patch, I suggest IO2 $9800-> $987F
The vt patch is relocatable so you can just put it where you think it fits.
There is a standard way. From the readme:nbla000 wrote:PS: I wish release the final SJLOAD patch for all Mega-Cart users with a stand alone program to install the SJLOAD patch without user interaction, just LOAD and RUN, there is a standard way or do I need to hack your INJECTOR a bit ?
Code: Select all
Special feature:
Mega-Inject can be made to automatically inject a binary (after asking).
1. Copy mega-inject.prg to a new file.
2. Change the last byte of the new file to $00 (originally $ff).
3. Append a structure like below to the end of the file:
0 zero-terminated string shown before accepting.
(Max two lines + one empty recommended)
n Start address to write
n+2 Last address to write
n+4... data to write
Example:
dc.b "STRINGSTRINGSTRINGSTRI"
dc.b "STRINGSTRINGSTRINGSTRI"
dc.b 0
dc.w $9df1
dc.w $9e0f
dc.b 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
dc.b 20,21,22,23,24,25,26,27,28,29,30,31
OK, I will inform you for the new location in case you want to change your VT patch inside the tar.gz archive.tlr wrote:The vt patch is relocatable so you can just put it where you think it fits.
Sorry, i didn't read your readmeThere is a standard way. From the readme:nbla000 wrote:PS: I wish release the final SJLOAD patch for all Mega-Cart users with a stand alone program ...
Next week I will try it, time for holidays now
Mega-Cart: the cartridge you plug in once and for all.