News:

NEW GAME and special BOOK (and more!) to come from Côté Gamers! ! Check this topic!

Main Menu

Ants! (a WIP)

Started by Chris!, March 22, 2011, 06:48:37 AM

Previous topic - Next topic

Chris!

Hey all, I'm working (or TRYING to work, anyway), on an Odyssey2 homebrew called Ants! I don't really understand what I'm doing (I hardly understand assembly), but if someone could take a look and tell me some ways to program or how to do things better, I'd really appreciate it. What I've been doing and what I've used to create the game so far is tweak samples. I do know a little Basic and C+, but I just can't seem to grasp assembly yet. Anyway, here's the link:
http://www.atari2600land.com/ants.html
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

Janzl

Okay the beginning is there!  :)

Did you check all the programming links in te links section of the forum. Lot's of information can be found there.

I like the Melvin sprite  :)
Ne tirez pas sur le administrator!

Chris!

I looked at the links. The problem is, I don't know assembly, so I didn't understand any of it, except, by chance, I did change the background color to red. I still haven't found through trial and error how to change the two to a one and how to make it stay a one when Melvin stops touching the ant. I was hoping someone could go through the code and tell me how to do this. I was modifying Soren's code I got from his website.  ???
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

Rafael

Hi Chris. I made some changes on my adventure attempt to change it to your Gosub project.  Have fun!

Chris!

Perhaps someone can offer some code about a score and how to make it increase by 1? Not much progress with this, except I did make a border around the play area, but it's kind of useless unless you bounce back into it.
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

gertk

This is some code from my program 'omegarace'

It uses two quads to display a 4 digit score (the 4 remaining characters in the quads are for displaying the number of lives left but that is not in this code)

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<

Chris!

#6
It doesn't like vdc_quad0 and vdc_quad1 and calls it "an invalid symbol name."
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

gertk

Ah, you need some "equates" (.equ) for that :)

Depending on the assembler you use (I switched to a different one, see Omega race on the Videopac):


vdc_quad0       equ     040h
vdc_quad1       equ     050h

or

vdc_quad0       .equ    0x040;
vdc_quad1       .equ    0x050;

Or have a look at the source of my Omega Race attempt under 'Programming', there is quite some comment in there.
;D

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<

Chris!

Nope, it still doesn't like it.
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

Chris!

OK, I figured out the problem. My asm doesn't like 0x00-type numbers, so I switched them all to 000h. After I got this all taken care of, two new problems arise:  #1 - there are four halves of the letter V to the left of the score, and #2 - It adds one to the score when Melvin touches an ant, but then SUBTRACTS it when he isn't. I don't remember telling the program to do that, plus I thought that the BIOS doesn't even have a subtraction routine built in it. You can find my .a48 file at the Ants! website I made http://www.atari2600land.com/ants.html here.
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

manopac

subtraction of 1 in 8048 assembler is just adding FFh - same effect  :-)
sex, lies, and videopac

Chris!

OK, I have made the score increase by one whenever he touches the ant. Next up is the border collision. Since I've added a border, I want to have it be like the walls in Adventure (Melvin bounces back when he attempts to cross it). I have attempted to do it myself. I have only made the top horizontal border work and when he crossed the bottom horizontal border, he went to the top for some reason. I have deleted the non working code at hopes that I can get one that does work. I have added the link to the game in my signature for easier access to it.
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

gertk

Nice work so far !

You asked for if-then examples in assembler.

It mostly comes down to doing some kind of function and then jump conditionally on the outcome or result:

Like you do in the collision part

        ; check collisions
        mov r0,#03dh                       ; address of collision register in VDC
        mov a,@r0                           ; get value of collisionregister in A
        anl a,#002h                         ; test bit 1 (check for s1)
        jz check_collision_grid           ; if zero then jump to check_collision_grid


There are several conditional jumps in the 8048 which all respond to bits set in the flag register.

Have a look at the 8048 manual pointed to in https://videopac.nl/forum/index.php?topic=1611.0
The manual mentioned there gets interesting from page 56 (Instruction set)
>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<

Chris!

Hi, everyone, I'm back! I have never seen a warning about topics not being posted in for at least 120 days before. I'm sure I want to because I'm back trying to figure this out again. I'd like some help regarding whether or not there is a random number generator for the Odyssey^2 and if so, how to work it.
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

Rene_G7400

There is a random number generator for the Odyssey2, but it's not a good idea to use it, since Videopac+ consoles (G7400, Jopac) don't have it anymore.
Usually, the timer is used to get random numbers.