Jump to content
  • entries
    34
  • comments
    88
  • views
    26,188

Little Man Progress


Guest

421 views

Okay, I have gone ahead and sculpted a simple set of platforms by hand. Ultimately I need to make myself a level editor tool to generate all the data for the level graphics. I also toned down the brightness of the PF colors so the player sprite isn't so washed out particulary on top of the blue ladders. I have attached a screenshot, the current code, and the bin all gzipped (Can be opened with Winzip).I did some tricks in the kernel to get it to work. The key thing is that I used what I call the Masked Draw technique. With masked drawing to draw a sprite you do this:

LDA (spritePtr),YAND (maskPtr),YSTA GRPx

Load the sprite graphics, then logically AND with a bit mask. The bit mask is zero for all lines where the sprie must not appear. Yes, that does mean a large table of mostly zeros in ROM, but it can draw a sprite in 13 cycles!Since the player sprite in little man is 5 pixels wide, I have 3 pixels free in the sprite mask table to use for missle rendering control. Like this:

LDA (Mxptr),YSTA ENAMx

Mxptr points into the same masking array in ROM we used for the player sprite. if bit 1 in the mask byte read from the table is set, then the missle is turned on for that line. So the missle is enabled/disabled on the correct line for just 8 cycles time. NOTE: In the attached code the Missle rendering code is turned off at this time. The appearance and dissappearance of sections of the gameboard, including gold that is picked up, is going to be done with a bitmask stored in RAM. The level PF data is stored in ROM. In the ROM image all the necessary elements are present. We can only subtract from the playfield displayed to the player, we can not add to it on the fly. Every write of PF data from ROM is bitwise AND'ed with a byte from the RAM masking table. The masking table has up to 16 entries so we can create up to 16 horizontal bands on the screen where PF pixels are made to appear and vanish as needed. Every time the player picks up some gold a mask modifier script is executed to update mask and hence the playfield appearance. Elevators and such are dynamically altered entries in the masking table. There is going to be some fun coding to get them to work smoothly. End Transmission!

8 Comments


Recommended Comments

This looks like it is coming along nicely - it is always good to see more platform games on the 2600! However, I am not entirely convinced by your sprite masking approach. The switchdraw algorithm would only use 15 cycles (2 cycles more) and would save a lot of ROM. Also, your missile technique appears to load the mask data twice. I think you could do something like this instead:

 

lda (MaskData),Y
sta ENAMx
and (PlayerData),Y 
sta GRPx

 

Cheers,

Chris

Link to comment

Hi there!

 

I think the masking idea is a reasonable compromise. At least when all sprites are of the same height ;)

 

Also thanks for opening my eyes. In Colony 7 I was doing something very stupid for the crosshair:

 

; Draw crosshair

LDY crossoffset

LDX crosshair,Y

STX GRP0

 

Plus some regular "DEC crossoffset"...

 

With some Y indexed pointer I'll now save 7 cycles each other line :)

 

I was pretty desperate looking for those cycles already, so thanks a billion! ;)

 

Greetings,

Manuel

Link to comment
This looks like it is coming along nicely - it is always good to see more platform games on the 2600!  However, I am not entirely convinced by your sprite masking approach.  The switchdraw algorithm would only use 15 cycles (2 cycles more) and would save a lot of ROM.  Also, your missile technique appears to load the mask data twice.  I think you could do something like this instead:

 

lda (MaskData),Y
sta ENAMx
and (PlayerData),Y 
sta GRPx

 

Cheers,

Chris

 

That would be nice if I could do a single load of the mask for both objects, but it would only work if the player sprite and missle are at the same vertical position.

 

As for SwitchDraw, its quick but I NEED those 2 extra cycles. Plus, for a 32K or 64K cart like this is going to be, having a single instance of the masking table is not a big deal. In the grand scheme of things.

 

Cheers!

Link to comment
Hi there!

 

I think the masking idea is a reasonable compromise. At least when all sprites are of the same height ;)

Yeah, that's a limitation to the system, but a fair number of games all use sprites about the same height. Little Man for example ;)

 

Also thanks for opening my eyes. In Colony 7 I was doing something very stupid for the crosshair:

 

; Draw crosshair

    LDY crossoffset

    LDX crosshair,Y

    STX GRP0

 

Plus some regular "DEC crossoffset"...

 

With some Y indexed pointer I'll now save 7 cycles each other line :)

 

I was pretty desperate looking for those cycles already, so thanks a billion! ;)

 

Greetings,

Manuel

 

That's the real power of the online homebrew community, all our shared knowledge and techniques leading to great new games. I like the Colony 7 demo you have posted. How do you plan to implement the secondary "Destroy all Enemies" weapon with a one button joystick?

 

Cheers!

Link to comment

Hi there!

 

That's the real power of the online homebrew community, all our shared knowledge and techniques leading to great new games.

 

Definitely!

 

I like the Colony 7 demo you have posted.  How do you plan to implement the secondary "Destroy all Enemies" weapon with a one button joystick?

 

Hm... I saved those recent [stella] messages about utilizing the second button of the 7800 controllers, but IIRC Eckhards last message regarding that said something like that it's not possible.

 

I did some research and it seems like some classic 2600 games just require the fire button of the second controller, like Spy Hunter and Stargate. I don't know how widespread footpedals are, but that might be a cool option then.

 

Also there may be joysticks with working extra buttons, like the Omega Booster grip and ... was there an extra Spy Hunter Joystick available? Or was it Stargate?

 

Other than that, I probably have to implement some sequence of joystick input to trigger it :)

 

Greetings,

Manuel

Link to comment
I like the Colony 7 demo you have posted.  How do you plan to implement the secondary "Destroy all Enemies" weapon with a one button joystick?

 

...

I did some research and it seems like some classic 2600 games just require the fire button of the second controller, like Spy Hunter and Stargate. I don't know how widespread footpedals are, but that might be a cool option then.

...

Other than that, I probably have to implement some sequence of joystick input to trigger it :)

 

Slightly (perhaps) better than reaching for a second joystick... is the Select switch... Which, of course, would require making it active for Game Select purposes only when the game is not actually being played.

 

Just 2¢ from the peanut gallery...

Link to comment
Slightly (perhaps) better than reaching for a second joystick... is the Select switch... Which, of course, would require making it active for Game Select purposes only when the game is not actually being played.

 

Just 2¢ from the peanut gallery...

 

What I don't like about using the select switch during a game is that I tend to push the reset button by mistake in the heat of the moment.

Link to comment
What I don't like about using the select switch during a game is that I tend to push the reset button by mistake in the heat of the moment.

 

Solution to that is to make the reset switch only operate if held down for some period of time.

Link to comment
Guest
Add a comment...

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