Videopac / Odyssey2 forum
December 14, 2019, 10:54:49 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Join Rafael's Haunted Woods contest and win a copy of the game!
 
   Home   arcade Help Login Register links videopac.nl  
Pages: 1 [2] 3 4   Go Down
  Print  
Author Topic: Nice Ice 2  (Read 7896 times)
Chris!
Give this man a Jopac!
******
Posts: 1148



WWW
« Reply #15 on: August 12, 2015, 08:36:16 PM »

Now no items will display. The relevant code (the code that gets the random number for the bag) begins at line 936. Why can't I get anything to show up? I don't care about the cane now. I just want the bag to show up first.
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 #16 on: August 13, 2015, 09:40:51 AM »

I think I see two problems:
- you've used MOVX a,@R0, but you should have used MOV (without X) (several times)
- after adding #0e8h, you need to use JC instead of JNC
Logged
Chris!
Give this man a Jopac!
******
Posts: 1148



WWW
« Reply #17 on: August 13, 2015, 12:23:10 PM »

I got it working, except for the Voice broke, so I took it out (so much for having little extra things.)
But now I can't test it on real hardware since my C7050 broke (see other topic in Hardware forum.)
Logged

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



WWW
« Reply #18 on: August 13, 2015, 12:50:29 PM »

My C7050 cart began working again. I tested it and it works OK on real hardware. Too bad I had to get rid of the Voice stuff, though.
Logged

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



WWW
« Reply #19 on: August 13, 2015, 02:20:45 PM »

I have one more item I want to randomly place in the game: Santa Claus. I was going to use two sprites for him (sprites 0 and 3) to make him multi-colored. Since I've used two different ways to randomly place things, I was wondering if there was a third way? How would I choose a room number for Santa?
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 #20 on: August 13, 2015, 02:27:43 PM »

You could try to use the value of register A5 of the VDC. You first need to enable this option with the following code at the start of your game:
(VDC access should be enabled)

mov r0,#0a0h
movx a,@r0
orl a,#002h
movx @r0,a
Logged
Chris!
Give this man a Jopac!
******
Posts: 1148



WWW
« Reply #21 on: August 13, 2015, 03:29:55 PM »

Then how would I make sure it stays between 1-23? Wouldn't the value be the same as the cane, since I'm constantly adding one to it and having it loop back to 1 if it gets over 23? Or would it be a different value?
Logged

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



WWW
« Reply #22 on: August 13, 2015, 03:34:06 PM »

Also, I'm using similar code already to allow the grid to be squares:
Code:
mov r0,#0a0h
movx a,@r0
orl a,#080h
movx @r0,a
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 #23 on: August 13, 2015, 05:43:01 PM »

You can combine the code by using:
orl a,#082h
between the movx instructions at the start of your game.

To read A5, just use:
mov r0,#0a5h
movx a,@r0
anl a,#01fh

Save the result in some register, and use ADD and JC to further limit the value, just as you have done with the timer value.
Logged
Chris!
Give this man a Jopac!
******
Posts: 1148



WWW
« Reply #24 on: August 13, 2015, 06:24:31 PM »

Why won't Santa display on the first screen?
Logged

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



WWW
« Reply #25 on: August 15, 2015, 06:49:41 PM »

OK, I massively rewrote the code so it works again. I made it so Santa appears when his room is set to one, but not when it's set to a5. So there must be something wrong with my Santa-s room getting code. It's at the very end and goes like this:
Code:
get_santa_room


mov r0,#0a5h
movx a,@r0
anl a,#01fh


mov a,@r0 ; get blue car speed
mov r7,a ; store in R6

mov r0,#santaroom
mov a,@r0
mov a,r7 ; adjust x pos
mov @r0,a


mov r0,#santaroom
mov a,@r0
add a,#0e8h
jc get_santa_random_2

mov r1,#santaroom
mov a,@r1 ; get blue car speed
mov r6,a ; store in R6




mov r1,#santaroom
mov a,@r1 ; get blue car speed
mov r6,a ; store in R6

mov r0,#bagroom
mov a,@r0
xrl a,r6 ; adjust x pos
jz get_santa_random_2


mov r1,#santaroom
mov a,@r1 ; get blue car speed
mov r6,a ; store in R6

mov r0,#caneroom
mov a,@r0
xrl a,r6 ; adjust x pos
jz get_santa_random_2




ret

get_santa_random_2
mov r0,#santaroom
mov a,@r0
mov a,#001h
mov @r0,a

ret
Yes, I remembered to make the orl thing 082h. What am I doing wrong here? I've also posted the full code if it helps.
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 #26 on: August 15, 2015, 10:38:00 PM »

In line 4 (mov a,@r0) you overwrite the value that you got from A5.

It looks like you need to remove line 4, 5, 7 and 8 (twice mov a,@r0 and mov r7,a).
Logged
Chris!
Give this man a Jopac!
******
Posts: 1148



WWW
« Reply #27 on: August 15, 2015, 11:35:20 PM »

That doesn't seem to help at all. I have noticed something odd, though. If I force the santa room value to be 2, it doesn't show up, but if I force it to be 1, it does. Something must be screwing up something here.
Logged

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



WWW
« Reply #28 on: August 16, 2015, 05:50:24 PM »

I knew it. Something is odd. I still don't know what, and I am able to get Santa into the game, but only as a character. It won't even allow me to put a beard on him. So I guess this will have to do. Up next is collision detection on the characters. I am hesitant to begin work on it, though, since putting Santa in the game didn't go as well as I had hoped.
Logged

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



WWW
« Reply #29 on: August 17, 2015, 03:42:20 AM »

Collision detection added. It only took a day. Problem: Sometimes one of the three objects don't show up. I have not gotten this bug on real hardware, so perhaps it is an O2EM thing? I don't know.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
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!