Open RodrigoDornelles opened 2 years ago
struct tbc_package_link_st {
tbc_nametable_st package_ptr;
tbc_anyfunc_ut package_func;
};
struct tbc_package_st {
tbc_package_link_st package_id;
tbc_package_link_st package_funcs;
};
struct tbc_nametable_st {
void*(char*) put;
}
static const tbc_nametable_st = {
NULL
};
static const tbc_package_link_st tbc_package_empty[] = {
(tbc_package_st*) &tbc_nametable_st.put, NULL;
};
static const tbc_package_st[] = {
TBC_PACKAGE_EMPTY, tbc_package_empty,
}
#include "../src/3bc.h"
#include "../src/pkg/nes.h"
int main(int argc, char** argv)
{
uint8_t appid = app_3bc_temp_init();
app_3bc_package(appid, TBC_PKG_NES_DEFAULT, tbc_nes_pkg_joystick_input); /** register in pkg **/
app_3bc_package(appid, TBC_PKG_NES_DEFAULT, tbc_nes_pkg_fullscreen_output); /** register in pkg **/
app_3bc_install(appid, TBC_PKG_NES_DEFAULT); /** update name tables **/
app_3bc_package_flush(appid); /** clean list of packages */
while (app_3bc_running(appid)){
app_3bc_update(appid);
}
app_3bc_destroy(appid);
return 0;
}
enum ___tbc_name_e
typedef struct ___tbc_name_s tbc_name_st
union ___tbc_name_u {}
struct ___tbc_name_s {}
#define name ((type)value)
#include <3bc.h>
#include <3bc-pkg-cpp.h>
#include <3bc-pkg-serial/pkg-arduino.h>
#include <3bc-pkg-gpio/pkg-arduino.h>
uint8_t id_3bc;
const static char code[] = "7.0.2,4.0.3,4.0.188";
void setup()
{
app_3bc_install(NULL, pkg_arduino_gpio);
app_3bc_install(NULL, pkg_arduino_serial);
id_3bc = app_3bc_new();
app_3bc_set(id_3bc, TTY_SOURCE, TTY_ARDUINO_SERIAL, "19200");
app_3bc_set(id_3bc, TTY_SOURCE, TTY_FROM_BUFFER, code);
}
loop()
{
app_3bc_update(id_3bc);
}
-------------------------------------
tbc_class_t app (pkg_arduino_serial, pkg_arduino_gpio);
void setup ()
{
app.tty.output.baudrate(19600);
app.tty.source.load_buffer(code);
}
void loop()
{
app.update();
}
#include <3bc.h>
#include <3bc/pkg/pkg-nes.h>
static tbc_u8_t app;
static const tbc_u8_t prog[] = {
MODE, NILL, 0x02,
STRX, NILL, 0x03,
STRX, NILL, 0xBC
};
void main()
{
app = app_3bc_new();
app_3bc_install(app, pkg_nes_ram_512);
app_3bc_install(app, pkg_nes_prog_fixed_array);
app_3bc_install(app, pkg_nes_output_fullscreen);
app_3bc_set(app, TTY_SOURCE, TTY_BUFFER, prog);
for (;;) {
app_3bc_update(app);
wait_nmi();
}
}
Please Describe The Problem To Be Solved
an initial idea, of how to organize the structure of the virtual machine's source code to scale in support times and still maintain performance and compatibility.