ARGHRGRHRG!! I can not figure this out... As far as I can tell, I don't seem to be doing anything too different from that one, but mine won't work on bsnes... *sigh* this is the only thing stopping me from making any more progress on my homebrew... I suppose i'll post my current code again, hopefully some can tell me what I am doing wrong:
http://www.pastebay.net/1070974
SPC700 help
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
Re: SPC700 help
@Shiriu it's strange how your SPC code uses 6502-like syntax.
@wiiqwertyuiop : Maybe it would be better if you told us what goes wrong ?
@wiiqwertyuiop : Maybe it would be better if you told us what goes wrong ?
Re: SPC700 help
It is optional in the Bass assembler, the best of currently available SPC700 assemblers. Actually, it is very convinient when you have previous knowledge of 6502 syntax, as the SPC700 is like a 6502 on steroids.
Re: SPC700 help
Code: Select all
mov $f2, #$5c ; \
mov $f3, #$ff ; |
mov $f2, #$4c ; |
mov $f3, #$00 ; |
mov $f2, #$5c ; |
mov $f3, #$00 ;/
The value of KOFF is read only ONCE during this 64 cycle window. If you do a loop like the following, there are 3 possible scenarios, depending on when the KOFF is processed by the DSP unit.
Code: Select all
loop:
<------------------- Read KOFF=$00
mov $f2, #$5c ; \
mov $f3, #$ff ; |
mov $f2, #$4c ; |
mov $f3, #$00 ; |
mov $f2, #$5c ; |
mov $f3, #$00 ;/
bra loop
Code: Select all
loop:
mov $f2, #$5c
mov $f3, #$ff
<------------------- Read KOFF=$FF
mov $f2, #$4c
mov $f3, #$00
mov $f2, #$5c
mov $f3, #$00
bra loop
Code: Select all
loop:
mov $f2, #$5c
mov $f3, #$ff
mov $f2, #$4c
mov $f3, #$00
mov $f2, #$5c
mov $f3, #$00
<------------------- Read KOFF=$00
bra loop
One solution is to write KOFF and KON only once during each main loop iteration:
Code: Select all
loop:
... (wait for next timer tick) ...
mov $f2, #$5c
mov $f3, koff_shadow
mov $f2, #$4c
mov $f3, kon_shadow
... (process channels, store key on/key off in shadow variable) ...
bra loop
-
wiiqwertyuiop
- Posts: 19
- Joined: Tue Apr 17, 2012 8:30 am
-
wiiqwertyuiop
- Posts: 19
- Joined: Tue Apr 17, 2012 8:30 am
Re: SPC700 help
Ok, I finally, after working on it some more on my own, got it working perfectly! Thanks to those of you who helped for putting up with my stupid questions. 