add sram interface

This commit is contained in:
optixx 2009-10-19 16:57:53 +02:00
parent 3c39e11784
commit 05bb485495

View File

@ -21,9 +21,17 @@
#include "neginf/neginf.h" #include "neginf/neginf.h"
#include "inflate.h" #include "inflate.h"
#include "sram.h"
char inflate_done = 0; char inflate_done = 0;
void inflate_init(){
neginf_init(0);
sram_bulk_write_start(0x000000);
}
void neginf_cb_completed() void neginf_cb_completed()
{ {
inflate_done = 1; inflate_done = 1;
@ -31,10 +39,28 @@ void neginf_cb_completed()
void neginf_cb_seq_byte(nbyte byte) void neginf_cb_seq_byte(nbyte byte)
{ {
// TODO: implement this sram_bulk_write(byte);
} }
uint8_t buffer[512];
void neginf_cb_copy(nsize from, nsize to, nint length) void neginf_cb_copy(nsize from, nsize to, nint length)
{ {
// TODO: implement this uint32_t addr;
uint8_t c;
/*
sram_bulk_addr_save();
for (addr=from; addr<from+length; addr++){
c = sram_read(addr);
sram_write(addr,c);
}
sram_bulk_addr_restore();
*/
sram_bulk_addr_save();
sram_bulk_copy_into_buffer(from, buffer, length);
sram_bulk_copy_from_buffer(to, buffer, length);
sram_bulk_addr_restore();
} }