+Random Terrain Posted March 18, 2015 Share Posted March 18, 2015 I'd start by checking out the asm tutorials on here and then check out the blog SpiceWare is working on about programming DCP+ in assembly. Some stuff can also be found here: randomterrain.com/atari-2600-memories.html#assembly_language Quote Link to comment Share on other sites More sharing options...
bs4 Posted March 18, 2015 Author Share Posted March 18, 2015 (edited) To all: Thankyou to everyone for all the excellent help! I've been programming since the C=64 days in the late 70's/early 80's. I knew enough asm back then to use a Super Snapshot fairly well to hack & train games but I've never coded anything in ASM on any system from the ground up. (I can crack things but who can't NOP a DEC ?) I had a friend who was far better at ASM than I was teach me on the C=64. It was when we combined our brains that we were able to do the real damage. I was always better at theory, then he would implement it. (I taught/corrupted him to phreak & other things that I was doing in basic, he taught me ASM.) I never got around to doing sound on the 64, it was just too much trouble. (The Korg M1 was more important back then, heheh!) I've actually got an SX-64 upstairs with an MSSIAH cartridge. I haven't even used it yet! It's like I want to go back and do all the things with all the old systems I loved as a kid now as an adult since things are so much easier now. All I'm really waiting for is the right project where my skills are wanted/needed. I'm almost 42 years old now. As I mentioned earlier, I'm a far better musician than coder. I am enjoying doing this but I don't think I have the time to start learning ASM right now, although I'm familliar with the registers because it's basically the same CPU as the 64. (I'm sure things would start coming back to me quickly if I started learning!) I'd rather just do what I know I'm excellent at and that is game design and music. Then pair up with someone who's good at ASM coding. But it seems most here are already paired up/have a sound/design guy already. (Or they are just BASIC coders like I am.) I am easy to work with because I understand the limitations and concepts and can even make what I want to happen happen in BASIC, just slow & ugly. So what I am going to do is try to make something that is kick ass in BASIC and then try to attract the attention of a good ASM coder with it. There are things I can think of which can be done that no one has tried yet. I am sure they would not work smoothly in BASIC but if they are unique enough, they might attract the attention of a good ASM coder. P.S. - What an awesome community. No one where I live understands this hobby. The VCS and the C=64 are very dear to me, I assume this is true with most here. Edited March 18, 2015 by bs4 Quote Link to comment Share on other sites More sharing options...
ZackAttack Posted March 19, 2015 Share Posted March 19, 2015 I'd rather just do what I know I'm excellent at and that is game design and music. Then pair up with someone who's good at ASM coding. But it seems most here are already paired up/have a sound/design guy already. If you're interested, I could definitely used some assistance with the sound for my current project. Supporting 8way scrolling with single pixel resolution takes up all the CPU time during the picture scanning, but there are plenty of available cycles during overscan and a ton of ROM space available. I would be interested in any ideas you may have. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 14, 2015 Share Posted November 14, 2015 How long does the audio file needs to be in order to be converted and read as complete as possible?, because the ones I've tried to playback with just the first 9 pages sound just like a long fart xD Quote Link to comment Share on other sites More sharing options...
iesposta Posted November 15, 2015 Share Posted November 15, 2015 How long does the audio file needs to be in order to be converted and read as complete as possible?, because the ones I've tried to playback with just the first 9 pages sound just like a long fart xD My sample of "Doh!" in Flappy is around 700 bytes and just a fraction of a second. In Fat Albert, "Game Is Over" uses nearly a whole bank, 4,000 bytes, and is quite long. The source should be mono, 8-bit WAV with a bitrate around 4,000. As I said, I didn't write the routine that keeps the constant scan line rate. I did manage to take that posted asm code shared in the post with the pearl script, and have batari Basic "include" it. I also used TJoppen's source code to do a 32K sample of the song "Popcorn". Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 15, 2015 Share Posted November 15, 2015 So is impossible to do so with a 14 second loop, right? Quote Link to comment Share on other sites More sharing options...
iesposta Posted November 15, 2015 Share Posted November 15, 2015 So is impossible to do so with a 14 second loop, right?Yeah. With this method you get almost 2 seconds per bank, 4K. Since the samples only change the Volume register, and the Atari Volume register can be a value from 0 to 15, 4 bytes are used to hold a number between 0-15. Two numbers are stored in each Byte. I have read about using only 2 bits. That would hold a number from 0 to 3, but each bit pair would hold 4 values, not two. Then the samples could be longer. You would need to write or modify both the encoder and playback routine. Since I haven't seen this demonstrated, I don't know what kind of quality it would give. It would still need the whole frame for playback so it would also blank the screen. DPC+ can have music during the display because its kernel is written with a Volume register update every scan line, or every other scan line, including overscan and vertical blank. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 15, 2015 Share Posted November 15, 2015 Or can it be called and place in different banks? like splitting the audio code into parts Quote Link to comment Share on other sites More sharing options...
ZackAttack Posted November 15, 2015 Share Posted November 15, 2015 Yeah. With this method you get almost 2 seconds per bank, 4K. Since the samples only change the Volume register, and the Atari Volume register can be a value from 0 to 15, 4 bytes are used to hold a number between 0-15. Two numbers are stored in each Byte. I have read about using only 2 bytes. That would hold a number from 0 to 3, but each Byte would hold 4 values, not two. Then the samples could be longer. You would need to write or modify both the encoder and playback routine. Since I haven't seen this demonstrated, I don't know what kind of quality it would give. It would still need the whole frame for playback so it would also blank the screen. DPC+ can have music during the display because its kernel is written with a Volume register update every scan line, or every other scan line, including overscan and vertical blank. Think you meant to say bits for a few of those... Instead of reducing the resolution from 4 bits to 2 bits I'd look into some sort of compression. Quote Link to comment Share on other sites More sharing options...
iesposta Posted November 15, 2015 Share Posted November 15, 2015 Or can it be called and place in different banks? like splitting the audio code into partsNot sure I understand the question. Yea you can switch to another bank, play a sample, then switch back or to another bank. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 15, 2015 Share Posted November 15, 2015 Yeah I accomplished that, now the problem is that to implement it I need more than 8 banks xD Quote Link to comment Share on other sites More sharing options...
iesposta Posted November 15, 2015 Share Posted November 15, 2015 Think you meant to say bits for a few of those... Instead of reducing the resolution from 4 bits to 2 bits I'd look into some sort of compression. Yep. Posted without really reading. Fixed that. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 15, 2015 Share Posted November 15, 2015 I was able to add three parts of the loop but only 2 play, it doesn't pop me any error, they're in different banks, and it compiles, any idea on the problem? Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 18, 2015 Share Posted November 18, 2015 How can I call a audio block from a bank while calling the titlescreen kernel also from another bank, basically to run the music at the same time as the game. Quote Link to comment Share on other sites More sharing options...
iesposta Posted November 18, 2015 Share Posted November 18, 2015 It sounds like you want to run a titlescreen kernel and a sample playback kernel at the same time. With these "canned" kernels, you can have a display or sample playback, but not both at the same time. Spiceware's game Frantic had an assembly/C code kernel where the DPC+ could play samples during gameplay, like Stay Frosty 2 plays music during gameplay, but he never added the actual samples, and he plans to rewrite the whole kernel with what he has learned from coding Draconian and using the bus stuffing technique to do a bit more every scan line. There was also a problem where he had to use a slower mode while programming Frantic because perfectly good code was crashing the ARM chip. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 19, 2015 Share Posted November 19, 2015 Ohh OK now I know what the problem is hehe, I think that modifying the code of the titlescreen kernel and including there the sound code it could work don't you think?, I'll give it a shot. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 25, 2015 Share Posted November 25, 2015 Can the assembly music code be run in the background while the game is running?, all I have been able to accomplish is to get it run in a blank screen, but I need it as a background for the gameplay itself, can it be done?, No it isn't that long as a** loop is a shorter one. Quote Link to comment Share on other sites More sharing options...
RevEng Posted November 25, 2015 Share Posted November 25, 2015 The 6502 doesn't multitask, so there is no "in the background". If you want things to seem to happen simultaneously you need to do one after another in a loop. In bB that loop would include your drascreen command. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 25, 2015 Share Posted November 25, 2015 So in the main loop?, I had in mind something like Princess Rescue by Sprybug, I know that that code was written in batari Basic and not in assembly, but can't that happen?, and actually assembly kind of has multitasking, in Halo 2600 on the titlescreen there is background music. Quote Link to comment Share on other sites More sharing options...
RevEng Posted November 25, 2015 Share Posted November 25, 2015 Yes, in the main loop, if you want the music to play during the main game. Princess Rescue and Halo 2600 don't multitask. They do thing sequentially, but that sequence repeats every 60th of a second, so from our perspective it looks like a lot of things happening in parallel. Playing music is no different than other sequential items in your main loop. You read the joysticks, then you adjust player variables, then you do enemy AI, ... Just add "check if it's time to play a note, and if so fetch note data and update AUDF/V/C registers" to the list. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 25, 2015 Share Posted November 25, 2015 That's true, and that's what I haven't been able to accomplish, so in other words in can't run while the titlescreen is on unless it's included on the titlescreen kernel itself, right? Quote Link to comment Share on other sites More sharing options...
iesposta Posted November 25, 2015 Share Posted November 25, 2015 That's true, and that's what I haven't been able to accomplish, so in other words in can't run while the titlescreen is on unless it's included on the titlescreen kernel itself, right? It can not be included. The hardware has 76 cycles per scan line. Those are used up in drawing the Titlescreen because it uses advanced cycle-consuming techniques to re-use the 2 player objects, changing their data as each scan line is being drawn. The sample playback technique uses all the cycles on every line to vibrate the speaker, recreating the sound sample. You can use the built-in notes & sounds for music because those registers are updated one time per frame, not every single scan line. You can't combine kernels together or include one kernel into another. Quote Link to comment Share on other sites More sharing options...
RevEng Posted November 25, 2015 Share Posted November 25, 2015 The titlescreen kernel is called in a loop in your basic program. It basically is a fancy drawscreen command that displays your titlescreen instead of the usual stuff. You can add whatever you like to that loop, including code that plays music. Quote Link to comment Share on other sites More sharing options...
STGraves Posted November 26, 2015 Share Posted November 26, 2015 Ok I guess I'll give it a try, but one more question, which do you think is better, using the assembly code that I have or redo it for batari Basic with the music and sound editor? Quote Link to comment Share on other sites More sharing options...
RevEng Posted November 26, 2015 Share Posted November 26, 2015 Writing it in assembler won't be easier than using basic. Write it in whichever you're most comfortable in, which I suspect is basic. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.