|
The stork brings them, but that's not the interesting part. I want to see 3D graphics on an 8 bit computer, at least once I get around to build the graphics card. It's going to have a TMS9981 graphics chip, a RISC graphics processor and a DMA based DGP (Decelerated Graphics Port).
Anyway, I'm going to need some math routines for, let's say, 32 bit fixed point math. Will 24 bits for the whole numbers will be enough, but maybe just 8 bits for the fractions are not. We shall see. Anyway, I intend to use the Russian Peasant Multiplication[^] algorithm. It's based on multiplying and dividing by 2 (also known as shifting) and addition. That should be easy to implement. But what is the algorithm for division called? I'm going to need that as well.
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.
|
|
|
|
|
|
Certainly does. At least I now have all bases covered. But before I write the first code, I'm going to check the runtime behavior of the algorithms to pick the best choice. No time to waste on an old 8 bit CPU.
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.
|
|
|
|
|
It is always going to be a slow(ish) operation in software, that is why they brought out co-processors and eventually implemented it on the CPU.
Just remember when you multiply/divide the decimal point will move and you will need to normalise the result.
You might also look into doing binary square roots:
Methods of computing square roots - Wikipedia[^]
I have never used this myself, but there is code there, so that should help you assess the speed of it.
|
|
|
|
|
and I'm struggling with keypad and 7-segment display on my Z80 I'm building.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
What's the problem?
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.
|
|
|
|
|
Keypad works fine(24 key), display works fine (7-segment 4 address, 2 data).
On reset I set display buffer to: FFFF FF
I then go into my main loop looking for keyboard input and when Data Available bit from keypad goes low I process the input and if it's a 0-F I put in address buffer if it's > 16 it's a function key and I process it as such.
For some reason on reset the system thinks that the data available bit is low and so I end up with display of; 0FFF FF.
I've put the scope on the DA pin and on reset it does not go low so not sure exactly what's going on. Not sure where to go from here as far as debugging.
For now Ive got it set up just to accept keypad input and put key input into 1st buffer position and if any function key pressed put 4444 44 into display buffer which it does just fine.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
Put in a delay loop before entering the main loop and processing any inputs. It's just an idea, but your code may be faster than the I/O chip after a reset. Give it a little more time to get going.
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.
|
|
|
|
|
Thanks I'll try that today, was working on honey-do list yesterday.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
Turns out I needed to RTFM a little better.
I am using a 8255 (PIO) to talk to the keypad and display and was trying to use Mode 1 on Port A without doing the appropriate handshacking. So I put it in straight input mode 0 and it works like a charm.
Thanks for your feedback.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
People who used the as IDE controller ran into similar problems. That's why I plan to skip all I/O devices and will try to access the registers of the IDE devices directly, as memory mapped I/O devices themselves.
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'm beginning to learn the same thing.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
That sounds like the video chip that was used in the TI-99/4A home computer.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Exactly. Oldschool graphics chips suitable for 8 bit computers are hard to get.
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.
|
|
|
|
|
Restoring Division, usually. There are other options, but they make more sense in hardware than in software.
By the way take a look at Quarter Square Multiplication, it costs a bunch of ROM but it's a lot faster than bit-by-bit multiplication. Usually I wouldn't recommend it, but for 3D stuff you may need the speed.
|
|
|
|
|
CodeWraith wrote: I want to see 3D graphics on an 8 bit computer A very long time ago, at a university not too far away...
When I was in college I did an independent study course as one of my electives. My project was to implement Binary Space Partitioning[^] as a method for doing 3D hidden-surface removal graphics. The computer was a Z-80 running CP/M, and the display was 256x256 with 8 colors per pixel. The code was written in PL/I-80[^] from Digital Research. The program was so large it was written as a bunch of overlays and took a couple of disk swaps (8" floppies) to render an image.
As far as I know I was the first implementor of the BSP algorithm after the original authors. Another claim to fame is that this was the same algorithm used in the 1st version of DOOM. This happened almost 40 years ago, in 1982-1983.
Software Zen: delete this;
|
|
|
|
|
Well, that is a new one...
I just opened a C# project after a week and the contents of some of the .cs files has somehow been replaced with MetadataAsSource contents. It looks like they are from a completely separate project too. Fnu, but backups FTW
|
|
|
|
|
My primary development laptop has decided to start tossing BSODs which is unacceptable. I'll accept that Microsoft might just crash if I get too happy with plugging stuff in and out, etc, but this in the middle of just typing. This laptop is a re-branded Clevo and has always had driver issues. The fact that Microsoft insists on wanting to install bad drivers is beside the point. So far the errors have been:
- MEMORY_MANAGEMENT
- system_thread_exception_not_handled
- faulty_hardware_corrupted_page (new one for me)
- critical_structure_corruption
Researching, almost all of the reference is to bad memory. So, over the weekend, I fired up memtest86 to soak test the RAM. A dozen passes, no RAM errors.
Question 1) Using RAM test tools, have you ever found a bad RAM? Replaced it and all was well?
So I just searched my records for how old this machine is, and I'm pushing almost 5 years (within a couple of months). Me thinks its time to start shopping.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Yes, many times, as a tech back in the day.
I've had bad RAM, brand new, out of the box, as recent as a a couple years ago.
|
|
|
|
|
Interesting. How did you detect it? Swap out modules or run something like memtest86?
This last crash at 7:13 this morning mentioned something about a chrome.sys driver. This crash happened when I launched chrome.
Quite oddly, google returns no info about this file.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Swap modules.
RAM testing tools really don't find intermittent faults. They're good for finding solid faults though, which are surprisingly rare in my experience.
|
|
|
|
|
just swapped the modules. I have 64GB of ram in this unit. The crash seems to happen when I have a number of VMs running. This would certainly push the ram usage up.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
If it happens relatively consistently when pushing memory to its limit, take them all out. Try to reproduce it again with a single module still in it. If it doesn't happen, take it out and replace it with one of the other ones, and try again. With luck, you might be able to narrow it down to the one faulty module.
Even if you find one, keep going until you've gone over all of them.
Once you're pretty confident you've found which is faulty, add the others by themselves. Then re-add the bad one. The idea is that you keep trying until you're very confident you've isolated it.
It's a time-consuming process, but might be worth it in the end.
|
|
|
|
|
(obligatory it works on my computer).
Never had issues with solid state hardware (motherboard, cpu , memory, ssd, gpu... )
Most/All of the time it was with hard-drives starting to have bad sectors.
It's your work computer, I'd start looking to change it now and hope you can find something that is not too backorder.
5 years is not that long, but you should be able to find something shiny to replace it.
good luck and do backups.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
This can easily happen if RAM got fragmented from too many allocations and deallocations. Usually best solution in this case is to increase size of your page swap file. Should be 4 times of physical memory (make sure the value is in the power of 2).
|
|
|
|