(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-18-24 06:23 PM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Interested in .SPC altering within a ROM
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
never-obsolete
Posts: 34/79
Originally posted by FreeDOS +

A useless GUI is also a pain.


my thoughts exactly. and seeing how every option with an assembler can be handled by switches, there really would be no point in coding a gui.
Originally posted by FreeDos +

the most complex thing is math


i have no knowledge of the SPC-700. is the math you are refering to specific to it, or do you mean operators like:

lda somelabel + 1
blackhole89
Posts: 145/427
Originally posted by MathOnNapkins
Well what I have in the NSPC for Zelda 3 is the following code:


0CA4: F7 14 MOV A,($14)+Y

0CA6: C9 F2 00 MOV $00F2,X ; Take the first four bytes of the instrument block and write them to
0CA9: C5 F3 00 MOV $00F3,A ; Dsp registers $00v4 through $00v7. See SPC docs for more info.
0CAC: 3D INC X ; The loop writes to the SRCN, ADSR1 and ADSR2, and Gain.
0CAD: FC INC Y
0CAE: AD 04 CMP Y,#$04

0CB0: D0 F2 BNE $0CA4

0CB2: CE POP X
0CB3: F7 14 MOV A,($14)+Y
0CB5: D5 21 02 MOV $0221+X,A ; This is a big endian encoding. The last 2 bytes of the six byte instrument block
0CB8: FC INC Y ; Are stored to [$0220-1]+X
0CB9: F7 14 MOV A,($14)+Y
0CBB: D5 20 02 MOV $0220+X,A
0CBE: 6F RET


SRCN = source number or the index into the sample table. This denotes what sample to use.

ADSR1 and ADSR2, and GAIN are a little more complicated and you should find some documentation. The last two bytes of the block are... some kind of multipliers for the instrument that I haven't totally figured out yet. It's a lot of code to look through and a lot of guesswork at first.

Thanks. This comes in very handy seeing as I apparently lost what Bouche told me about the instrument table's format.
FreeDOS +
Posts: 514/1312
A useless GUI is also a pain. For me, the command line is the best place assemblers and disassemblers belong. Not to mention that they're the easiest programs to port. For an SPC-700 (dis)assembler, the most complex thing is math and file I/O; really the only porting problems you should encounter if you write a program correctly is endianness.
HyperHacker
Posts: 2069/5072
I'll agree with you there. Batch scripts are powerful but making them can be a major pain.
MathOnNapkins
Posts: 497/1106
There is a difference between something being unknown/difficult to you and something being annoying to you. Command line is annoying, and batch files are annoying. You can copy+paste in a batch file though, whereas you cannot in a DOS environment.

So basically to make command line convenient you need to learn to use batch files, which grow more archaic every day.
HyperHacker
Posts: 2049/5072
Originally posted by never-obsolete
you and i dont think so, but i find more and more people that:

a. dont know how to use the command prompt and batch files or
b. dont even know they exist

for ease of use, a simple gui could be constructed.

I can't imagine somebody knowing SPC700 ASM and not being able to use a command line. As for long paths, copy+pase FTW. You can put paths with spaces in them in quotes: del "C:\Some place\wherever\a file I don't want.txt"

Also, batch files are just multiple commands:
@echo off
color 1e
title Command Prompt
echo Command prompt for %USERNAME% on %COMPUTERNAME%
echo Current time is %TIME%, %DATE%
echo System uptime:
uptime
echo.
echo Scheduled tasks:
at
echo.
echo Enter command:
if "%1" EQU "" goto default_dir

cd /d "%*"
goto :EOF

:default_dir
f:
MathOnNapkins
Posts: 493/1106
Well what I have in the NSPC for Zelda 3 is the following code:


0CA4: F7 14 MOV A,($14)+Y

0CA6: C9 F2 00 MOV $00F2,X ; Take the first four bytes of the instrument block and write them to
0CA9: C5 F3 00 MOV $00F3,A ; Dsp registers $00v4 through $00v7. See SPC docs for more info.
0CAC: 3D INC X ; The loop writes to the SRCN, ADSR1 and ADSR2, and Gain.
0CAD: FC INC Y
0CAE: AD 04 CMP Y,#$04

0CB0: D0 F2 BNE $0CA4

0CB2: CE POP X
0CB3: F7 14 MOV A,($14)+Y
0CB5: D5 21 02 MOV $0221+X,A ; This is a big endian encoding. The last 2 bytes of the six byte instrument block
0CB8: FC INC Y ; Are stored to [$0220-1]+X
0CB9: F7 14 MOV A,($14)+Y
0CBB: D5 20 02 MOV $0220+X,A
0CBE: 6F RET


SRCN = source number or the index into the sample table. This denotes what sample to use.

ADSR1 and ADSR2, and GAIN are a little more complicated and you should find some documentation. The last two bytes of the block are... some kind of multipliers for the instrument that I haven't totally figured out yet. It's a lot of code to look through and a lot of guesswork at first.
S.N.N.
Posts: 762/2028
Originally posted by MathOnNapkins
Um... I'm not sure if you know what you're editing exactly. I'd at least read up a bit on the SPC's and the DSP's registers, and how they work. I'll have to dig through my own notes to see how the instrument table is formatted.


I know, I have no clue what I'm editing That's why I'm trying to figure out how to do this the right way. That's actually why I started this whole thread up in the first place - to get info on the SPC stuff.

Meh....could take a lot of work to get this whole thing working
MathOnNapkins
Posts: 492/1106
Um... I'm not sure if you know what you're editing exactly. I'd at least read up a bit on the SPC's and the DSP's registers, and how they work. I'll have to dig through my own notes to see how the instrument table is formatted.
S.N.N.
Posts: 761/2028
My methods? You mean my methods of finding it?

I kinda searched the SPC file for the song pointer, then swapped them and jumped to that offset. Then I found....that.

So if that's my instrument tables, that will be what controls the song, correct? And by changing those all to 11, I royally screwed the file

EDIT: @Bio: I did what you said and changed them all to 00. The good news is, it didn't crash on me. The bad news is, all I hear is a bunch of *clicking* type noises.
MathOnNapkins
Posts: 489/1106
If it's Nintendo it's likely N-SPC, and therefore likely that $3D00 is your instrument table. The sample table is usually at $3C00. But without knowing your methods, I can't say for sure what you found.
C:/xkas bio.asm
Posts: 853/1209
maybe they are spc-700 ASM oppcode, try changing all of these to 00(wich is NOP in the spc-700 ASM)
S.N.N.
Posts: 760/2028
Apparently I made a new "breakthrough" for myself (I think) I dumped the SPC data of the YI World Map (all completed) and played around with it. I think I may have discovered one of the sound channels:



As soon as i changed every byte in $3D00 - $3D60 to 11, the sound wouldn't even start.

Have I discovered a sound channel, or is it false hope?
MathOnNapkins
Posts: 488/1106
The problem I have with command line apps is that working with files that are in distant folders from the application, typing the full address is painful. And what if you have multiple files in different folders you need to address? When I use Xkas, I put all my files in the same folder and shorten their names to 3 letters + 3 letter extension. No wonder I want to write a front end for it.

And I had someone show me how to write batch files a while ago, but I forgot most of it. I did not grow up on DOS b/c I had a Mac when I was younger. And yeah you can still look it up on the web, but it's more of a pain than just having a simple gui handle it all.
never-obsolete
Posts: 30/79
you and i dont think so, but i find more and more people that:

a. dont know how to use the command prompt and batch files or
b. dont even know they exist

for ease of use, a simple gui could be constructed.
HyperHacker
Posts: 2044/5072
There's nothing wrong with being a command line app.
never-obsolete
Posts: 29/79
so basically non-command line and bugless...got it. but if there's already one out there i dont see the point in re-inventing the wheel.
HyperHacker
Posts: 2037/5072
I mean it doesn't have a lot of stupid/annoying bugs, isn't a pain to use, etc.
never-obsolete
Posts: 28/79
by "good" do you mean non-dos or what? i havent had a problem with asemblers before. i dont see how a disassembler could be bad, it does one thing that is easy to implement. assemblers can be tricky on the other hand, but ive already written one for the 65xx, so i think i got a grasp on the idea.
HyperHacker
Posts: 2026/5072
Originally posted by never-obsolete
i might write a assembler/disassembler for it, though would anyone be interested in this?

If it's good, absolutely.
This is a long thread. Click here to view it.
Acmlm's Board - I3 Archive - ROM Hacking - Interested in .SPC altering within a ROM


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.003 seconds; used 367.59 kB (max 430.74 kB)