From ad4910a8a8c0b1ca6930eee35121fe18aca84cd3 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Sun, 26 Apr 2009 23:54:37 +0000 Subject: Bulk change alert. This update changes the way we handle memory allocation. Rather than allocating in terms of bytes, allocations are now done in terms of objects. This is done via new set of macros that replace the malloc_or_die() macro: alloc_or_die(t) - allocate memory for an object of type 't' alloc_array_or_die(t,c) - allocate memory for an array of 'c' objects of type 't' alloc_clear_or_die(t) - same as alloc_or_die but memset's the memory to 0 alloc_array_clear_or_die(t,c) - same as alloc_array_or_die but memset's the memory to 0 All original callers of malloc_or_die have been updated to call these new macros. If you just need an array of bytes, you can use alloc_array_or_die(UINT8, numbytes). Made a similar change to the auto_* allocation macros. In addition, added 'machine' as a required parameter to the auto-allocation macros, as the resource pools will eventually be owned by the machine object. The new macros are: auto_alloc(m,t) - allocate memory for an object of type 't' auto_alloc_array(m,t,c) - allocate memory for an array of 'c' objects of type 't' auto_alloc_clear(m,t) - allocate and memset auto_alloc_array_clear(m,t,c) - allocate and memset All original calls or auto_malloc have been updated to use the new macros. In addition, auto_realloc(), auto_strdup(), auto_astring_alloc(), and auto_bitmap_alloc() have been updated to take a machine parameter. Changed validity check allocations to not rely on auto_alloc* anymore because they are not done in the context of a machine. One final change that is included is the removal of SMH_BANKn macros. Just use SMH_BANK(n) instead, which is what the previous macros mapped to anyhow. --- src/mame/drivers/cshooter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mame/drivers/cshooter.c') diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c index cc3d476a46c..092418b3d9e 100644 --- a/src/mame/drivers/cshooter.c +++ b/src/mame/drivers/cshooter.c @@ -260,7 +260,7 @@ static READ8_HANDLER(pal_r) static ADDRESS_MAP_START( cshooter_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0xafff) AM_READWRITE(SMH_BANK1, SMH_RAM) + AM_RANGE(0x8000, 0xafff) AM_READWRITE(SMH_BANK(1), SMH_RAM) AM_RANGE(0xb000, 0xb0ff) AM_READ(SMH_RAM) // sound related ? AM_RANGE(0xc000, 0xc1ff) AM_WRITE(pal_w) AM_READ(pal_r) AM_BASE(&paletteram) AM_RANGE(0xc200, 0xc200) AM_READ_PORT("IN0") @@ -280,9 +280,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( airraid_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK1) + AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK(1)) AM_RANGE(0xb000, 0xb0ff) AM_RAM // sound related ? - AM_RANGE(0xb100, 0xb1ff) AM_RAM//READ(SMH_BANK1) // sound related ? + AM_RANGE(0xb100, 0xb1ff) AM_RAM//READ(SMH_BANK(1)) // sound related ? AM_RANGE(0xc000, 0xc000) AM_READ_PORT("IN0") AM_RANGE(0xc001, 0xc001) AM_READ_PORT("IN1") AM_RANGE(0xc002, 0xc002) AM_READ_PORT("IN2") @@ -666,7 +666,7 @@ static DRIVER_INIT( cshootre ) const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); int A; UINT8 *rom = memory_region(machine, "maincpu"); - UINT8 *decrypt = auto_malloc(0x8000); + UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000); memory_set_decrypted_region(space, 0x0000, 0x7fff, decrypt); -- cgit v1.2.3 e8b51a60949c97a7dfa5304'>diffstatshomepage
path: root/src/lib/formats/sf7000_dsk.h
blob: 75f7ff7e314fd0a2c56c142adcce4b85f066480c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/*********************************************************************

    formats/sf7000_dsk.h

    sf7000 format

*********************************************************************/

#ifndef SF7000_DSK_H_
#define SF7000_DSK_H_

#include "upd765_dsk.h"

class sf7000_format : public upd765_format {
public:
	sf7000_format();

	virtual const char *name() const override;
	virtual const char *description() const override;
	virtual const char *extensions() const override;

private:
	static const format formats[];
};

extern const floppy_format_type FLOPPY_SF7000_FORMAT;

#endif