Jump to content
IGNORED

Having problems adding ASM routine into Batari Basic


bs4

Recommended Posts

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. 8)

(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. 8)

 

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 by bs4
Link to comment
Share on other sites

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. 8)

 

 

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.

Link to comment
Share on other sites

  • 7 months later...

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".

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...