Comença a funcionar

This commit is contained in:
2024-04-09 14:30:47 +02:00
parent 84fdb68a70
commit d1982fc8b5
5 changed files with 183 additions and 14 deletions

View File

@@ -1,14 +1,41 @@
#include <stdint.h>
#include <stdio.h>
#include <z80.h>
#include "z80.h"
#include "z80dis.h"
uint8_t memory[65536];
uint32_t t = 0;
int ula_in()
{
return 0;
}
void ula_out(int val)
{
}
int main(int argc, char *argv[])
{
const char *peiv = "HOLA %s\n";
printf(peiv, "mundo");
FILE* f = fopen("48.rom", "rb");
fread(memory, 1024, 48, f);
fread(memory, 1024, 16, f);
fclose(f);
z80::reset(memory);
z80::connect_port(0xfe, ula_in, ula_out);
bool should_exit = false;
while(!should_exit)
{
uint16_t PC = z80::getPC();
printf("[%04x] %s", PC, z80dis::getAsm(&memory[PC]));
t += z80::step();
getchar();
}
return 0;
}