Videopac / Odyssey2 forum

Programming the Videopac / Odyssey2 => Homebrews => Topic started by: Chris! on November 10, 2014, 09:57:32 PM



Title: Aaron the Aant (was: Multiplication)
Post by: Chris! on November 10, 2014, 09:57:32 PM
Is there an easy way to multiply numbers? Like say I want a value to increase from 003h to 007h then to 00fh and so on until it gets to 0ffh? And also, is there a way to decrease numbers the same way?


Title: Re: Multiplication
Post by: LD on November 11, 2014, 01:48:20 AM
hm....

03h is 00000011b
07h is 00000111b
0Fh is 00001111b

My suggestion is rotate to the left (RL A) and ORL A with 001h
rotating A = 00000001 goes to 00000010, orl 001h set 1 to bit 0 : 00000011
(R0 holds the var, starting in this case as 003h)

   mov a,@R0
   cpl a          ;<- if var is 0ffh, cpl changes to 000h
   jz VarIsFull ;So if A is zero, R0 is 0ffh. jump the code
   cpl a          : return to the original value
   rl a
   orl a,#001h
   mov @R0,a
VarIsFull


I think it works.

To decrease just rotate to the right using RR A :

   mov a,@R0
   jz  VarIsZero ;Assuming you wanna check if var is zero, if is, jump
   rr a
   mov @R0,a
VarIsZero



Title: Re: Multiplication
Post by: Chris! on November 11, 2014, 02:53:53 AM
The decreasing code doesn't work, but the increasing code does.


Title: Re: Multiplication
Post by: Rene_G7400 on November 11, 2014, 09:35:20 AM
For decreasing you can use:

mov a,@r0  ; get value from intram
clr c    ; clear carry flag
rrc a    ; rotate right with carry
mov @r0,a

For increasing you can use a similar code:

mov a,@r0
clr c
cpl c     ; complement carry flag
rlc a     ; rotate left with carry
mov @r0,a


Title: Re: Multiplication
Post by: LD on November 11, 2014, 12:44:56 PM
The decreasing code doesn't work, but the increasing code does.

Sorry the bit 0 goes to 7 if RR. You need to ANL with 07Fh.
But René code is more optimized.
You still need to use the "jz" part for my code to check if var is 0FFh.

For decreasing you can use:

mov a,@r0  ; get value from intram
clr c    ; clear carry flag
rrc a    ; rotate right with carry
mov @r0,a

For increasing you can use a similar code:

mov a,@r0
clr c
cpl c     ; complement carry flag
rlc a     ; rotate left with carry
mov @r0,a


Interesting use of carry. Too bad there isn't a "Set Carry" instruction, to save a byte.


Title: Re: Multiplication
Post by: Chris! on November 11, 2014, 07:27:38 PM
Thank you. It works great now. I'll reveal what I'm working on a little later.


Title: Re: Multiplication
Post by: Chris! on November 13, 2014, 04:28:34 AM
So I added a few things and discovered that I need to make it so once it reaches 007h to start over again instead of 001h. How would I do this?


Title: Re: Multiplication
Post by: Rene_G7400 on November 13, 2014, 09:28:48 AM
So I added a few things and discovered that I need to make it so once it reaches 007h to start over again instead of 001h. How would I do this?

What should start over again? During increasing or decreasing?


Title: Re: Multiplication
Post by: Chris! on November 13, 2014, 04:04:47 PM
It should reach 007h instead of 000h.


Title: Re: Multiplication
Post by: Rene_G7400 on November 14, 2014, 09:36:40 AM

With XRL A,#007h you can compare the value and then use JZ (true) or JNZ (false) to jump to the right piece of code.


Title: Re: Multiplication
Post by: Chris! on December 25, 2014, 09:27:39 AM
OK, here's what I've been working on and why I needed to ask the question. Merry Christmas.
http://www.atari2600land.com/aaron/ (http://www.atari2600land.com/aaron/)


Title: Re: Multiplication
Post by: timdu on December 26, 2014, 06:20:02 AM
I am happy to report the news that we ( the 2600 Connection ) will be publishing and releasing AARON THE AANT on cartridge sometime in 2015.



Title: Re: Multiplication
Post by: Chris! on January 03, 2015, 12:33:23 AM
Here is a picture from the newest version:


Title: Re: Multiplication
Post by: TomBeck on January 03, 2015, 04:56:24 PM
I like that game, also the idea with an ant as the hero!

I have some suggestions:

So maybe the trees can grow and disappear at an random place (animation like in KC Krazy Chase). They can also grow between the coins and the ant. That would it make not so easy to get they. It would look better when Aaron looked in the direction he walk. Also a little smile at Aaron face would be great.(Like the dratpillar in KC Krazy Chase - picture) There can be also appear a little fruit with some extra points every 25 or 50 points. Were some plus graphics possible?  This were a great game for it. Maybe two trees, one on the left and one of the right site.
But again, only suggestions. What ever you use, much fun to finish the game.


Title: Re: Multiplication
Post by: Chris! on January 06, 2015, 06:41:02 PM
The latest version is now at the Aaron the Aant website:
http://www.atari2600land.com/aaron/ (http://www.atari2600land.com/aaron/)


Title: Re: Multiplication
Post by: Chris! on January 16, 2015, 11:22:27 PM
Work on an Atari 2600 version has begun.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Chris! on March 04, 2015, 03:34:00 AM
I made a few changes to the Odyssey 2 version.
First of all I made the aardvark's tongue get faster every 20 points, and the game pause every 20 points, and pressing fire starts it up again. Every 40 points, a tree is added until there are four on the screen. (using all the characters available.) As I was making these changes, though, more and more ants are coming into the kitchen. Blech! I don't know if it's a sign or what. I have less than 100 bytes left. I really struggled to make those changes, and I think I MAY have even fixed the highscore function as well. Anyway, here's a shot of all four trees in the shot. I have tested this on a real Odyssey 2 and it works good as far as I can tell. I hope to have the 2600 Connection (timdu) publish it later this year (like he said in an earlier post), I don't know when. Details are being worked on.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Rafael on May 23, 2015, 02:33:20 PM
Just like Chief Chef, here´s another great concept and congrats with you work with the tongue.
Maybe, for this game, you should use at least 2 colors, like you did with your Atari version. There´s an arcade game called Anteater, maybe you should to try to create a sideview anteater, combining sprite and chars. And don´t forget about the sounds, maybe it´s just my point of view (personal taste), but using the usual Odyssey tunes repeatedly, may not be beneficial to the game.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: VideopacBelgium on May 23, 2015, 06:16:37 PM
Oh, create a sideview anteater, combining sprite and chars, you mean like that, for example:


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Rafael on May 23, 2015, 11:59:28 PM
Oh, create a sideview anteater, combining sprite and chars, you mean like that, for example:

 :D Something like this :D


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Chris! on October 23, 2016, 04:45:01 AM
I'm resurrecting this game title. I can't take full credit for what you see here, I didn't design the screen, Rafael did. I just took a mock up picture he did and made it real. The game isn't playable as of yet, this is just an aardvark tongue test. I would like to thank Rafael's compliments and advice for the game.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: TomBeck on October 23, 2016, 10:03:50 AM
I really like what I see!. The sprites are great. That remembers me on the old Pink Panther cartoons here in Germany. There always come (sorry I only know the german name) "die blaue Elise". She always want to catch the ant. It was really funny. I loved and still love this cartoon.

Make the anteater blue and we have the first game, that live in the Pink Panther universe!  8)

Interesting to see, what the game will be.  :D


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Rafael on October 23, 2016, 09:07:47 PM
I'm resurrecting this game title. I can't take full credit for what you see here, I didn't design the screen, Rafael did. I just took a mock up picture he did and made it real. The game isn't playable as of yet, this is just an aardvark tongue test. I would like to thank Rafael's compliments and advice for the game.

You´re welcome, Chris. I really like some of your concepts, like this one, Ghost Palace and Chief Chef for instance.
There´s a detail to be changed  ( if you want ), the holes need to be in the green portion, it should look like the drawing below.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Chris! on October 23, 2016, 11:23:00 PM
OK, I'll try to fix the holes.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Chris! on October 24, 2016, 01:56:03 AM
Holes are fixed. You can now start a new game by pressing Fire. I changed the controller from the right one to the left one. You'd think
Code:
mov r1,#001h
call getjoystick
would mean the right one and 000 would be the left one, but nope. You can move the aant around, but that's all you can do in this version. I designed the aant's borders so there is no "safe zone," wherever the aant can move, the aant is in danger. Should make for a more exciting game. And yes, I spell ants with two a's because aants are bigger than an ordinary ant.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Chris! on October 24, 2016, 04:04:24 AM
Should I make the ant jump or have it so pressing up and down on the joystick makes the ant go up and down? Here's a version with the ant jumping. Press ACTION to jump.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: timdu on October 24, 2016, 10:46:15 AM
my vote is for a jumping ant!


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Chris! on October 27, 2016, 08:28:13 AM
I figured out how to make collision checks on the grid. It uses the same values as detection. So This:
Code:
    mov     r0,#vdc_collision
    mov     a,#010h
    movx    @r0,a           
for the vertical grid, and for the horizontal grid, replace the #010h with #020h. This discovery led to making the aardvark's tongue deadly to Aaron's face as well as his body. Instead of checking the characters, I instead checked the grid for characters and sprite 2 (Aaron's head) collisions. Now while it is technically a playable game, I still have work to do on it, like make the high score detection work, and randomize the aardvark. I have about 500 bytes left.


Title: Re: Aaron the Aant (was: Multiplication)
Post by: timdu on October 27, 2016, 04:27:54 PM
 :) I'M LOVIN' IT  :)


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Chris! on October 28, 2016, 09:45:03 AM
More work was done.
+ added some simple stock sfx for apple collecting and death.
+ moved the score down to the bottom.
+ implemented high score function.
+ made aardvark's tongue random (but will go in a pattern if Aaron stands still.)
I now have less than 400 bytes left to play with.
What's left to do is make the aardvark's tongue go faster as the game progresses. I'll have the game stop at a certain amount of points like in the previous version (like 50 points or something.) to pause it. The pause is needed to update the tongue variable. And probably some other stuff as well. I also made the "official" (for now) Aaron website where you can download the latest version. It's at http://www.atari2600land.com/aaron/ (http://www.atari2600land.com/aaron/).


Title: Re: Aaron the Aant (was: Multiplication)
Post by: Rafael on October 29, 2016, 01:52:44 PM
I like the version in which the ant can run around the anthill than jumping.