Design initial hardware / memory map
I've started the hardware design on the wiki https://github.com/lefticus/arm_thing/wiki/Memory-Map
Soliciting comments if you have any, @mattgodbolt and @jonathandturner
Just my gut feeling, but I would suspect that the XYZ and RUV axis would have padding between them. I.e.:
0xA0100: 8bit joy 0 X axis0xA0101: 8bit joy 0 Y axis0xA0102: 8bit joy 0 Z axis0xA0104: 8bit joy 0 R axis0xA0105:8bit joy 0 U axis0xA0106:8bit joy 0 V axis
Reason being that you'd have better alignment, reserved space for an additional register and would have then something like #define JOY0_XYZ (Joy_XYZ_t*)0xA0100 in the periph lib.
@klemens-morgenstern makes a valid point that there's no reason to be overly stingy with the address space on a 32 bit architecture. OTOH, you're never going to see a #define with a c-style cast in my example code for using this system.
Hopefully not - this is one of the most evil kinds of defines. I'm just going by how that would look on something like an stm32 controller. Also you might wanna save a status-byte for later developments. E.g. indicating an axis is turned off or what have you.
Echoing Klemens's comments; I was surprised to see hardware on non-32-bit addresses. As I understand it most "real" hardware doesn't like being read from (usually reading and/or writing has side effects other than just storing data). Some of the things you've put are only 16-bit -- IIRC half-word stores only came in with the StrongARM :) Does your emulation support STRH and LDRH? If not, the compiler will have to emit a 32-bit read, modify, and the write it back. I guess I could check :P
Of course, most of the things here are "really" packed 32-bit values.e.g. 0xa0000 and 0xa0002 is really 0xa0000 -32 bit - |WWWWHHHH|, right?
Some thoughts, what about vblank and so on? :) Reading the "current" line being rasterised, generating interrupts...lots of cool things to think about :)
What units are the aspect in? What about the refresh rate?
Keyboards are tricky to do without interrupts too; most keyboard controllers require some programmatic reading to find the (multiple) keys being pressed. I can bore you about how the beeb did it, and I think modern keyboards use the same kind of thing, except they do the programmed reading in the keyboard controller, whicih then sends keydown and keyup events as USB events. Or something...
On Tue, Apr 24, 2018 at 5:00 PM Klemens Morgenstern < [email protected]> wrote:
Hopefully not - this is one of the most evil kinds of defines. I'm just going by how that would look on something like an stm32 controller. Also you might wanna save a status-byte for later developments. E.g. indicating an axis is turned off or what have you.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lefticus/arm_thing/issues/1#issuecomment-384093999, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmsdRQCM-Zq-58JQ7b_mVS6I90QGw-eks5tr6CJgaJpZM4TicFK .