#garfield Logs

Apr 04 2021

#garfield Calendar

12:03 AM rue_mohr: ugh
12:10 AM rue_mohr: the dissassmbler sucks, this will take some work
12:55 AM rue_mohr: wow I coded it totally funkey
12:57 AM rue_mohr: the 4 row screen is two hd44780 controllers, my implementation of line feeds was impressive
12:58 AM rue_mohr: so.
12:58 AM rue_mohr: when it boots up it needs to be given an address
12:59 AM rue_mohr: it will print '=' and the value at the address it was given
01:00 AM rue_mohr: then it will prompt for a command
01:00 AM rue_mohr: which can be I, R, W, P, G
01:34 AM rue_mohr: http://paste.debian.net/1192271/
01:34 AM rue_mohr: ahahah how does this code WORK!!!
01:34 AM rue_mohr: ahahaha I wrote it!!!!!
01:35 AM rue_mohr: its scanning the rows and columns, via the address and data lines,
01:35 AM rue_mohr: it calculates a keycode with the row and column, then it runs it thru a lookup table and fires back the result
01:35 AM rue_mohr: but AAAAAHHHH
01:36 AM rue_mohr: its an 8x8 matrix
01:36 AM rue_mohr: the 8 lsb of the address are the columns, the data (address 3000 - 3FFF) are the rows
01:39 AM rue_mohr: LD C,A
01:39 AM rue_mohr: LD A,H
01:39 AM rue_mohr: LD B,000H
01:39 AM rue_mohr: LD D,C
01:39 AM rue_mohr: LD C,A
01:39 AM rue_mohr: LD A,D
01:39 AM rue_mohr: ^^ that bit is especially painfull
01:41 AM rue_mohr: ok
01:41 AM rue_mohr: INKEYVNEXT:
01:41 AM rue_mohr: RRA
01:41 AM rue_mohr: JP C,INKEYFINISH
01:41 AM rue_mohr: INC C
01:41 AM rue_mohr: JP INKEYVNEXT
01:41 AM rue_mohr: there I work out which bit is set
04:13 AM rue_shop1: I found the other code that does the rows, it adds 8 for each bit
08:18 AM polprog: https://youtu.be/bZJoiB56N74
08:19 AM polprog: haha imsai guy made a stepper motor controller on a 22v10
12:22 PM KitchenMoon: rue_mohr: hey tough guy
12:28 PM rue_mohr: moon
12:29 PM KitchenMoon: me
12:30 PM KitchenMoon: I got a big ommelete what do you have?
12:32 PM KitchenMoon: omlette?
12:32 PM KitchenMoon: I french worse than I english
12:32 PM rue_mohr: I have code that is so crazy it doesn't need obfiscation
12:32 PM rue_mohr: and I wrote it
12:32 PM rue_mohr: PUSH AF ; RESET CARRY FLAG....
12:32 PM rue_mohr: POP HL
12:32 PM rue_mohr: RES 0,L
12:32 PM rue_mohr: PUSH HL
12:32 PM rue_mohr: POP AF
12:33 PM KitchenMoon: i see unicode in there maybe on this console???
12:33 PM KitchenMoon: but
12:34 PM KitchenMoon: pushing flags
12:34 PM KitchenMoon: po into lower half or an H register?
12:34 PM KitchenMoon: poping
12:34 PM KitchenMoon: dont recongnize RES
12:34 PM rue_mohr: itsa bit reset
12:35 PM rue_mohr: as it turns out, the happy way to clear the carry flag is with OR A, which or's A to A, in the process, clearing the carry
12:36 PM rue_mohr: you know the game with the cups and the ball?
12:36 PM rue_mohr: guess which cup the ball is under, ya know?
12:37 PM KitchenMoon: i have to take it slow with reading this someones talking in the background
12:37 PM rue_mohr: sure
12:37 PM rue_mohr: so, 3 cups, one of them has a ball put under, and then the cups get swapped all around and you win by knowing which cup has the ball under it
12:38 PM KitchenMoon: yes
12:38 PM rue_mohr: LD C,A
12:38 PM rue_mohr: LD A,H
12:38 PM rue_mohr: LD B,000H
12:38 PM rue_mohr: LD D,C
12:38 PM rue_mohr: LD C,A
12:38 PM rue_mohr: LD A,D
12:38 PM rue_mohr: ^^ where did the ball go?
12:38 PM rue_mohr: :)
12:38 PM KitchenMoon: XD
12:38 PM KitchenMoon: k 1sec
12:38 PM rue_mohr: yea
12:38 PM KitchenMoon: intex syntax right?
12:39 PM KitchenMoon: intel
12:39 PM KitchenMoon: no cant be
12:39 PM KitchenMoon: at&t
12:39 PM rue_mohr: first one is copy A -> C
12:39 PM KitchenMoon: ok intel
12:39 PM KitchenMoon: 1sec
12:39 PM rue_mohr: heh
12:39 PM KitchenMoon: back in A
12:40 PM KitchenMoon: ?
12:41 PM rue_mohr: A does end up in A yes
12:41 PM KitchenMoon: cool
12:41 PM rue_mohr: LD H,A
12:41 PM rue_mohr: LD A,C
12:41 PM rue_mohr: CPL
12:41 PM rue_mohr: LD L,C
12:41 PM rue_mohr: PUSH HL
12:41 PM rue_mohr: POP IX
12:42 PM rue_mohr: ^^ in this part, for no reason, I move data into IX
12:42 PM rue_mohr: it goes there, it never comes back
12:42 PM KitchenMoon: shoot me the whole thing, and ill copy it into nedit then tell me what it does
12:42 PM rue_mohr: its part of the keyboard decoder
12:43 PM rue_mohr: http://paste.debian.net/1192263/
12:43 PM rue_mohr: there is orig source
12:43 PM KitchenMoon: thanks
12:44 PM rue_mohr: http://paste.debian.net/1192302/ there is a decompile of the actaul rom ON it.
12:44 PM rue_mohr: its a bit different
12:44 PM KitchenMoon: 6502
12:44 PM KitchenMoon: ?
12:44 PM rue_mohr: I accidently overwrote the orig source file
12:44 PM rue_mohr: Z80
12:44 PM KitchenMoon: ok
12:44 PM rue_mohr: brb
12:44 PM KitchenMoon: k
12:46 PM rue_mohr: so, I need to replace the keyboard
12:46 PM rue_mohr: and so it needs new decoder circuitry and new decoder code
12:48 PM rue_mohr: the way the main loop works (for editing memory and stuff) is crazy too
12:48 PM rue_mohr: I need to see if I can feed it back into an assembler
12:48 PM rue_mohr: the old code was hand assembled
12:49 PM rue_mohr: if I'm trickey, I can run microsoft z80 basic on it
12:52 PM rue_mohr: I'v spent 2 days in a chair tho, I need to get up and move around a bit
12:52 PM KitchenMoon: yeah DO IT!
12:52 PM rue_mohr: and the cat need to be fed
12:52 PM KitchenMoon: :|
12:52 PM rue_mohr: oh you cant view images
12:53 PM rue_mohr: I got a scan free keyboard decoder down to some resistors and a ROM
12:54 PM KitchenMoon: that is sexy, but I have to carry on. come by if you want and molest my robot
12:55 PM KitchenMoon: Dysnomia: your sexy too ;)
12:55 PM KitchenMoon: bye
01:20 PM Tom_L: the ball wasn't under A to begin with
01:21 PM Tom_L: you assumed it was
01:27 PM rue_mohr: :)
01:43 PM rue_mohr: I'm having a hard time finding any z80 code to use as a format example for asz80
01:45 PM Tom_L: C?
01:46 PM rue_mohr: assembler
01:47 PM Tom_L: https://gist.github.com/mwadams/5358890
01:47 PM Tom_L: http://www.z80.info/lesson1.htm
01:47 PM rue_mohr: ok, but
01:48 PM rue_mohr: will asz80 compile it?
01:48 PM Tom_L: https://shop-pdp.net/ashtml/asmlnk.htm
01:48 PM Tom_L: http://k1.spdns.de/Develop/Hardware/AVR/mixed%20docs.../doc/as/asxhtm.html
01:49 PM rue_mohr: the documentation for asz80 has NO real code examples, just some tet files
01:50 PM rue_mohr: I'll try stuff from those and see what I win
01:51 PM Tom_L: https://z80avrproject.wordpress.com/2016/10/23/z80-testing-simple-program-to-exercise-the-uart/
01:52 PM Tom_L: ?? why avr stuff in there?
01:52 PM rue_mohr: :)
01:53 PM Tom_L: https://groups.google.com/g/rc2014-z80/c/6mO-3_kKfRM
01:53 PM rue_mohr: that looks like more real code tho
01:53 PM Tom_L: it runs cpm?
01:53 PM Tom_L: check that last one
01:54 PM rue_mohr: yes
01:54 PM Tom_L: further down are some snips
01:54 PM rue_mohr: I have a z80 CP/M card for the apple IIe
01:55 PM Tom_L: https://github.com/kenyapcomau/asz80-8080
01:55 PM Tom_L: those should keep you out of the bars at least for today
01:56 PM rue_mohr: I suppose I can try a hello world with the thing
01:56 PM Tom_L: i never used a z80 that i remember
01:56 PM rue_mohr: the keybaord is down, and thats a bit of an issue just now
01:56 PM Tom_L: what did that heathkit thing have on it?
01:56 PM Tom_L: i had one of those
01:56 PM rue_mohr: I also need to work out where the nibble reverse on the bus is
01:57 PM rue_mohr: somewhere I swapped the high and low nibbles
01:57 PM Tom_L: i bet it's still in the attic with all the books :)
02:00 PM rue_mohr: gonna go play in the sun
02:00 PM rue_mohr: there must be somthing to be done out there
02:00 PM Tom_L: nice out today here
03:22 PM rue_mohr: clouding over now
03:22 PM rue_mohr: got some yard stuff done
03:22 PM rue_mohr: I'm sure nature will have it all undone in about 8 hours
04:19 PM Tom_L: plant your raised beds yet?
04:23 PM aandrew: Sigh. Filament jammed and I didn’t notice for like 5h. Fixed, printed again, and this time my 12yo son stuck his fingers in the printer to “feel the vibrations” and it moved in a way he didn’t expect and he caused it to skip steps, ruining the print
04:24 PM aandrew: Tried a few times to edit the gcode but couldn’t get it right, so scrapped and am reprinting again.
04:24 PM Tom_L: happy easter :)
04:24 PM aandrew: Indeed. This is an Easter print too. :-)
04:25 PM aandrew: I suspect I don’t have enough white filament to finish now
04:27 PM aandrew: I have some esun brand white and some white PETG, but no more CCTree white PLA
04:29 PM aandrew: I’ve kind of standardized on CCTree brand since it’s giving me the best results and I’m more or less dialled in with it
06:58 PM rue_mohr: were just fixing up the strawberries and rubarb
07:10 PM rue_mohr: huh, it has an issue with every line
07:10 PM rue_mohr: the z80 assembler
07:11 PM rue_mohr: .org 0x0000
07:11 PM rue_mohr: A-3ROM.s:5: Error: <o> .org in REL area or directive / mnemonic error
07:11 PM rue_mohr: this is why I need a file it will actually assemble
07:12 PM rue_mohr: a whole file
07:12 PM rue_mohr: not some little clip from the middle of a file
07:17 PM rue_mohr: ok, now the error is on the first line of code
07:17 PM rue_mohr: LD SP,02FE0H
07:17 PM rue_mohr: A-3ROM.s:7: Error: <a> machine specific addressing or addressing mode error
07:18 PM rue_mohr: ok, the number format from the dissassembler cannot be accpeted by the assembeler
07:19 PM rue_mohr: so all I have to do is go thru and change the format of every number in the code
07:20 PM rue_mohr: ah no wait its worse
07:20 PM rue_mohr: LD SP,0x2FE0
07:20 PM rue_mohr: A-3ROM.s:8: Error: <a> machine specific addressing or addressing mode error
07:20 PM rue_mohr: I need a real example of code that sdasz80 will assemble
07:22 PM rue_mohr: ok It looks like I'm getting there with the corrections
07:34 PM Tom_L: http://msx.avelinoherrera.com/index_en.html
07:34 PM rue_mohr: I'm slowly getting closer...
07:38 PM rue_mohr: oof 4 errors left
07:42 PM Tom_L: https://www.msx.org/forum/msx-talk/software/how-to-access-undocumented-z80-instructions-in-sdcc-sdasz80
07:42 PM rue_mohr: hah, I dont need that one, but thanks
07:42 PM rue_mohr: everything I did was by the book
07:43 PM rue_mohr: I got it to assemble, the first two instructions look ok
07:43 PM rue_mohr: I next need to get it to a binary file
07:43 PM rue_mohr: its a .o right now
07:44 PM Tom_L: http://www.kswichit.com/Z80/AN001.pdf
07:45 PM Tom_L: not much there
07:45 PM rue_mohr: I have it assembled to an obj file
07:45 PM rue_mohr: I dont think I need to link it
07:45 PM rue_mohr: just objdump it
07:46 PM Tom_L: http://k1.spdns.de/Develop/Hardware/AVR/mixed%20docs.../doc/as/asxhtm.html
07:46 PM rue_mohr: sdobjcopy
07:49 PM Tom_L: sjasm
07:49 PM Tom_L: ever look at that?
07:50 PM rue_mohr: no changing directions
07:50 PM rue_mohr: I need to try to get this to work
07:52 PM Tom_L: do you have sdcc installed?
07:52 PM Tom_L: or just some assembler
07:53 PM rue_mohr: yea, this look sgood, the process seems to be:
07:53 PM rue_mohr: sdasz80 -o A-3ROM.s
07:53 PM rue_mohr: sdldz80 compiled.ihx A-3ROM.rel -i
07:53 PM rue_mohr: sdobjcopy -Iihex -Obinary --gap-fill 255 compiled.ihx compiled.bin
07:54 PM rue_mohr: I have to fix the source a bit, but it seems to compile, cool
07:54 PM rue_mohr: and I can try testing the final image against the origional dump
07:54 PM rue_mohr: if I can get it to assemble back to what I have, I'm looking good
07:55 PM Tom_L: it won't be exactly the same
07:56 PM rue_mohr: it should
07:57 PM rue_mohr: I have some data tables I didn't copy over cause the decompiler turned them to mush
08:08 PM rue_mohr: diff compiled.bin A-3ROM-corrected.bin
08:08 PM rue_mohr: Binary files compiled.bin and A-3ROM-corrected.bin differ
08:08 PM rue_mohr: hmmm
08:08 PM Tom_L: by how much?
08:09 PM rue_mohr: working on that :)
08:09 PM Tom_L: some compilers/assemblers add stuff you may not need
08:09 PM Tom_L: others may be smarter
08:09 PM rue_mohr: oo thats odd
08:10 PM rue_mohr: ood
08:10 PM rue_mohr: oooh
08:10 PM rue_mohr: the...
08:10 PM rue_mohr: when I wrote the old rom... there was some garbage in the ram is was copied from
08:11 PM rue_mohr: the blank space isn't properly blank
08:11 PM rue_mohr: its right in all the places that matter
08:11 PM rue_mohr: no wait...
08:12 PM rue_mohr: there is a descrepency in the lookup table...
08:12 PM rue_mohr: 07B0: 4D 20 45 4E 44 20 00 FF - 00 00 00 00 00 00 00 00 M EN | 07B0: 4D 20 45 4E 44 20 00 00 - 00 00 00 00 00 00 00 00 M EN
08:12 PM rue_mohr: where is it...
08:12 PM rue_mohr: oh the FF
08:13 PM rue_mohr: 2B BE 38 7F 2D 30 7C 39 - 4F 5D 00 00 49 50 0A 22 +.8. | 07C0: 2B BE 38 0A 2D 30 7C 39 - 4F 5D 00 00 49 50 0A 22 +.8.
08:13 PM rue_mohr: hmm
08:14 PM rue_mohr: 07b7
08:14 PM rue_mohr: should be
08:14 PM rue_mohr: 00
08:16 PM rue_mohr: er
08:16 PM rue_mohr: wait the left is the orig
08:16 PM rue_mohr: so its fine
08:16 PM rue_mohr: I must have added the other 0x00 later
08:17 PM rue_mohr: at 07B8 the key lookup table starts
08:18 PM rue_mohr: ah
08:18 PM Tom_L: you didn't load it though did you?
08:18 PM rue_mohr: 07C3
08:18 PM rue_mohr: not yet
08:18 PM rue_mohr: its the position for one of the enter characters
08:18 PM rue_mohr: in my source, they all have an * beside them
08:18 PM rue_mohr: I must have been having an issue
08:19 PM rue_mohr: 3B 0A 7F 20 4C 00 42 3F - 20 7D 00 48 5A 7F 7E 0A ;.. | 07F0: 3B 0A 0A 20 4C 00 42 3F - 20 7D 00 10 5A 0A 00 0A
08:19 PM rue_mohr: same there, I was having issues with the enter char
08:19 PM rue_mohr: the keyboard had two enters and a line feed key
08:20 PM rue_mohr: -17FC 5A
08:20 PM rue_mohr: -17FD 0A*
08:20 PM rue_mohr: -17FE 00*
08:20 PM rue_mohr: -17FF 0A
08:20 PM rue_mohr: ^^ indications of issues
08:30 PM rue_mohr: ok, all the code comes thru ok
08:30 PM rue_mohr: I have a few discrepancies in things that dont matter, I should be able to write something and it should work
08:31 PM rue_mohr: and for the first time in 27 years I have the original source back
08:31 PM Tom_L: well what you waitin for... let's find out!
08:31 PM Tom_L: that's a long time to wait
08:31 PM rue_mohr: shall I nibble reverse the image and write it?
08:32 PM Tom_L: i've been going to compile a kernel but just can't get myself to do it
08:33 PM rue_mohr: doyou know what config yu ned?
08:34 PM Tom_L: https://github.com/NTULINUX/RTAI
08:34 PM Tom_L: that's the kernel
08:34 PM Tom_L: changes
08:35 PM Tom_L: i think i did it once but can't remember now
08:35 PM Tom_L: it's so buster will run with RTAI instead of preempt-rt
08:35 PM rue_shop1: k
08:35 PM Tom_L: i wanted to see how it would perform on my old mb (Intel D525)
08:36 PM rue_shop1: see if the eprom programmer can do this flash cip
08:36 PM Tom_L: but i don't wanna screw up what's on it now
08:36 PM Tom_L: and i got a busy week so i doubt i do much
08:36 PM rue_mohr: grub or lilo
08:37 PM Tom_L: grub
08:37 PM rue_mohr: hmm
08:37 PM rue_mohr: if it were lilo I'd say just make another entry
08:37 PM Tom_L: no, i'm not touching the original ssd
08:37 PM Tom_L: this will be a clean slate
08:37 PM rue_mohr: ouch
08:38 PM rue_mohr: you could make a copy of it
08:38 PM Tom_L: pretty sure i did it once already
08:38 PM rue_mohr: now is later than then tho
08:38 PM Tom_L: but a few dependencies weren't there at the time
08:38 PM Tom_L: now they are
08:38 PM Tom_L: so linuxcnc should work on it now
08:39 PM Tom_L: i just gotta get myself to do it
08:40 PM rue_mohr: yea it can do it, ok
08:41 PM rue_mohr: well, end of a weekend
08:41 PM rue_mohr: is it an afternoons thing
08:48 PM rue_mohr: huh
08:48 PM rue_mohr: the programmer cant write this flash chip
08:48 PM rue_mohr: its the easiest thing to write ever
08:48 PM rue_mohr: its fail
08:50 PM Tom_L: so all for naught?
08:50 PM rue_mohr: well, you see the origional chips I used requrie 27V to program
08:50 PM rue_mohr: or 30
08:50 PM rue_mohr: anyhow this programmer cant do that
08:51 PM Tom_L: hmm
08:51 PM rue_mohr: so I have a super simple flash chip
08:51 PM rue_mohr: that it cant write
08:51 PM rue_mohr: I made a programmer a while ago that, if I can find all the parts of, can
08:51 PM Tom_L: most are 5 or 12v now aren't they?
08:52 PM rue_mohr: yup
08:53 PM rue_mohr: huh
08:53 PM rue_mohr: it lists support for a few 2716 types, I'll see if I have any of them
08:53 PM rue_mohr: AM2716@DIP24
08:53 PM rue_mohr: AM2716B@DIP24
08:53 PM rue_mohr: MBM2716@DIP24
08:53 PM rue_mohr: M2716@DIP24
08:53 PM rue_mohr: M2716M@DIP24
08:53 PM rue_mohr: ETC2716@DIP24
08:53 PM rue_mohr: M2716@DIP24
08:53 PM rue_mohr: ETC2716@DIP24
08:53 PM rue_mohr: M2716@DIP24
08:53 PM rue_mohr: TMS2716@DIP24
08:53 PM rue_mohr: might not be able to write them all
09:02 PM rue_mohr: yea its failing it can only hit 18V
09:15 PM Tom_L: funny that you can program an avr at 1.5v
09:17 PM rue_mohr: :)
09:17 PM rue_mohr: tech has come a long way since '77
09:17 PM rue_mohr: I MIGHT be able to write/substitute a 32k rom
09:17 PM Tom_L: no joke
09:17 PM rue_mohr: I have to check the pinouts
09:18 PM rue_mohr: they used to be able to do voice recognition with a sub-1mips cpu, now it takes a pi
09:20 PM rue_mohr: both 24 pins ok
09:20 PM rue_mohr: pins 20 and 21 change
09:21 PM rue_mohr: my 21 goes to +5, my 20 is chip select
09:21 PM rue_mohr: so I'v tied A11 high for the 32k
09:54 PM rue_mohr: so
09:54 PM rue_mohr: every second time I try to program the rom, it goes one byte further
09:54 PM rue_mohr: so I put the programmer in a shell loop
09:54 PM rue_mohr: its at 24F
09:55 PM rue_mohr: when it gets to about 2E0, it'll zip along a way, big blank spot in the image
09:55 PM rue_mohr: provided nothing else goes wrong
09:55 PM rue_mohr: in the meantime, I should find some space and make sure the z80 boots its orig tom
09:55 PM rue_mohr: I cant use the keybaord, so
09:57 PM Tom_L: ?
09:57 PM Tom_L: so how do you tell it's alive?
09:57 PM rue_mohr: hmm
09:57 PM rue_mohr: flashing cursor?
09:57 PM rue_mohr: I can try pounding keys, see if I get anything
09:58 PM rue_mohr: oooh tommorow monnday
09:58 PM rue_mohr: and its not going to be a nice one
09:58 PM Tom_L: nope
09:58 PM Tom_L: the week is that way
09:59 PM rue_mohr: we have a fire inpsection on a building that the guys didn't finish installing the decives in
09:59 PM rue_mohr: they wont be there
09:59 PM rue_mohr: so yea
09:59 PM Tom_L: how to inspect if it's not there?
10:00 PM rue_mohr: they coldn't finish it cause the building wasn't ready in time
10:00 PM rue_mohr: its mostly there
10:00 PM rue_mohr: its not ready
10:01 PM rue_mohr: I'm gonna go rewire the keyboard more
10:02 PM Tom_L: :)
10:02 PM rue_shop1: I have to be carefull not to stay up till 2am tonight
10:03 PM Tom_L: might be best
10:03 PM Tom_L: i'm good for about an hour
10:23 PM aandrew: HAAAAAAAAAAAAAAAAAAAAAAAAAAHAHAHAHAHAHAHAHAHHAHA
10:23 PM aandrew: https://i.redd.it/wmst3elyh2r61.jpg one of the top comments is "mein tramp"
10:29 PM aandrew: and the third attempt I ran out of filament. sigh.
11:19 PM rue_mohr: oh bugger
11:19 PM rue_mohr: you need a protective cage around your printer
11:43 PM rue_mohr: keyboard remapping is on the home stretch
11:45 PM rue_mohr: oof, I need a 30 pin connector for the new keybaord
11:46 PM rue_mohr: the programmer has the rom up to 7F8
11:51 PM rue_mohr: 7F9