diff options
Diffstat (limited to 'src/mame/machine/amstrad.cpp')
-rw-r--r-- | src/mame/machine/amstrad.cpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index 1cda012e914..611a2cbaf41 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -67,7 +67,7 @@ enum { // This is the sequence for unlocking the ASIC in the CPC+/GX4000 // These are outed to port &bc00, after syncing the lock by outing a non-zero value then a zero to &bc00 // To lock the ASIC again, repeat the sequence without the last &ee -static const UINT8 asic_unlock_seq[15] = +static const uint8_t asic_unlock_seq[15] = { 0xff, 0x77, 0xb3, 0x51, 0xa8, 0xd4, 0x62, 0x39, 0x9c, 0x46, 0x2b, 0x15, 0x8a, 0xcd, 0xee }; @@ -290,7 +290,7 @@ with different data and be able to select the other entries - not tested on a re and not supported by this driver */ PALETTE_INIT_MEMBER(amstrad_state,kccomp) { - const UINT8 *color_prom = memregion("proms")->base(); + const uint8_t *color_prom = memregion("proms")->base(); int i; color_prom = color_prom+0x018000; @@ -599,7 +599,7 @@ TIMER_CALLBACK_MEMBER(amstrad_state::amstrad_video_update_timer) } /* Set the new colour from the GateArray */ -void amstrad_state::amstrad_vh_update_colour(int PenIndex, UINT16 hw_colour_index) +void amstrad_state::amstrad_vh_update_colour(int PenIndex, uint16_t hw_colour_index) { if ( m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000 ) { @@ -622,7 +622,7 @@ void amstrad_state::amstrad_vh_update_colour(int PenIndex, UINT16 hw_colour_inde } -void amstrad_state::aleste_vh_update_colour(int PenIndex, UINT16 hw_colour_index) +void amstrad_state::aleste_vh_update_colour(int PenIndex, uint16_t hw_colour_index) { timer_set(attotime::from_usec(0), TIMER_VIDEO_UPDATE, 0); m_GateArray_render_colours[PenIndex] = hw_colour_index+32; @@ -653,7 +653,7 @@ void amstrad_state::amstrad_update_video() if ( m_gate_array.draw_p ) { - UINT32 cycles_passed = (now - m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); + uint32_t cycles_passed = (now - m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); while( cycles_passed ) { @@ -701,9 +701,9 @@ void amstrad_state::amstrad_update_video() void amstrad_state::amstrad_plus_gate_array_get_video_data() { - UINT16 caddr; - UINT16 ma = ( m_gate_array.ma - m_asic.split_ma_started ) + m_asic.split_ma_base; - UINT16 ra = m_gate_array.ra + ( ( m_asic.ram[0x2804] >> 4 ) & 0x07 ); + uint16_t caddr; + uint16_t ma = ( m_gate_array.ma - m_asic.split_ma_started ) + m_asic.split_ma_base; + uint16_t ra = m_gate_array.ra + ( ( m_asic.ram[0x2804] >> 4 ) & 0x07 ); if ( ra > 7 ) { @@ -728,7 +728,7 @@ void amstrad_state::amstrad_plus_update_video() if ( m_gate_array.draw_p ) { - UINT32 cycles_passed = (now - m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); + uint32_t cycles_passed = (now - m_gate_array.last_draw_time ).as_ticks(XTAL_16MHz); while( cycles_passed ) { @@ -751,7 +751,7 @@ void amstrad_state::amstrad_plus_update_video() m_gate_array.colour_ticks--; if ( ! m_gate_array.colour_ticks ) { - UINT16 caddr; + uint16_t caddr; m_gate_array.data <<= 1; if((m_asic.ram[0x2804] & 0x80) && m_asic.hsync_first_tick) @@ -766,7 +766,7 @@ void amstrad_state::amstrad_plus_update_video() { case 8: { - UINT16 caddr; + uint16_t caddr; m_gate_array.data = m_ram->pointer()[ m_gate_array.address + 1 ]; if((m_asic.ram[0x2804] & 0x80) && m_asic.hsync_first_tick) @@ -803,9 +803,9 @@ void amstrad_state::amstrad_plus_update_video() void amstrad_state::amstrad_plus_update_video_sprites() { - UINT16 *p; + uint16_t *p; int i; - UINT16 horiz; + uint16_t horiz; if ( m_gate_array.y < 0 ) return; @@ -818,14 +818,14 @@ void amstrad_state::amstrad_plus_update_video_sprites() p = &m_gate_array.bitmap->pix16(m_gate_array.y, horiz ); for ( i = 15 * 8; i >= 0; i -= 8 ) { - UINT8 xmag = ( m_asic.ram[ 0x2000 + i + 4 ] >> 2 ) & 0x03; - UINT8 ymag = m_asic.ram[ 0x2000 + i + 4 ] & 0x03; + uint8_t xmag = ( m_asic.ram[ 0x2000 + i + 4 ] >> 2 ) & 0x03; + uint8_t ymag = m_asic.ram[ 0x2000 + i + 4 ] & 0x03; /* Check if sprite is enabled */ if ( xmag && ymag ) { - INT16 spr_x = m_asic.ram[ 0x2000 + i ] + ( m_asic.ram[ 0x2001 + i ] << 8 ); - INT16 spr_y = m_asic.ram[ 0x2002 + i ] + ( m_asic.ram[ 0x2003 + i ] << 8 ); + int16_t spr_x = m_asic.ram[ 0x2000 + i ] + ( m_asic.ram[ 0x2001 + i ] << 8 ); + int16_t spr_y = m_asic.ram[ 0x2002 + i ] + ( m_asic.ram[ 0x2003 + i ] << 8 ); xmag -= 1; ymag -= 1; @@ -834,16 +834,16 @@ void amstrad_state::amstrad_plus_update_video_sprites() //if(i == 0) printf("%i <= %i, %i < %i, %i < %i, %i > 0\n", spr_y,m_asic.vpos,m_asic.vpos,spr_y+(16<<ymag),spr_x,(m_asic.h_end - horiz),spr_x+(16<<xmag)); if ( spr_y <= m_asic.vpos && m_asic.vpos < spr_y + ( 16 << ymag ) && spr_x < (m_asic.h_end - horiz) && spr_x + ( 16 << xmag ) > 0 ) { - UINT16 spr_addr = i * 32 + ( ( ( m_asic.vpos - spr_y ) >> ymag ) * 16 ); + uint16_t spr_addr = i * 32 + ( ( ( m_asic.vpos - spr_y ) >> ymag ) * 16 ); int j, k; for ( j = 0; j < 16; j++ ) { for ( k = 0; k < ( 1 << xmag ); k++ ) { - INT16 x = spr_x + ( j << xmag ) + k; + int16_t x = spr_x + ( j << xmag ) + k; if ( x >= 0 && x < (m_asic.h_end - horiz)) { - UINT8 spr_col = ( m_asic.ram[ spr_addr + j ] & 0x0f ) * 2; + uint8_t spr_col = ( m_asic.ram[ spr_addr + j ] & 0x0f ) * 2; if ( spr_col ) p[x] = m_asic.ram[ 0x2420 + spr_col ] + ( m_asic.ram[ 0x2421 + spr_col ] << 8 ); } @@ -1093,7 +1093,7 @@ VIDEO_START_MEMBER(amstrad_state,amstrad) } -UINT32 amstrad_state::screen_update_amstrad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t amstrad_state::screen_update_amstrad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap( bitmap, *m_gate_array.bitmap, 0, 0, 0, 0, cliprect ); return 0; @@ -1146,7 +1146,7 @@ WRITE_LINE_MEMBER(amstrad_state::cpc_romdis) -----------------*/ void amstrad_state::amstrad_setLowerRom() { - UINT8 *bank_base; + uint8_t *bank_base; /* b2 : "1" Lower rom area disable or "0" Lower rom area enable */ if ( m_system_type == SYSTEM_CPC || m_system_type == SYSTEM_ALESTE ) @@ -1246,7 +1246,7 @@ void amstrad_state::amstrad_setLowerRom() -----------------*/ void amstrad_state::amstrad_setUpperRom() { - UINT8 *bank_base = nullptr; + uint8_t *bank_base = nullptr; /* b3 : "1" Upper rom area disable or "0" Upper rom area enable */ if ( ! ( m_gate_array.mrer & 0x08 ) && m_gate_array.romdis == 0) @@ -1300,7 +1300,7 @@ void amstrad_state::AmstradCPC_GA_SetRamConfiguration() int ConfigurationIndex = m_GateArray_RamConfiguration & 0x07; int BankIndex,i; unsigned char *BankAddr; - UINT8 banknum = (m_GateArray_RamConfiguration & 0x38) >> 3; + uint8_t banknum = (m_GateArray_RamConfiguration & 0x38) >> 3; /* if b5 = 0 */ if(m_ram->size() > 65536) @@ -1310,7 +1310,7 @@ void amstrad_state::AmstradCPC_GA_SetRamConfiguration() BankIndex = RamConfigurations[(ConfigurationIndex << 2) + i]; if(BankIndex > 3) { - UINT8 maxbank = ((m_ram->size()-65536) / 65536); + uint8_t maxbank = ((m_ram->size()-65536) / 65536); BankAddr = m_ram->pointer() + (BankIndex << 14) + ((banknum%maxbank)*0x10000); } else @@ -1406,7 +1406,7 @@ WRITE8_MEMBER(amstrad_state::amstrad_plus_asic_4000_w) m_asic.ram[offset] = data & 0x0f; else { - UINT8* RAM = (UINT8*)m_bank11->base(); + uint8_t* RAM = (uint8_t*)m_bank11->base(); RAM[offset] = data; } } @@ -1509,7 +1509,7 @@ WRITE8_MEMBER(amstrad_state::amstrad_plus_asic_6000_w) } else { - UINT8* RAM = (UINT8*)m_bank12->base(); + uint8_t* RAM = (uint8_t*)m_bank12->base(); RAM[offset] = data; } } @@ -1522,7 +1522,7 @@ READ8_MEMBER(amstrad_state::amstrad_plus_asic_4000_r) return m_asic.ram[offset]; else { - UINT8* RAM = (UINT8*)m_bank3->base(); + uint8_t* RAM = (uint8_t*)m_bank3->base(); return RAM[offset]; } } @@ -1565,7 +1565,7 @@ READ8_MEMBER(amstrad_state::amstrad_plus_asic_6000_r) } else { - UINT8* RAM = (UINT8*)m_bank4->base(); + uint8_t* RAM = (uint8_t*)m_bank4->base(); return RAM[offset]; } } @@ -1602,7 +1602,7 @@ Bit 7 Bit 6 Function Note 1 : This function is not available in the Gate-Array, but is performed by a device at the same I/O port address location. In the CPC464,CPC664 and KC compact, this function is performed in a memory-expansion (e.g. Dk'Tronics 64K Ram Expansion), if this expansion is not present then the function is not available. In the CPC6128, this function is performed by a PAL located on the main PCB, or a memory-expansion. In the 464+ and 6128+ this function is performed by the ASIC or a memory expansion. Please read the document on Ram Management for more information.*/ -void amstrad_state::amstrad_GateArray_write(UINT8 dataToGateArray) +void amstrad_state::amstrad_GateArray_write(uint8_t dataToGateArray) { /* Get Bit 7 and 6 of the dataToGateArray = Gate Array function selected */ switch ((dataToGateArray & 0xc0)>>6) @@ -1733,7 +1733,7 @@ WRITE8_MEMBER(amstrad_state::aleste_msx_mapper) int ramptr = (data & 0x3f) * 0x4000; int rampage = data & 0x3f; int function = (data & 0xc0) >> 6; - UINT8 *ram = m_ram->pointer(); + uint8_t *ram = m_ram->pointer(); // It is assumed that functions are all mapped to each port &7cff-&7fff, and b8 and b9 are only used for RAM bank location switch(function) @@ -2249,20 +2249,20 @@ void amstrad_state::amstrad_handle_snapshot(unsigned char *pSnapshot) if ((pSnapshot[0x01b] & 1)==1) { - m_maincpu->set_state_int(Z80_IFF1, (UINT64)1); + m_maincpu->set_state_int(Z80_IFF1, (uint64_t)1); } else { - m_maincpu->set_state_int(Z80_IFF1, (UINT64)0); + m_maincpu->set_state_int(Z80_IFF1, (uint64_t)0); } if ((pSnapshot[0x01c] & 1)==1) { - m_maincpu->set_state_int(Z80_IFF2, (UINT64)1); + m_maincpu->set_state_int(Z80_IFF2, (uint64_t)1); } else { - m_maincpu->set_state_int(Z80_IFF2, (UINT64)0); + m_maincpu->set_state_int(Z80_IFF2, (uint64_t)0); } RegData = (pSnapshot[0x01d] & 0x0ff) | ((pSnapshot[0x01e] & 0x0ff)<<8); @@ -2772,8 +2772,8 @@ IRQ_CALLBACK_MEMBER(amstrad_state::amstrad_cpu_acknowledge_int) // update AMX mouse inputs (normally done every 1/300th of a second) if (m_io_ctrltype.read_safe(0) == 1) { - static UINT8 prev_x,prev_y; - UINT8 data_x, data_y; + static uint8_t prev_x,prev_y; + uint8_t data_x, data_y; m_amx_mouse_data = 0x0f; data_x = m_io_mouse1.read_safe(0); @@ -2799,7 +2799,7 @@ IRQ_CALLBACK_MEMBER(amstrad_state::amstrad_cpu_acknowledge_int) /* the following timings have been measured! */ -static const UINT8 amstrad_cycle_table_op[256] = { +static const uint8_t amstrad_cycle_table_op[256] = { 4, 12, 8, 8, 4, 4, 8, 4, 4, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, 8, 12, 20, 8, 4, 4, 8, 4, 8, 12, 20, 8, 4, 4, 8, 4, @@ -2818,7 +2818,7 @@ static const UINT8 amstrad_cycle_table_op[256] = { 8, 12, 12, 4, 12, 16, 8, 16, 8, 8, 12, 4, 12, 4, 8, 16 }; -static const UINT8 amstrad_cycle_table_cb[256]= +static const uint8_t amstrad_cycle_table_cb[256]= { 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, @@ -2838,7 +2838,7 @@ static const UINT8 amstrad_cycle_table_cb[256]= 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4 }; -static const UINT8 amstrad_cycle_table_ed[256]= +static const uint8_t amstrad_cycle_table_ed[256]= { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, @@ -2858,7 +2858,7 @@ static const UINT8 amstrad_cycle_table_ed[256]= 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; -static const UINT8 amstrad_cycle_table_xy[256]= +static const uint8_t amstrad_cycle_table_xy[256]= { 4, 12, 8, 8, 4, 4, 8, 4, 4, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, @@ -2878,7 +2878,7 @@ static const UINT8 amstrad_cycle_table_xy[256]= 8, 12, 12, 4, 12, 16, 8, 16, 8, 8, 12, 4, 12, 4, 8, 16 }; -static const UINT8 amstrad_cycle_table_xycb[256]= +static const uint8_t amstrad_cycle_table_xycb[256]= { 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, @@ -2898,7 +2898,7 @@ static const UINT8 amstrad_cycle_table_xycb[256]= 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 }; -static const UINT8 amstrad_cycle_table_ex[256]= +static const uint8_t amstrad_cycle_table_ex[256]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2924,13 +2924,13 @@ static const UINT8 amstrad_cycle_table_ex[256]= void amstrad_state::enumerate_roms() { - UINT8 m_rom_count = 1; - UINT8 *rom = m_region_maincpu->base(); + uint8_t m_rom_count = 1; + uint8_t *rom = m_region_maincpu->base(); bool slot7 = false; if (m_system_type == SYSTEM_PLUS || m_system_type == SYSTEM_GX4000) { - UINT8 *crt = m_region_cart->base(); + uint8_t *crt = m_region_cart->base(); int bank_mask = (m_cart->get_rom_size() / 0x4000) - 1; /* ROMs are stored on the inserted cartridge in the Plus/GX4000 */ @@ -3071,12 +3071,12 @@ void amstrad_state::amstrad_common_init() /* Using the cool code Juergen has provided, I will override the timing tables with the values for the amstrad */ m_maincpu->z80_set_cycle_tables( - (const UINT8*)amstrad_cycle_table_op, - (const UINT8*)amstrad_cycle_table_cb, - (const UINT8*)amstrad_cycle_table_ed, - (const UINT8*)amstrad_cycle_table_xy, - (const UINT8*)amstrad_cycle_table_xycb, - (const UINT8*)amstrad_cycle_table_ex); + (const uint8_t*)amstrad_cycle_table_op, + (const uint8_t*)amstrad_cycle_table_cb, + (const uint8_t*)amstrad_cycle_table_ed, + (const uint8_t*)amstrad_cycle_table_xy, + (const uint8_t*)amstrad_cycle_table_xycb, + (const uint8_t*)amstrad_cycle_table_ex); /* Juergen is a cool dude! */ } @@ -3262,7 +3262,7 @@ MACHINE_RESET_MEMBER(amstrad_state,aleste) /* load snapshot */ SNAPSHOT_LOAD_MEMBER( amstrad_state,amstrad) { - std::vector<UINT8> snapshot; + std::vector<uint8_t> snapshot; /* get file size */ if (snapshot_size < 8) @@ -3285,7 +3285,7 @@ SNAPSHOT_LOAD_MEMBER( amstrad_state,amstrad) DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge) { - UINT32 size = m_cart->common_get_size("rom"); + uint32_t size = m_cart->common_get_size("rom"); unsigned char header[12]; bool is_cpr = FALSE; logerror("IMG: loading CPC+ cartridge file\n"); @@ -3336,9 +3336,9 @@ DEVICE_IMAGE_LOAD_MEMBER(amstrad_state, amstrad_plus_cartridge) // 'cb01' represent Cartridge block 1, and is loaded to &4000-&7fff // ... and so on. - UINT32 offset = 0; - UINT8 *crt = m_cart->get_rom_base(); - std::vector<UINT8> temp_copy; + uint32_t offset = 0; + uint8_t *crt = m_cart->get_rom_base(); + std::vector<uint8_t> temp_copy; temp_copy.resize(size); image.fread(&temp_copy[0], size); |