Jump to content
IGNORED

Space Invaders 7800


PacManPlus

Recommended Posts

question about joysticks and how they are read.

 

Too lazy to read my own thread. But I think what CpuWiz said should do the trick. Looks like the HSC cart is switching the 7800 into two or one button mode. I cannot say which cause I do not know what address yer reading for your fire button input. At least not without running your cart thru a7800x in debug mode.

 

If you wanna test HSC in an emu emu7800 has HSC support.

Edited by Shannon
Link to comment
Share on other sites

Thanks again guys :)

 

Okay, I actually NOW have the latest one and it has the problem of the game NOT REALLY ENDING when you lose your last laser base or even when the aliens land. You just keep getting laser bases.

I am so confused with this. I literally cannot get that to happen to me, and it doesn't seem that other people are having the same issue :( I don't know what to say... BTW, is this in emulation or are you playing this on a Cuttle Cart?

Definitely works fine with my CC2. That's probably why I didn't understand the first laser base comment. :lol:

Edited by HammR25
Link to comment
Share on other sites

Hi Everyone:

 

Thanks for the help. :) I actually figured out the 'fire button' HSC issue as well. It turns out that you have to initialize the 7800 (like you first entered the program) after you make the call, even though that subroutine to fetch the current high score doesn't interfere with the screen at all. :ponder:

 

Ok.

- Invader / Shield Collision

- Stack issues

- Tweak sounds

 

Just those left.

 

Will anyone have any issues if I handle the Invader / Shield collision the '2600 way' (removed the entire line the invaders are on once they move into the shield area). I only ask this because I cannot believe I didn't overrun the cycle / frame count yet. I HAVE to be close.

 

Bob

Edited by PacManPlus
Link to comment
Share on other sites

Works just fine on my CC2. What a great job, PMP!

Thank you! :)

 

Although I don't use it I have approximate maria cycle counting that I inserted into a7800x. I could probably give a guestimate of how many cycles are being used.

That would be great - it's the shields that take up the most processing time! To really see the maximum number of cycles, You need to turn on '2 player Competitive' mode, Moving Shields, and Zig Zagging Shots. Thanks!

 

 

 

Great work as always PMP....One thing would really make this complete.

The reverse missle secret in the arcade.

Thank you for the compliments!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The reverse what?

Edited by PacManPlus
Link to comment
Share on other sites

I know about the 2600 one, Gorf said "the reverse missile secret in the ARCADE" ;)

 

If he's talking about the rumor where on the 5th level, the 2nd mystery ship reflects your shot back down on you - I tried that in MAME and it didn't happen. (At least on the regular Space Invaders). I don't believe it happens...

 

:P

 

BTW, I got (for the most part) the shield / invader collision working, and I didn't use the 2600 way of doing it. :D

It's just every once in a while the invader doesn't erase the shield... I have to figure out why.

Edited by PacManPlus
Link to comment
Share on other sites

Well I'm glad you got the shield stuff working. Not sure if this is needed any more.... But here we go. The calculation of maria_cycles is based on the following info from the 7800 software guide.

APPENDIX 3: DMA TIMING

There is some uncertainty as to the number of cycles DMA will
require, because the internal MARIA chip timing resolution is
7.16 MHz, while the 6502 runs at either 1.79 MHz or 1.19MHz. As
a result, it is not known how many extra cycles will be needed in
DMA startup/shutdown to make the 6502 happy. It is even possible
for the 6502 to be in the middle of a long (TIA or 6532) acces
when it is to be halted, so the uncertainty goes up to about 5
cycles.

All times listed below refer to 7.16 MHz cyles.

	  DMA startup			5-9	  cycles

	  Header (4 byte)		8		cycles
	  Header (5 byte)		12	   cycles

	  Graphics Reads:
	  Direct				 3		cycles
	  Indirect/1 byte		6		cycles
	  Indirect/2 byte		9		cycles

	  Character Map access   3		cycles

	  Shutdown Times:
	  Last line of zone	  10-13	cycles
	  Other lines of zone	4 - 7	cycles


End of VBLANK is made up of a DMA startup plus a Long shutdown.

DMA does not begin until 7 cpu (1.79 MHz) cycles into each scan
line. The significance of this is that there is enough time to
change a color, or change CTRL before DMA begins, and during
HBLANK (before display begins). This figure should, however, be
included in any DMA usage calculations.

Another timing characteristic is that there is one mpu (7.16 MHz)
cycle between DMA shutdown and generation of a DLI.


APPENDIX 4: FRAME TIMING


		   34 cycles @1.79 MHz	   80 cycles @1.79 MHz
		  136 cycles @7.16 MHz	  320 cycles @7.16 MHz
		<--68 pixels--> <-----------160 pixels------------->
 ______|_______________|____________________________________|
  ^	|			   |				  ^				 |
  |	|			   |				  |				 |
  15   |<---HBLANK---->|			   VBLANK			   |
  |	|			   |				  |				 |
  v	|			   |				  v				 |
___________|_______________|____________________________________|
^	^	|			   |				  ^				 |
|	|	|			   |				  |				 |
|	25   |			   |				  |				 |
|	|	|			   |				  |				 |
|	v	|			   |				  |				 |
|	-----|---------------|------------------|-----------------|
|	^	|			   |				  |				 |
|	|	|			   |				  |				 |
|	|	|			   |				  |				 |
|	|	|			   |				  |				 |
|	|	|			   |				  |				 |
243  192   |			   |			   VISIBLE			  |
|	|	|			   |				  |				 |
|	|	|			   |				  |				 |
|	|	|			   |				  |				 |
|	|	|			   |				  |				 |
|	v	|			   |				  |				 |
|	-----|---------------|------------------|-----------------|
|	^	|			   |				  |				 |
|	|	|			   |				  |				 |
|	26   |			   |				  |				 |
|	|	|			   |				  |				 |
v	v	|			   |				  v				 |
___________|_______________|____________________________________|
  ^	|			   |				  ^				 |
  |	|			   |				  |				 |
  4	|			   |			   VBLANK			   |
  |	|			   |				  |				 |
  v	|			   |				  v				 |
 ______|_______________|____________________________________|
	   |<-------------------228 pixels--------------------->|
							456 cycles @7.16 MHz
							114 cycles @1.79 MHz

 

Now both prosystem (and my a7800x compilation) make the assumption that these cycles are "stolen" no matter what. I have no idea if on a real 7800 these cycles get stolen all the time, or only depending on what type of "work" the maria actually ends up doing. Worst case scenario these numbers do not apply at all times but do represent the max number of cycles that "could" be eaten. Best case scenario they are always accurate. :lol:

 

The line that eats the most cycles is 192. Which I'm guessing is the shields. Based on the chart above it eats approx 439 maria_cycles. I also verified this by running it through the Prosystem Emu in debug mode.

 

To give you an idea of the various cycle ranges I got. 31, 293, 335, 439, 377, 319, and 293 thru out an entire frame. I'm sure you can probably "guess" at which points these occur. Too give you an idea Centipede hits 480 when it switches out of character mode (after drawing the score, extra lives) and draws the top line. Probably why the display in MESS is screwed up because a real 7800 probably eats up all the cycles (see chart above).

 

Assuming it is correct you are still underneath the threshold (456-439=17). But it is pretty close. According to the text above I think the CPU already gets/eats 7 cycles before the scan line is processed. Hope that helps and is not false/misleading information. :lol:

Edited by Shannon
Link to comment
Share on other sites

Thank you very much for the analysis, Shannon :) I had a feeling I was close to the edge.

 

That being said, here is release candidate 1 for Space Invaders 7800. The following was done:

- Sound changed (improved?) for almost all sounds. Hey ZylonBane - is the shot a little better now? Unfortunately this was the best I could do with the TIA... :(

- Invader / Shield Collision. It ended up being easier than I thought. It just took a little time to get the algorithm down.

- High Score Cart support. I use $19 $80 for the Cart ID. Hopefully that doesn't clash with another cart. - Speaking of which, we should really make a database of what carts use what IDs...

- Took care of (I hope) the stack issues when jumping out of a subroutine. Most of them I was able to change to do a return instead. The two I couldn't change, had two 'pla' statements just before the jump out of the subroutine. It seems to be ok.

- Changed Colors

 

Please let me know if you see any screen rolls, or any other strange behavior. BTW, Please use ProSystem to test, as I believe MESS has a few bugs.

 

PLEASE NOTE, this game is now 16K. You would use this in a CCII:

7800:Space Invaders	SI7800	HSC_16K	HSC

 

Thanks, and enjoy!

Edited by PacManPlus
Link to comment
Share on other sites

I have a question... Since you did a version of Asteroids Deluxe (very nice) in hi-res mode, how come no version in hi-res for Vector Edition?

 

Probably because there would be no practical way to have high-res vector shapes overlap properly.

 

The 7800's screen is divided horizontally into 160 double-pixels. While it's possible to display different colors in the halves of a double pixel, transparency decisions are made on a double-pixel basis.

Link to comment
Share on other sites

I have a question... Since you did a version of Asteroids Deluxe (very nice) in hi-res mode, how come no version in hi-res for Vector Edition?

 

Probably because there would be no practical way to have high-res vector shapes overlap properly.

 

The 7800's screen is divided horizontally into 160 double-pixels. While it's possible to display different colors in the halves of a double pixel, transparency decisions are made on a double-pixel basis.

 

What is different in Vector Edition than Deluxe that would make this relevant?

Link to comment
Share on other sites

What is different in Vector Edition than Deluxe that would make this relevant?

 

The frequency and nature of object overlap.

 

In Space Invaders, objects generally do not overlap. Almost any time objects would overlap, one or the other is destroyed.

 

By contrast, the flying rocks in Asteroids Deluxe routinely overlap. If the rocks were solid, they could be drawn with low-resolution edges but high-resolution insides. Since the rocks are hollow, however, and must allow other objects to 'show through', both the inside and outside edges have to be jagged.

 

If the player ship were the object and UFO were drawn with the lowest priority, it would probably be possible to have them be high resolution while everything else was low resolution. Depending upon how the rocks were drawn, that might not be a bad approach, but I'm not sure how worthwhile it would be.

Link to comment
Share on other sites

What is different in Vector Edition than Deluxe that would make this relevant?

 

The frequency and nature of object overlap.

 

In Space Invaders, objects generally do not overlap. Almost any time objects would overlap, one or the other is destroyed.

 

By contrast, the flying rocks in Asteroids Deluxe routinely overlap. If the rocks were solid, they could be drawn with low-resolution edges but high-resolution insides. Since the rocks are hollow, however, and must allow other objects to 'show through', both the inside and outside edges have to be jagged.

 

If the player ship were the object and UFO were drawn with the lowest priority, it would probably be possible to have them be high resolution while everything else was low resolution. Depending upon how the rocks were drawn, that might not be a bad approach, but I'm not sure how worthwhile it would be.

 

Wait a minute, wait... Have you ever played Asteroids Deluxe on the 7800?? It's already in hi-res mode... :|

Edited by MrFish
Link to comment
Share on other sites

Well if someone could make a list of games (including homebrew) that support the HSC I could run them all and then provide a dump of the HSC contents. Then someone could analyze that (or maybe I could if I knew where to look) and make a list of Cart ID's.

 

Sound like a plan?

Link to comment
Share on other sites

Well if someone could make a list of games (including homebrew) that support the HSC I could run them all and then provide a dump of the HSC contents. Then someone could analyze that (or maybe I could if I knew where to look) and make a list of Cart ID's.

 

Sound like a plan?

 

For original released carts we have:

Asteroids

Dig Dug

Centipede

Galaga

Joust

Ms. Pac Man

Xevious

Food Fight

Robotron 2084

 

Desert Falcon proto

 

I don't know if the PAL versions use the same code but I would assume yes.

 

For modern releases we have:

Asteroids Deluxe

Beef Drop

BonQ

Froggie

Pac-Man Collection (includes seperate HSC codes for many variations of Pac-Man)

 

And maybe a few more I'm forgetting.

 

I'm sure Bob and Ken can provide the codes for their games and maybe some of the released games as well. :)

 

Mitch

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...