Hangman for the Commander X16

Made something in Assembly? Show it off, and tell us how it works...
Absolute beginners welcome... we want to see what you've done!
Forum rules
There is a special rule on this forum...
This forum is intended to offer equal amounts encouragement and constructive feedback...
Therefore, if you say 2 negative things about someones work, you must think of 2 or more equally positive things...

Eg: "Great first effort, the idea is absolutely fascinating... However I noticed a few bugs, and maybe the graphics could be improved..."

If you can't think of anything good to say, then don't say anything!

If we don't encourage newbie programmers they won't have the confidence and motivation to stick at it and become great programmers! *speaking from experience*
Post Reply
Voyager_sput
Posts: 15
Joined: Tue Jan 07, 2020 11:45 am

Hangman for the Commander X16

Post by Voyager_sput » Wed Jan 08, 2020 8:16 pm

Hello everyone!

I thought it would be a fun project to learn 6502 assembly by taking a BASIC program from an old computer book and rewrite the BASIC code line by line in assembler. I'm amazing how much BASIC does for you, even the simplest of functions require some creative thinking to get working in assembler.

I'm not the most creative of people, but it was a great way for me to learn about 8-bit and 16-bit logic. From how to print lines of text on screen, capture user input or how to deal with line and character control (and quirks of the Commander X16 emulator). Trying to add a few small features like a blinking cursor was good fun!

Hangman may not be the most interesting game to play, but i'm curious to hear what you all think about this little project. I've included the files you need to assemble and run it yourself (or just run the binary in the Emulator).

The source code is in the Sources folder, there's a modified version of Keiths BasicFunctions.asm file in the SrcAll file you'll need to assemble the game, since i'm using Keiths PrintChar function, but modified it for some more character and line control. I've also included the Font bitmap in the ResAll folder if you don't have Keiths DevTools. There's also a build binary in the BldX16 folder. You can run the binary in the Commander X16 Emulator r35 or r36 (haven't tried any older versions).

Looking forward to read your tips and advice to improve my understanding of assembler!

Cheers, Marc
Attachments
Hangman-X16.7z
(36.23 KiB) Downloaded 384 times

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Hangman for the Commander X16

Post by akuyou » Thu Jan 09, 2020 11:04 pm

I had a quick go at this yesterday, It's fantastic, though it seems my wordiness* is a bit lacking these days, as I didn't do very well!

It's a very impressive project to take on as your first effort as I imagine it must have been pretty complex in places, and it seems to work superbly - I need to have more of a go at it later when I get time.

What do you plan for it next... is this done, or are you planning to add graphical or gameplay changes?

Keep up the good work,

Keith

* https://www.reddit.com/r/TheSimpsons/co ... wordiness/
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Voyager_sput
Posts: 15
Joined: Tue Jan 07, 2020 11:45 am

Re: Hangman for the Commander X16

Post by Voyager_sput » Fri Jan 10, 2020 2:05 pm

Hi Keith,

I considered this project to be 'done'. I could change the ASCII art for the hangman around for some sprites. But I have a different project in mind to make better use of the sprites then a static picture of a person handing by a rope... ;)

This was more of a project to bridge the gap for me between a 'higher' level programming language like BASIC and Assembler. I feel like I learned a great deal on how to code for a 6502 CPU.

If you poke the game hard enough, i'm sure a bug or two would pop up. I know of one issue where it might not like it if the letter you guess consists of more then one letter :shock: ...

I also feel like the code could be cleaner or more optimized. But i'm honestly not sure how, or where to do that. Still lots to learn :)

Post Reply

Return to “Show and Tell”