/* One start -----------------------------------------------------------------*/ static void startup() { unsigned char err = 0; init_hardware(); dbg_init(); dbg_print_app_ver(); crc32_init(); pins_init(); //spi0_init(); // used in m25pexx.c (FLASH) spi1_init(); adc_init(); err = memory_init(); // memory initialization, external EEPROM (used in pref.c, orion.c), external FLASH, internal FLASH if (err) goto err; pref_init(); ds1390_init(); evt_fifo_init(); GPS_init(); //SIM900_init(); light_init(); saveDatePorojectIP();//новые параметры связи vpu_init(); /*VPU start*/ //Init_USB(); //if (PROJ.jornal.power_on) //Event_Push_Str("СТАРТ"); return; err: Err_led(err); }
int main(int argc, char* argv[]) { int i,j = 0; unsigned int frame = 0; char *rom_file = NULL; int rom_size = 0; double z80_cycles = 0; if (argc < 2) { fprintf(stderr, "Usage: %s ROM_FILE\n", argv[0]); return 1; } rom_file = argv[1]; memory_init(); rom_size = memory_load(rom_file); if (rom_size < 0) { fprintf(stderr, "Couldn't read ROM file %s\n", rom_file); return 1; } printf("Read ROM %s (%d bytes)\n", rom_file, rom_size); io_init(); video_init(); input_init(); vpu_init(); Z80Reset(&z80_state); z80_state.pc = 0; while (input_quit() == 0) { z80_cycles += Z80Emulate(&z80_state, Z80_CYCLES_PER_STEP); vpu_draw_screen(); video_flip(); video_wait_frame(); input_process(); Z80NonMaskableInterrupt (&z80_state); frame++; } printf("Ran %d frames and %f Z80 cycles.\n", frame, z80_cycles); return 0; }