Crap 0.1 first assembly project

Show us what you're working on, (preferably with screenshots).
User avatar
Kweepa
Manic Miner
Posts: 311
Joined: Sat Feb 03, 2018 6:14 pm
Location: Albuquerque, New Mexico

Re: Crap 0.1 first assembly project

Post by Kweepa »

One liner for the coin toss program:
1 DIM a$(2,5): LET a$(2)="inf": LET heads=0: LET tails=0: FOR i=1 TO 2 STEP 0: LET coin=INT (RND*2): LET heads=heads+(coin=0): LET tails=tails+(coin=1): LET a$(1)=STR$ (heads/((tails=0)+tails)): PRINT heads;"/";tails;"=";a$(1+(tails=0)): NEXT i
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Big thank you to Kweepa - tip of the hat to you sir.

Image
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

More Basic sillyness.

Due to a splitting headache I haven't been able to get much work done. Still was enough juice in the tank to mess around with some basic in the downtime.

Code: Select all

   1 DIM C$(10,50): LET C$(1)="HELP ME. I CAN'T GET OUT. YOU HAVE TO HELP": LET 
C$(2)="THE DOOR IS LOCKED. TELL MY FAMILY I LOVE THEM.": LET C$(3)="IT'S SO DARK
 I HAVE NOT EATEN FOR DAYS.": LET C$(4)="I BEEN DRINKING URINE FROM MY SHOE": LE
T C$(5)="YOU CAN'T TAKE HER FROM ME NOW. SHE IS REBORN."
   2 PRINT "PHONE CALL": PRINT AT 18,10;"PRESS ANY KEY": INPUT A$
   5 RANDOMIZE 
   6 LET PP=100: LET K=7: LET P=2: LET B=2: LET C=1
   8 FOR J=1 TO 4 : GO SUB 700: BEEP 0.3,2: BEEP 0.1,2: BEEP 0.3,2: CLS : NEXT J
  10 PRINT C$(C): PAUSE PP
  15 LET R=INT (RND*2): IF R<>1 THEN PRINT "HE IS HERE, IT ENDS.": IF R = 1 THEN
 PRINT "THE LINE IS SILENT."
  20 IF R=0 THEN PAUSE PP: CLS 
  30 IF R=0 THEN GO TO 10
  40 IF R=1 THEN GO SUB 500
  50 IF C=5 THEN GO TO 1000
 500 GO SUB 600: IF R=1 THEN PAUSE PP: CLS : PRINT "*SCREAMS FILL THE LINE*": PA
USE PP: PRINT "*GURGLES*": PAUSE PP: PRINT "*BONES SNAPPING*" : PAUSE PP: LET K=
0: LET P=7: LET B=7: LET C=5: GO SUB 600: RETURN 
 600 BORDER B: PAPER P: INK K: CLS : RETURN 
 700 FLASH 1: PRINT AT 10,5;"THE PHONE RINGS": FLASH 0: PAUSE 1 : RETURN 
1000 CLS : PRINT C$(5): PAUSE PP: CLS : PRINT "FORGET THIS - IT'S BETTER THAT WA
Y. THIS WAS NOT FOR YOU *CLICK*"
1010 STOP 
Essentially I wanted to use the same part of the program to print different strings based upon the value of C. It's not particularly successful and you can see its missing now the part where the phone rings. :lol:

The idea is you have two random numbers generated, one if if the captor is present in the room with the victim. the second is the dialog that the victim can tell you on the phone. - as you can see the second random value is not there yet.. But ya'all can see how it works.

Even very simple structure can lead to interesting game potential for dialog. Really this is very simple. But for something like text adventure its nice way to spice up the room descriptions.

A lot of text adventures have the npcs as static things - they don't move around - me I was a big fan of the Hobbit. Where guys like Gandalf could wonder willy nilly across the land. I figure that is good for these games. I always wanted the room descriptions to be different based upon random events. Eventually I suppose I could expand the locations to enhance the messages.)

I'll put this down to my migrane .. that and my being a potato. :lol:
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Crap 0.1 first assembly project

Post by Seven.FFF »

Get well soon! I've hardly done any coding for about two weeks, my brain feels like the inside of an overcooked baked potato.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Yup migraines suck. Lucky for me my head was not too pickled :lol: (just my grammar)

Project time was today reviewing Crap games comp, and reading the rather awesome "Cracking the code on the ZX Spectrum".

I'll put it in the book thread but I might as well record it here also for those who would otherwise miss it.

The above book is in my humble opinion the best practical guide to assembly programming on the ZX Spectrum. The author managed to give someone all the tools they would need to start programming, the explanations to why they were doing it, suggestions for other approaches that the reader to think about and research on their own. But its not just simple stuff - the guy covers a lot - but its not a scatter gun approach its all targeted to creating a program.

I can't say enough good things about this book. Even with the archaic hex monitor - its just one chapter out of the book, and it does not affect the rest of the listings. it's not like other books where its crippled by over-reliance on some esoteric custom assembler or its all in hex (yes there are books like that :lol: ).

Gentle reader you might ask yourself (why did all these books spend chapters on hex monitors and stuff nobody ever read (like octal chapters/sections in programming books.. I defy anyone to say they have used octal in anger in a programming project - not you mr Radar becon man! sit down.)
Spoiler
Image
It was a simpler time..

Anyway moving on. Way to much fun with the crap game comp :lol: Where is the time going? Ok I am easy to please I guess but these little games are great I find myself laughing at their antics. It's a great way to brighten up a day.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Crap 0.1 first assembly project

Post by Seven.FFF »

I did CSE Computing in 1984. Apart from the syllabus not requiring you to have touched or even seen a computer, I'm pretty sure octal was on it. And core memory, chain printers, punched cards and tape, etc.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
Guesser
Manic Miner
Posts: 641
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: Crap 0.1 first assembly project

Post by Guesser »

Teletext magazine numbers and unix file system bitmasks are 3 bit numbers, does that count? (No! Ed.)
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Guesser wrote: Wed Mar 28, 2018 3:28 pm Teletext magazine numbers and unix file system bitmasks are 3 bit numbers, does that count? (No! Ed.)
Tip of the hat to you sir :lol:

That reminds me of a excellent viewdata book I found a while back I will see if I can dig it out...

Lol I remembered the airfield beacon because it was the only octal application I could think of - When I was doing my A-level I was paranoid that it would come up in a question, "Name one application of octal in software" But it never did...
Seven.FFF wrote: Wed Mar 28, 2018 3:22 pm I did CSE Computing in 1984. Apart from the syllabus not requiring you to have touched or even seen a computer, I'm pretty sure octal was on it. And core memory, chain printers, punched cards and tape, etc.
The system charts and most of the systems analysis by the end of the 90s was so out of date, the books still had all of the old symbols in them. But I guess at the time it made a lot of sense because it seemed like everyone who could was cashing in on the year 2000 'certification' scam :lol: so digging through all these crusty old systems was something we all assumed was going to be important 'for years to come' our instructors actually envisaged that we would be spending decades fixing the year 2000 fallout with legacy systems :lol:
User avatar
Guesser
Manic Miner
Posts: 641
Joined: Wed Nov 15, 2017 2:35 pm
Contact:

Re: Crap 0.1 first assembly project

Post by Guesser »

Nomad wrote: Wed Mar 28, 2018 3:41 pm Tip of the hat to you sir :lol:
Tin hat perhaps?

Image


'Ooligans!
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

:D Very nice! The patients something like that must take is really something.

Here is my most pointless 1 liner yet :lol: adapted from the hard work of John Wilson.

Yes its slow, this is BASIC! :lol:

Image

And the 1 liner Basic/Machine code hybrid.

Image

Orders of magnitude faster. :lol:
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Another one liner I am afraid.. This one is marginally more useful :lol:

Image

Image
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Crap 0.1 first assembly project

Post by Seven.FFF »

I wish I had the energy to blog about my daily coding on a sustained basis. If only it was as much fun writing posts as reading yours ;)

I've been stuck working on the same fairly small piece of Next code for the last five weeks. Finally cracked it yesterday, which encouraged me to do the next step, to expand it into a wider system for scripting events... which promptly broke it in an infuriatingly non-obvious way.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

I started it so I had something to keep me accountable to my goals :lol: (to use the new age woo woo talk.)

I didn't really keep up to date with the Next, I thought a number of the features were still undecided. But I guess the boards are already out. Will be really cool to see what people come up with especially now as there is a emulator for the thing right?

Glad someone else can chuckle at my antics.

The one liners are what I do for fun, usually because I forgot something. If I had more skills I would go totally down the Dunning–Kruger rabbit hole and make a bunch of pdf/beamer slides for a youtube presentation. I tend to shy away from that kinda thing because really I don't think I can do it justice. But that never stopped anyone else. :lol:

I loved the masterclass VHS tapes. the guy presenting the videos did it like he was a character from a Dune book accessing some forbidden technology. I kept thinking I would hear the phrase 'Thou shalt not make a machine in the likeness of a man's mind' There need to be more youtube videos like that - I know I would watch them. :lol:

[media]https://www.youtube.com/watch?v=0Tt8TmVc2h8[/media]

Like the Battle of Britain listing, that is pages of notes but I am not sure of the legal situation with that so for now its just on my notepad. Lol What interest anyone else would have in a obscure 82' basic program that got 1/5 in the magazines on release is anyone guess :lol:
I guess I loved it because it was a game from the past that I actually played as a kid I was fascinated how it worked. It took till this year for me to finally look at the whole of the listing. :lol:

I find that frustrating as its on the verge of being an awesome game if it was actually done in assembly. The options could be expanded to make it a full simulation with tons of options. :lol:

Hmm I guess other stuff, I have been getting my makefile shuffle up to standard. That is going to streamline a lot of what previously was tripping me up. :) That and making a hard transition to using zeus :lol:

It all looks like disconnected stuff but in a crazy way it all kinda links in together. Most of these little demos are to do with me being lazy and wanting to find graphics on the rom for free :lol: tonight is just me messing around drawing dragonquest style text boxes. But I plan to use them in crapchess and the battle of Britain knockoff.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Crap 0.1 first assembly project

Post by Seven.FFF »

HEh, great. I think you’re are easily distracted by the latest idea as I am :)

I’ve had the Next board since December, but it’s frustrating. There are two partial emulators, which other people are using successfully, but my code has never felt like running on them.

I think it’s easier to start off making stuff that works in the emulator, then it’s likely to mostly work on the hardware. I started the other way round, and seem to have unerringly picked all the unimplemented or buggy features. Ones that make the entire emulator crash and terminate are my speciality!

Zeus only supports the sprites and memory map, but ironically works the best, as the rest degrades gracefully. And it does let me do remote USB debugging, otherwise i’d be lost.

I had an idea yesterday to try and write a frame dumper on the Pi Zero W Next coprocessor, to avoid having to buy a £150 HDMI capture card. The pi has access to the video memory, as you can use it to output a second HDMI screen (it was originally going to be the primary HDMI mechanism, before they integrated that onto the main board).
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

I been thinking of getting a Pi zero or a teensy for some music projects. I just ran out of time :lol:

Still if you can save a bunch of money it makes sense to use it, plus I am curious what other monitoring you could get going on the board with that bad boy. Would probably be pretty useful.

I didn't really think much about the next till the tools get a bit more mature, everything is so new like you said I think it will take a few years for stuff to settle down. :lol: Looking forward to ya'll pioneers doing all kinds of awesome stuff in the meantime though.

Another day, another one liner.

This is from last night actually - the next stage is to generalize this one liner to use variable box height.

Image

Image

After that its time to switch to assembly :lol:
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

CCS 2003 games are in my dreams :lol: Having way to much fun.

Messing around with basic some more. You can see the error I made with the box program its re-drawing the whole screen when the player updates. That is wrong. What I should be doing is recording where the XO YO positions were, erasing them them putting the new player pos in XY while keeping the box border.

Another thing I need to fix is using INKEY$ instead of regular input.

Trying to then get all that to work in a one liner will be a pita. :lol:

Image

Image
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

My D grade B stock Chinese keyboard decided to pick today to start acting up :lol: Not expecting a lot to get done today..

Still at least its still got some functionality 8-) Will be back on track Monday.
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Figured out how to write disk menu systems today with the +3. Next to get the menu file to auto boot. :lol:

How it works is pretty simple. All it is the menu program merges whatever program is chosen from a series of choices. At the moment it goes to line 1000. This is probably a dumb choice (would have been better to have put it to something like 9950. That way even the largest of programs should not have issues.

Merge is ok but you still run the risk of running out of memory.

Like anything - its not perfect but its good enough.

Eventually I'll have a menu like what you used to get with the +3 multi disks.

It probably makes sense to make this as good as I can do, because I can use it again and again for every disk I make. I should probably make an effort to do this in assembly but honestly I am lazy. :lol:
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Today project time was divided between CCS 2003 and my one liner addiction. :lol:

What's the hard limit on one liners for size with the +3 I think its a little different to the 48k right?

On the plus side I got the chess UDG example converted to a one liner now.

Next task is to see if I can create an entire chess game board as a one liner :lol:

Here are the assembled chessmen. Next step is to try and squeeze this into a 1 liner. :lol:
Image
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Tonight I found one of the most pointless BASIC programs I have ever seen.

Artificial Intelligence on the Spectrum, Chapter 2 first listing. :lol:

It takes a string input, uses an IF THEN control structure to print a string after compairing the input string.. But not in the way you would expect pop pickers... :lol:

You are thinking IF I$="NORTH" THEN PRINT I$... but no..

Image

I added a clear screen and a slight pause as I like to keep the screen clean. 8-)

Interesting outcome. The first thing I did was try and convert this pointless program into a one liner. But for the life of me I cant figure out why it wont work. :lol:

Image
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Crap 0.1 first assembly project

Post by Seven.FFF »

Are statements after colons being treated as part of the THEN?
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Yea it seems there is a weird feature of the IF THEN block. In fairness I never knew there was this issue with the IF THEN block with one liners. 8-) I guess it was not so boring after all. :lol:
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

I been reading 'House of Leaves'. So I figured it would be nice to see if I could replicate some of the typography style used in the book as a one liner. As its a spectrum program figured it would be good to use different colours just like the book but with different paper values :lol:

Listing.

Image

Here are a few screens of the program running.

Image

Image

Improvements:

Well the most obvious thing that can be improved is making sure that A & B can't be equal.
I could add in different sentence string arrays that are selected at random.

After I thought to myself ; "I can cheese my way to another 1 liner with a little change" :lol:

In doing so I found a problem with the earlier program, I was not printing on the whole page.

All I did was use a single graphics character instead of four strings, extended the X Y values to cover as much as the screen as I could. Badabing badaboom - new one liner. 8-)

Listing:
Image

Screen:
Image

But then why just use CHR$(143)? Why not use all the graphics chars you get for free :lol:

Listing:
Image

Screen:
Image
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Crap 0.1 first assembly project

Post by Seven.FFF »

Ha excellent. The cutout effect would work really well with the Next's 3 layers and global transparency.

I love the Navidson house sections in that book so much.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Yes I really enjoyed the book, I like things where you can interpret them on lots of different levels/ways. It is stunning that one guy wrote it. No wonder it took so long. It is a shame he didn't write more about his process. I figure the planning alone of the various layers of narrative must have taken years.

I had always hoped that games would be created of similar complexity but who knows what the future will bring. With all these ARG type multi media projects in the last 10 years or so I think perhaps in the next few decades one will be created that will use multiple media channels to tell the story. It's just a matter of time.

I will need to take a look at the next and see what is possible, it sounds pretty cool. Kind of like a neo-geo type specification.
Post Reply