My First Apple I Program (15 Puzzle)

11 posts / 0 new
Last post
Offline
Last seen: 1 week 3 days ago
Joined: Feb 18 2020 - 16:59
Posts: 11
My First Apple I Program (15 Puzzle)

Hi folks,

 

I've finished my first attempt at an Apple I assembly language program (apart from "Hello, World!" of course), but I've only ever run it in an emulator. I developed it using Will Scullin's awesome Apple 1js and it works fine there. I dug up some old Java version of Pom1 which loaded it fine but won't run it. Not sure if the fault is mine or the emulator.

 

Anyway, here's the github page for it: https://github.com/JeffJetton/apple1-15-puzzle

 

And a direct link to the Monitor-pasteable text: https://github.com/JeffJetton/apple1-15-puzzle/blob/master/puzz15.txt

 

If anyone has the gumption to run it on actual hardware, that would be awesome. Let me know how it goes!

 

Thanks,

 

 - Jeff

 

 

P.S. Should I have posted this in the "Development & Software Hacks" section instead? Let me know if I need to move it.

Offline
Last seen: 3 weeks 1 day ago
Joined: Sep 21 2017 - 11:10
Posts: 12
Re: My First Apple I Program (15 Puzzle)

Hi Jeff,

 

Nice game.  It must be a problem with the emulator because it works on my hardware.

 

 

Thanks!

Kevin

Offline
Last seen: 1 week 1 day ago
Joined: Feb 27 2020 - 16:06
Posts: 11
Have you tried it on the

Have you tried it on the latest version of POM1? 
 

http://pom1.sourceforge.net/

Offline
Last seen: 1 week 1 day ago
Joined: Feb 27 2020 - 16:06
Posts: 11
I gave it  a tru... it does

I gave it  a try... it does work under the current POM1 emulator.

 

Nice job!  :)

 

 

 

Offline
Last seen: 1 week 3 days ago
Joined: Feb 18 2020 - 16:59
Posts: 11
Thanks

PROMetheus wrote:

Nice game.  It must be a problem with the emulator because it works on my hardware.

 

Thanks, Kevin! And a Level 5 win too... nice. :-)

Offline
Last seen: 1 week 3 days ago
Joined: Feb 18 2020 - 16:59
Posts: 11
TomXP411 wrote:
TomXP411 wrote:

I gave it  a try... it does work under the current POM1 emulator.

 

Nice job!  :)

 

Thanks, Tom! Yeah, I tried to compile the latest version of POM1 (since I'm on a Mac) but ran into some snags with an SDL library or something. Probably need to dive back into that and figure out what's going on. Wouldn't hurt to have two different emus to test things on.

Offline
Last seen: 1 week 1 day ago
Joined: Feb 27 2020 - 16:06
Posts: 11
Yeah, that's always a

Yeah, that's always a challenge with source distros. 

 

FYI, I also tried your game on the MiSTer Apple I core, and it works there, as well. The only problem I have with the game is that when you try to enter an invalid move, the game sometimes locks up. I'm not sure, but I think it's when I enter an invalid character, like the space bar. I'll play with that a bit more and try to track down the specific failure. 

 

You might also want to re-print the game board on an invalid move - I can see a situation where making a mistake or a stuck key will scroll the game board off the screen, then the user can't figure out what he's supposed to be doing. So it would look like


ABCD
EGFH
IJKL
MNO

YOUR MOVE: K

INVALID MOVE

ABCD
EGFH
IJKL
MNO

YOUR MOVE: @

Offline
Last seen: 1 week 3 days ago
Joined: Feb 18 2020 - 16:59
Posts: 11
Thanks for the play testing

Yeah, I bet it's the space bar and I bet I know why.

 

(It's a potential bug that I knew couldn't happen in the early versions of the game, due to the way I was handling keyboard input. But then I changed the input routine to accomodate choosing difficulty levels, and, well...)

 

 

I really tried to print as little as possible to the Apple 1 screen, since it's so slow. That's why I didn't want to redisplay the board needlessly on an error. But I see your point. Hmmm... what if I had it keep track of consecutive errors and only reprint the board after , say, every eight or so of them?

 

 

Offline
Last seen: 1 week 1 day ago
Joined: Feb 27 2020 - 16:06
Posts: 11
Hmm... redrawing the board

Hmm... redrawing the board after a few failed attempts is not a bad idea. You might also redraw the board on null input (when the person just presses RETURN without entering anything.)

 

Offline
Last seen: 1 week 3 days ago
Joined: Feb 18 2020 - 16:59
Posts: 11
New version just uploaded to

New version just uploaded to GitHub (same link as in first post).

 

gigatronTTL's picture
Offline
Last seen: 3 days 12 hours ago
Joined: Feb 8 2020 - 14:06
Posts: 2
Runs well on TTL

Thanks Jeff. To make this run best under Apple-1 emulation on my TTL computer, I just needed to replace the BCD counter update and adjust the line breaks a bit. Both are limitations of the emulator of course. It was very easy to do and it is a joy to read the source code.

 

For its simplicity the game is surpisingly fun to play. Very well done.

 

 

 

 

 

 

 

Log in or register to post comments