Search
lxdream.org :: lxdream/test/lib.h
lxdream 0.9.1
released Jun 29
Download Now
filename test/lib.h
changeset 190:f7653df5e832
prev185:6755a04c447f
next210:c356f597c896
author nkeynes
date Sat Aug 05 00:18:21 2006 +0000 (16 years ago)
permissions -rw-r--r--
last change Add error lines to tests with incomplete polys
Split clip tests to separate data file
Add tests for cmd bit 23 ("use list size field")
view annotate diff log raw
     1 #ifndef dc_lib_H
     2 #define dc_lib_H
     4 #include <stdio.h>
     6 typedef unsigned char uint8_t;
     7 typedef unsigned short uint16_t;
     8 typedef unsigned int uint32_t;
     9 typedef volatile unsigned int vuint32_t;
    10 typedef volatile unsigned short vuint16_t;
    12 #define ASIC_STATUS0    0xA05F6900
    13 #define ASIC_STATUS1    0xA05F6904
    14 #define ASIC_STATUS2    0xA05F6908
    15 #define ASIC_IRQB0      0xA05F6920
    16 #define ASIC_IRQC2      0xA05f6938
    17 #define IRQB0_MASK      0x0007B000
    19 #define long_read(A)      (*((volatile unsigned long*)(A)))
    20 #define long_write(A, V) ( (*((volatile unsigned long*)(A))) = (V) )
    21 #define word_read(A)      (*((volatile unsigned short*)(A)))
    22 #define word_write(A, V) ( (*((volatile unsigned short*)(A))) = (V) )
    23 #define byte_read(A)       (unsigned int)(*((volatile unsigned char*)(A)))
    24 #define byte_write(A, V) ( (*((volatile unsigned char*)(A))) = (V) )
    26 int asic_wait(int event);
    27 void asic_clear(void);
    28 void asic_dump(FILE *f);
    30 void fwrite_dump(FILE *f, char *buf, int length);
    31 void fwrite_diff(FILE *f, char *expect, int exp_length, char *buf, int length);
    32 void fwrite_diff32(FILE *f, char *expect, int exp_length, char *buf, int length);
    34 void *align32(char *buf );
    35 void write_asic_status(void);
    36 void reset_asic_status(void);
    37 void g2_fifo_wait( void );
    39 void spu_memload( uint32_t dst, const void *src, int length );
    40 void spu_memread( void *dst, uint32_t src, int length );
    41 void dump_spu_memory( unsigned int from, int length );
    43 struct spudma_struct {
    44     uint32_t g2_addr;
    45     uint32_t sh4_addr;
    46     uint32_t count;
    47     uint32_t direction;
    48     uint32_t mode;
    49     uint32_t enable;
    50     uint32_t status;
    51     uint32_t blah;
    52 };
    53 extern struct spudma_struct *spudma;
    55 #define get_asic_status() (long_read(ASIC_STATUS0)&EVENT_MAPLE_MASK)
    57 int is_start_pressed();
    59 #define CHECK_IEQUALS( a, b ) if( a != b ) { fprintf(stderr, "Assertion failed at %s:%d: expected %08X, but was %08X\n", __FILE__, __LINE__, a, b ); return -1; }
    61 #endif
.