I have some questions about memory-mapping. I know nothing about all this, so bear with me ... You write a byte to addresses $4001 or $4002 result in writing a number or a character on the screen ... Does this happen immediately? When? How often? Why doesn't the CPU keep writing the same character / number stored in those addresses ...? Or is my understanding wrong? Does the system "know" when a new value has been stored on an address and "react" (?) only once? Thanks in advance!
My understanding (which is severely lacking compared to actual hardware experts) is that real hardware essentially acts as a state machine. Writing to addresses mapped to the hardware can trigger this state machine, when it's in the correct state, to begin an operation and to move along in states, so that it will complete an operation once when the correct number of write operations are performed. You can think of these addresses as hardware registers that are monitored for changes.
In terms of my implementation for this project, I have the hardware designed as plugin objects that have onRead and onWrite methods. When the plugins are registered, the addresses they want monitored for reading and the addresses they want monitored for writing, are transferred to the main program/class. Memory access triggers the correct methods for the correct hardware.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have some questions about memory-mapping. I know nothing about all this, so bear with me ... You write a byte to addresses $4001 or $4002 result in writing a number or a character on the screen ... Does this happen immediately? When? How often? Why doesn't the CPU keep writing the same character / number stored in those addresses ...? Or is my understanding wrong? Does the system "know" when a new value has been stored on an address and "react" (?) only once? Thanks in advance!
My understanding (which is severely lacking compared to actual hardware experts) is that real hardware essentially acts as a state machine. Writing to addresses mapped to the hardware can trigger this state machine, when it's in the correct state, to begin an operation and to move along in states, so that it will complete an operation once when the correct number of write operations are performed. You can think of these addresses as hardware registers that are monitored for changes.
In terms of my implementation for this project, I have the hardware designed as plugin objects that have
onReadandonWritemethods. When the plugins are registered, the addresses they want monitored for reading and the addresses they want monitored for writing, are transferred to the main program/class. Memory access triggers the correct methods for the correct hardware.