|
Post by lunchbox on Dec 17, 2018 17:50:48 GMT
So, I've seen the turbo-usb2.exe file that is found under the downloads section on krikzz.com, however I don't see any usage instructions and calling it with /h or -? doesn't seem to produce anything useful that might show hows its used..
Also I do have to mention that I JUST installed the FTDI FT245RL chip and USB port onto my turbo everdrive and on centos7 linux bistro i am able to power the console on with the usb cable hooked up and see that under /var/log/messages that I have an FT245RL device connected and its showing the serial number associated with the device. So I have to assume its working somewhat. Under windows however I do not get a device that shows up and as unknown new hardware or even a comp port assigned to the usb device. Any ideas?
|
|
|
Post by lunchbox on Dec 17, 2018 18:27:43 GMT
spoke WAAAY tooo soon. its working
call it with turbo-usb2.exe filename.pce
|
|
|
Post by dshadoff on Dec 17, 2018 21:18:12 GMT
Glad to see you got it working... but I hadn't heard of anybody using the Turbo Everdrive in this way.
I just got a Turbo Everdrive myself, and I was wonder whether you could point me in the direction of any information (i.e. what new features are available ?)
I assume that the FTDI chip goes on the empty pads on the opposite side of the card from the SD card slot, and the USB socket goes on the 10 unused pads adjacent to it ?
Dave
|
|
|
Post by elmer on Dec 17, 2018 22:02:32 GMT
Glad to see you got it working... but I hadn't heard of anybody using the Turbo Everdrive in this way. It's not a new capability, the TED1 had it, too IIRC. When the TED2 came out krikzz used to sell them (for something like $15 extra) with the USB chips already installed ... that's when I bought mine. But at some point he decided that there weren't enough people willing to pay the extra cost to bother keeping them in stock, and so he just sells the base version now ... but you can enable the USB if you solder on the parts yourself (which I'd love to pay someone to do for my 2nd TED2 card). Being able to just squirt down a test ROM from your PC to the TED makes testing your stuff on real hardware really easy and pleasant. I've been using that capability to write/test some code so that we can read the TED2's SD card from within a game. Reading FAT32 isn't anywhere near as nasty as I'd thought. Writing FAT32 is a much bigger PITA, but it should be fairly easy to overwrite existing files instead so that we can save/load/swap backup memory to SD card. The USB link is just a serial FIFO that appears as a serial-port on the PC. IIRC, the drivers are standard on linux, but Windows users need to download them from FTDI's website. I included a couple of macros for reading/writing the USB in my TED2 Programming thread on PCEFX (that NW has now un-stickied because I've somehow offended him).
|
|
|
Post by dshadoff on Dec 17, 2018 22:14:10 GMT
Right... the FTDI chip being a serial-USB chip, I was just wondering what can be done over the serial line.
For example, the UperGrafx has an FTDI chip to do the same thing... but it automatically outputs a bunch of system-logging info as game execution happens, such as SCSI command etc. (and it appears to have some more functionality which hasn't been explained to me yet).
For the Turbo Everdrive, I guess it's just data transfer back and forth ? And access to the SD Card isn't handled by an intermediary processor ? (from your post here, it sounds like you wrote routines to do that)...
|
|
|
Post by elmer on Dec 17, 2018 22:38:52 GMT
Right... the FTDI chip being a serial-USB chip, I was just wondering what can be done over the serial line. krikzz has his utility that uploads a ROM image from the PC to the TED2, but that's the only capability built into the TED2 OS on the card itself. The TED2 OS runs entirely on the PCE, there is no secondary processor on the card. So both the USB and SD card hardware are available to be used by PCE homebrew in any way that we wish. krikzz released some very-low-level source code for using the capabilities years ago, but nobody seems to have built on it to program anything interesting, yet. You could easily squirt whatever data you like between the TED2 and your PC. It would be easy to transfer backup RAM images that way. But ... it would be even easier for most people (IMHO) if we could just read/write them from/to SD card. I tried to get SD card reading implemented a couple of years ago, but ran into a brick wall with the low level code failing. I took a look at it again a month or two ago and realized what I had been doing wrong, and have been (slowly) building up from there. I want to be able to use the SD card to build/test an ArcadeCard-style game someday.
|
|
|
Post by lunchbox on Dec 18, 2018 3:34:08 GMT
I've been able to get the usb port to work somewhat (writing bytes out) but havn't been able to read anything in yet. Not sure if im just tired and not seeing an obvious mistake or not. Im checking the status register to see if data is available in the fifo but... for some reason it isnt working..
Anyhow, ive been able to get the FT245RL Chip to do some cool stuff on the mega-everdrive x7 for the sega genesis. Currently ive got sonic2 able to play against another console with everdrive over the internet using a custom program to "translate" or handle serial tunneling. Works really well actually and thats basically my goal here as well. Its just going to take me a little bit of time to learn and get use to 6502 asm and the pc-engine hardware.
|
|
|
Post by lunchbox on Dec 18, 2018 17:34:47 GMT
but you can enable the USB if you solder on the parts yourself (which I'd love to pay someone to do for my 2nd TED2 card). So, as far as soldering the FT245RL chip and connector on, it wasnt too difficult tbh. I thankfully didn't really need to add any solder to the FTDI chip as the pads already had enough to make a decent connection (atleast on my TED PCB). Having a super duper fine tip and a good magnifying glass and positioning the chip on the board perfectly are key. Bridging of pins and heating up the chip too much are probably the main concerns. Beyond that, the only solder i really added was to the usb connector mounting pads to re-enforce it as plugging in and unplugging a usb cable might take its toll on the connector if it wasnt secured well. I could probably do it for you if you want. i wont charge you anything in exchange for solid, tested usb examples everyone could use or learn from.
|
|
|
Post by elmer on Dec 19, 2018 4:03:25 GMT
I could probably do it for you if you want. i wont charge you anything in exchange for solid, tested usb examples everyone could use or learn from. Now that is a good offer! I'll be very happy to take you up on it, but you'd need to wait a week-or-so for me to get a little bit further in the other things that I'm doing. In the meantime, I'll update my "programming" sticky with the latest TED2 header file that I'm using for the SD-card code. If you look at that, and KRIKzz's bios.s code that he released, then you may solve the problems yourself before I have the time to get something working myself.
|
|
|
Post by lunchbox on Dec 19, 2018 18:42:23 GMT
I took a look but honestly i was fairly tired when i looked through bios.s and my understanding of banking/mapping on the PCE is probably not the best. I was spoiled by messing with consoles that didnt require banking and had 64kb of ram or larger.
Anyhow, i guess my understanding of WHERE i can use the usb feature is the biggest roadblock. From what i gathered i wasnt able to use it unless i was in bank0 and also something about the first 16 bytes or more of bank0 had to be reserved for the TED? Also from what i understand i cant use the USB functions if the interrupts are enabled? I guess those are my biggest questions. Also the addressing between whats seen in the header file you posted on krikzz forums and also krikzz bios.s file are different. I see $E000 base address used on your header files and then Krikzz is using $4000 Area.
Anyhow, if you get examples going whenever, id love to know what setup you use for assembly (what assembler and if any publically avail libraries). Would be cool ot have an all in one working send/receive example in assembly.
Also just PM me whenever you're ready. you'll probably need to source an FT245RL Chip, but i have a few of the usb connectors left still, so don't worry about that part.
|
|
|
Post by elmer on Dec 22, 2018 19:56:05 GMT
I took a look but honestly i was fairly tired when i looked through bios.s and my understanding of banking/mapping on the PCE is probably not the best. I was spoiled by messing with consoles that didnt require banking and had 64kb of ram or larger. The hardware docs have some images that might make it clearer to you. The banking scheme that the PCE uses is very nice for the time in which it was designed. It's a much cleaner solution (IMHO) than the convoluted mess that Nintendo came up with in order to use the 65816. It's actually very similar to the virtual-memory scheme on later processors. But sure, a 32-bit linear address space is simpler to use. You have to get your mind around the difference between the processor's 64KB of logical address space that is mapped into view at any time, and the 2MB of physical address space that available to the cartridge, RAM and hardware. Anyhow, i guess my understanding of WHERE i can use the usb feature is the biggest roadblock. From what i gathered i wasnt able to use it unless i was in bank0 and also something about the first 16 bytes or more of bank0 had to be reserved for the TED? Also from what i understand i cant use the USB functions if the interrupts are enabled? I guess those are my biggest questions. Traditionally, cartridges are started by mapping bank 0 into mpr7 (logical addresses $E000-$FFFF), and that's where the processor's interrupt vectors are located. When you enable access to the TED2's hardware, it replaces bank 0 (in physical address space) with its own internal memory and hardware registers. So if an interrupt comes along while you're doing that, it's going to see the interrupt vectors in the TED2 ROM instead of the interrupt vectors in your cartridge image, and your program is probably going to crash. That is why you have to disable interrupts ... or, alternatively, you can rearrange your program's bank layout and not map bank 0 into mpr7. But neither HuC, not the CD BIOS support this, and you'd have to create your program entirely in assembly-language. Also the addressing between whats seen in the header file you posted on krikzz forums and also krikzz bios.s file are different. I see $E000 base address used on your header files and then Krikzz is using $4000 Area. That's because you can map physical bank0 into any mpr region (i.e. logical address) that you like ... if you've developed your program to handle that. Krikzz's use of $4000 is a good and sensible place to put it since he's running his own custom-built OS and he has his interrupt vectors in a different bank. I default to using it at $E000, and disabling interrupts, since that's what will work easiest with HuC and CD-based game development. I don't know if that all helps you, or if it is just technical gobbledygook.
|
|
|
Post by lunchbox on Dec 30, 2018 1:13:58 GMT
No, that definitely helps out.
So My end goal really is to plop usb code into existing game rom images. So for instance lets just pick dungeon explorer for example sake. Id probably be looking to insert code into the main game loop that would access the USB port for reading/writing. My guess would be that I would more than likely have to disable interrupts, save register contents and then map in TED to use the usb functions and then when finished just swap back to the bank I was in, restore register contents and then re-enable interrupts. Assuming the game is ok with added code in the game loop and it doesn't have any SUPER time sensitive stuff, this SHOULD work out in theory.
Thoughts or does that not seem logical? My experience with the FT245RL on the mega-everdrive (Sega genesis) has been that I can unlock the everdrive for USB port use once and leave it that way and just use when needed since there is no banking done on 99% of the game roms that exist. It seems that once the everdrive is unlocked that you don't have to really do much else and you can come back to use it at any time. Im just hoping that banking in and out on the PCE isn't going to cause problems or add significant delay for any reason aside from the steps mentioned above about storing register contents/disabling and enabling interrupts and such and the normal bank switching.
|
|
|
Post by dshadoff on Dec 30, 2018 2:25:52 GMT
What are you intending to read/write ? One (sort of) obvious use would be re-writing the CD_READ function, in order to use the PC as an external source for data.
Probably, you'd want to put your I/O access functions into system card-like functions, if you plan to make adjustments to existing games. Even if you don't replace existing functions, you could add new ones (beyond the end of the existing list of call addresses).
Dave
|
|
|
Post by elmer on Dec 30, 2018 2:42:23 GMT
What are you intending to read/write ? I think that lunchbox mentioned this earlier ... he wants to implement multi-console play over the internet. See ... Anyhow, ive been able to get the FT245RL Chip to do some cool stuff on the mega-everdrive x7 for the sega genesis. Currently ive got sonic2 able to play against another console with everdrive over the internet using a custom program to "translate" or handle serial tunneling. Works really well actually and thats basically my goal here as well.
|
|
|
Post by dshadoff on Feb 10, 2019 6:58:13 GMT
I could probably do it for you if you want. i wont charge you anything in exchange for solid, tested usb examples everyone could use or learn from. Now that is a good offer! I'll be very happy to take you up on it, but you'd need to wait a week-or-so for me to get a little bit further in the other things that I'm doing. In the meantime, I'll update my "programming" sticky with the latest TED2 header file that I'm using for the SD-card code. If you look at that, and KRIKzz's bios.s code that he released, then you may solve the problems yourself before I have the time to get something working myself. I was just chasing this stuff down, and had a lot trouble finding it (and not sure whether it's the right versions). I was able to find a version of your TED2 header from 2015 from within one of the threads on krikzz's forum (I didn't see references to the TED programming in your programming sticky). And as for Krikzz's bios.s file, I searched and searched, and finally found a reference to a dropbox location... but it was no longer serving the file. But I found something in the downloads section... looks like it's only the last bank of the actual bios file though (and done with a different assembler). Have I misuderstood, or have you not yet updated your programming sticky with this information ? Dave
|
|