Mercurial > repos > blastem
comparison vdp.c @ 63:a6dd5b7a971b
Add FPS counter to console output
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 19 Dec 2012 20:53:59 -0800 |
parents | a6a19c45d358 |
children | aef6302770c2 |
comparison
equal
deleted
inserted
replaced
62:b37cb596bc21 | 63:a6dd5b7a971b |
---|---|
890 { | 890 { |
891 //printf("control port write: %X\n", value); | 891 //printf("control port write: %X\n", value); |
892 if (context->flags & FLAG_PENDING) { | 892 if (context->flags & FLAG_PENDING) { |
893 context->address = (context->address & 0x3FFF) | (value << 14); | 893 context->address = (context->address & 0x3FFF) | (value << 14); |
894 context->cd = (context->cd & 0x3) | ((value >> 2) & 0x3C); | 894 context->cd = (context->cd & 0x3) | ((value >> 2) & 0x3C); |
895 if (context->cd & 0x30) { | |
896 puts("attempt to use DMA detected!"); | |
897 } | |
898 //printf("New Address: %X, New CD: %X\n", context->address, context->cd); | |
895 context->flags &= ~FLAG_PENDING; | 899 context->flags &= ~FLAG_PENDING; |
896 } else { | 900 } else { |
897 if ((value & 0xC000) == 0x8000) { | 901 if ((value & 0xC000) == 0x8000) { |
898 //Register write | 902 //Register write |
899 uint8_t reg = (value >> 8) & 0x1F; | 903 uint8_t reg = (value >> 8) & 0x1F; |
900 if (reg < VDP_REGS) { | 904 if (reg < VDP_REGS) { |
901 //printf("register %d set to %X\n", reg, value); | 905 //printf("register %d set to %X\n", reg, value & 0xFF); |
902 context->regs[reg] = value; | 906 context->regs[reg] = value; |
907 /*if (reg == REG_MODE_2) { | |
908 printf("Display is now %s\n", (context->regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled"); | |
909 }*/ | |
903 } | 910 } |
904 } else { | 911 } else { |
905 context->flags |= FLAG_PENDING; | 912 context->flags |= FLAG_PENDING; |
906 context->address = (context->address &0xC000) | (value & 0x3FFF); | 913 context->address = (context->address &0xC000) | (value & 0x3FFF); |
907 context->cd = (context->cd &0x3C) | (value >> 14); | 914 context->cd = (context->cd &0x3C) | (value >> 14); |