Language…
10 users online:  Atari2.0, drkrdnk, Enan63, futhark, gr8fulAF, GRIMMKIN, kasoku,  Nanako, Nemesis1407, Pink Gold Peach - Guests: 256 - Bots: 413
Users: 64,795 (2,377 active)
Latest user: mathew

MSU1 Complications

I'm probably biting off more than I can chew here, but I'm getting impatient.

I have been trying to insert the MSU1 chip into level 105 using LevelASM, but to no avail.
Here's my code:
Quote
ldx #01
stx $2004
-lda $2000
bvs -
lda #$01
sta $2007

ldx #01
stx $2004
-lda $2000
bvs -
lda #$03
sta $2007

lda #$FF
sta $2006

RTS


I copied this from a MSU1 player made by Kawa. Though, I'm not sure if its the code or not, since I could never get their rom to play the music.

And here's my XML file:
Quote
>?xml version="1.0" encoding="UTF-8" ?<
- >cartridge region="NTSC"<
- >rom<
>map mode="linear" address="00-6f:8000-ffff" /<
>map mode="linear" address="80-ff:8000-ffff" /<
>/rom<
- >ram size="2000"<
>map mode="linear" address="70:0000-1fff" /<
>/ram<
- >msu1<
- >mmio<
>map address="00-6f:2000-2007" /<
>map address="80-ff:2000-2007" /<
>/mmio<
>/msu1<
>/cartridge<

( The > and < are swapped so the site doesn't report an error )

So to those who DO understand how to use this enhancement chip, what am I doing wrong?
Check out my Youtube channel! 獣耳 Brony for life.
Originally posted by Ddoomm10
-lda $2000
bvs -

I'm not sure if the - needs a space after it or not, but you want BIT here. Not LDA.
Also you need STZ $2005 after the STX $2004, unless X is already 16bit (and in that case, it'll probably crash since the LDX will assume 8bit).
And I have no idea why you're telling the MSU to play track 1 twice.
(I hope you're putting that in the INIT...)

I didn't check the XML file, so I'm not sure if it's correct. Try reading from $2002. If it returns #$53, then MSU is plugged in.
<blm> zsnes users are the flatearthers of emulation
Holy shit. I actually got it to work. If my dad wasn't sleeping in the other room, I'd be jumping off the walls right now.

Err, Here's the code I used for anyone stumbling across this thread:
Quote
levelinit105:
LDA $2002
CMP #$53
BNE levelinit105

ldx #01
stx $2004
stz $2005
- bit $2000
bvs -
lda #$01
sta $2007

lda #$FF
sta $2006

Check out my Youtube channel! 獣耳 Brony for life.
Quote
levelinit105:
LDA $2002
CMP #$53
BNE levelinit105

So you're going to throw in all non-bsnes emulators to an infinite loop.
Sounds nice.

$2002 is #$53 from the start if MSU1 is plugged in. No MSUs are going to magically appear then 5000th time you check. A better method is sending up an error message for non-bsnes.
<blm> zsnes users are the flatearthers of emulation
Alright, so...
Quote
LDA $2002
CMP #$53
BEQ MSU1
LDA #$02
STA $1DFB
RTS

MSU1:
ldx #01
stx $2004
stz $2005
- bit $2000
bvs -
lda #$01
sta $2007

lda #$FF
sta $2006
RTS

Does that work?
Check out my Youtube channel! 獣耳 Brony for life.
Yeah, that looks good. I don't have any MSU-compatible music nearby, so I can't test it, but it looks valid.
<blm> zsnes users are the flatearthers of emulation
I am happy to have indirectly contributed to this. Alcaro, you can use thisthis to make tracks.

Also, there's no real need to check for MSU1 availability unless you'll do fallback SPC music. If it's not available, sending "play track" commands will effectively do nothing, and the busy loop will terminate immediately because it'll never be nonzero.

It's the data track that causes the bigger compatibility problems and requires an error message.
If your just playing video, it's better to just skip playback then to issue an error. Of course, data tracks can be used for anything, but has anyone used them for anything besides video?
Your layout has been removed.
My jukebox sample uses the data stream to store graphics, track names and track counts.

The only graphics data in ROM is the "this requires MSU1 support" error screen.