- [NEW] Afegits varios documents útils recopilats.
- [NEW] Afegida la rom de Combat. - [NEW] Afegit mòdul "rom" - [NEW] Ampliats stubs de "mem", "tia" i "pia"
This commit is contained in:
1 parent
421826d4b6
commit
22fd027cff
18 files changed
+3768
-1
No files matched your search
@@ -0,0 +1,74 @@
|
||||
#include "pia.h"
|
||||
|
||||
namespace pia
|
||||
{
|
||||
uint8_t ram[128];
|
||||
uint8_t INTIM;
|
||||
uint8_t TIMINT;
|
||||
|
||||
void reset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void tick()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
uint8_t read(uint16_t address)
|
||||
{
|
||||
if (address & 0x200) {
|
||||
if ( (address & 0x04) ) {
|
||||
// Timer functions
|
||||
if (address & 0x01) {
|
||||
uint8_t flags = TIMINT;
|
||||
TIMINT &= ~0x80; // resetejem el flag
|
||||
return flags;
|
||||
} else {
|
||||
return INTIM;
|
||||
}
|
||||
} else {
|
||||
// I/O Ports
|
||||
switch( address & 0x03) {
|
||||
case 0x00: // [TODO] SWCHA
|
||||
case 0x01: // [TODO] DDRA
|
||||
case 0x02: // [TODO] SWCHB
|
||||
case 0x03: // [TODO] DDRB
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return ram[address & 0x7f];
|
||||
}
|
||||
}
|
||||
|
||||
void write(uint16_t address, uint8_t value)
|
||||
{
|
||||
if (address & 0x200) {
|
||||
if ( (address & 0x04) ) {
|
||||
if ( (address & 0x10) ) {
|
||||
// Timer functions
|
||||
switch( address & 0x03) {
|
||||
case 0x00: // [TODO] TIM1T
|
||||
case 0x01: // [TODO] TIM8T
|
||||
case 0x02: // [TODO] TIM64T
|
||||
case 0x03: // [TODO] TIM1024T
|
||||
}
|
||||
} else {
|
||||
// Funcionalitat relacionada amb les interrupcions. Ignorar per a la Atari 2600
|
||||
}
|
||||
} else {
|
||||
// I/O Ports
|
||||
switch( address & 0x03) {
|
||||
case 0x00: // [TODO] SWCHA
|
||||
case 0x01: // [TODO] DDRA
|
||||
case 0x02: // [TODO] SWCHB
|
||||
case 0x03: // [TODO] DDRB
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ram[address & 0x7f] = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user