Author Topic: Accessing the CD system without the system card  (Read 1003 times)

nodtveidt

  • Guest
Accessing the CD system without the system card
« on: January 23, 2011, 05:41:15 PM »
This was part of the plan for the Street Fighter II' project but it was scrapped. I want to know how to access the CDROM system hardware without using a system card; aka how to control the CDROM hardware on a hucard. Any leads? Or perhaps a system card disassembly?

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Accessing the CD system without the system card
« Reply #1 on: January 23, 2011, 10:58:17 PM »
There's a disassembly floating around on the net. I think zeograd had it on his site. It's only partially commented, but that's better than nothing....

nodtveidt

  • Guest
Re: Accessing the CD system without the system card
« Reply #2 on: January 24, 2011, 12:23:15 AM »
OK thanks for the hint. I did make a disassembly of the system card using dis.exe found on zophar.net not long after I made this post, but zeograd's site seems to have the same thing with some comments. This might be more useful. :D

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Accessing the CD system without the system card
« Reply #3 on: January 24, 2011, 12:36:57 AM »
OK thanks for the hint. I did make a disassembly of the system card using dis.exe found on zophar.net not long after I made this post, but zeograd's site seems to have the same thing with some comments. This might be more useful. :D

Yeah comments tend to help with 6502 disassembly, which usually looks like someone just smacked their nuts on a keyboard and saved the file.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Accessing the CD system without the system card
« Reply #4 on: January 24, 2011, 01:48:54 AM »
Keep in mind that not all of the card is cd-related, either. Bank 1 (the second 8K) is the mml player, and Bank 2 is the line-graphics and math routines. Basically, you just have to figure out whats going on in the first 8K.

And somewhere Charlie has a list of what the cd/adpcm registers control. That will be a big help figuring out how to actually write to the hardware.

nodtveidt

  • Guest
Re: Accessing the CD system without the system card
« Reply #5 on: January 24, 2011, 03:08:11 AM »
Well, this seems to be helping a bit. Been awhile since I messed with the assembler. This is the CD_RESET subroutine reworked for pceas, though I'm not quite certain exactly what it does:

Code: [Select]
CD_RESET:
lda #$02
tsb $1804
ldy #$0a
ldx #$3b
decx1:
dex
bne decx1
decy1:
dey
bne decy1
lda $1804
and #$fd
sta $1804
ldx #$77
decx2:
dex
bne decx2
rts
I'll keep looking at the disassembly for more information. Basically, my aim is to write a microdriver capable of initializing the CDROM system enough to enable redbook playback and access to the ADPCM circuit from a regular hucard. I don't know if any emulators would support this though... YAME probably will because of how it's set up, and a recent build of mednafen might as well... but I doubt Hu-Go! will, and Ootake is only a maybe.

EDIT: Oh, and bank 1 seems to have some important routines too, but it seems that for the most part, it just calls subroutines in bank 0... mainly just cluster subs, probably a convenience measure taken when they were writing the system card software. For example, jsr cb0f during the boot sequence goes to a sub in bank 1 that calls a ton of other subs in one fell swoop, mostly in bank 0. But yeah, most of the "good stuff" is in bank 0.
« Last Edit: January 24, 2011, 03:19:00 AM by The Old Rover »

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Accessing the CD system without the system card
« Reply #6 on: January 24, 2011, 04:53:49 AM »
It's basically a couple of delay loops and a test to see if the cd is ready. $1804 is one of the hardware addresses - that's why It pays to find charlies doc about the hardware. Then you can actually figure out what bits it tests....

And I think the stuff in bank 1 is calling some of the interrupt stuff in bank 0 for the mml player. The player irq hook has to be mapped in all the time (at least part of it), but there's not enough room to keep it all in bank 0. But I Could Be Wrong - it's been a while since I looked at any of the cd stuff.

nodtveidt

  • Guest
Re: Accessing the CD system without the system card
« Reply #7 on: January 24, 2011, 05:28:23 AM »
Well, Charles is on IRC at this very minute so I'll bug him about that. :D

nodtveidt

  • Guest
Re: Accessing the CD system without the system card
« Reply #8 on: January 24, 2011, 05:59:20 AM »
OK... he pointed me to this document:

http://cgfm2.emuviews.com/txt/pcetech.txt

which confirms a lot of what I'm looking at and should be enough to get this ball rolling a little faster. :D

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Accessing the CD system without the system card
« Reply #9 on: January 24, 2011, 06:25:22 AM »
That's the one!. Knowing the reset bit may not help, but knowing the other addresses should make things much easier. Especially the adpcm buffer addresses :-)

Good Luck!

Edit: Thinking about this makes me wonder: What are you planning on doing, making your own CD-System card?
Or..... Uh-oh. Don't answer that question here. Arkhan will pee himself.....
« Last Edit: January 24, 2011, 06:28:25 AM by TheOldMan »

nodtveidt

  • Guest
Re: Accessing the CD system without the system card
« Reply #10 on: January 24, 2011, 07:25:41 AM »
Haha :) nah, just wanting to write a microdriver to allow CD audio playback from a hucard, like SFII' was originally supposed to have. Tom and I did plan on making a System Card 4 which would double the normal RAM to 512KB plus add the extra banks of the ACD as well as implement ISO-9660 compliance (much like the Games Express card did) but we never got around to it.

nikdog

  • Full Member
  • ***
  • Posts: 165
Re: Accessing the CD system without the system card
« Reply #11 on: January 24, 2011, 10:24:09 AM »
Basically, my aim is to write a microdriver capable of initializing the CDROM system enough to enable redbook playback and access to the ADPCM circuit from a regular hucard. I don't know if any emulators would support this though... YAME probably will because of how it's set up, and a recent build of mednafen might as well... but I doubt Hu-Go! will, and Ootake is only a maybe.

Mednafen should do it, even 8.0. Just have to tell it that your HuCard is your cd system card and load the cd you want to use.

nodtveidt

  • Guest
Re: Accessing the CD system without the system card
« Reply #12 on: January 24, 2011, 11:49:49 AM »
That's a great idea... it should work fine. :) I'm about halfway through the process of converting enough of the BIOS functions to support the idea... but I might also have to swipe some code from pceas's cdrom source to make it fully work.

MottZilla

  • Full Member
  • ***
  • Posts: 192
Re: Accessing the CD system without the system card
« Reply #13 on: January 26, 2011, 05:43:18 AM »
Pretty cool sounding project. Where did you hear that SF2CE was supposed to be on CD/have CD audio?

Necromancer

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 21371
Re: Accessing the CD system without the system card
« Reply #14 on: January 26, 2011, 06:24:31 AM »
Where did you hear that SF2CE was supposed to be on CD/have CD audio?


I remember hearing that rumor from a variety of magazines - here's one of 'em.  Dig that white Avenue Pad 6 with what appears to be a threaded insert for a mini-joystick, like those Gravis pc pads from way back when.
U.S. Collection: 98% complete    157/161 titles