Play SPC Intrument

player->pause(1);
// backup_pc()
uint16_t *pc_ptr = (uint16_t*)&IAPURAM[report::last_pc];
uint16_t pc_backup = *pc_ptr;

// write with never-ending loop
#define ENDLESS_LOOP_OPCODE 0xfe2f
// overwrite_pc_with_endless_loop()
*pc_ptr = ENDLESS_LOOP_OPCODE;

player->pause(0);

// restore_pc()
uint16_t *pc_ptr = (uint16_t*)&IAPURAM[report::last_pc];
*pc_ptr = pc_backup;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s