Sprites in ML

Basic and Machine Language

Moderator: Moderators

Bacon
for breakfast
Posts: 578
Joined: Mon Apr 19, 2004 8:07 am

Post by Bacon »

Bo Zimmerman hosts the central Commodore repository at http://www.zimmers.net/anonftp/pub/cbm/

You should contact him and ask him to host the program and scans. I'm sure you won't get into trouble for scanning a few pages out of that old book.

Btw, is there a source listing for the resulting ML program in the article?
Bacon
-------------------------------------------------------
Das rubbernecken Sichtseeren keepen das cotton-pickenen Hands in die Pockets muss; relaxen und watschen die Blinkenlichten.
viclizard
Vic 20 Drifter
Posts: 26
Joined: Mon Feb 05, 2007 12:07 pm

Post by viclizard »

ok, thanks for the link.

Not exactly a source listing- it would have to be converted to readable code- there is a program with a lot of data statements that pokes something into memory. When run, this does it's magic and then saves a second program to disk (I guess memory contents after poking itself, so maybe could be disassembled). This second "program" is what you actually load and sys6000 to use the sprites. So I guess could be examined with a monitor. As is, it works with unexpanded or +3k expanded vics.

I was thinking I'd upload the both programs (the one entered and the one that one made) as well as both brief demo files and scans of the chapter, which has the listings as well as the instructions for use.
________
Last edited by viclizard on Wed Feb 16, 2011 6:44 pm, edited 1 time in total.
Bacon
for breakfast
Posts: 578
Joined: Mon Apr 19, 2004 8:07 am

Post by Bacon »

viclizard wrote:Not exactly a source listing- it would have to be converted to readable code- there is a program with a lot of data statements that pokes something into memory. When run, this does it's magic and then saves a second program to disk (I guess memory contents after poking itself, so maybe could be disassembled). This second "program" is what you actually load and sys6000 to use the sprites. So I guess could be examined with a monitor.
That was common back then and I figured this was the case here too, but I was hoping they included an assembly source listing too. The Transactor often did this. You get the best of both worlds: a BASIC program with data statements that's easy (or not so easy, depending on the size) to type in, and an assembly source listing for educational purposes (and for those lucky enough to have an assembler).
Bacon
-------------------------------------------------------
Das rubbernecken Sichtseeren keepen das cotton-pickenen Hands in die Pockets muss; relaxen und watschen die Blinkenlichten.
User avatar
Victragic
Frogger '07
Posts: 605
Joined: Tue Nov 14, 2006 5:56 pm
Location: South Australia

Post by Victragic »

I'm very interested to see that program too - hell, I'd even type it in to run it..

-G
3^4 is 81.0000001
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

viclizard wrote:[...]sprite-imation [...] provides 4 sprites for the vic. These are 16x24 bit sprites, they can be multicolor, they have variable sprite to sprite priority and sprite-sprite collision detection, as well as sprite-background collision detection.
If there's no source available, this info alone justifies a reverse-engineering attempt. :) Consider me very interested.

Greetings,

Michael
viclizard
Vic 20 Drifter
Posts: 26
Joined: Mon Feb 05, 2007 12:07 pm

Post by viclizard »

OK, I've got the chapter scanned and the files all zipped and ready to go. Only problem- I don't have a place to upload to. Can't find a link at the central commodore repository to upload to or how to contact the owner.

If anyone can host it, let me know. The file is big ( over 4.5 MB) beause of the scanned images of the chapter- I don't use the scanner much and not sure how to reduce file size while maintaining easy reading of the print.
________
Last edited by viclizard on Wed Feb 16, 2011 6:44 pm, edited 1 time in total.
User avatar
Victragic
Frogger '07
Posts: 605
Joined: Tue Nov 14, 2006 5:56 pm
Location: South Australia

Post by Victragic »

Hi,

you can send the file to my gmail account and I'll upload it onto my webspace if you want..

my address - richards.richards@gmail.com

I'll type it in and provide links to all for the .prg file, as well as the (Basic) source and scanned pages. If someone wants to then disassemble it, I guess just a post to this message thread would suffice.

Looking forward to it
-Glen
3^4 is 81.0000001
viclizard
Vic 20 Drifter
Posts: 26
Joined: Mon Feb 05, 2007 12:07 pm

Post by viclizard »

Sent. If it doesn't make it, please let me know.
________
Last edited by viclizard on Wed Feb 16, 2011 6:45 pm, edited 1 time in total.
User avatar
Victragic
Frogger '07
Posts: 605
Joined: Tue Nov 14, 2006 5:56 pm
Location: South Australia

Post by Victragic »

Thanks,

here's the link to the scans of the article and the .prg files that Viclizard kindly contributed :


http://www.adam.com.au/grichards/Sprite-imation/

The only thing I changed was to convert the original .bmp files to .jpg files, just to save some space - I don't think any resolution was lost in the process.

Haven't had a chance to look at it yet, but seems promising!

-Glen

EDITED EDIT : The files work fine, remember to only have unexp. or +3K installed when running it!
Last edited by Victragic on Sat Apr 14, 2007 10:49 pm, edited 1 time in total.
3^4 is 81.0000001
viclizard
Vic 20 Drifter
Posts: 26
Joined: Mon Feb 05, 2007 12:07 pm

Post by viclizard »

Thank you Glen
________
Last edited by viclizard on Wed Feb 16, 2011 6:45 pm, edited 1 time in total.
viclizard
Vic 20 Drifter
Posts: 26
Joined: Mon Feb 05, 2007 12:07 pm

Post by viclizard »

Oh, just caught the edit. The prg files are not corrupted on my 64hdd- work fine on my vic, and on vice, so maybe something with zipping them? I'll e-mail the files without zipping.
________
Last edited by viclizard on Wed Feb 16, 2011 6:45 pm, edited 1 time in total.
viclizard
Vic 20 Drifter
Posts: 26
Joined: Mon Feb 05, 2007 12:07 pm

Post by viclizard »

I re-sent, but as an afterthought, I downloaded what you already have up on your site and tried in vice and works just fine. You are doing something wrong when you try to run- files are good. Remember to run in an unexpanded machine or with +3k ram only- no more than that.

Load "sptim.prg",8,1
sys 6000

your machine should reset and sprite imation appear on the screen

then
load"sptdmo.prg",8
run

I should also note I have an NTSC machine and settings same on vice- don't know if that makes a difference or not.
________
Last edited by viclizard on Wed Feb 16, 2011 6:45 pm, edited 2 times in total.
User avatar
Victragic
Frogger '07
Posts: 605
Joined: Tue Nov 14, 2006 5:56 pm
Location: South Australia

Post by Victragic »

Oh how silly of me, I still had 8K+ installed when I tried to run it..

.. :oops: ..

That's quite an impressive demo, with the earth going around the sun - remembering that this is all calculated in basic, it's reasonably smooth.. and the colour clash is quite acceptable considering the hardware limitations..

What is also interesting is that it 'patches' basic to add new commands and sets the environment up itself..

..I'm guessing that using machine code with these sprites, they would absolutely fly over the screen..

Considering it's such a small program I think converting to work with 8K+ expansions is a must. I'd also like to try and modify a version to work in 16-bit character mode as well..

Good stuff

-G
3^4 is 81.0000001
viclizard
Vic 20 Drifter
Posts: 26
Joined: Mon Feb 05, 2007 12:07 pm

Post by viclizard »

A few more sprites on the expanded memory version would be nice too.
________
Last edited by viclizard on Wed Feb 16, 2011 6:45 pm, edited 1 time in total.
User avatar
Victragic
Frogger '07
Posts: 605
Joined: Tue Nov 14, 2006 5:56 pm
Location: South Australia

Post by Victragic »

Yes, I think 8 sprites would be nice.. though from tinkering with the demos in basic, it does slow down quite a bit when you have to start plotting more than 1 sprite

..for the fun of it I uploaded a version of the 'Up, Up, And Away!' prog in the C64 manual - comparing times, the C64 hardware sprite prog is approx 4.5x faster than the Vic software sprite prog when all 4 sprites are 'enabled' as you'd expect. With only 1 sprite enabled the speed is really quite comparable.

The VIC sprite routine does slow down when you enable more sprites.. so perhaps that is why only four sprites, 8 sprites would probably half the speed again as it draws every sprite enabled each refresh, whether you are making changes to the sprites or not.. but moving loads of objects around in basic is never going to yield fast results..

Not all the features are documented, I note - for example I'm not sure how sprite collision works, even though the registers are there.. and as for the 'alternate joystick register', I wonder if that's for connecting a second joystick through the user port? (EDIT - I think this is just an easier way to read the standard joystick port..)
3^4 is 81.0000001
Post Reply