[patinho] indentation / comments cleanup

This commit is contained in:
Felipe Corrêa da Silva Sanches 2015-11-30 15:03:56 -02:00
parent 864f32d774
commit f387764de1
3 changed files with 31 additions and 28 deletions

View File

@ -46,7 +46,7 @@ static ADDRESS_MAP_START(prog_8bit, AS_PROGRAM, 8, patinho_feio_cpu_device)
ADDRESS_MAP_END ADDRESS_MAP_END
patinho_feio_cpu_device::patinho_feio_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) patinho_feio_cpu_device::patinho_feio_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: cpu_device(mconfig, PATINHO_FEIO, "PATINHO FEIO", tag, owner, clock, "patinho_feio_cpu", __FILE__), : cpu_device(mconfig, PATINHO_FEIO, "PATINHO FEIO", tag, owner, clock, "patinho_feio_cpu", __FILE__),
m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(prog_8bit)), m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(prog_8bit)),
m_icount(0) m_icount(0)
{ {
@ -56,11 +56,11 @@ void patinho_feio_cpu_device::device_start()
{ {
m_program = &space(AS_PROGRAM); m_program = &space(AS_PROGRAM);
save_item(NAME(m_pc)); save_item(NAME(m_pc));
save_item(NAME(m_acc)); save_item(NAME(m_acc));
// Register state for debugger // Register state for debugger
state_add( PATINHO_FEIO_CI, "CI", m_pc ).mask(0xFFF); state_add( PATINHO_FEIO_CI, "CI", m_pc ).mask(0xFFF);
state_add( PATINHO_FEIO_ACC, "ACC", m_acc ).mask(0xFF); state_add( PATINHO_FEIO_ACC, "ACC", m_acc ).mask(0xFF);
state_add( PATINHO_FEIO_IDX, "IDX", m_idx ).mask(0xFF); state_add( PATINHO_FEIO_IDX, "IDX", m_idx ).mask(0xFF);
state_add(STATE_GENPC, "GENPC", m_pc).formatstr("0%06O").noshow(); state_add(STATE_GENPC, "GENPC", m_pc).formatstr("0%06O").noshow();
@ -90,16 +90,16 @@ void patinho_feio_cpu_device::device_reset()
/* execute instructions on this CPU until icount expires */ /* execute instructions on this CPU until icount expires */
void patinho_feio_cpu_device::execute_run() void patinho_feio_cpu_device::execute_run()
{ {
do do
{ {
if ((! m_run)){ if ((! m_run)){
m_icount = 0; /* if processor is stopped, just burn cycles */ m_icount = 0; /* if processor is stopped, just burn cycles */
} else { } else {
execute_instruction(); execute_instruction();
m_icount --; m_icount --;
} }
} }
while (m_icount > 0); while (m_icount > 0);
} }
/* execute one instruction */ /* execute one instruction */
@ -389,7 +389,7 @@ void patinho_feio_cpu_device::execute_instruction()
offs_t patinho_feio_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) offs_t patinho_feio_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
{ {
extern CPU_DISASSEMBLE( patinho_feio ); extern CPU_DISASSEMBLE( patinho_feio );
return CPU_DISASSEMBLE_NAME(patinho_feio)(this, buffer, pc, oprom, opram, options); return CPU_DISASSEMBLE_NAME(patinho_feio)(this, buffer, pc, oprom, opram, options);
} }

View File

@ -8,7 +8,7 @@
/* register IDs */ /* register IDs */
enum enum
{ {
PATINHO_FEIO_CI=1, PATINHO_FEIO_ACC, PATINHO_FEIO_IDX PATINHO_FEIO_CI=1, PATINHO_FEIO_ACC, PATINHO_FEIO_IDX
}; };
enum { enum {
@ -19,23 +19,26 @@ enum {
class patinho_feio_cpu_device : public cpu_device class patinho_feio_cpu_device : public cpu_device
{ {
public: public:
// construction/destruction // construction/destruction
patinho_feio_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock); patinho_feio_cpu_device(const machine_config &mconfig, const char *_tag, device_t *_owner, UINT32 _clock);
protected: protected:
virtual void execute_run(); virtual void execute_run();
virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
address_space_config m_program_config; address_space_config m_program_config;
/* processor registers */ /* processor registers */
unsigned char m_acc; /* accumulator (8 bits) */ unsigned char m_acc; /* accumulator (8 bits) */
unsigned int m_pc; /* program counter (12 bits) unsigned int m_pc; /* program counter (12 bits)
(CI stands for "Contador de Instrucao") */ * Actual register name is CI, which
* stands for "Contador de Instrucao"
* or "instructions counter".
*/
unsigned char m_idx; unsigned char m_idx;
/* processor state flip-flops */ /* processor state flip-flops */
bool m_run; /* processor is running */ bool m_run; /* processor is running */
bool m_wait_for_interrupt; bool m_wait_for_interrupt;
bool m_interrupts_enabled; bool m_interrupts_enabled;
bool m_scheduled_IND_bit_reset; bool m_scheduled_IND_bit_reset;
@ -49,7 +52,7 @@ protected:
bool m_device_is_ok[16]; bool m_device_is_ok[16];
bool m_IRQ_request[16]; bool m_IRQ_request[16];
int m_address_mask; /* address mask */ int m_address_mask; /* address mask */
int m_icount; int m_icount;
address_space *m_program; address_space *m_program;

View File

@ -5,10 +5,10 @@
CPU_DISASSEMBLE( patinho_feio ) CPU_DISASSEMBLE( patinho_feio )
{ {
int addr, value, n, f; int addr, value, n, f;
switch (oprom[0] & 0xF0) switch (oprom[0] & 0xF0)
{ {
case 0x00: case 0x00:
//PLA = "Pula": Unconditionally JUMP to effective address //PLA = "Pula": Unconditionally JUMP to effective address
addr = (oprom[0] & 0x0F) << 8 | oprom[1]; addr = (oprom[0] & 0x0F) << 8 | oprom[1];
@ -144,7 +144,7 @@ CPU_DISASSEMBLE( patinho_feio )
addr = (oprom[0] & 0x0F) << 8 | oprom[1]; addr = (oprom[0] & 0x0F) << 8 | oprom[1];
sprintf (buffer, "PUG /%03X", addr); sprintf (buffer, "PUG /%03X", addr);
return 2; return 2;
} }
sprintf (buffer, "illegal instruction"); sprintf (buffer, "illegal instruction");
return 1; return 1;
} }