Videopac / Odyssey2 forum
December 09, 2022, 07:24:54 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: The forum will disappear in April 2023 please check this topic!
 
   Home   Help Login Register links videopac.nl  
Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: Ants! (a WIP)  (Read 20149 times)
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« on: March 22, 2011, 06:48:37 AM »

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
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Janzl
Administrator
I'd sell my mother for a Videopac
*****
Posts: 2441


I now can cross that bloody street...


facebook@janzl.com
WWW
« Reply #1 on: March 22, 2011, 09:52:42 AM »

Okay the beginning is there!  Smiley

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  Smiley
Logged

Ne tirez pas sur le administrator!
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #2 on: March 23, 2011, 01:58:41 AM »

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.  Huh?
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2838



« Reply #3 on: March 23, 2011, 02:43:49 AM »

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

Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #4 on: March 23, 2011, 05:36:30 AM »

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.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
gertk
Post Axe Pete!
*****
Posts: 868



gertk64
WWW
« Reply #5 on: March 23, 2011, 08:17:08 AM »

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)

Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #6 on: March 23, 2011, 08:58:23 AM »

It doesn't like vdc_quad0 and vdc_quad1 and calls it "an invalid symbol name."
« Last Edit: March 23, 2011, 09:07:51 AM by Chris! » Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
gertk
Post Axe Pete!
*****
Posts: 868



gertk64
WWW
« Reply #7 on: March 23, 2011, 05:22:01 PM »

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

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.
 Grin

Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #8 on: March 24, 2011, 01:05:32 AM »

Nope, it still doesn't like it.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #9 on: March 24, 2011, 01:33:46 AM »

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.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
manopac
Game & App Development
Give this man a Jopac!
*
Posts: 1182



« Reply #10 on: March 24, 2011, 08:45:32 AM »

subtraction of 1 in 8048 assembler is just adding FFh - same effect  :-)
Logged

sex, lies, and videopac
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #11 on: March 24, 2011, 10:23:25 AM »

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.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
gertk
Post Axe Pete!
*****
Posts: 868



gertk64
WWW
« Reply #12 on: March 24, 2011, 01:23:40 PM »

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 http://videopac.nl/forum/index.php?topic=1611.0
The manual mentioned there gets interesting from page 56 (Instruction set)
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Chris!
Give this man a Jopac!
******
Posts: 1310



WWW
« Reply #13 on: September 06, 2011, 05:13:07 AM »

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.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Rene_G7400
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2519



WWW
« Reply #14 on: September 06, 2011, 12:52:43 PM »

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.
Logged
Pages: [1] 2 3 4   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!