konami/k573mcal.cpp, konamigq.cpp, konamigv.cpp: Use multibyte.h helpers

This commit is contained in:
AJR 2023-11-04 13:33:21 -04:00
parent 8ff8e5fa54
commit feb8df3f11
3 changed files with 12 additions and 17 deletions

View File

@ -24,6 +24,8 @@
#include "machine/timehelp.h"
#include "multibyte.h"
k573mcal_device::k573mcal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
jvs_device(mconfig, KONAMI_573_MASTER_CALENDAR, tag, owner, clock),
m_in1(*this, "IN1"),
@ -122,7 +124,7 @@ int k573mcal_device::handle_message(const uint8_t* send_buffer, uint32_t send_si
case 0x7c: {
// msg: 7c 7f 00 04
const uint16_t val = (send_buffer[1] << 8) | send_buffer[2];
const uint16_t val = get_u16be(&send_buffer[1]);
if (val == 0x7f00) {
// Return main ID
@ -152,11 +154,11 @@ int k573mcal_device::handle_message(const uint8_t* send_buffer, uint32_t send_si
case 0x7d: {
// msg: 7d 80 10 08 00 00 00 01 ff ff ff fe
const uint16_t val = (send_buffer[1] << 8) | send_buffer[2];
const uint16_t val = get_u16be(&send_buffer[1]);
if (val == 0x8010) {
// Set next sub ID
subId = (send_buffer[4] << 24) | (send_buffer[5] << 16) | (send_buffer[6] << 8) | send_buffer[7];
subId = get_u32be(&send_buffer[4]);
uint8_t resp[] = {
0x01, // status, must be 1

View File

@ -84,6 +84,8 @@
#include "screen.h"
#include "speaker.h"
#include "multibyte.h"
namespace {
@ -287,11 +289,7 @@ void konamigq_state::scsi_dma_read( uint32_t *p_n_psxram, uint32_t n_address, in
i = 0;
while( n_this > 0 )
{
p_n_psxram[ n_address / 4 ] =
( sector_buffer[ i + 0 ] << 0 ) |
( sector_buffer[ i + 1 ] << 8 ) |
( sector_buffer[ i + 2 ] << 16 ) |
( sector_buffer[ i + 3 ] << 24 );
p_n_psxram[ n_address / 4 ] = get_u32le( &sector_buffer[ i ] );
n_address += 4;
i += 4;
n_this--;

View File

@ -230,6 +230,8 @@ Notes:
#include "speaker.h"
#include "cdrom.h"
#include "multibyte.h"
namespace {
@ -383,11 +385,7 @@ void konamigv_state::scsi_dma_read( uint32_t *p_n_psxram, uint32_t n_address, in
i = 0;
while( n_this > 0 )
{
p_n_psxram[ n_address / 4 ] =
( sector_buffer[ i + 0 ] << 0 ) |
( sector_buffer[ i + 1 ] << 8 ) |
( sector_buffer[ i + 2 ] << 16 ) |
( sector_buffer[ i + 3 ] << 24 );
p_n_psxram[ n_address / 4 ] = get_u32le( &sector_buffer[ i ] );
n_address += 4;
i += 4;
n_this--;
@ -416,10 +414,7 @@ void konamigv_state::scsi_dma_write( uint32_t *p_n_psxram, uint32_t n_address, i
i = 0;
while( n_this > 0 )
{
sector_buffer[ i + 0 ] = ( p_n_psxram[ n_address / 4 ] >> 0 ) & 0xff;
sector_buffer[ i + 1 ] = ( p_n_psxram[ n_address / 4 ] >> 8 ) & 0xff;
sector_buffer[ i + 2 ] = ( p_n_psxram[ n_address / 4 ] >> 16 ) & 0xff;
sector_buffer[ i + 3 ] = ( p_n_psxram[ n_address / 4 ] >> 24 ) & 0xff;
put_u32le( &sector_buffer[ i ], p_n_psxram[ n_address / 4 ] );
n_address += 4;
i += 4;
n_this--;