UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 7th Jan 2023, 5:18 pm   #1
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default PIC14 and moonlander

Hi peeps, could someone with a PIC14 please confirm that 'Moonlander' runs ok, specifically that you can control the burn with the number keys?
We're using Slothie's 'good' copy from this post:
https://www.vintage-radio.net/forum/...2&postcount=10
Phil__G is online now  
Old 7th Jan 2023, 8:07 pm   #2
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: PIC14 and moonlander

You could try using the version included in the .zip attached to this post, as I assembled that one. I confess I have not tried it on a PIC14.

https://www.vintage-radio.net/forum/...5&postcount=90

If that one doesn't work either try using a plain text editor to remove the second last line of Intel Hex from the file as that is there specifically for the Pi-Uploader and it contains code at FFFE/FFFF, these would be non-existent addresses on a real MK14.

The Pi-Uploader knows that and does not try to upload those two bytes of code to those addresses, instead it harvests them and uses them as the high byte / low byte of the address to run the program from after the code has been entered. That is how the auto-run feature of the Pi-Uploader works.
SiriusHardware is online now  
Old 7th Jan 2023, 8:27 pm   #3
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

Thanks G, no moonlanding in that one but found it at https://www.vintage-radio.net/forum/...52&postcount=9
Its the same - freefall all the way, no control of the engine at all.
I've tried quite a few versions now on the 'big' & 'little' PIC14s including one from Doug Rice's page and I'm beginning to wonder if we've stumbled across a whoopsie with the PIC portA keypad port read... if I manually patch in higher thrust values at F1D it responds, and will climb with thrust at 8 until the fuel runs out!
... yet Duckshoot, which also does simultaneous screen and keypad, works perfectly!
Hopefully someone with a PIC14 can give it a try...
Cheers
Phil

Last edited by Phil__G; 7th Jan 2023 at 8:57 pm.
Phil__G is online now  
Old 8th Jan 2023, 4:24 pm   #4
DavidMS
Pentode
 
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 135
Default Re: PIC14 and moonlander

Quote:
Originally Posted by Phil__G View Post
Thanks G, no moonlanding in that one but found it at https://www.vintage-radio.net/forum/...52&postcount=9
Its the same - freefall all the way, no control of the engine at all.
I've tried quite a few versions now on the 'big' & 'little' PIC14s including one from Doug Rice's page and I'm beginning to wonder if we've stumbled across a whoopsie with the PIC portA keypad port read... if I manually patch in higher thrust values at F1D it responds, and will climb with thrust at 8 until the fuel runs out!
... yet Duckshoot, which also does simultaneous screen and keypad, works perfectly!
Hopefully someone with a PIC14 can give it a try...
Cheers
Phil
I think I had it working using "George's PIC14 image" - where it is embedded in the code. Unfortunately cannot confirm as i'm not in a position to get my PIC14 up and running with his code today
DavidMS is offline  
Old 8th Jan 2023, 6:10 pm   #5
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

Ah ok thanks David, I'll check to see if George's Moonlander image is the same as the copies I have here... Meanwhile if anyone has a standard PIC14 to try? 😁
To be sure we have a good working copy of moon landing it would be nice if someone with a genuine SC/MP MK14 could confirm that Slothies version is controllable 😁
Phil__G is online now  
Old 8th Jan 2023, 8:14 pm   #6
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: PIC14 and moonlander

The version you found in post #9 of the uploader V2 thread works fine on my issue VI.

I have an idea... you're not going to like it, but... why don't you type the code in from the manual and see if it works? Maybe 15-20 minutes to enter and a further 5 to look back through it to make sure there are no typos.

Unless you've looked right through the code after loading it you won't know whether it is the code, the PIC14 loading process or some other undiscovered quirk of the PIC14 which is the cause. Unfortunately we seem to have an unexpected shortage of PIC14 users at the present time.

Moon Landing happens to be just about the largest program in the manual, unfortunately, so I don't know if it is just exceeding some kind of hitherto unknown limit of the built in hex loader (Since DavidMS has suggested that it has worked from an embedded version, one which bypasses the uploading process).
SiriusHardware is online now  
Old 8th Jan 2023, 8:20 pm   #7
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: PIC14 and moonlander

I don't know enough about where PIC14 stores program code but I have a vague idea that the 'standard' 256 bytes of MK14 memory is based in EEPROM to make it non-volatile. If that's the case, could you use a Pickit2 to load the game code directly into the EEPROM memory of the PIC?
SiriusHardware is online now  
Old 8th Jan 2023, 9:24 pm   #8
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

Thanks G that confirms that we have a 'working copy' and that it is a problem with the PIC14. After a load I have stepped through manually and verified against the manual so I'm 99% sure its loading ok but I will extract Georges image from his PIC code & try that too.
'SC/MP RAM' in the PIC14 is register based, the EEPROM holds it whilst power is off (this is how I 'pre-load' the S of C message program in a freshly programmed PIC) but its loaded back into four 64-byte register banks as part of the startup process. I'll try pre-loading moonlander but after loading it does seem to be all present & correct in memory.
I tried Karens original PIC14 code in case my edits had introduced a problem but the result is exactly the same. A further clue is that Tim says his FPGA MK14 wouldnt run Moonlanding! I'm now thinking about the actual Moonlanding keypad read, for me the source code isnt the easiest to follow, especially keeping track of the pointer registers...
I feel compelled to try as my pal Wiggles has just built a PIC14 specifically to play Duckshoot and Moon Landing!
Cheers
Phil
Phil__G is online now  
Old 8th Jan 2023, 11:55 pm   #9
Mark1960
Octode
 
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,264
Default Re: PIC14 and moonlander

Sirius mentioned in this post that there was a problem with using -128 as an offset for some instructions in the verilog.
https://www.vintage-radio.net/forum/...0&postcount=69

Is that also a problem on PIC14?
Mark1960 is offline  
Old 9th Jan 2023, 12:33 am   #10
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

Hi Mark, it was but Karen fixed it years ago
I've spent this evening extracting Georges Moonlander hex (not as easy as it sounds (14 bit))
and there are differences, I'm just working through them now. They seem minor - George added a bit of fuel (68h instead of 58h at 0F1Eh), took out a NOP at 0FA4h, and fixed a relative jump offset error at 0FA8h (which was already good in Slothies monlander)
BUT the big news is that this version runs fine on the PIC14 - though I'm not very good at it yet!
Attached Files
File Type: zip moonpic14.zip (443 Bytes, 24 views)
Phil__G is online now  
Old 9th Jan 2023, 12:48 am   #11
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: PIC14 and moonlander

This is all very strange - if you enter the code from the manual byte for byte, ignoring the assembly language / labels because as you say there is at least one jump destination label in the wrong place, it will run, at least on a real MK14 because of course that was the only way to get the code into the machine, initially at least.

I think my question for you is going to be - how are you uploading the extracted 'George' version into PIC14? As Intel Hex? If that works I would ask again (because you did not specifically mention it) whether you removed this line, the second last line, from my and Slothie's versions because there is some potential for this line to confuse Karen's Intel Hex uploader.

Code:
:02FFFE000F52A0
I would be interested to try your reconstructed 'George' code via my Pi-uploader on the issue VI. Of course I'd have to run it manually, but, needs must. I'll try to give it a go tomorrow evening, although I have other things going on as well.

Last edited by SiriusHardware; 9th Jan 2023 at 12:53 am.
SiriusHardware is online now  
Old 9th Jan 2023, 1:10 am   #12
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

Hi G yes I took out the autostart address line, and I manually stepped through memory comparing against Slothies SBASM list file so I'm sure it loaded ok
I might leave it for tonight as I'm going boz-eyed here manually comparing all these hex files and listings. The original bad jump offset didnt even land on an instruction boundary, it landed on an E3h operand which is an invalid SC/MP opcode and should reset the PIC emulated SC/MP but would be ignored on a genuine SC/MP so would run ok. But Slothies lst file has the correct jump so that wasnt it. My brain hurts and I've given myself double vision but the moonlander attached above works on the PIC14!!! (...and I just retried Slothies again to be absolutely sure, and theres no control of the engine...)

PS Unrelated, Wiggles found this site which I've not seen before: https://www.heinpragt.com/english/so...processor.html

Last edited by Phil__G; 9th Jan 2023 at 1:27 am.
Phil__G is online now  
Old 9th Jan 2023, 1:26 am   #13
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: PIC14 and moonlander

It's a shame George isn't still around or we could have asked him but it strikes me that the only reason he would make core changes (rather than 'cosmetic' changes like a change to the starting fuel level) was if he also couldn't get it to run as originally written on his PIC14.
SiriusHardware is online now  
Old 9th Jan 2023, 1:30 am   #14
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: PIC14 and moonlander

I know that when I originally tried to SBASM Moon Landing by typing in the assembly language (not the hex code) from the manual I could not get it to produce the exact same hex code as in the manual because of that one jump destination label in the wrong place. I'm sure Slothie also came across the same problem independently.
SiriusHardware is online now  
Old 9th Jan 2023, 1:56 am   #15
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

I'll do a proper comparison tomorrow G, easiest way might be to disassemble both hex files so they're exactly the same format to compare
Phil__G is online now  
Old 9th Jan 2023, 4:24 am   #16
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

Ignore the address offset by one, this is caused by the missing NOP, but theres a significant change to how the keypad is read.
It starts to differ from 0FDF in Slothies, 0FDE in Georges:
Attached Files
File Type: zip diff.zip (487.4 KB, 19 views)
Phil__G is online now  
Old 9th Jan 2023, 9:37 am   #17
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: PIC14 and moonlander

When you said 'tomorrow', I didn't realise you meant 'at half three in the morning'.
SiriusHardware is online now  
Old 9th Jan 2023, 10:54 am   #18
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,482
Default Re: PIC14 and moonlander

Just had a very quick look at the image, it certainly looks as though George customised Moon Landing to make it PIC14 compatible because of some difference in the way the PIC14 key reading hardware works.

I have a 'Key Test' utility at home which does nothing other than display the character corresponding to any key pressed - 0-9 and A-F are obviously displayed as those characters, Go= 'G and Term= 't'. 'Mem' and 'Abort' are difficult to represent on a single 7-seg display cell, so for those the util just shows 'something' different from the rest whenever those keys are pressed.

I'll try to post it later, it would be interesting to see if it runs as expected on a PIC14.
SiriusHardware is online now  
Old 9th Jan 2023, 11:43 am   #19
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

Quote:
Originally Posted by SiriusHardware View Post
When you said 'tomorrow', I didn't realise you meant 'at half three in the morning'.
Couldnt sleep G

It wasnt all moonlanding though, I needed to update my disassembler to allow specifying a PC offset, which meant I needed to reinstall Turbo C, meanwhile time passes...

Not heard from Wiggles yet, I assume he's moonlanding as we speak...
Phil__G is online now  
Old 9th Jan 2023, 1:49 pm   #20
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,079
Default Re: PIC14 and moonlander

Wiggles reports that George's version of Moon landing works perfectly on his PIC14
Phil__G is online now  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 12:45 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.