Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Apple » Apple II » Space 4048 for the Apple II
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Space 4048 for the Apple II [message #320403] Tue, 28 June 2016 18:53 Go to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

Hey everyone, I just wanted to share with you a small preview of a game I've been working on. It's a lo-res, vertically scrolling shooter that will run on any 48k Apple II. Yes, the graphics are extremely blocky and a bit ugly, but I thought it'd be a fun way to learn 6502 assembly on the Apple II.. It's not quite ready for release, but when it's done I'll make it available to anyone interested.

Oh, and if you watch the video, I recommend keeping the size small as it's easier on the eyes. I know this isn't Game of the Year material, so please be kind! :)

https://www.youtube.com/watch?v=wKF_gARfMCc

-Marc
Re: Space 4048 for the Apple II [message #320404 is a reply to message #320403] Tue, 28 June 2016 23:22 Go to previous messageGo to next message
sicklittlemonkey is currently offline  sicklittlemonkey
Messages: 570
Registered: October 2012
Karma: 0
Senior Member
On Wednesday, 29 June 2016 10:54:00 UTC+12, AppleIIGSMarc wrote:
> I know this isn't Game of the Year material, so please be kind! :)

That is fricken awesome!

Great use of lores colours.
Attention to detail worthy of the classics.
Power-ups, sheilds, double-ship action!

Seriously impressed with the effort you put into this.

Cheers,
Nick.
Re: Space 4048 for the Apple II [message #320405 is a reply to message #320404] Tue, 28 June 2016 23:47 Go to previous messageGo to next message
Rob Justice is currently offline  Rob Justice
Messages: 98
Registered: January 2013
Karma: 0
Member
I agree too, that looks very cool. Nice work!!!!

/Rob
Re: Space 4048 for the Apple II [message #320407 is a reply to message #320405] Wed, 29 June 2016 02:25 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

On Tuesday, June 28, 2016 at 8:47:25 PM UTC-7, Rob Justice wrote:
> I agree too, that looks very cool. Nice work!!!!
>
> /Rob

Thanks Nick and Rob! It's been a really fun project to work on...I only wish I had more free time to spend on it. :)
Re: Space 4048 for the Apple II [message #320408 is a reply to message #320403] Wed, 29 June 2016 03:43 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Nicola

On 2016-06-28 22:53:59 +0000, AppleIIGSMarc said:

> Hey everyone, I just wanted to share with you a small preview of a game
> I've been working on. It's a lo-res, vertically scrolling shooter that
> will run on any 48k Apple II. Yes, the graphics are extremely blocky
> and a bit ugly, but I thought it'd be a fun way to learn 6502 assembly
> on the Apple II. It's not quite ready for release, but when it's done
> I'll make it available to anyone interested.
>
> Oh, and if you watch the video, I recommend keeping the size small as
> it's easier on the eyes. I know this isn't Game of the Year material,
> so please be kind! :)
>
> https://www.youtube.com/watch?v=wKF_gARfMCc

Wow, very nice! Planning to release the source code, too?

Nicola


--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Re: Space 4048 for the Apple II [message #320409 is a reply to message #320408] Wed, 29 June 2016 06:26 Go to previous messageGo to next message
Antoine Vignau is currently offline  Antoine Vignau
Messages: 1860
Registered: October 2012
Karma: 0
Senior Member
very very very good. Congratulations!
av
Re: Space 4048 for the Apple II [message #320410 is a reply to message #320403] Wed, 29 June 2016 11:24 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
On Tuesday, June 28, 2016 at 3:54:00 PM UTC-7, AppleIIGSMarc wrote:
> Hey everyone, I just wanted to share with you a small preview of a game I've been working on. It's a lo-res, vertically scrolling shooter that will run on any 48k Apple II.

Looks good !

> Yes, the graphics are extremely blocky and a bit ugly,

So are Minecraft's -- your point? ;-)

Some of us prefer function over form.

> but I thought it'd be a fun way to learn 6502 assembly on the Apple II.

Motivation to learn asm is more important then _how_ you did it. Looks like you succeeded! Not only because you got a game done but you reached your goal.

What were the hard parts about asm?
What do you wish was explained better?
What tools do you wish you had?

> https://www.youtube.com/watch?v=wKF_gARfMCc

Left a comment. :-)
Re: Space 4048 for the Apple II [message #320411 is a reply to message #320410] Wed, 29 June 2016 11:34 Go to previous messageGo to next message
Steve Nickolas is currently offline  Steve Nickolas
Messages: 2036
Registered: October 2012
Karma: 0
Senior Member
On Wed, 29 Jun 2016, Michael 'AppleWin Debugger Dev' wrote:

> On Tuesday, June 28, 2016 at 3:54:00 PM UTC-7, AppleIIGSMarc wrote:
>
>> but I thought it'd be a fun way to learn 6502 assembly on the Apple II.
>
> Motivation to learn asm is more important then _how_ you did it. Looks
> like you succeeded! Not only because you got a game done but you reached
> your goal.

And IMO, there's no better platform on which to learn 6502 assembly than
the Apple ][.

-uso.
Re: Space 4048 for the Apple II [message #320412 is a reply to message #320403] Wed, 29 June 2016 14:46 Go to previous messageGo to next message
Warren Ernst is currently offline  Warren Ernst
Messages: 65
Registered: May 2013
Karma: 0
Member
On Tuesday, June 28, 2016 at 3:54:00 PM UTC-7, AppleIIGSMarc wrote:
> Hey everyone, I just wanted to share with you a small preview of a game I've been working on. It's a lo-res, vertically scrolling shooter that will run on any 48k Apple II. Yes, the graphics are extremely blocky and a bit ugly, but I thought it'd be a fun way to learn 6502 assembly on the Apple II. It's not quite ready for release, but when it's done I'll make it available to anyone interested.
>
> Oh, and if you watch the video, I recommend keeping the size small as it's easier on the eyes. I know this isn't Game of the Year material, so please be kind! :)
>
> https://www.youtube.com/watch?v=wKF_gARfMCc
>
> -Marc

Look amazing and fun! It reminds me of stuff Activision used to make for the Atari 2600, and those were fun games!

Keep at it and let us know when we can play.

-Warr
Re: Space 4048 for the Apple II [message #320413 is a reply to message #320411] Wed, 29 June 2016 15:08 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
On Wednesday, June 29, 2016 at 8:34:14 AM UTC-7, Steve Nickolas wrote:
> And IMO, there's no better platform on which to learn 6502 assembly than
> the Apple ][.

Amen! Especially with the emulators these days -- but then again, I'm biased. :-)

Does anyone know how JACE's debugging / single-step is coming along?

Michael
Re: Space 4048 for the Apple II [message #320416 is a reply to message #320412] Wed, 29 June 2016 15:57 Go to previous messageGo to next message
datawiz is currently offline  datawiz
Messages: 55
Registered: December 2012
Karma: 0
Member
Incrediblely slick game, Marc! I'm very impressed. I was thinking that it reminded me of a classic Activision game as well. I can't wait to play it.

I do have a question. I know you probably did all of the graphics within your source code, but is there an application for the Apple II that allows you to draw lores/double lores screens and save them for use?

dw

On Wednesday, June 29, 2016 at 2:46:36 PM UTC-4, Warren Ernst wrote:
> On Tuesday, June 28, 2016 at 3:54:00 PM UTC-7, AppleIIGSMarc wrote:
>> Hey everyone, I just wanted to share with you a small preview of a game I've been working on. It's a lo-res, vertically scrolling shooter that will run on any 48k Apple II. Yes, the graphics are extremely blocky and a bit ugly, but I thought it'd be a fun way to learn 6502 assembly on the Apple II. It's not quite ready for release, but when it's done I'll make it available to anyone interested.
>>
>> Oh, and if you watch the video, I recommend keeping the size small as it's easier on the eyes. I know this isn't Game of the Year material, so please be kind! :)
>>
>> https://www.youtube.com/watch?v=wKF_gARfMCc
>>
>> -Marc
>
> Look amazing and fun! It reminds me of stuff Activision used to make for the Atari 2600, and those were fun games!
>
> Keep at it and let us know when we can play.
>
> -Warr
Re: Space 4048 for the Apple II [message #320419 is a reply to message #320403] Wed, 29 June 2016 17:55 Go to previous messageGo to next message
Nootrac90 is currently offline  Nootrac90
Messages: 39
Registered: June 2013
Karma: 0
Member
Looks like a fun game. I wanna play!
Re: Space 4048 for the Apple II [message #320420 is a reply to message #320408] Wed, 29 June 2016 18:02 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

On Wednesday, June 29, 2016 at 12:43:05 AM UTC-7, Nicola wrote:
>
> Wow, very nice! Planning to release the source code, too?
>

Yes, I will probably release the code along with the game. I'm always grateful when other developers release their code and I love to look through it as it's both interesting and educational. So, it only seems fair that I do the same. That being said, this was a learning experience for me, so going through my code may cause more harm than good! :)
Re: Space 4048 for the Apple II [message #320422 is a reply to message #320403] Wed, 29 June 2016 20:34 Go to previous messageGo to next message
xorxif is currently offline  xorxif
Messages: 17
Registered: November 2012
Karma: 0
Junior Member
This is very cool. The use of color and animation is very attractive.

When you release the source code, could you also release any notes you
had on your process of learning assembler, and how that learning
translated into parts of the game? Also can you add things like how long
you worked on it, and what limitations you ran into?

Also, are you taking gameplay / design / functionality suggestions?

- xorxif
Re: Space 4048 for the Apple II [message #320424 is a reply to message #320403] Thu, 30 June 2016 00:54 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: awanderin

AppleIIGSMarc <appleiigsmarc@gmail.com> writes:

> Hey everyone, I just wanted to share with you a small preview of a
> game I've been working on. It's a lo-res, vertically scrolling
> shooter that will run on any 48k Apple II. Yes, the graphics are
> extremely blocky and a bit ugly, but I thought it'd be a fun way to
> learn 6502 assembly on the Apple II. It's not quite ready for
> release, but when it's done I'll make it available to anyone
> interested.
>
> Oh, and if you watch the video, I recommend keeping the size small as
> it's easier on the eyes. I know this isn't Game of the Year material,
> so please be kind! :)
>
> https://www.youtube.com/watch?v=wKF_gARfMCc
>
> -Marc

Hey Marc, that looks great! I didn't think a lo-res game could actually
look that good!


--
--
Jerry awanderin at gmail dot com
Re: Space 4048 for the Apple II [message #320428 is a reply to message #320412] Thu, 30 June 2016 09:46 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Ralph Glatt

On Wednesday, June 29, 2016 at 2:46:36 PM UTC-4, Warren Ernst wrote:
> On Tuesday, June 28, 2016 at 3:54:00 PM UTC-7, AppleIIGSMarc wrote:
>> Hey everyone, I just wanted to share with you a small preview of a game I've been working on. It's a lo-res, vertically scrolling shooter that will run on any 48k Apple II. Yes, the graphics are extremely blocky and a bit ugly, but I thought it'd be a fun way to learn 6502 assembly on the Apple II. It's not quite ready for release, but when it's done I'll make it available to anyone interested.
>>
>> Oh, and if you watch the video, I recommend keeping the size small as it's easier on the eyes. I know this isn't Game of the Year material, so please be kind! :)
>>
>> https://www.youtube.com/watch?v=wKF_gARfMCc
>>
>> -Marc
>
> Look amazing and fun! It reminds me of stuff Activision used to make for the Atari 2600, and those were fun games!
>
> Keep at it and let us know when we can play.
>
> -Warr

It reminds me as being something Gamevision (from the show Code Monkeys) would produce. Would AppleWin be able to play it?
Re: Space 4048 for the Apple II [message #320430 is a reply to message #320403] Thu, 30 June 2016 12:29 Go to previous messageGo to next message
Howard Poe is currently offline  Howard Poe
Messages: 58
Registered: January 2013
Karma: 0
Member
On Tuesday, June 28, 2016 at 3:54:00 PM UTC-7, AppleIIGSMarc wrote:
> Hey everyone, I just wanted to share with you a small preview of a game I've been working on. It's a lo-res, vertically scrolling shooter that will run on any 48k Apple II. Yes, the graphics are extremely blocky and a bit ugly, but I thought it'd be a fun way to learn 6502 assembly on the Apple II. It's not quite ready for release, but when it's done I'll make it available to anyone interested.
>
> Oh, and if you watch the video, I recommend keeping the size small as it's easier on the eyes. I know this isn't Game of the Year material, so please be kind! :)
>
> https://www.youtube.com/watch?v=wKF_gARfMCc
>
> -Marc

Have you thought about using the double-low res mode available on the //e, //c and IIgs? That would give you a bit more horizontal resolution to play with...
Re: Space 4048 for the Apple II [message #320432 is a reply to message #320420] Thu, 30 June 2016 14:52 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
On Wednesday, June 29, 2016 at 3:02:50 PM UTC-7, AppleIIGSMarc wrote:
> That being said, this was a learning experience for me, so going through my code may cause more harm than good! :)

The #1 reason developer's don't release their code.

Shame.

It is why I didn't for my "u7shapes" (Ultima 7 sprite viewer) back in the day.

Don't worry -- we ALL wrote crappy code at one time. (Some of us still do! :-)
Re: Space 4048 for the Apple II [message #320603 is a reply to message #320410] Tue, 05 July 2016 15:06 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

On Wednesday, June 29, 2016 at 8:24:23 AM UTC-7, Michael 'AppleWin Debugger Dev' wrote:

> What were the hard parts about asm?
> What do you wish was explained better?

I messed around a little with assembly back when I first had an Apple IIGS, so it wasn't a completely foreign idea to me. I was able to understand the basic concepts pretty easily, but I never made anything even close to a full game and the 65816 can be much easier to work with than the 6502 as it has 16-bit registers, a much larger stack, and access to significantly more memory. This project was to see how hard it is to make a full game when dealing with the limitations of the 8-bit 6502.

Off the top of my head, some of the things that a little unclear to me were:
-How do you work with large numbers when you are limited to registers that can only store numbers up to 255? Especially for world coordinates of objects and indexing into large tables of game data.
-What is the best way to pass a large number of parameters into a function? For a small number of parameters, you can use the x and y registers and the accumulator, but what if you need to pass more than that?
-What is the best way to return multiple values from a function?
-How do you handle simultaneous keypresses on the Apple II and II+? (from what I can tell, you can't really)


> What tools do you wish you had?

I used AppleWin for all of the development of this game and worked really well. Having a debugger came in quite useful as did the ability to crank up the emulation speed (especially before I started using a cross assembler). But the one mistake I made was not running on actual Apple hardware sooner. AppleWin, while great, doesn't do a very good job emulating the lo-res screen. When I finally saw what the game looked like on real hardware, I was very disappointed. Color fringing between adjacent pixels was much worse, different colors seem to be offset slightly horizontally, and the color palette wasn't very accurate (AppleWin shows two distinct shades of gray, but on the real hardware they're difficult to distinguish). I had to make many changes to the art because of this and will probably do another pass before it's finished.

Two features that would be nice to have are:
-quick save and quick load for game states, so it's not necessary to go through the save file and open file dialog boxes.
-the ability to remap emulation speed uncapping to a different key. My laptop doesn't have a scroll lock key and the virtual keyboard doesn't seem to work.
Re: Space 4048 for the Apple II [message #320604 is a reply to message #320416] Tue, 05 July 2016 15:26 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

> I do have a question. I know you probably did all of the graphics within your source code, but is there an application for the Apple II that allows you to draw lores/double lores screens and save them for use?
>

Yes, as you guessed, the sprite data for the game is all inside the code. Since this was a relatively simple game, I didn't want to mess around with loading files just yet.

Unfortunately, I don't really know of any good programs that do exactly what you asked. For this game, I did write a VERY simple paint program in BASIC that let's me draw to the lo-res screen. It's pretty terrible, but it did let me test out different designs and see what they would look like in the emulator or on the real hardware without having to worry about aspect ratios or setting color palettes in a Windows paint program. Unfortunately, I then had to hand convert the sprites into the hex data. Eventually, I did give the program the ability to dump out the full lo-res screen into hex data so I could bake the title screen into my game.

At some point, I will probably write a real tool to export hex data for images drawn in the different modes (if it hasn't already been done)
Re: Space 4048 for the Apple II [message #320605 is a reply to message #320430] Tue, 05 July 2016 15:36 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

On Thursday, June 30, 2016 at 9:29:36 AM UTC-7, Howard Poe wrote:
>
> Have you thought about using the double-low res mode available on the //e, //c and IIgs? That would give you a bit more horizontal resolution to play with...

For this game, I wanted to start with the "worst" mode available to see how far I could push it. I've definitely considered rewriting the game for double lo-res and I've even spent some time redrawing the art and mocking up the screen to see what it could look like. The extra horizontal pixels actually do help quite a bit! Unfortunately, rendering a page-flipped double lo-res screen is much more complicated than rendering to the standard lo-res screen, so I don't have a working proto just yet. But it should be doable and I will definitely give it a shot!
Re: Space 4048 for the Apple II [message #320606 is a reply to message #320422] Tue, 05 July 2016 15:46 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

On Wednesday, June 29, 2016 at 5:34:23 PM UTC-7, xorxif wrote:
> This is very cool. The use of color and animation is very attractive.
>
> When you release the source code, could you also release any notes you
> had on your process of learning assembler, and how that learning
> translated into parts of the game? Also can you add things like how long
> you worked on it, and what limitations you ran into?
>
> Also, are you taking gameplay / design / functionality suggestions?
>
> - xorxif

Thanks! Yes, I will try to document the code as much as possible for anyone who happens to go through it (myself included...there have been times I've looked at old code I wrote and I wondered what the heck I was thinking!)

And sure, if you have any suggestions, please feel free to mention them! There are many aspects of the design that aren't locked down yet, so it'd be interesting to see what other people think. And even if I don't use your ideas in this game, I may use them for a later game (or the eventual double lo-res port!)
Re: Space 4048 for the Apple II [message #320607 is a reply to message #320603] Tue, 05 July 2016 15:58 Go to previous messageGo to next message
Steve Nickolas is currently offline  Steve Nickolas
Messages: 2036
Registered: October 2012
Karma: 0
Senior Member
On Tue, 5 Jul 2016, AppleIIGSMarc wrote:

> -How do you work with large numbers when you are limited to registers
> that can only store numbers up to 255? Especially for world coordinates
> of objects and indexing into large tables of game data.

Use a pair of ZP addresses, probably.

> -the ability to remap emulation speed uncapping to a different key. My
> laptop doesn't have a scroll lock key and the virtual keyboard doesn't
> seem to work.

This would be useful to me on my netbook, since on Linux ScrLk isn't
treated the same as on Windows, and sometimes it doesn't register
properly, locking the speed wrong (since sometimes I want turbo, and
sometimes I absolutely have to run the game I all too often play on it at
1 MHz...)

-uso.
Re: Space 4048 for the Apple II [message #320608 is a reply to message #320603] Tue, 05 July 2016 16:03 Go to previous messageGo to next message
gids.rs is currently offline  gids.rs
Messages: 1395
Registered: October 2012
Karma: 0
Senior Member
> -How do you handle simultaneous keypresses on the Apple II and II+? (from what I can tell, you can't really)


Sure you can.

If you are talking about key combinations with Ctrl-OA-Option-letter, I can send you a pretty nifty little routine that covers every possible combination.
Re: Space 4048 for the Apple II [message #320609 is a reply to message #320608] Tue, 05 July 2016 16:12 Go to previous messageGo to next message
gids.rs is currently offline  gids.rs
Messages: 1395
Registered: October 2012
Karma: 0
Senior Member
>> -How do you handle simultaneous keypresses on the Apple II and II+? (from what I can tell, you can't really)
>
>
> Sure you can.
>
> If you are talking about key combinations with Ctrl-OA-Option-letter, I can send you a pretty nifty little routine that covers every possible combination.

if you are talking about two letters try this

]LOOP BIT $C000
BPL ]LOOP
LDX $C010
]LOOP2 BIT $C000
BPL ]LOOP2
LDA $C010
STA $7
STX $6
RTS


I tried this routine in Applewin both keys pressed showed up in $6.7.
Re: Space 4048 for the Apple II [message #320610 is a reply to message #320609] Tue, 05 July 2016 17:58 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

On Tuesday, July 5, 2016 at 1:12:06 PM UTC-7, gid...@sasktel.net wrote:
>>> -How do you handle simultaneous keypresses on the Apple II and II+? (from what I can tell, you can't really)
>>
>>
>> Sure you can.
>>
>> If you are talking about key combinations with Ctrl-OA-Option-letter, I can send you a pretty nifty little routine that covers every possible combination.
>
> if you are talking about two letters try this
>
> ]LOOP BIT $C000
> BPL ]LOOP
> LDX $C010
> ]LOOP2 BIT $C000
> BPL ]LOOP2
> LDA $C010
> STA $7
> STX $6
> RTS
>
>
> I tried this routine in Applewin both keys pressed showed up in $6.7.

Well, the specific problem I was having is that I want the player to be able to move the ship by pressing and holding the arrow keys while shooting with another. But as soon the shoot key is pressed, I have no way of knowing if the movement keys are still being held. That's because $C000 only stores data on the most recently pressed key. If the player presses and holds a key to move left, and then presses another key to shoot the gun, $C000 will only contain information relevant to the key used to shoot. At that point, I can't tell if the movement key is still being pressed...at least as far as I know. :)

Because of this, I had to add joystick support to the game. The controls just felt really awkward with the keyboard (but it's still supported in case of an emergency!)

If I'm wrong about this and someone can show me how I can monitor the state of individual keys so they can be pressed and released independently of each other, that'd be awesome. I'd love to put true keyboard support into the game!
Re: Space 4048 for the Apple II [message #320611 is a reply to message #320610] Tue, 05 July 2016 19:58 Go to previous messageGo to next message
Michael J. Mahon is currently offline  Michael J. Mahon
Messages: 1767
Registered: October 2012
Karma: 0
Senior Member
AppleIIGSMarc <appleiigsmarc@gmail.com> wrote:
> On Tuesday, July 5, 2016 at 1:12:06 PM UTC-7, gid...@sasktel.net wrote:
>>>> -How do you handle simultaneous keypresses on the Apple II and II+?
>>>> (from what I can tell, you can't really)
>>>
>>>
>>> Sure you can.
>>>
>>> If you are talking about key combinations with Ctrl-OA-Option-letter, I
>>> can send you a pretty nifty little routine that covers every possible combination.
>>
>> if you are talking about two letters try this
>>
>> ]LOOP BIT $C000
>> BPL ]LOOP
>> LDX $C010
>> ]LOOP2 BIT $C000
>> BPL ]LOOP2
>> LDA $C010
>> STA $7
>> STX $6
>> RTS
>>
>>
>> I tried this routine in Applewin both keys pressed showed up in $6.7.
>
> Well, the specific problem I was having is that I want the player to be
> able to move the ship by pressing and holding the arrow keys while
> shooting with another. But as soon the shoot key is pressed, I have no
> way of knowing if the movement keys are still being held. That's because
> $C000 only stores data on the most recently pressed key. If the player
> presses and holds a key to move left, and then presses another key to
> shoot the gun, $C000 will only contain information relevant to the key
> used to shoot. At that point, I can't tell if the movement key is still
> being pressed...at least as far as I know. :)
>
> Because of this, I had to add joystick support to the game. The controls
> just felt really awkward with the keyboard (but it's still supported in
> case of an emergency!)
>
> If I'm wrong about this and someone can show me how I can monitor the
> state of individual keys so they can be pressed and released
> independently of each other, that'd be awesome. I'd love to put true
> keyboard support into the game!
>
>

You are correct, there is no such thing as "two non-modifier keys being
pressed simultaneously". The keyboard encoder will resolve the (to human
perception) two simultaneous key presses into two sequential key presses
(as demonstrated by the code above). This is what "n-key rollover" means
when applied to a keyboard/encoder. Of course, modifier keys are completely
different.

Your particular problem is addressed to some degree by the //e and IIc.
They support "Any Key Down" sensing, which allows an approximation of your
desired behavior.

Instead of reading $C000, read $C010. If the high bit is set, some key is
(still) pressed. The low 7 bits are the ASCII code for the most recently
pressed key.

If all keys are up and a key is pressed--say an arrow key--it will
immediately register while polling $C010. If, while the original key is
held down, a new key is pressed, the high bit remains set, but the ASCII
code changes to the new key. When the new key is released, the code will
not change, so as long as either the first key or the second key is held
down, the code for the latest key press will remain. When all keys are up,
the high bit will go to zero.

Since it is not possible to tell whether the first ("move") key or the
second ("fire") key is being held down, you'd have to make an assumption.
Also, while the move key continues to be held down, presses of the fire key
after the first will not change the code, and so cannot be sensed.

This behavior may seem difficult to use, but it actually permits some novel
keyboard uses. For example, my music synthesizer, RT.SYNTH, detects
keyboard activity by polling $C010 and observing any change in the code.
This permits "playing" the keyboard like a piano keyboard, on which the
next key is often pressed before the prior key is released, allowing for
"glissando" runs of keys not separated by a "key up".

While the AKD method of keyboard sensing may not solve all of your problem,
it does permit some additional flexibility in controls.
--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
Re: Space 4048 for the Apple II [message #320613 is a reply to message #320610] Tue, 05 July 2016 23:49 Go to previous messageGo to next message
gids.rs is currently offline  gids.rs
Messages: 1395
Registered: October 2012
Karma: 0
Senior Member
On Tuesday, July 5, 2016 at 3:58:12 PM UTC-6, AppleIIGSMarc wrote:
> On Tuesday, July 5, 2016 at 1:12:06 PM UTC-7, gid...@sasktel.net wrote:
>>>> -How do you handle simultaneous keypresses on the Apple II and II+? (from what I can tell, you can't really)
>>>
>>>
>>> Sure you can.
>>>
>>> If you are talking about key combinations with Ctrl-OA-Option-letter, I can send you a pretty nifty little routine that covers every possible combination.
>>
>> if you are talking about two letters try this
>>
>> ]LOOP BIT $C000
>> BPL ]LOOP
>> LDX $C010
>> ]LOOP2 BIT $C000
>> BPL ]LOOP2
>> LDA $C010
>> STA $7
>> STX $6
>> RTS
>>
>>
>> I tried this routine in Applewin both keys pressed showed up in $6.7.
>
> Well, the specific problem I was having is that I want the player to be able to move the ship by pressing and holding the arrow keys while shooting with another. But as soon the shoot key is pressed, I have no way of knowing if the movement keys are still being held. That's because $C000 only stores data on the most recently pressed key. If the player presses and holds a key to move left, and then presses another key to shoot the gun, $C000 will only contain information relevant to the key used to shoot. At that point, I can't tell if the movement key is still being pressed...at least as far as I know. :)
>
> Because of this, I had to add joystick support to the game. The controls just felt really awkward with the keyboard (but it's still supported in case of an emergency!)
>
> If I'm wrong about this and someone can show me how I can monitor the state of individual keys so they can be pressed and released independently of each other, that'd be awesome. I'd love to put true keyboard support into the game!


I think most games get around this by using the left or right arrow key to start the direction of travel, then using the down-arrow or space bar to stop movement.

Some games use a double press of the other directional key. i.e. if going right, then the first press of the left arrow pauses the ship, and the second press makes the ship go left.

One of my favorite games, Alien Typhoon has really good keyboard control.


I am not even sure the IIGS would handle what you are suggesting. when holding down an arrow key, the keyboard modifier key at $C025 would register that key is repeating, but would reset once a fire button key is pressed and released, so the repeating arrow would no longer be sensed.

Another alternative might be to program the game to respond to the arrow keys being held down and use the Open-Apple and/or Option keys to fire. On a II+ or IIe without these keys, one can use the joystick fire button. Since the OA and Option keys are read separately from the arrow keys, the arrow key being held down will not be interfered with.
Re: Space 4048 for the Apple II [message #320620 is a reply to message #320603] Wed, 06 July 2016 20:24 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
On Tuesday, July 5, 2016 at 12:06:49 PM UTC-7, AppleIIGSMarc wrote:
> On Wednesday, June 29, 2016 at 8:24:23 AM UTC-7, Michael 'AppleWin Debugger Dev' wrote:
>
>> What were the hard parts about asm?
>> What do you wish was explained better?

> -How do you work with large numbers when you are limited to registers that can only store numbers up to 255? Especially for world coordinates of objects and indexing into large tables of game data.
> -What is the best way to pass a large number of parameters into a function? For a small number of parameters, you can use the x and y registers and the accumulator, but what if you need to pass more than that?
> -What is the best way to return multiple values from a function?

Thanks for this feedback! This is great stuff to see concepts that others are struggling with. At some point I'll collate all these notes to an 6502 asm guide. :-)

> AppleWin, while great, doesn't do a very good job emulating the lo-res screen.

Yup, AppleWin's (current) color palette is total crap -- that's the technical term for "doesn't have 100% correct emulation." :-) We've integrated Sheldon's video rewrite which will make it into the next version that fixes most, but not all, of the color problems.

There are 2 main work-arounds in the mean-time:

* Use an Alpha version 1.26+. Sheldon's original NTSC version doesn't have the debugger which is why I was hosting an alpha version -- so people could preview it with a working debugger.
http://michael.peopleofhonoronly.com/dev/applewin/nightlybui ld/ntsc/ApplewinNTSC_v17BmpPalette.exe

That reminds me, I need to get another alpha version out the door ...

What I like about the alpha is that one can tweak the color palette to your hearts contents! For specific color palette tweaking see:
http://michael.peopleofhonoronly.com/dev/applewin/nightlybui ld/ntsc_palette/

* Use another emulator such as Jace.

Jace currently has the best color accuracy around. If Java didn't bilinear blur the shit out of everything I would probably be very, very happy with it.

I have a build script that compiles a .s assembly source file, throws it onto a DSK image, and boots Jace with that DSK. Makes for *extremely* quick turn around time. :-)

I need to post my DSK utilities soonish ...
Re: Space 4048 for the Apple II [message #320621 is a reply to message #320611] Wed, 06 July 2016 20:27 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
On Tuesday, July 5, 2016 at 4:58:53 PM UTC-7, Michael J. Mahon wrote:
> You are correct, there is no such thing as "two non-modifier keys being
> pressed simultaneously".

Slightly OT: There is a bug in AppleWin's keyboard handling that doesn't happen on real hardware.

Thanks to Michael's test case I've created issue #330.
https://github.com/AppleWin/AppleWin/issues/330
Re: Space 4048 for the Apple II [message #320640 is a reply to message #320403] Fri, 08 July 2016 11:56 Go to previous messageGo to next message
David Schmidt is currently offline  David Schmidt
Messages: 993
Registered: October 2012
Karma: 0
Senior Member
On 6/28/2016 6:53 PM, AppleIIGSMarc wrote:
> https://www.youtube.com/watch?v=wKF_gARfMCc

I was thinking about the Z-order of the starfield vs. the planetoid on
the playfield. It seems like the stars would be more distant, so they
should pass behind the planet. But then again, they move pretty fast,
so maybe they should be passing between our eye and the planet. Tough call!

I can't wait to see the code! Graphics might as well be magic to me, so
I'm hoping I can get my head wrapped around your lo-res example.
Re: Space 4048 for the Apple II [message #320647 is a reply to message #320640] Fri, 08 July 2016 15:06 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: AppleIIGSMarc

On Friday, July 8, 2016 at 8:56:31 AM UTC-7, schmidtd wrote:
> On 6/28/2016 6:53 PM, AppleIIGSMarc wrote:
>> https://www.youtube.com/watch?v=wKF_gARfMCc
>
> I was thinking about the Z-order of the starfield vs. the planetoid on
> the playfield. It seems like the stars would be more distant, so they
> should pass behind the planet. But then again, they move pretty fast,
> so maybe they should be passing between our eye and the planet. Tough call!
>
> I can't wait to see the code! Graphics might as well be magic to me, so
> I'm hoping I can get my head wrapped around your lo-res example.


On Friday, July 8, 2016 at 8:56:31 AM UTC-7, schmidtd wrote:
> On 6/28/2016 6:53 PM, AppleIIGSMarc wrote:
>> https://www.youtube.com/watch?v=wKF_gARfMCc
>
> I was thinking about the Z-order of the starfield vs. the planetoid on
> the playfield. It seems like the stars would be more distant, so they
> should pass behind the planet. But then again, they move pretty fast,
> so maybe they should be passing between our eye and the planet. Tough call!
>
> I can't wait to see the code! Graphics might as well be magic to me, so
> I'm hoping I can get my head wrapped around your lo-res example.

Yeah, you're right it doesn't make much sense if you think about it, but I really wanted to have parallax scrolling "stars" to liven up the screen. With a stationary planet in the background as well as the moving "stars", there isn't really any way of doing it that makes much sense. I tried rendering the scene both ways, and eventually decided that I would leave the "stars" in front. I figured that if anyone was really bothered by it, we could just call it space dust, distant asteroids, or space debris. :)

Then again, maybe I'll try it again with the stars behind the planet again..... :)
Re: Space 4048 for the Apple II [message #320651 is a reply to message #320647] Fri, 08 July 2016 20:49 Go to previous messageGo to next message
datawiz is currently offline  datawiz
Messages: 55
Registered: December 2012
Karma: 0
Member
On Friday, July 8, 2016 at 3:06:21 PM UTC-4, AppleIIGSMarc wrote:
> On Friday, July 8, 2016 at 8:56:31 AM UTC-7, schmidtd wrote:
>> On 6/28/2016 6:53 PM, AppleIIGSMarc wrote:
>>> https://www.youtube.com/watch?v=wKF_gARfMCc
>>
>> I was thinking about the Z-order of the starfield vs. the planetoid on
>> the playfield. It seems like the stars would be more distant, so they
>> should pass behind the planet. But then again, they move pretty fast,
>> so maybe they should be passing between our eye and the planet. Tough call!
>>
>> I can't wait to see the code! Graphics might as well be magic to me, so
>> I'm hoping I can get my head wrapped around your lo-res example.
>
>
> On Friday, July 8, 2016 at 8:56:31 AM UTC-7, schmidtd wrote:
>> On 6/28/2016 6:53 PM, AppleIIGSMarc wrote:
>>> https://www.youtube.com/watch?v=wKF_gARfMCc
>>
>> I was thinking about the Z-order of the starfield vs. the planetoid on
>> the playfield. It seems like the stars would be more distant, so they
>> should pass behind the planet. But then again, they move pretty fast,
>> so maybe they should be passing between our eye and the planet. Tough call!
>>
>> I can't wait to see the code! Graphics might as well be magic to me, so
>> I'm hoping I can get my head wrapped around your lo-res example.
>
> Yeah, you're right it doesn't make much sense if you think about it, but I really wanted to have parallax scrolling "stars" to liven up the screen. With a stationary planet in the background as well as the moving "stars", there isn't really any way of doing it that makes much sense. I tried rendering the scene both ways, and eventually decided that I would leave the "stars" in front. I figured that if anyone was really bothered by it, we could just call it space dust, distant asteroids, or space debris. :)
>
> Then again, maybe I'll try it again with the stars behind the planet again.... :)

You have stars that travel at different speeds, what would it look like if you had the slower stars go behind the planet and the faster ones in front of it? Maybe it would enhance the parallax scrolling effect?
Re: Space 4048 for the Apple II [message #320659 is a reply to message #320403] Sat, 09 July 2016 06:23 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Tom Porter

I hate to 'help' a competitor with something that looks this amazing... as far as the colors in AppleWIN I've noticed that V.1.25.0.3 has a different lo-res color display than V.1.20.0 (The 20.0 has exactly the same as original hardware, I'm not sure what changed on the last version?!?) I'm gulping at how expert your visuals look!
Re: Space 4048 for the Apple II [message #320661 is a reply to message #320659] Sat, 09 July 2016 08:17 Go to previous messageGo to next message
Michael AppleWin Debu is currently offline  Michael AppleWin Debu
Messages: 1262
Registered: March 2013
Karma: 0
Senior Member
On Saturday, July 9, 2016 at 3:23:47 AM UTC-7, Tom Porter wrote:
> I hate to 'help' a competitor with something that looks this amazing... as far as the colors in AppleWIN I've noticed that V.1.25.0.3 has a different lo-res color display than V.1.20.0 (The 20.0 has exactly the same as original hardware, I'm not sure what changed on the last version?!?) I'm gulping at how expert your visuals look!

This probably belongs in comp.emulators.apple2 but Bug #253 specifically discusses AppleWin's crappy GR color palette:
https://github.com/AppleWin/AppleWin/issues/253
Re: Space 4048 for the Apple II [message #354376 is a reply to message #320403] Fri, 13 October 2017 21:36 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: Tom Porter

What ever happened to this project?
Re: Space 4048 for the Apple II [message #354645 is a reply to message #354376] Tue, 17 October 2017 20:21 Go to previous message
anthonypaulo is currently offline  anthonypaulo
Messages: 531
Registered: September 2013
Karma: 0
Senior Member
Yeah what happened to Mark?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Ultimate Apple III ///
Next Topic: Crash-course in MDBasic programming?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Apr 19 05:46:11 EDT 2024

Total time taken to generate the page: 0.07295 seconds