Bored doing just awesome pixel art for the C64 so.....
-
llamaprotector
- Baaaa!

- Posts: 648
- Joined: Fri Apr 23, 2010 2:00 am 0
Bored doing just awesome pixel art for the C64 so.....
Right I can code but not in ASM on 6502 so I was wondering if there is...
1. A good book on C64 general routines (custom chip access for 6581 or 6526)
2. General list of instr for 6502 ASM
3. Tips on how to use the memory map
Obviously ASM on a C64 is a bit special because you can run things in a sort of time sliced way that is nothing like any high level language on the C64, although Laser Basic does allow 3 concurrent tasks.
1. A good book on C64 general routines (custom chip access for 6581 or 6526)
2. General list of instr for 6502 ASM
3. Tips on how to use the memory map
Obviously ASM on a C64 is a bit special because you can run things in a sort of time sliced way that is nothing like any high level language on the C64, although Laser Basic does allow 3 concurrent tasks.
Re: Bored doing just awesome pixel art for the C64 so.....
Eh?llamaprotector wrote:Obviously ASM on a C64 is a bit special because you can run things in a sort of time sliced way that is nothing like any high level language on the C64, although Laser Basic does allow 3 concurrent tasks.
Re: Bored doing just awesome pixel art for the C64 so.....
I think lp might be referring to the IRQ mechanism (whether from the CIA or VIC-II).
@lp there are loads of online resources for C64 assembler programming, general 6502 programming, and the C64 memory map. Google. Lemon64 is not a bad place to begin.
@lp there are loads of online resources for C64 assembler programming, general 6502 programming, and the C64 memory map. Google. Lemon64 is not a bad place to begin.
- gilesgoat
- Sheepie Whore

- Posts: 27259
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Bored doing just awesome pixel art for the C64 so.....
.. the more I read that sentence above the more I think it sounds "incredible" even if I am not really sure about what it really means ...gravy wrote:Eh?llamaprotector wrote:Obviously ASM on a C64 is a bit special because you can run things in a sort of time sliced way that is nothing like any high level language on the C64, although Laser Basic does allow 3 concurrent tasks.
The "Eh?" is appropriate.
Giles the billy goat
"Baa"
"Baa"
-
llamaprotector
- Baaaa!

- Posts: 648
- Joined: Fri Apr 23, 2010 2:00 am 0
Re: Bored doing just awesome pixel art for the C64 so.....
Designing routines in something like a souped up BASIC has a completely different mentality as it's just one massive bit of code that does nothing independently and steps through it all in sequence where as in ASM you would run bits of machine code to do various things automatically via interrupts etc like looped animations of sprites for spinning wheels or scrolling the background or playing music and basically check for things that are conditional like collisions or player input (fire lasers etc). You can sort of do this in Laser BASIC as it allows 3 concurrent tasks. However 17kb is all you have left for writing your game on a 64kb computer in that system so it's no good 
Re: Bored doing just awesome pixel art for the C64 so.....
That's a pretty bad way to write games.
You'd create a display abstraction that would probably work off of interrupts and do some processing but the game itself? You'd do it in the foreground.
If you want to make a game that's fairly simply but still could look really nice you really don't need very much at all to happen in interrupts
You'd create a display abstraction that would probably work off of interrupts and do some processing but the game itself? You'd do it in the foreground.
If you want to make a game that's fairly simply but still could look really nice you really don't need very much at all to happen in interrupts
- sack
- Baaaaaaa!

- Posts: 7077
- Joined: Fri May 10, 2002 4:13 pm 0
- XBL Gamertag: evilgopher
- PSN: sixFiveOhTwo
- Location: Rijswijk, The Netherlands
- Contact:
Re: Bored doing just awesome pixel art for the C64 so.....
interrupts are for things you can't miss on a per-frame basis, are quick and are timing critical.
If possible you should build things up in your main loop in a way the interrupts can just blindly read off the data and use it as needed
If possible you should build things up in your main loop in a way the interrupts can just blindly read off the data and use it as needed
- gilesgoat
- Sheepie Whore

- Posts: 27259
- Joined: Wed Sep 03, 2003 7:54 am 0
- Location: Monfalcone, Italy
- Contact:
Re: Bored doing just awesome pixel art for the C64 so.....
loops, state machines and linked lists are your friends ...
Even "interrupts and do things" I think could be 'questionable' .. more maybe about "interrupts collects info as fast as possible and adds it into a queue thing and exits as soon as it can " but then
beware you need atomic operations when using the queue.
Queues IMHO are another of those "best friends".
But I see you mean for time-critical thing, ok if the stuff it's like "doing things during the Nth scanline interrupt" and such that's a thing, but remember overall KISS.
Even "interrupts and do things" I think could be 'questionable' .. more maybe about "interrupts collects info as fast as possible and adds it into a queue thing and exits as soon as it can " but then
beware you need atomic operations when using the queue.
Queues IMHO are another of those "best friends".
But I see you mean for time-critical thing, ok if the stuff it's like "doing things during the Nth scanline interrupt" and such that's a thing, but remember overall KISS.
Giles the billy goat
"Baa"
"Baa"
Re: Bored doing just awesome pixel art for the C64 so.....
Definitely.gilesgoat wrote: But I see you mean for time-critical thing, ok if the stuff it's like "doing things during the Nth scanline interrupt" and such that's a thing, but remember overall KISS.
What game do you want to write?
That's the most important thing.
If you're starting out in assembly I'd advise:
- Single screen : no scorlling or panel
- 8 sprites
- Simple logic - can easily be completed at a good interactive rate (20fps is fine for a starter)
You won't need any interrupts there, the code will be pretty simple and it'll mean your chances of actually finishing the project a lot higher.
There's been some great games written that way; Spy Vs Spym Jack Attack and Confuzion are examples of excellent games that both work in those constraints. There's plenty more.
The biggest problem with most hobby game projects (and I'm hugely guilty of this) is they're actually technology projects. The tech gets done and the game never gets finished. If you can lower the tech reqs and concentrate on the game you're much more likely to end up with something others can play.
- sack
- Baaaaaaa!

- Posts: 7077
- Joined: Fri May 10, 2002 4:13 pm 0
- XBL Gamertag: evilgopher
- PSN: sixFiveOhTwo
- Location: Rijswijk, The Netherlands
- Contact:
Re: Bored doing just awesome pixel art for the C64 so.....
If you're feeling really lazy do what I did as a kid and put the score panel down the right hand side 
(sprite MSB register? What's that all about then?)
(sprite MSB register? What's that all about then?)
- merman
- Sheepie Whore

- Posts: 10943
- Joined: Wed Feb 16, 2005 1:44 pm 0
- XBL Gamertag: merman1974
- Yahoo Messenger: andrewrfisher
- Location: Skegness, England
- Contact:
Re: Bored doing just awesome pixel art for the C64 so.....
A single byte of memory can only hold 0-255, a sprit e's X-position can run from 0-343 (this includes positions under the screen border, allowing you to move a sprite smoothly into view).sack wrote:If you're feeling really lazy do what I did as a kid and put the score panel down the right hand side
(sprite MSB register? What's that all about then?)
To cope with the extra section, you have the sprite MSB or Most Significant Bit. This is stored in a separate register with one bit for each of the eight hardware sprites. If the bit is set, the sprite is at positions 255-343 on the right of the screen.
You can see this sort of bug/problem in early games and some US imports. Either the sprite flickers briefly or appears in the wrong place because the MSB is set wrong. And many games have a large score panel on the right so there is less need to use the MSB.
Twitter, Xbox, Wii U and Steam - merman1974
ZZAP is back - https://www.patreon.com/zzapmagazine
ZZAP is back - https://www.patreon.com/zzapmagazine
Re: Bored doing just awesome pixel art for the C64 so.....
I wonder why everyone doesn't understand what a rhetorical question is? 
Re: Bored doing just awesome pixel art for the C64 so.....
Because the urge to appear clever overrides the urge to...
Oh, hang on.
Oh, hang on.
- sack
- Baaaaaaa!

- Posts: 7077
- Joined: Fri May 10, 2002 4:13 pm 0
- XBL Gamertag: evilgopher
- PSN: sixFiveOhTwo
- Location: Rijswijk, The Netherlands
- Contact:
Re: Bored doing just awesome pixel art for the C64 so.....
I think I skipped that part of the manual because I was still laughing at the SEX register
-
llamaprotector
- Baaaa!

- Posts: 648
- Joined: Fri Apr 23, 2010 2:00 am 0
Re: Bored doing just awesome pixel art for the C64 so.....
Thanks for the advice everybody 
Ultimately I actually want to code my own conversion of the VCS version of Vanguard on the C64. I did some graphics for it and there is no way to do it nicely in BASIC (Laser BASIC compiled or CBM BASIC V2).
I had the idea if the screen is scrolled under its own automatic routine then my code just needs to do conditional things. If you hit the background it wouldn't matter in this game as the screen always scrolls. If I ran the scroller after line 200 is drawn each frame then it would be nice and silky smooth I thought.
For other stuff though it would be a simple case of dumping some bytes in specific memory locations so those routines can check for collisions and update player/enemies/bullet positions etc.
There was a really excellent website that had a tutorial on writing machine code (may have been from Commodore User or Your Commodore magazine feature) and by lesson 3 you were multiplexing a sprite or 8
If anyone remembers that site would appreciate a link.
Too much like huge brown pants of the video gaming world 
I thought this way all the time until one day in my 20s I had a couple of spliffs in a row sitting in a coffee shop and the answer came to me instantly like a revelation, I think I still have the code I wrote on the back of the menu sheet there and then.
Ultimately I actually want to code my own conversion of the VCS version of Vanguard on the C64. I did some graphics for it and there is no way to do it nicely in BASIC (Laser BASIC compiled or CBM BASIC V2).
I had the idea if the screen is scrolled under its own automatic routine then my code just needs to do conditional things. If you hit the background it wouldn't matter in this game as the screen always scrolls. If I ran the scroller after line 200 is drawn each frame then it would be nice and silky smooth I thought.
For other stuff though it would be a simple case of dumping some bytes in specific memory locations so those routines can check for collisions and update player/enemies/bullet positions etc.
There was a really excellent website that had a tutorial on writing machine code (may have been from Commodore User or Your Commodore magazine feature) and by lesson 3 you were multiplexing a sprite or 8
And that's exactly why I didn't like Raiden on the Atari Jaguar...huge brown panel too of all colourssack wrote:If you're feeling really lazy do what I did as a kid and put the score panel down the right hand side
(sprite MSB register? What's that all about then?)
I thought this way all the time until one day in my 20s I had a couple of spliffs in a row sitting in a coffee shop and the answer came to me instantly like a revelation, I think I still have the code I wrote on the back of the menu sheet there and then.
