|
RickZeeland wrote: Strange thing is that in reviews they always state that the camera quality of Moto-G phones is "mediocre" Probably because the number of pixels is not the only parameter taken into account for quality: contrast, behaviour under low lightness, color balance, autofocus, etc., could drive the result down as well.
"Five fruits and vegetables a day? What a joke!
Personally, after the third watermelon, I'm full."
|
|
|
|
|
It all depends on what you compare with.
|
|
|
|
|
Single board computers can be boring. Without any I/O ports they can't do very much. The traditional way to change that was to add a UART (that's the good old RS232 serial port, more or less) and get yourself a terminal. Quite a sight. Some rigged board or a breadboard with a handful of ICs, hooked up to a one ton terminal.
I do have a CDP1854 UART for the Zwölf, but I don't want to add that to the breadboard yet. It also would need a baud rate generator. Too many more potential errors at this point, but Zwölf does not really need it anyway.
The CDP1802 has one single output pin that can be controlled by instructions. I used it to blink a LED for the first tests. In the old days it was used for many things at once. Sound, even speech synthesis, saving your programs to cassette tape and also emulating serial communication. There are also four separate input bits, so we could also receive bytes from the terminal or the tape recorder.
Now I have added a MAX232 IC to the Zwölf and hooked it up directly to the processor's output bit and one of the four input bits. Now I only need subroutines to send and receive ASCII characters and Zwölf will become interactive.
The following code is my subroutine to send a character to the terminal. It already does a fine job on the emulator. 1200 baud are not very much, but it will be sufficient as long as the Zwölf is clocked with only 1 MHz. It uses separate call and parameter stacks (that's what all the SEX is about). I could even have up to 15 stacks if I needed them. I also don't think that RISC processors need an excessive number of instructions to actually do something.
Now, show me how you do all that with a fancy Z80 by simply adding that MAX232. And of course faster and with even shorter code.
; =========================================================================================
; RS232 Out (software protocol)
;
; Parameters:
; 01 Character to be sent (byte)
;
; Return:
; ---
; =========================================================================================
RS232OutSoftware: SEX R2 ; save register RE onto the call stack
GHI RE
STXD
GLO RE
STXD
SEX R6 ; load parameter 01 into RE.1
IRX
LDX
PHI RE
SEQ ; Q = 0
LDI BIT_COUNT ; load bit counter into RE.0
PLO RE
REQ ; Q = 1 (start bit)
LDI BIT_DELAY ; delay for one bit phase
PLO RF
SER_Delay1: DEC RF
GLO RF
BNZ SER_Delay1
SER_TransLoop: GHI RE ; shift out highest bit from the character
SHRC
PHI RE
LSDF
REQ ; Q = 1 if bit = 0
SKP
SEQ ; Q = 0 if bit = 1
LDI BIT_DELAY ; delay for one bit phase
PLO RF
SER_Delay2: DEC RF
GLO RF
BNZ SER_Delay2
DEC RE ; decrement bitcount
GLO RE
LBNZ SER_TransLoop ; shift out another bit if not done yet
SEQ ; Q = 0 (last phase to get back in step)
LDI BIT_DELAY ; delay for one bit phase
PLO RF
SER_Delay3: DEC RF
GLO RF
BNZ SER_Delay3
LDI BIT_DELAY ; delay for one bit phase (stop bit)
PLO RF
SER_Delay4: DEC RF
GLO RF
BNZ SER_Delay4
SEX R2 ; restore register RE from call stack
IRX
LDXA
PLO RE
LDX
PHI RE
SEP R5
;------------------------------------------------------------------------------------------
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
This sort of information does not deserve to drop off the end of the Lounge. How about an article (or a set thereof)? I would love to say that I understand it all, but most of the electronics are beyond me, although I am trying to learn a bit.
|
|
|
|
|
Well, at least i would have one reader, as it seems, but before I write an article, I first have to get to a point where it has become a complete computer, and not just the bare minimum.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Write it, release it, as a serial.
And, two. I will read it and perhaps it gets me to pull a breadboard out of storage.
|
|
|
|
|
Um ... You do realise that "modern" Z80 processors have integrated peripherals, including SIO?
Zilog Z180 - Wikipedia[^]
I hate to rain on your parade, but it's one line of assembler per character ... and it's buffered.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Those additions came to the Z80 Zwölf years after the CDP1802...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
If my grandmother had wheels, she'd be a wagon.
I was just joking about the processor nerd wars of the old days, when every additional IC was expensive. The original Z80 would need a UART, or at least a bit on a parallel port to do similar bit banging.
And before we get a real nerd war here: Long ago I followed such a 'contest' in the newsletters that I could get hold off. Someone with a 2 MHz Z80 against a 1.79 MHz CDP1802. He thought that his Z80 would blow that 'primitive', 'weird' and slow 1802 out of the water at some task. It went back and forth for a while, but nobody really won. Both processors' performance was too close to each otherin the end they only proved that even the greatest features of your processor can't help when the algorithm sucks.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Yep, they were always pretty close - but the Z80 got much wider "general purpose" acceptance, so it got the further development the 1802 didn't but probably should have.
The 32MHz Z180 was a seriously usable chip that you can still get new and cheap today.
Not looking for a Nerd War: we're both outclassed by more modern designs like ARM and even PIC these days...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You know very well what kind of equipment and knowledge you would need if you want to do serious work with modern components. Just look how many people here own a car in the same price class as an oscilloscope in the 10 GHz range.
It would be totally unreasonable, just for a hobby. No problem. I like the old stuff, not despite the limitations but because of them. It's a little like camping, even if I could easily afford to live in a palace.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
You're right the ?vintage? Z80 probably would take more code to do the same job, but the Z80 wouldn't need all that SEX to get the job done...so there!
And I agree about the article, would love to see what you've done!
Monday starts Diarrhea awareness week, runs until Friday!
JaxCoder.com
|
|
|
|
|
The thing I always liked about "working in the small" as it were, was figuring out how much you could do with so few resources. I wrote a piece of PIC software once that output a 5.5 KHz beep for 100ms and turned on an LED for one second every hour. The accuracy of the timing only depends upon the precision of the crystal used with the chip. I was counting clock cycles to get the timing right. The code used 4 bytes of RAM, no stack, and was only a single printed page.
Software Zen: delete this;
|
|
|
|
|
Don't forget to disable interrupts and, if you can, DMA. Otherwise your careful timing can fail very quickly. At least a PIC is a RISC processor. That makes the calculations a little easier.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
I guess his PIC did not have DMA.
|
|
|
|
|
No interrupts needed for this application, and the chip didn't support DMA. I don't remember the exact PIC chip, but it seems like it had 1K of ROM and 256 bytes of RAM. This project was a one-off for a local predatory bird rescue, so we built it out of what was on hand.
Software Zen: delete this;
|
|
|
|
|
Looks like I'm not going the serial port working today. The MAX 232 causes some serious noise on the power lines. At least I programmed a little memory test for the RAM. The processor ran it in under 4 minutes with a 5 MHz clock. On the breadboard. Now I can be sure that my wiring on the breadboard is ok so far.
A PIC will be next after getting the serial port to work. It will act as a bootloader after a reset This way I can replace the EEPROM by another RAM and need no more ROM in the memory map.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
So I was about to buy the 2nd edition of a book for which I have the first edition, but then the author tells me that epsilon rules in a CFG don't require special casing.
But he offers no example on how to generate an LR table using a grammar with epsilon transitions in it.
Meanwhile, I'm over here trying to generate the (S)LR table, and so I create the extended grammar.
so I take this:
S -> A
A -> B b
B -> B a
B ->
And then I mark it up with the itemSet ids, like so:
0/Sstart/-1 -> 0/S/1 1/#EOS/2
0/S/1 -> 0/A/3
0/A/3 -> 0/B/4 4/b/5
0/B/4 -> 0/B/4 4/a/6
0/B/4 ->
But the bold lines, I need a symbol there but i don't have it. Should be like
0/B/4 -> number/#EPSILON/number
but if i add the artificial #EPSILON tag it breaks everything.
And if I leave it out I don't end up generating my reductions for the corresponding state in the LR table.
Again, the book I have says epsilons don't need any special handling.
But here I am. I got the first edition of this book for free. The second one, new costs over $200? (i think thats the publishers ask - not necessarily the cheapest price), used costs $80-$120.
I guess the author doesn't want me to buy it.
Real programmers use butterflies
modified 16-Feb-20 6:06am.
|
|
|
|
|
Most authors nowadays provide a Github repository of all their code. Strange that this author does not.
|
|
|
|
|
This book was published in 1991
Real programmers use butterflies
|
|
|
|
|
Hi, i would like to re-read an old article about virtual life or world simulation. But I can't find that article. It has been deleted or classified under other tag(s).
When i say old, i am talking about vb6/vs6 era. I barely remember much details about, but i may describe it a bit.
The article topic was a social simulation. vb6 coded. It talked about how to simulate a virtual world with a lot of entities and how it worked under the hood.
The captures showed something similiar to this
smallworlds game[LINK DELETED]
I have searched using tags such vb6,vb,vs6,social simulator,emulator,virtual world,ai and other tags that I cannot remember.
I hope somebody read that article and may give other details, or help me to find it.
Thanks.
|
|
|
|
|
Try a search for "game of life" here and you will fine several articles about Conway's Game of Life and a few about Cellular Automata.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Thanks for the suggestion. I am checking another tags such social computing, messaging, etc.
That simulation was more complex i think. The described "system" handled a lot of entities with messaging and syncronization.
It can be said it was a "cheap" sims game simulation. The article offered a capture showing an isometric world with inhabitants interacting.
I am searching how that it worked under the hood
Thanks again.
|
|
|
|
|
Just sayin
I'll get my coat.
Real programmers use butterflies
|
|
|
|
|
When you tell people about it, call it a cup.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|