Jump to content



Avram's Photo

Avram

Member Since 11 Jan 2002
OFFLINE Last Active May 24 2012 8:57 PM

Posts I've Made

In Topic: DLI timing

Fri Jan 20, 2012 8:48 AM

Thanks for the super fast reply Rybags!

In Topic: DLI timing

Fri Jan 20, 2012 7:45 AM

Ad to specify, I'm looking to have each line's character that I'm changing to look different. So the "A" on line 0 will look different from the "A" on line 1 etc.

In Topic: 6502 teacher

Wed Aug 17, 2011 8:06 AM

1) Set up a cross assembler on your computer so that you can quickly write code and test it. I shared a document here on post #12 that will walk you through the steps.

2) Not only is Atari Archives a great resource, you can also browse almost 100 books at atarimania. You might find Atari 130XE Machine Language for the Absolute Beginner a good read.

3) Start simply and build from there. Many people have helped me in this forum with my assembly language questions but it's best to play with your cross-assembler and books first to at least get a sense of how the language works.

4) I'm a beginner coder so can't help with anything advanced but here's a very simple piece of code to flash color on the screen. Again, I began with the basics and built from there (guided by many very helpful Atariage users).

*=$4000
loop
	lda $14
	sta 710
	cmp #100
	bne loop
	lda 53770
	sta 712
	jmp loop

And here's a breakdown.

*=$4000
Every piece of code has to be stored somewhere in memory. $4000, the hexadecimal of 16384, is a good place. I should state that hex is very common but is a numbering system I still don't use as often as possible. If you read Mapping the Atari, for instance (or many other Atari assembly books), you'll notice that the author usually lists both the hex and decimal equivalents of a memory location. If you're working on a PC then load up the built in calculator, go to View in the menu bar, and then choose Scientific. That way you'll be able to easily switch from dec to hex.

loop
The software will go back to this marker or label later.

	lda $14
Another piece of hex. What happens here is that the accumulator is loaded with whatever is in memory location $14/20, the real-time clock. This changes 50/60 times a second (depending on whether you're using a NTSC or PAL machine).

	sta 710
Whatever is stored in the accumulator is now put into memory location 710, the color of the screen. Because we just loaded $14/20, the clock location, a number between 0-255 will go here.

	cmp #100
Now we CoMPare the value stored in the accumulator (whatever the clock read) with the value #100. If they don't match then...

	bne loop
... return to loop. "Branch Not Equal" to "loop".

	lda 53770
But if the accumulator WAS equal to 100 then we'll load the accumulator with a random number that has been generated automatically at location 53770.

	sta 712
Which we'll store as a border color.

	jmp loop
And then finally go back to loop, repeating the process.

In Topic: character graphics programming help

Sun Jul 24, 2011 4:56 PM

Hi Dariusz,

To read characters and collisions I plan on using the method you set up for me, i.e. convert the player sprite position (0-255) to an equivalent on the screen (0-39 and 0-23). The four slime characters (and the monster characters) will be inverse characters for the extra color, but at this stage I'm developing the game idea and graphics as I go along so it's all still quite fluid.

Though the more I think about it, the bmi command is a pretty good idea. Essentially, any character that's over 127 should trigger the platform flag?

Avram

In Topic: character graphics programming help

Sun Jul 24, 2011 2:09 PM

Thanks everyone. I'll add this change to the code.