1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-27 16:31:31 +00:00

Switches to standard logging.

This commit is contained in:
Thomas Harte 2019-12-23 22:00:40 -05:00
parent afae1443b4
commit b2bed82da6

View File

@ -8,6 +8,9 @@
#include "DMAController.hpp" #include "DMAController.hpp"
#define LOG_PREFIX "[DMA] "
#include "../../../Outputs/Log.hpp"
#include <cstdio> #include <cstdio>
using namespace Atari::ST; using namespace Atari::ST;
@ -187,11 +190,11 @@ int DMAController::bus_grant(uint16_t *ram, size_t size) {
// Check that the older buffer is full; stop if not. // Check that the older buffer is full; stop if not.
if(!buffer_[active_buffer_ ^ 1].is_full) return 0; if(!buffer_[active_buffer_ ^ 1].is_full) return 0;
printf("[1], to %06x: ", address_); #define b(i, n) " " << PADHEX(2) << buffer_[i].contents[n]
for(int c = 0; c < 16; ++c) { #define b2(i, n) b(i, n) << b(i, n+1)
printf("%02x ", buffer_[active_buffer_ ^ 1].contents[c]); #define b4(i, n) b2(i, n) << b2(i, n+2)
} #define b16(i) b4(i, 0) << b4(i, 4) << b4(i, 8) << b4(i, 12)
printf("\n"); LOG("[1] to " << PADHEX(6) << address_ << b16(active_buffer_ ^ 1));
for(int c = 0; c < 8; ++c) { for(int c = 0; c < 8; ++c) {
if(size_t(address_) < size) { if(size_t(address_) < size) {
@ -207,11 +210,11 @@ int DMAController::bus_grant(uint16_t *ram, size_t size) {
// Check that the newer buffer is full; stop if not. // Check that the newer buffer is full; stop if not.
if(!buffer_[active_buffer_ ].is_full) return 8; if(!buffer_[active_buffer_ ].is_full) return 8;
printf("[2], to %06x: ", address_); LOG("[2] to " << PADHEX(6) << address_ << b16(active_buffer_));
for(int c = 0; c < 16; ++c) { #undef b16
printf("%02x ", buffer_[active_buffer_].contents[c]); #undef b4
} #undef b2
printf("\n"); #undef b
for(int c = 0; c < 8; ++c) { for(int c = 0; c < 8; ++c) {
if(size_t(address_) < size) { if(size_t(address_) < size) {