Videopac / Odyssey2 forum

Programming the Videopac / Odyssey2 => Homebrews => Topic started by: Chris! on April 02, 2016, 10:28:59 AM



Title: lowercase i (WIP)
Post by: Chris! on April 02, 2016, 10:28:59 AM
I thought about naming this game just "i", but then I thought people would get confused by it, so I'm naming it "lowercase i." The premise is simple, it's a little bit like my Q game I started earlier, but instead of the letter Q, it's the letter I.
All was peaceful in I land until you pressed the I key on your Odyssey 2 keyboard. Now, insulted by your selfishness, the Hs started to invade. Now it's up to a littler lowercase I to defeat the Hs and restore peace to I land. But the little lowercase I has a weapon the Hs don't. It's not a sword or a gun, but his dot. He can throw it around and punch the H enemies with it. It acts just like a boomerang.
I have the intro done and that's it. I would like it make it so that I is the only button that starts the game, but I can't figure it out with this setup. The setup is sort of like Pitfall! for the Atari 2600 (I'm well aware about Wildlife, so don't ask. I hope this game will be different enough.) The intro does have Voice support, but, like I said, once it says "go!" going does nothing because I haven't gotten that far into the game yet.
I want to make a 4k game, so that's what I'm aiming for. I would need to learn how to bankswitch, something I haven't really done yet. (I touched it on the Plumber game).
So can anyone tell me how to make it so only I starts the game and pressing any other key goes back to the SELECT GAME on a black background? (I got it so it said "SELECT GAME" but the background was set up like the beginning of the game.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 02, 2016, 12:04:32 PM
I figured out how to make only typing the letter I on the keypad start the game!


Title: Re: lowercase i (WIP)
Post by: Chris! on April 03, 2016, 03:18:03 AM
The lowercase I can move back and forth by pressing left and right. Pressing fire makes the i swing his dot in a punching motion. This took a few unnecessary hours of work, I say that because it shouldn't have been that hard but I was having quite the time with it.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 03, 2016, 06:02:57 AM
Lowercase i's are afraid of water and will not go in it. Needless to say, this lowercase i is stuck here until I add a raft for the dot to get and pull back across so the i can move across the river.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 04, 2016, 12:12:12 PM
You can now move up and down as well. I also added a simplified health meter. It starts at 99 and if you get down to 00, you die and the game ends. But nothing can kill you so far, so it doesn't decrease. I had an earlier health meter, but the code was gigantic because it was using two quads for one two-digit score. I made this one two characters, so it reduced the code quite a bit.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 04, 2016, 05:50:10 PM
I had some trouble with the 0e4 value since it's used for the Voice and also the grids. So I had to make it so the i can only use his dot while standing still for some reason. It was like that before, but if you were holding the joystick left or right or up or down, you stood still and could use the dot. Now the joystick can't be pressed while using your dot.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 04, 2016, 10:38:55 PM
I put in the first enemy: the first H you encounter.


Title: Re: lowercase i (WIP)
Post by: Rafael on April 04, 2016, 11:49:41 PM
I put in the first enemy: the first H you encounter.


Nice graphics and sprites. Good luck!


Title: Re: lowercase i (WIP)
Post by: Chris! on April 05, 2016, 01:37:43 AM
I need help. Fill in the blanks with the appropriate values. I've just about tried everything and nothing seems to work okay. The dot is 3x2 pixels, and the H is 8x8 pixels.
Code:
check_hit_enemy
mov r0,#008h ;h enemy

mov r1,#doty
mov a,@r1
mov r1,a

movx a,@r0 ; get Y pos of sprite 0
mov r4,a
movx a,@r1 ; get Y pos of sprite 2
cpl a ; make negative
inc a
add a,r4 ; calculate the difference
add a,# ; add offset (a sprite pixel is two lines) (what is this value?!)
add a,# ; determine sprite distance (what is this value?!)
jc the_end_check_hit_enemy

mov r0,#009h ;h xpos
mov r1,#015h ;dot xpos
movx a,@r0
mov r4,a
movx a,@r1
cpl a
inc a
add a,r4
add a,# ; add offset (what is this value?!)
add a,# ; determine sprite distance (what is this value?!)
jc the_end_check_hit_enemy


Title: Re: lowercase i (WIP)
Post by: Chris! on April 20, 2016, 08:52:15 AM
New version!
I got rid of the Voice module stuff, though. It was taking up too much room. But now there are 4 screens to go through. The game works fine on real hardware (after about 7 or 8 continuous hours of programming.) I was having way too much trouble on the last screen, but I eventually got it the way I wanted it.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 21, 2016, 10:06:38 AM
New version.
A fight with a big H ensues. No matter what, you will lose some health in this fight. How much depends on your fighting skill, with the point being, of course, not to lose a lot of it. I broke and then fixed it so it now works on real hardware. I have 500 bytes to go before I attempt to make this game 4k. I think for a sizeable game that isn't too short, it should be 8k. What I plan to do is what I did with Super Giuseppe: Put part of the same code in each bank (the controls), and then add some new code to control the new stuff in each bank.
What was the program that will merge 2 2k files and make it one 4k file? I forgot what it was.


Title: Re: lowercase i (WIP)
Post by: Rene_G7400 on April 21, 2016, 11:39:24 AM
What was the program that will merge 2 2k files and make it one 4k file? I forgot what it was.

copy /B file1.bin + file2.bin game4k.bin
in a Command Prompt window


Title: Re: lowercase i (WIP)
Post by: Chris! on April 21, 2016, 11:27:55 PM
Will the 4k Odyssey 2 game start in bank 1? Since it starts in bank 3 in an 8k game?


Title: Re: lowercase i (WIP)
Post by: Rene_G7400 on April 22, 2016, 09:43:25 AM
It always starts in the highest bank.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 23, 2016, 03:13:11 AM
I was working on the latest version with my week-old computer when the computer died on me.  >:( Luckily I had saved the version I was working on at the best possible time to my website where I back stuff up. I am having trouble with something, though. I was working on a suit for the I to put on to make him look like an H. The trouble is I want the suit to go five (or so) pixels to the right of where it automatically goes when he picks it up with his dot. I got it at the y position I want, but the X position isn't working. Any thoughts?


Title: Re: lowercase i (WIP)
Post by: Chris! on April 23, 2016, 07:12:24 AM
I solved my problem about the H-suit thing. Here is a new version. Everything works fine on O2EM, though I am unable to test it on real hardware for the moment, though.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 24, 2016, 12:14:55 AM
Tested v. 16a on a real Odyssey 2. It works great.


Title: Re: lowercase i (WIP)
Post by: Chris! on April 24, 2016, 12:19:57 AM
I have a plan for an 8k game.
From bank 3, I'll jump to bank 0, then to bank 1, then again to bank 3 and if the game has been played, I'll jump again to bank 2 (otherwise it will jump to bank 0 if finished.) That should cover all 4 banks of an 8k game.


Title: Re: lowercase i (WIP)
Post by: Chris! on May 08, 2016, 02:08:31 AM
Spent all day on this, so this project isn't dead. And I don't want it to be since I spent a lot of time on it so far.


Title: Re: lowercase i (WIP)
Post by: Chris! on May 11, 2016, 04:35:42 AM
Wow! I actually made a 4k game! I successfully merged two 2k files so that when it gets to the end of the first one, it goes to the second one. Now I have to program the second one. I know I did it before once, but that was a long time ago. I'm glad I was able to figure out how to.


Title: Re: lowercase i (WIP)
Post by: timdu on May 11, 2016, 01:48:44 PM
Way to go, Chris! You are learning and mastering the ways! You are an O2 / Videopac "JEDI"    :)

(Sorry - had to include that Star Wars reference - I can't help it ... I'm a fan ! )


Title: Re: lowercase i (WIP)
Post by: Chris! on May 12, 2016, 11:57:48 PM
Thanks. I had hoped to get better at this as I went along. There are some things I still don't understand, but I think I have got better at this as the few years went by. I worked on the game again, and I made the I move around on the second bank. He can't go to the next screen because I haven't programmed that yet. I had some trouble with the game flickering when you tried to move down when you couldn't move down any more, but I think I have solved that.


Title: Re: lowercase i (WIP)
Post by: Chris! on May 14, 2016, 04:18:36 AM
Well, it looks like I won't be programming any time soon in my room at least. My computer I took to Best Buy, they have to send it somewhere and get it fixed. It will take at least two weeks they said, so if I were to do any programming, it would have to be in the den and I would have to move the TV and Odyssey 2 console in the den so I can hook it up to my computer. Someone needs to make a Atari 2600 "Harmony"-type cartridge for the Odyssey 2.


Title: Re: lowercase i (WIP)
Post by: Rene_G7400 on May 14, 2016, 05:08:21 PM
Maybe this cart could help you:
http://videopac.nl/forum/index.php?topic=2591.0 (http://videopac.nl/forum/index.php?topic=2591.0)


Title: Re: lowercase i (WIP)
Post by: Rafael on May 15, 2016, 03:15:49 PM
Wow! I actually made a 4k game! I successfully merged two 2k files so that when it gets to the end of the first one, it goes to the second one. Now I have to program the second one. I know I did it before once, but that was a long time ago. I'm glad I was able to figure out how to.


I played the game. Thereīs some nice activities but maybe it needs to be  more dangerous.


Title: Re: lowercase i (WIP)
Post by: Chris! on May 15, 2016, 11:37:17 PM
Yeah, I think it needs to be more dangerous, too. I can't really think of anything to put in the game now. Any suggestions?


Title: Re: lowercase i (WIP)
Post by: Chris! on May 20, 2016, 03:33:19 AM
If this all goes well, this screen will have an h in the sky following you dropping bombs on you while you run through the maze. The h's aren't there yet, but the maze is. I haven't tested this on real hardware. I plan to test this stuff once I get my computer back. This would be easier, since any mistake would be in the second bank. The first one is perfect.


Title: Re: lowercase i (WIP)
Post by: Chris! on May 20, 2016, 09:57:43 AM
I made this because I was bored. All it needs is some artwork to go with it.


Title: Re: lowercase i (WIP)
Post by: Chris! on May 22, 2016, 04:02:33 AM
Everything is good now! Just tested this on a real Odyssey 2. Once you complete the maze, it just ends because I haven't programmed the next screen yet. You lose 11 health points if a bomb drops on you.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 16, 2016, 11:25:21 AM
I haven't been keeping up on programming Odyssey 2 lately. It's now 2:20AM as I write this. I spent a few hours trying to get back into the groove. The last time I worked on anything significant was May 20, this game. So it took me a few hours to get a wall on the eighth screen. I hate trying to go to sleep since it takes really long unless I stay up all night and get super tired, which is what I'm doing now. I successfully got the wall in, and got it so it doesn't flicker if you run into it. How do you get past the big wall? I haven't programmed the answer in yet! The answer is a trampoline. Here is a picture of the wall screen. Man that's a big wall.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 17, 2016, 03:31:29 AM
Screen 8 finished. Once you get to the right side of the screen, it goes crazy because I haven't programmed screen 9 in yet.


Title: Re: lowercase i (WIP)
Post by: Rafael on June 17, 2016, 03:57:54 AM
Screen 8 finished. Once you get to the right side of the screen, it goes crazy because I haven't programmed screen 9 in yet.

I like it. But smoe obstacle is needed. Maybe you can try some birds flying  R to L


Title: Re: lowercase i (WIP)
Post by: Chris! on June 17, 2016, 04:24:52 AM
I found a bug in version 26. It has been fixed and updated to version 26a.

I like it. But smoe obstacle is needed. Maybe you can try some birds flying  R to L

I'll try to do it next time I resume work on this. I might not be able to do it though. It gets picky if I try to add stuff on top, like on previous games.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 17, 2016, 08:02:41 AM
Added an H flying above on screen 8 (with the now-leaner wall.)


Title: Re: lowercase i (WIP)
Post by: Rafael on June 17, 2016, 11:01:06 PM
Added an H flying above on screen 8 (with the now-leaner wall.)

 8)


Title: Re: lowercase i (WIP)
Post by: Chris! on June 17, 2016, 11:03:39 PM
There's something I don't get though: When I put it on my C7050 cart, the title screen i displays correctly, but if I turn it off and turn it back on again, it's all screwed up, like one time it showed an R above a T. When I turned the power off and back on again more, it always displayed correctly again. Or is it just a problem with my C7050 cart?


Title: Re: lowercase i (WIP)
Post by: Chris! on June 18, 2016, 02:22:11 AM
I have made instructions for the game. I managed to fit it all on one page so the booklet can be a 4-page one, although I want it to be 8 pages with i illustrations. That would be really cool. I also fixed a bug pertaining to screen 8, where if you touch the H, the H restarts on-screen. I moved it off screen.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 18, 2016, 04:39:51 AM
I made the i weaker, so the game is a little bit harder. At some point, I will introduce a healthy thing for the I to get (a jar of mayonnaise) to replenish his health.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 18, 2016, 07:50:51 AM
Was wondering if characters went behind the sprites or in front of them. Turns out the characters go behind the sprites. Such is with this ketchup bottle. The white is the round character (31h) and the red are sprites 0 and 1. And I will have the ketchup bottle disappear once the player touches it, so it shouldn't have time to go crazy (which is why I added the red border around the white character, and the round character is apparently only 6 pixels long instead of eight) since the i is made up of characters and characters go crazy if they touch each other. It has to be this way because if I used the block character (2fh) it is 8 pixels wide and therefore the characters would touch each other and go crazy. (I changed the mayo to ketchup since it's easier to draw a ketchup bottle.)


Title: Re: lowercase i (WIP)
Post by: Chris! on June 18, 2016, 09:30:14 AM
Here is the ketchup bottle and the i to show you how big the ketchup bottle is.
I just thought of something: the character and the sprite automatically are touching each other. That's no good. Unless I make it so that if there is a collision between the character and the upper half of the bottle (sprite 0), which I must do in order to keep this ketchup bottle design. I'll have to say the i must open the bottle by touching the top of it.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 18, 2016, 09:37:09 AM
Thinking aloud here. What would probably be easiest to do is just remove the K from the ketchup bottle, that way I can test for either a sprite 0 or sprite 1 collision with the character.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 19, 2016, 12:12:05 PM
Added the ketchup bottle on screen 9. It was extremely hard, and if you play it on real hardware, there's a tiny bit of visible noise below where the ketchup bottle used to be once you touch it. The hard part was making it so if you get the ketchup bottle and have more than 69 points to make it 99 exactly. Because getting the ketchup bottle puts 30 health points back on your health total.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 19, 2016, 01:39:05 PM
I could not for the life of me figure out how to make the stuff go away upon collision with the bottle, so I just gave up and made the bottle label sprite 2. I also fixed a bug that happened when you got the bottle and your score was between 69-94.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 23, 2016, 03:08:40 PM
I want to work on this game again but I have no ideas for right now. I plan on making the third bank's grid color blue for an idea I thought up for a river, but right now, I don't have any ideas on how to finish out the bank. I figure I could be able to squeeze one more idea in before the bank ends. I have used 1,496 bytes of the 2,048. So yes, I'm planning on making this an 8k game. I need all the space I can get. The idea I have for the river is that there's a block floating around in the sky and some way to shoot it down. The object of this screen would be to make the block land in the river so the I can get across. In case you miss, you can go back to the previous screen and back ahead for a fresh start. But first I need to finish this bank up.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 23, 2016, 03:27:48 PM
Question time.
If I make the game 8k, it will have four banks. I would like the game to move from bank 2 to bank 0. Does this mean that bank 1 must be filled or can it be empty in order for the BIOS bank jumping routine to work correctly?


Title: Re: lowercase i (WIP)
Post by: Rene_G7400 on June 23, 2016, 05:09:21 PM
Bank 1 can stay empty.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 24, 2016, 03:06:42 PM
Can I change the grid colors mid-bank?
Right now I'm using Rafael's code:
Code:
vsync
stop tcnt
;mov r0,#000h ; (first color: I used black/black here, to keep SELECT GAME screen black)
;mov a,#0a3h
movx @r0,a
mov a,#0ffh ; (Hereīs the size. FF is the smallest trace, the same size of a horizontal bar, at this size it will not visible on screen)
mov t,a
strt cnt
jmp 001ah

timer
sel rb0
mov r5,a ; save accumulator
stop tcnt
mov r0,#030h ; get color data pointer
mov a,@r0
add a,#colordata & 0ffh ; get color data address
mov r2,a
movp a,@a ; get color
mov r1,#0a3h
waitline1
jt1 waitline1 ; wait for end of video line
waitline2
jnt1 waitline2
movx @r1,a ; set color
inc @r0 ; update data pointer
inc r2
mov a,r2
movp a,@a ; get timer data
mov t,a
strt cnt ; start timer
inc @r0 ; update data pointer
inc r2
mov a,r2 ; check if next data = 0
movp a,@a
jnz timerend
mov @r0,a ; reset pointer if end of data
stop tcnt
timerend
mov a,r5 ; restore accumulator
retr





colordata:   ;(2nd color) (itīs size)   (3rdcolor) (itīs size)    ...
   db 01ah,      0e9h,        01ah,          0ech,       01ah,0fdh,018h,0bfh
  db 010h,0fah,010h,0dbh,010h,0d6h,009h,0feh,009h,0feh,000h ;(use 000h to close)




start en tcnti ; enable timer interrupt
mov r0,#030h ; init color register
mov @r0,#0
How would I get it to use a new colordata set, like colordata2?


Title: Re: lowercase i (WIP)
Post by: Rene_G7400 on June 25, 2016, 12:27:09 AM

If you haven't used intram register 031h yet, you could do it like this:

Code:
timer
sel rb0
mov r5,a ; save accumulator
stop tcnt
mov r0,#031h ; get color database
mov a,@r0
dec r0
add a,@r0 ; add color data pointer
mov r2,a
movp a,@a ; get color
mov r1,#0a3h
waitline1
jt1 waitline1 ; wait for end of video line
waitline2
jnt1 waitline2
movx @r1,a ; set color
inc @r0 ; update data pointer
inc r2
mov a,r2
movp a,@a ; get timer data
mov t,a
strt cnt ; start timer
inc @r0 ; update data pointer
inc r2
mov a,r2 ; check if next data = 0
movp a,@a
jnz timerend
mov @r0,a ; reset pointer if end of data
stop tcnt
timerend
mov a,r5 ; restore accumulator
retr


colordata:   ;(2nd color) (itīs size)   (3rdcolor) (itīs size)    ...
   db 01ah,      0e9h,        01ah,          0ech,       01ah,0fdh,018h,0bfh
  db 010h,0fah,010h,0dbh,010h,0d6h,009h,0feh,009h,0feh,000h ;(use 000h to close)


start en tcnti ; enable timer interrupt
mov r0,#030h ; init color register
mov @r0,#0
inc r0
mov @r0,#colordata & 0ffh ; set color data address

(Don't forget the initialization of register 031h at the start of the game (bottom of code).)

To load a new set, use:
mov r0,#031h
mov @r0,#colordata2 & 0ffh



Title: Re: lowercase i (WIP)
Post by: Rafael on June 25, 2016, 02:12:17 PM
Can I change the grid colors mid-bank?
Right now I'm using Rafael's code:

Give the credits to the right guy: René. ;)


Title: Re: lowercase i (WIP)
Post by: Chris! on June 25, 2016, 02:56:15 PM
How do I initialize 031h?
I tried adding "colordata2  equ 031h" but it didn't seem to help any.
What I have right now is just one color definition on the whole screen. I'm thinking because I didn't initialize 031h.


Title: Re: lowercase i (WIP)
Post by: Chris! on June 25, 2016, 03:13:29 PM
Never mind. I figured it out!


Title: Re: lowercase i (WIP)
Post by: Chris! on June 26, 2016, 01:58:40 PM
Here is the latest version. I worked for 8 hours on this dumb thing. 4 before I went to sleep and 4 when I got up this morning at about 12:30am. I don't know why, but it kept doing odd things for no apparent reason. Thus, if you find anything weird going on, please tell me. Screen 10 is implemented, where there's a big brick floating in the sky to shoot down. Part of the problem was on real hardware, it kept doing the collision routine for the grid even though it wasn't supposed to and didn't on O2EM. So the solution was once the brick got shot down, remove the grid part and cover it up with the brick. If you miss, just go back to screen 9 and ahead to screen 10 again.


Title: Re: lowercase i (WIP)
Post by: Chris! on July 04, 2016, 12:16:38 AM
Haven't given up on this yet. Just made it 8k after an hour of code wrestling.


Title: Re: lowercase i (WIP)
Post by: Chris! on July 22, 2016, 03:49:11 AM
Thought of an idea: Have a race between you and an H. If you touch the H, you go back to the beginning of the screen. The object is to beat the H to the other side of the screen so you don't touch him. This took hours to do. The first attempt didn't go very well, and took up 1,040 or so bytes of code. But I kept doing it and got it down to 865 bytes. That was hard. And hot. I'm hot in here.


Title: Re: lowercase i (WIP)
Post by: Rafael on July 31, 2016, 01:19:49 AM
I played your game. Thereīs a lot o nice ideas here. But Iīm not sure if all these ideas are from "the same world".


Title: Re: lowercase i (WIP)
Post by: Chris! on July 31, 2016, 09:34:51 AM
What do you mean, "The same world,"?


Title: Re: lowercase i (WIP)
Post by: Rafael on July 31, 2016, 07:08:58 PM
Not sure I can explain better.  Perhaps it has to do with the fact that you are using a different action for each screen (I'm not saying this is wrong), but maybe do it seems a junction minigames.


Title: Re: lowercase i (WIP)
Post by: Chris! on August 02, 2016, 12:08:36 AM
So it seems to you like it's a collection of minigames?


Title: Re: lowercase i (WIP)
Post by: Rafael on August 02, 2016, 01:24:26 AM
Yes.


Title: Re: lowercase i (WIP)
Post by: Chris! on August 08, 2016, 07:18:47 AM
Well, I suppose that's not a bad thing. I went back to work on this after I found a major bug that took a few hours to kill. Pertaining to the race screen. I also found another bug that I killed where if you touch the wall above the H on the race screen, the race starts. I think I know why the reason some people are having trouble with the game: They're not pressing the I key to start the game. I tried pressing numbers on real hardware and I got weird results.


Title: Re: lowercase i (WIP)
Post by: Chris! on August 08, 2016, 08:35:13 AM
I decided it was time to see if I could fit the code in bank 3 to put the game into bank 2 if the screennumber was over 0. I did it successfully after about 10 minutes. I also fixed a bug that came up about throwing the dot while going through the race. Now I'm all set once I fill up bank 0. I will switch it to bank 3 and then it SHOULD go to bank 2 where the game will finish.


Title: Re: lowercase i (WIP)
Post by: Chris! on May 23, 2017, 04:43:31 AM
I've decided to go back to work on this game. I think all the bugs are gone, but if you see any while playing, be sure to tell me. This version ends after the H "race."