o cleanup
o refactor debug function o add ifeq platform to makefile o get crc working on bank 0
This commit is contained in:
@@ -5,20 +5,18 @@
|
||||
#include "ressource.h";
|
||||
#include "PPU.h"
|
||||
#include "debug.h"
|
||||
#include "crc.h"
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
padStatus pad1;
|
||||
|
||||
event *currentScrollEvent;
|
||||
word scrollValue;
|
||||
|
||||
void initInternalRegisters(void) {
|
||||
characterLocation[0] = 0x0000;
|
||||
characterLocation[1] = 0x0000;
|
||||
characterLocation[2] = 0x0000;
|
||||
characterLocation[3] = 0x0000;
|
||||
|
||||
initDebugMap();
|
||||
}
|
||||
|
||||
@@ -28,38 +26,42 @@ void preInit(void) {
|
||||
}
|
||||
|
||||
void main(void) {
|
||||
word i,j;
|
||||
word crc01;
|
||||
word crc02;
|
||||
padStatus pad1;
|
||||
char line_header[32] = "BANK CRC 123456789ABCDEF";
|
||||
char line[32] = " ";
|
||||
char test_buffer[] = "da";
|
||||
char *pointer;
|
||||
|
||||
initInternalRegisters();
|
||||
|
||||
// Screen map data @ VRAM location $1000
|
||||
setTileMapLocation(0x1000, (byte) 0x00, (byte) 0);
|
||||
//*(byte*) 0x2107 = 0x10;
|
||||
|
||||
// Plane 0 Tile graphics @ $2000
|
||||
setCharacterLocation(0x2000, (byte) 0);
|
||||
//*(byte*) 0x210b = 0x02;
|
||||
|
||||
//VRAMLoad((word) title_pic, 0x2000, 0x1BE0);
|
||||
//VRAMLoad((word) title_map, 0x1000, 0x0800);
|
||||
CGRAMLoad((word) title_pal, (byte) 0x00, (word) 256);
|
||||
|
||||
// TODO sitwch to mode 0 for trying
|
||||
*(byte*) 0x2105 = 0x01; // MODE 1 value
|
||||
|
||||
*(byte*) 0x212c = 0x01; // Plane 0 (bit one) enable register
|
||||
*(byte*) 0x212d = 0x00; // All subPlane disable
|
||||
|
||||
*(byte*) 0x2100 = 0x0f; // enable background
|
||||
|
||||
currentScrollEvent = NULL;
|
||||
scrollValue = 0;
|
||||
enableDebugScreen();
|
||||
|
||||
//initEvents();
|
||||
//enablePad();
|
||||
debug();
|
||||
//addEvent(&NMIReadPad, 1);
|
||||
|
||||
// Loop forever
|
||||
writeln(line_header,0);
|
||||
|
||||
while(1){
|
||||
pointer = (void*)0x8000;
|
||||
crc02 = crc_update(test_buffer,2);
|
||||
//crc01 = crc_update(pointer,255);
|
||||
for(j=0; j<8; j++) {
|
||||
crc01 = crc_update(pointer,0x8000);
|
||||
int2hex(j,&line[0]);
|
||||
int2hex(crc01,&line[5]);
|
||||
//int2hex((word)pointer,&line[10]);
|
||||
writeln(line,j+1);
|
||||
}
|
||||
while(!pad1.start) {
|
||||
waitForVBlank();
|
||||
pad1 = readPad((byte) 0);
|
||||
}
|
||||
}
|
||||
while(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user