Crap 0.1 first assembly project

Show us what you're working on, (preferably with screenshots).
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Update:

Looking at the combat/mission model. It has a number of problems. The RAF numbers are wrong, You have a maximum of 90 fighters, this should be closer to 630.. Also the number of bases should be increased to 18..

This is not so hard to implement, actually its pretty easy. I don't understand why the wrong data was used in the first place..

The German bases are easy to model - you have N number of bases, once you know how many groups are being sent randomly select the base for each group. This can then be used to determine stuff like fuel level.

The detection chance totally changes the game - to make it more realistic detection should be variable. So you can either have all systems (observer + radar) working perfectly in good weather. So you have advanced warning of attack and can accurately respond. This is the default state in the original game.

If weather is bad, observers can't see the incoming attack until its ontop of them. Radar is still primitive and cannot detect aircraft bellow 1000ft (thus the need for observers), the system also can fail due to weather conditions. Therefore this worst case you have no advance warning.

and a spread in between.. the ultimate impact is enhanced gameplay, sometimes the bombers/escorts just come out of nowhere and you have to scramble. In future defenders would get a penalty (because not enough altitude to effectively engage..) but at the moment I don't want to mess with the combat model.

With this change you switch from a scramble based approach (where you just react to the incoming confirmed enemy positions.. to one of patrol based gameplay - because you can't rely on having advanced information.)

German data needs to be updated, I want to update the targets so RAF Radar can be targeted, the Air bases, Shipping in the Chanel, and civilian population centers. This is also not the most difficult job in the world. its just a matter of plugging in the coordinates of the different locations and randomly selecting a objective.

If just these three things are done (updating RED/BLUE team data, the objectives, and increase the air bases/radar stations) It will really improve the game.

Having you play the RED team and computer the BLUE is more complex.. I want to improve the model first before I do this.

There are a few factors that were never modeled by the game but (really should have been) weather, observer core response, radar.

At first I thought it was a problem with the game size - perhaps too much memory was used already but this is not the case, there is more than enough room to add in all the above...

The combat model is still pretty bad/simplistic. But I don't want to mess with that till I have the underlying data fixed. The program is slow enough as it is with the simple combat algo. If I plug in a better one its going to slow things down even more.
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Image

:lol:
Image

Little things please little minds...
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

Update:

So as you can see by the string slicing examples, I have been giving the old coconut a rest from the assembly :lol: There is a point where the best way to move forward is to take a step back and let yourself have a think on whats stopping progress.

:lol: That's what I tell myself anyway - to be honest with all of the application issues it was getting to the point where I was asking myself 'why am I doing this?' :shock: I had hit the assembly burnout phase.

But being a suborn potato I was not about to walk away and admit defeat. No I would do something else that was tangentially useful and come back to it when I was 'ready' :lol: Kind of like an act 2 before the training montage.

Well y'all saw what I did - gathered a huge amount of papers/books on chess & chess computers. This is been a great help and totally changed how I thought about the project. It was one of the best unintentional moves I made.

Other than that - I wanted to quickly prototype ideas I was having not just for the project but just random stuff that would take my interest. I wish I was at a level in specy machine code to do this in assembly but am not. So I settled on its Poor cousins Forth & Basic. Oddly this enabled rapid prototyping and in many cases exposed errors in my judgement/thinking that would have taken much longer for me to figure out had I done it with assembly. Also there is the issue that assembly being so flexible and fast it can mask many logical errors that get exposed pretty quick in slower languages like Forth or Basic.

The thing with BASIC is, yea its slow, yes its somewhat cryptic but I found myself many times just playing with it and having a bunch of fun. Unintentionally productive. I had my own numbers station running all in BASIC using potato techniques that a 'real' programmer would never admit to. :lol:

I then thought to myself 'but I could make this respectable, use a proper for next loop with some sort of string array and its all going to look pretty nice.. The interesting thing about doing the numbers station in basic was - speed was not an issue. As I am just vomiting out numbers in Morse, Basic is good enough to get the job done. There would be no perceptible speed advantage in doing this in assembly.

This lead to another insight - just sometimes it makes sense to use BASIC. :lol:

The corollary being therefore sometimes it might be a good idea to use BASIC & Assembly in a kind of unholy alliance. The more I thought about this and looked back on the documentation this was really how the designers anticipated an 'accomplished' user to use the machine. Not to be doing stuff purely in assembly but to be using a hybrid solution. (well at least in the beginning).

I think that is a somewhat lost skill is figuring out the balance of BASIC/assembly within a program to get the optimal results. I questioned the cost/benifit of implementing projects wholy in assembly - especially when I didn't have a great grasp of z80. There is a big time cost..

I guess what I came to appreciate is that perhaps my various projects could be finished/developed in a better way if I just combined basic & assembly. That way when I hit a brick wall with the assembly solution I could just cheese things with a basic solution to the problem and move on and replace it later. This would seem to be a better approach to what I had been doing.

The other big advantage with being a BASIC bod is there is a ton of books that are actually competently written for the spectrum :lol: the better part of a decade of magazines, plus I had experience from back in the day writing it. So its a lot easier. :lol:

That said I was raring to get back to the esoteric Z80 assembly, the seemingly antagonistic tools and get stuck in. So I think the time away was useful. :lol:
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Crap 0.1 first assembly project

Post by Nomad »

MMMMM BASIC..

Image

Image

Image

That last one I can't seem to crush into a 2 line program..

Busy reviewing CCS 2003 :lol:
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 silliness.

Image
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: 736
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: 736
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: 639
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: 639
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: 736
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: 736
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
Post Reply