1
General Discussion / Name that tune!
« on: August 25, 2012, 12:03:31 pm »
I've spent the last 4 years trying to figure out what the music playing in this video is. Does anyone happen to know? It's a long shot, but maybe someone knows.
June 19, 2013, 07:45:55 am
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
) and I'm wondering if anyone uses it for their romhacking projects? I know I'm definitely going to be using some sort of revision control from here on. Not looking for suggestions or anything. I just wanna see what people are doing.
*__ops[i](); bool M68K_Opcode::assemble()
{
const unsigned int OPCODE_COUNT = 71;
//A sort of jump table to the code generating functions
void (M68K_Opcode::*__ops[OPCODE_COUNT])(void) =
{
&M68K_Opcode::abcd, &M68K_Opcode::adda, &M68K_Opcode::addi,
&M68K_Opcode::addq, &M68K_Opcode::addx, &M68K_Opcode::add,
&M68K_Opcode::andi, &M68K_Opcode::and, &M68K_Opcode::asl,
&M68K_Opcode::asr, &M68K_Opcode::bchg, &M68K_Opcode::bclr,
&M68K_Opcode::bra, &M68K_Opcode::bset, &M68K_Opcode::bsr,
&M68K_Opcode::btst, &M68K_Opcode::chk, &M68K_Opcode::clr,
&M68K_Opcode::cmpa, &M68K_Opcode::cmpi, &M68K_Opcode::cmpm,
&M68K_Opcode::cmp, &M68K_Opcode::divs, &M68K_Opcode::divu,
&M68K_Opcode::eori, &M68K_Opcode::eor, &M68K_Opcode::exg,
&M68K_Opcode::ext, &M68K_Opcode::jmp, &M68K_Opcode::jsr,
&M68K_Opcode::lea, &M68K_Opcode::link, &M68K_Opcode::lsl,
&M68K_Opcode::lsr, &M68K_Opcode::movea, &M68K_Opcode::movem,
&M68K_Opcode::movep, &M68K_Opcode::moveq, &M68K_Opcode::move,
&M68K_Opcode::muls, &M68K_Opcode::mulu, &M68K_Opcode::nbcd,
&M68K_Opcode::neg, &M68K_Opcode::negx, &M68K_Opcode::nop,
&M68K_Opcode::not, &M68K_Opcode::ori, &M68K_Opcode::or,
&M68K_Opcode::pea, &M68K_Opcode::reset, &M68K_Opcode::rol,
&M68K_Opcode::ror, &M68K_Opcode::roxl, &M68K_Opcode::roxr,
&M68K_Opcode::rte, &M68K_Opcode::rtr, &M68K_Opcode::rts,
&M68K_Opcode::sbcd, &M68K_Opcode::stop, &M68K_Opcode::suba,
&M68K_Opcode::subi, &M68K_Opcode::subq, &M68K_Opcode::subx,
&M68K_Opcode::sub, &M68K_Opcode::swap, &M68K_Opcode::tas,
&M68K_Opcode::trapv ,&M68K_Opcode::trap, &M68K_Opcode::tst,
&M68K_Opcode::unlk, &M68K_Opcode::illegal
};
//instruction opcodes:
//these are used as indexes to call the correct function from __ops[]
char __ops_indexes[OPCODE_COUNT][8] =
{
"abcd", "adda", "addi", "addq", "addx", "add", "andi", //7
"and", "asl", "asr", "bchg", "bclr", "bra", "bset", //14
"bsr", "btst", "chk", "clr", "cmpa", "cmpi", "cmpm", //21
"cmp", "divs", "divu", "eori", "eor", "exg", "ext", //28
"jmp", "jsr", "lea", "link", "lsl", "lsr", "movea", //35
"movem","movep","moveq","move", "muls", "mulu", "nbcd", //42
"neg", "negx", "nop", "not", "ori", "or", "pea", //49
"reset","rol", "ror", "roxl", "roxr", "rte", "rtr", //56
"rts", "sbcd", "stop", "suba", "subi", "subq", "subx", //63
"sub", "swap", "tas", "trapv","trap", "tst", "unlk", //70
"illegal"
};
bool success = true; //set to false if an error occurs
string mnemonic = opcode; //this will equal opcode with the size field removed
//first check the size field
set_size();
if(opsize != NONE && opsize != INVALID)
{
//remove the size field
int pos = opcode.find('.');
//we can assume that if an error wasn't flagged by set_size()
//then a '.' is present in the opcode
mnemonic.erase(pos);
}
//next use the mnemonic to determine which opcode function to call
if(opsize != INVALID)
{
//first convert all upper-case letters to lower-case
for(unsigned int i = 0; i < mnemonic.length(); i++)
{
if(mnemonic[i] >= 'A' && mnemonic[i] <= 'Z')
{
//ASCII upper-case letters are 0x20 more than their
//lower-case equivalent
mnemonic[i] += 0x20;
}
}
//next use the mnemonic as an index and call the code generating function
for(unsigned int i = 0; i < OPCODE_COUNT; i++)
{
if(!mnemonic.compare(__ops_indexes[i]))
{
//call the appropriate function and generate binary data
*__ops[i]();
}
}
}
return success;
}
void exg();
void lea();
void link();
void move();
list<int> int_list;
for(int i = 0; i < 5; i++)
{
int_list.push_back(i + 100);
}

;===============================;
;dma_char ;
;===============================;
;This routine DMA's the last ;
;8x16 character drawn in the ram;
;buffer to VRAM. ;
;===============================;
print "dma_char @ ",pc
dma_char:
php
rep #$20
lda !ram_index ;determine the location of the 8x16 to DMA
asl #4
pha
clc ;the location in vram to put the 8x16
adc #$2000
sta $2116
lda #$1801
sta $4370
lda #$0020 ;two 8x8 2bpp tiles = $20 bytes
sta $4375
pla ;the location of the 8x16 in ram
asl
clc
adc #$6000
sta $4372
sep #$20
lda #$7e
sta $4374
wait_for_vblank:
lda $4212 ;check the vblank flag
and #$80
beq wait_for_vblank
lda #$80
sta $420b
plp
rts