Comença a funcionar
This commit is contained in:
31
main.cpp
31
main.cpp
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user