int_fast8_t verbosity = 0;
uint8_t default_stages;
uint32_t val;
- ERRNUM res = ESUCCESS;
/* get default values */
memcpy_P(&boot_param, cfboot, sizeof boot_param);
default_stages = boot_param.stages;
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("vna:s:c:t:i:"))) != -1) {
switch (opt) {
uint32_t addr;
bool hold = 0;
- /* reset getopt() */
- optind = 0;
-
int opt;
while ((opt = getopt(argc, argv, PSTR("h"))) != -1) {
switch (opt) {
}
if (z80_bus_state() & ZST_RUNNING) {
- printf_P(PSTR("CPU already running!\n"));
- return CMD_RET_FAILURE;
+ cmd_error(CMD_RET_FAILURE, ERUNNING, NULL);
}
printf_P(PSTR("Starting application at 0x%04lx ...\n"), addr);
if (addr != 0) {
- uint8_t tmp[3];
+// uint8_t tmp[3];
- z80_bus_cmd(Request);
- z80_read_block (tmp, 0, 3);
+ z80_bus_request_or_exit();
+// z80_read_block (tmp, 0, 3);
z80_write(0, 0xc3);
z80_write(1, addr);
z80_write(2, (addr >> 8));
+ z80_bus_cmd(Release);
+ _delay_ms(100);
z80_bus_cmd(Run);
- _delay_us(10);
- z80_bus_cmd(M_Cycle);
- _delay_us(10);
- z80_bus_cmd(M_Cycle);
- _delay_us(10);
- z80_write_block(tmp, 0, 3);
+// z80_write_block(tmp, 0, 3);
} else {
if (!hold)
z80_bus_cmd(Request);