Videopac / Odyssey2 forum
December 08, 2022, 04:32:01 PM *
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]   Go Down
  Print  
Author Topic: Omega Race on the Videopac..  (Read 5849 times)
gertk
Post Axe Pete!
*****
Posts: 868



gertk64
WWW
« on: February 01, 2011, 12:00:14 AM »

This is some experimental code trying to port one of my old-time favorites to the Videopac.
At the moment it is still written in sdcc (C) on the DS5000 cpu  just to get the hang of programming the videochip.

The characters inside the box displaying the number of lives, the score and hiscore are the 4 quads interleaved, the dots surrounding the playfield are single characters which are displayed every odd frame, during the even frames these characters are use for displaying the mines (x)

The ship is moving and rotating and collision detect is working on the center box, on the outside perimeter I simply check for x and y limits. I am still thinking about how to display the 'bullets' fired from the ship. In the original there are lots of bullets at the same time on screen not only from the ship but also from the enemy but since I only have 4 sprites this is going to be tricky.
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2838



« Reply #1 on: February 01, 2011, 01:01:31 AM »

Wow! Amazing, it?s a really cool game. May the Force be with you!
Logged

Seob
Give this man a Jopac!
******
Posts: 1396



« Reply #2 on: February 01, 2011, 08:39:07 PM »

Looks like a version of minestorm.
Logged

8 bits of fun
gertk
Post Axe Pete!
*****
Posts: 868



gertk64
WWW
« Reply #3 on: February 01, 2011, 09:51:41 PM »

Well MineStorm is like Asteroids and Omega Race is not Asteroids :-)

For example you cannot fly across the screen and come back in at the other end.
Omega Race has invisible boundaries shown by the dots, when you try to fly off screen the barrier appears and you bounce off.
The barriers are not easy to make on the Videopac: the grid lines are to far inward from the sides and would limit movement too much so they are not usable.
Maybe temporarily use two sprites in double size mode for a single frame would be possible. But already I am using up ram like crazy for all the variables... Porting it back to the original 8048 + its 128 bytes extra would become a real challenge.
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
gertk
Post Axe Pete!
*****
Posts: 868



gertk64
WWW
« Reply #4 on: February 03, 2011, 10:16:55 PM »

Converting back to 8048 ..
First steps to getting the sdcc code back to 8048 assembler....
When you start programming in assembler again it is just as easy as C (haha)
It does not do much but the center box and the ship sprite already work.

BTW which internal (iram) addresses are safe to use ?


« Last Edit: February 16, 2011, 11:43:29 PM by gertk » Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Rene_G7400
Moderator
I take the Videopac and leave the Canoli!
*****
Posts: 2519



WWW
« Reply #5 on: February 04, 2011, 10:35:43 AM »

If you use the standard Vsync routines, you can use intram addresses 20H to 3CH.
Logged
gertk
Post Axe Pete!
*****
Posts: 868



gertk64
WWW
« Reply #6 on: February 16, 2011, 11:49:10 PM »

Updated the files in former post:

ship bouncing of center box and invisible boundaries, can be turned with joystick and you can see the thrust at the back when you push forward, enemies shown and collision detect tests, score is updated when a character is hit for testing/debug
The program grew beyond 1k and so I ran out of the first 2k Bank.. I have not found a neat way to tell as8048 how to deal with that.
For now I placed some subroutines at org 0x800 and set mb1 and subtract 0x800 from the call address and it assembles without errors.  

I am still fiddling with the speed of the ship, I have two counters dx_counter and dy_counter which set te number of vblanks to wait before moving the ship but then I can only move a maximum of one position per vblank (either horizontal, vertical or both) and to get some real speed this increment should be greater than 1 increment per vblank.. It should work more like a Bresenham line routine since the ship can rotate in 16 positions. Anyway.. have a look at the source if you like and comment me :-)  
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2838



« Reply #7 on: February 16, 2011, 11:51:26 PM »

Beatifull. I?ll test it now  Cheesy
Logged

Janzl
Administrator
I'd sell my mother for a Videopac
*****
Posts: 2441


I now can cross that bloody street...


facebook@janzl.com
WWW
« Reply #8 on: February 17, 2011, 09:37:48 AM »

I have done some tinkering in programming for videopac but you have already surpassed me so I can't help you much with the code :-)

I like what the game looks like and I like the dynamics of the space ship. I noticed a slight mistake though. When the ship hits the centre box from the right it bounces the wrong way back. When it comes from left-top its bounce direction should be right-down but at the moment it is right-up.

That's my 2 cent. Keep up the good work, I like what I see and I truly hope this game will be finished :-)
Logged

Ne tirez pas sur le administrator!
gertk
Post Axe Pete!
*****
Posts: 868



gertk64
WWW
« Reply #9 on: February 17, 2011, 06:56:43 PM »

I like what the game looks like and I like the dynamics of the space ship. I noticed a slight mistake though. When the ship hits the centre box from the right it bounces the wrong way back. When it comes from left-top its bounce direction should be right-down but at the moment it is right-up.

That is an effect of the collision detection of the VDC chip, it seems the grid lines overlap at the edges and so when you hit the edge of the box you get both vertical and horizontal collision detect bits set and so my bounce routine inverts both dx and dy.

Maybe I can set the  bounce parameters the same way as the outer limits (hardcoding instead of collision detect) I found out it is even possible to get the ship 'trapped' on one of the grid lines and I managed to get it stuck inside the center box too :-)
When you are rotating the ship while near the center box you can get overlap of some pixels over the grid lines resulting in lots of collission detects and dx/dy inverting will sometimes push the ship over the edge.
Logged

>>G7000 G7200(P+S) G7400 N60 JET27 VG5000 ZX80 ZX81 ORIC-1 COMX35 Aquarius<<
Pages: [1]   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!