The serial_transfer loader, as long as the target program voluntarily terminates itself at some point, is able to load multiple programs consecutively without requiring a physical power cycle to reload the transfer program from CD. The current example.mk juggles between two different "memory layouts", one for "burn to a physical CD" and another for "load via serial cable". Because the serial_transfer program now relocates itself to the end of system memory, this means the 0x8c010000 area is now usable by programs that are loaded by serial_transfer.
25 lines
431 B
C++
25 lines
431 B
C++
#include <cstdint>
|
|
|
|
#include "sh7091/sh7091.hpp"
|
|
#include "sh7091/sh7091_bits.hpp"
|
|
#include "sh7091/serial.hpp"
|
|
|
|
#include "serial_load.hpp"
|
|
|
|
void main() __attribute__((section(".text.main")));
|
|
|
|
void main()
|
|
{
|
|
//serial::init(12);
|
|
load_init();
|
|
|
|
while (1) {
|
|
using namespace scif;
|
|
|
|
while ((scfdr2::receive_data_bytes(sh7091.SCIF.SCFDR2)) > 0) {
|
|
const uint8_t c = sh7091.SCIF.SCFRDR2;
|
|
load_recv(c);
|
|
}
|
|
}
|
|
}
|