| Previous | 15994 Revisions | Next |
| r9923 Wednesday 5th January, 2011 at 13:38:50 UTC by Miodrag Milanović |
|---|
| Sync with MAME, MESSRAM moved to emu section |
| [src/emu] | driver.h emu.mak emuopts.c emuopts.h info.c inptport.c uimenu.c |
| [src/emu/cpu] | cpu.mak drcbex64.c drcfe.c drcfe.h |
| [src/emu/cpu/arm7] | arm7core.c |
| [src/emu/cpu/mips] | mips3drc.c mips3fe.c mips3fe.h |
| [src/emu/cpu/nec] | necdasm.c |
| [src/emu/cpu/powerpc] | ppcdrc.c ppcfe.c ppcfe.h |
| [src/emu/cpu/rsp] | rsp.c rsp.h rspdrc.c rspfe.c rspfe.h |
| [src/emu/cpu/sh2] | sh2comn.h sh2drc.c sh2fe.c |
| [src/emu/machine] | ram.c* ram.h* |
| [src/emu/sound] | disc_dev.c disc_flt.c disc_inp.c disc_mth.c disc_sys.c disc_wav.c discrete.c discrete.h |
| [src/mess] | mess.c mess.h mess.mak |
| [src/mess/audio] | mac.c |
| [src/mess/devices] | coco_vhd.c |
| [src/mess/drivers] | a310.c abc1600.c abc80.c abc80x.c aim65.c amstrad.c apple1.c apple2.c apple2gs.c apple3.c apricot.c aquarius.c at.c atari.c atarist.c atm.c atom.c avigo.c b2m.c bebox.c beta.c bullet.c bw12.c bw2.c c16.c c65.c c80.c cgc7900.c cgenie.c coco.c comx35.c cosmicos.c crvision.c cybiko.c dai.c dgn_beta.c e01.c einstein.c elf.c elwro800.c enterp.c eti660.c exp85.c fk1.c fmtowns.c galaxy.c gb.c huebler.c jtc.c kc.c kyocera.c lc80.c llc.c lviv.c mac.c mc10.c mc1000.c micronic.c mikromik.c mtx.c mz700.c nanos.c nascom1.c nc.c newbrain.c ob68k1a.c ondra.c orion.c osbexec.c osborne1.c osi.c palm.c partner.c pc.c pc8001.c pc8401a.c pce220.c pcw.c pcw16.c pecom.c pentagon.c pet.c phc25.c pk8000.c pk8020.c pmd85.c pocketc.c poly880.c portfoli.c pp01.c prestige.c prof180x.c prof80.c ptcsol.c px4.c px8.c pyl601.c ql.c qx10.c rmnimbus.c rt1715.c rx78.c samcoupe.c sapi1.c scorpion.c sg1000.c spc1000.c spec128.c special.c specpls3.c spectrum.c svi318.c sym1.c tandy2k.c tek405x.c thomson.c tiki100.c timex.c tmc1800.c tmc2000e.c tmc600.c trs80m2.c tvc.c unixpc.c v1050.c vcs80.c vector06.c vg5k.c vic20.c victor9k.c vidbrain.c vip.c vixen.c vt220.c vt240.c vt320.c vt520.c vtech1.c x68k.c xerox820.c xor100.c z80ne.c z88.c zx.c |
| [src/mess/formats] | comx35_comx.c |
| [src/mess/includes] | abc80.h abc80x.h bullet.h bw12.h bw2.h comx35.h gb.h kyocera.h mac.h ob68k1a.h ql.h sg1000.h tandy2k.h tek405x.h tmc600.h v1050.h victor9k.h vip.h vixen.h xerox820.h xor100.h |
| [src/mess/machine] | 6883sam.c aim65.c amstrad.c apple1.c apple2.c apple2gs.c apple3.c at.c ataricrt.c b2m.c bebox.c c16.c c65.c cgenie.c coco.c comx35.c cybiko.c dai.c dgn_beta.c galaxy.c gb.c kc.c llc.c lviv.c mac.c mpc105.c mtx.c mz700.c nascom1.c ondra.c orion.c osborne1.c partner.c pc.c pc1350.c pc1401.c pc1403.c pecom.c pet.c pk8020.c pmd85.c pp01.c rmnimbus.c rt1715.c samcoupe.c special.c svi318.c sym1.c tf20.c thomson.c vector06.c zx.c |
| [src/mess/osd/winui] | optionsms.c propertiesms.c |
| [src/mess/tools/messtest] | testmess.c |
| [src/mess/video] | apple2.c apple3.c b2m.c coco3.c dgn_beta.c epnick.c fmtowns.c kc.c mac.c mc68328.c nc.c ondra.c orion.c pc_t1t.c pcw.c pcw16.c pk8020.c pmd85.c pp01.c special.c timex.c vector06.c x68k.c z88.c |
| r9922 | r9923 | |
|---|---|---|
| 842 | 842 | $(CPUOBJ)/mips/r3000.o: $(CPUSRC)/mips/r3000.c \ |
| 843 | 843 | $(CPUSRC)/mips/r3000.h |
| 844 | 844 | |
| 845 | $(CPUOBJ)/mips/mips3.o: $(CPUSRC)/mips/mips3.h \ | |
| 846 | $(CPUSRC)/mips/mips3com.h \ | |
| 847 | $(CPUSRC)/mips/mips3.c | |
| 845 | $(CPUOBJ)/mips/mips3.o: $(CPUSRC)/mips/mips3.h $(CPUSRC)/mips/mips3com.h \ | |
| 846 | $(CPUSRC)/mips/mips3.c | |
| 848 | 847 | |
| 849 | 848 | $(CPUOBJ)/mips/mips3com.o: $(CPUSRC)/mips/mips3.h \ |
| 850 | 849 | $(CPUSRC)/mips/mips3com.h |
| r9922 | r9923 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Generic dynamic recompiler frontend structures and utilities. |
| 6 | 6 | |
| 7 | **************************************************************************** | |
| 8 | ||
| 7 | 9 | Copyright Aaron Giles |
| 8 | Released for general non-commercial use under the MAME license | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 10 | All rights reserved. | |
| 10 | 11 | |
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | **************************************************************************** |
| 12 | 39 | |
| 13 | 40 | Future improvements/changes: |
| r9922 | r9923 | |
| 21 | 48 | #include "drcfe.h" |
| 22 | 49 | |
| 23 | 50 | |
| 24 | /*************************************************************************** | |
| 25 | CONSTANTS | |
| 26 | ***************************************************************************/ | |
| 51 | //************************************************************************** | |
| 52 | // CONSTANTS | |
| 53 | //************************************************************************** | |
| 27 | 54 | |
| 28 | ||
| 55 | co | |
| 29 | 56 | |
| 30 | 57 | |
| 31 | 58 | |
| 32 | /*************************************************************************** | |
| 33 | TYPE DEFINITIONS | |
| 34 | ***************************************************************************/ | |
| 59 | //************************************************************************** | |
| 60 | // TYPE DEFINITIONS | |
| 61 | //************************************************************************** | |
| 35 | 62 | |
| 36 | /* an entry that maps branches for our code walking */ | |
| 37 | typedef struct _pc_stack_entry pc_stack_entry; | |
| 38 | struct _pc_stack_entry | |
| 63 | // an entry that maps branches for our code walking | |
| 64 | struct pc_stack_entry | |
| 39 | 65 | { |
| 40 | 66 | offs_t targetpc; |
| 41 | 67 | offs_t srcpc; |
| 42 | 68 | }; |
| 43 | 69 | |
| 44 | 70 | |
| 45 | /* internal state */ | |
| 46 | struct _drcfe_state | |
| 47 | { | |
| 48 | /* configuration parameters */ | |
| 49 | UINT32 window_start; /* code window start offset = startpc - window_start */ | |
| 50 | UINT32 window_end; /* code window end offset = startpc + window_end */ | |
| 51 | UINT32 max_sequence; /* maximum instructions to include in a sequence */ | |
| 52 | 71 | |
| 53 | drcfe_describe_func describe; /* callback to describe a single instruction */ | |
| 54 | void * param; /* parameter for the callback */ | |
| 72 | //************************************************************************** | |
| 73 | // DRC FRONTEND | |
| 74 | //************************************************************************** | |
| 55 | 75 | |
| 56 | /* CPU parameters */ | |
| 57 | cpu_device * cpudevice; /* CPU device object */ | |
| 58 | address_space *program; /* program address space for this CPU */ | |
| 59 | offs_t pageshift; /* shift to convert address to a page index */ | |
| 76 | //------------------------------------------------- | |
| 77 | // drc_frontend - constructor | |
| 78 | //------------------------------------------------- | |
| 60 | 79 | |
| 61 | /* opcode descriptor arrays */ | |
| 62 | opcode_desc * desc_live_list; /* head of list of live descriptions */ | |
| 63 | opcode_desc * desc_free_list; /* head of list of free descriptions */ | |
| 64 | opcode_desc ** desc_array; /* array of descriptions in PC order */ | |
| 65 | UINT32 desc_array_size; /* size of the array */ | |
| 66 | }; | |
| 67 | ||
| 68 | ||
| 69 | ||
| 70 | /*************************************************************************** | |
| 71 | FUNCTION PROTOTYPES | |
| 72 | ***************************************************************************/ | |
| 73 | ||
| 74 | static opcode_desc *describe_one(drcfe_state *drcfe, offs_t curpc, const opcode_desc *prevdesc); | |
| 75 | static opcode_desc **build_sequence(drcfe_state *drcfe, opcode_desc **tailptr, int start, int end, UINT32 endflag); | |
| 76 | static void accumulate_required_backwards(opcode_desc *desc, UINT32 *reqmask); | |
| 77 | static void release_descriptions(drcfe_state *drcfe, opcode_desc *desc); | |
| 78 | ||
| 79 | ||
| 80 | ||
| 81 | /*************************************************************************** | |
| 82 | INLINE FUNCTIONS | |
| 83 | ***************************************************************************/ | |
| 84 | ||
| 85 | /*------------------------------------------------- | |
| 86 | desc_alloc - allocate a new opcode description | |
| 87 | -------------------------------------------------*/ | |
| 88 | ||
| 89 | INLINE opcode_desc *desc_alloc(drcfe_state *drcfe) | |
| 80 | drc_frontend::drc_frontend(device_t &cpu, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) | |
| 81 | : m_window_start(window_start), | |
| 82 | m_window_end(window_end), | |
| 83 | m_max_sequence(max_sequence), | |
| 84 | m_cpudevice(downcast<cpu_device &>(cpu)), | |
| 85 | m_program(m_cpudevice.space(AS_PROGRAM)), | |
| 86 | m_pageshift(m_cpudevice.space_config(AS_PROGRAM)->m_page_shift), | |
| 87 | m_desc_live_list(cpu.machine->m_respool), | |
| 88 | m_desc_allocator(cpu.machine->m_respool), | |
| 89 | m_desc_array(auto_alloc_array_clear(cpu.machine, opcode_desc *, window_end + window_start + 2)) | |
| 90 | 90 | { |
| 91 | opcode_desc *desc = drcfe->desc_free_list; | |
| 92 | ||
| 93 | /* pull a description off of the free list or allocate a new one */ | |
| 94 | if (desc != NULL) | |
| 95 | drcfe->desc_free_list = desc->next; | |
| 96 | else | |
| 97 | desc = auto_alloc(drcfe->cpudevice->machine, opcode_desc); | |
| 98 | return desc; | |
| 99 | 91 | } |
| 100 | 92 | |
| 101 | 93 | |
| 102 | /*------------------------------------------------- | |
| 103 | desc_free - free an opcode description | |
| 104 | -------------------------------------------------*/ | |
| 94 | //------------------------------------------------- | |
| 95 | // ~drc_frontend - destructor | |
| 96 | //------------------------------------------------- | |
| 105 | 97 | |
| 106 | ||
| 98 | ||
| 107 | 99 | { |
| 108 | /* just put ourselves on the free list */ | |
| 109 | desc->next = drcfe->desc_free_list; | |
| 110 | drcfe->desc_free_list = desc; | |
| 111 | } | |
| 100 | // release any descriptions we've accumulated | |
| 101 | release_descriptions(); | |
| 112 | 102 | |
| 113 | ||
| 114 | ||
| 115 | /*************************************************************************** | |
| 116 | CORE IMPLEMENTATION | |
| 117 | ***************************************************************************/ | |
| 118 | ||
| 119 | /*------------------------------------------------- | |
| 120 | drcfe_init - initializate the drcfe state | |
| 121 | -------------------------------------------------*/ | |
| 122 | ||
| 123 | drcfe_state *drcfe_init(device_t *cpu, const drcfe_config *config, void *param) | |
| 124 | { | |
| 125 | drcfe_state *drcfe; | |
| 126 | ||
| 127 | /* allocate some memory to hold the state */ | |
| 128 | drcfe = auto_alloc_clear(cpu->machine, drcfe_state); | |
| 129 | ||
| 130 | /* allocate the description array */ | |
| 131 | drcfe->desc_array = auto_alloc_array_clear(cpu->machine, opcode_desc *, config->window_end + config->window_start + 2); | |
| 132 | ||
| 133 | /* copy in configuration information */ | |
| 134 | drcfe->window_start = config->window_start; | |
| 135 | drcfe->window_end = config->window_end; | |
| 136 | drcfe->max_sequence = config->max_sequence; | |
| 137 | drcfe->describe = config->describe; | |
| 138 | drcfe->param = param; | |
| 139 | ||
| 140 | /* initialize the state */ | |
| 141 | drcfe->cpudevice = downcast<cpu_device *>(cpu); | |
| 142 | drcfe->program = drcfe->cpudevice->space(AS_PROGRAM); | |
| 143 | drcfe->pageshift = drcfe->cpudevice->space_config(AS_PROGRAM)->m_page_shift; | |
| 144 | ||
| 145 | return drcfe; | |
| 103 | // free the description array | |
| 104 | auto_free(m_cpudevice.machine, m_desc_array); | |
| 146 | 105 | } |
| 147 | 106 | |
| 148 | 107 | |
| 149 | /*------------------------------------------------- | |
| 150 | drcfe_exit - clean up after ourselves | |
| 151 | -------------------------------------------------*/ | |
| 108 | //------------------------------------------------- | |
| 109 | // describe_code - describe a sequence of code | |
| 110 | // that falls within the configured window | |
| 111 | // relative to the specified startpc | |
| 112 | //------------------------------------------------- | |
| 152 | 113 | |
| 153 | ||
| 114 | const opcode_desc *drc | |
| 154 | 115 | { |
| 155 | /* release any descriptions we've accumulated */ | |
| 156 | release_descriptions(drcfe, drcfe->desc_live_list); | |
| 116 | // release any descriptions we've accumulated | |
| 117 | release_descriptions(); | |
| 157 | 118 | |
| 158 | /* free our free list of descriptions */ | |
| 159 | while (drcfe->desc_free_list != NULL) | |
| 160 | { | |
| 161 | opcode_desc *freeme = drcfe->desc_free_list; | |
| 162 | drcfe->desc_free_list = drcfe->desc_free_list->next; | |
| 163 | auto_free(drcfe->cpudevice->machine, freeme); | |
| 164 | } | |
| 165 | ||
| 166 | /* free the description array */ | |
| 167 | auto_free(drcfe->cpudevice->machine, drcfe->desc_array); | |
| 168 | ||
| 169 | /* free the object itself */ | |
| 170 | auto_free(drcfe->cpudevice->machine, drcfe); | |
| 171 | } | |
| 172 | ||
| 173 | ||
| 174 | /*------------------------------------------------- | |
| 175 | drcfe_describe_code - describe a sequence of | |
| 176 | code that falls within the configured window | |
| 177 | relative to the specified startpc | |
| 178 | -------------------------------------------------*/ | |
| 179 | ||
| 180 | const opcode_desc *drcfe_describe_code(drcfe_state *drcfe, offs_t startpc) | |
| 181 | { | |
| 182 | offs_t minpc = startpc - MIN(drcfe->window_start, startpc); | |
| 183 | offs_t maxpc = startpc + MIN(drcfe->window_end, 0xffffffff - startpc); | |
| 119 | // add the initial PC to the stack | |
| 184 | 120 | pc_stack_entry pcstack[MAX_STACK_DEPTH]; |
| 185 | 121 | pc_stack_entry *pcstackptr = &pcstack[0]; |
| 186 | opcode_desc **tailptr; | |
| 187 | ||
| 188 | /* release any descriptions we've accumulated */ | |
| 189 | release_descriptions(drcfe, drcfe->desc_live_list); | |
| 190 | drcfe->desc_live_list = NULL; | |
| 191 | ||
| 192 | /* add the initial PC to the stack */ | |
| 193 | 122 | pcstackptr->srcpc = 0; |
| 194 | 123 | pcstackptr->targetpc = startpc; |
| 195 | 124 | pcstackptr++; |
| 196 | 125 | |
| 197 | /* loop while we still have a stack */ | |
| 126 | // loop while we still have a stack | |
| 127 | offs_t minpc = startpc - MIN(m_window_start, startpc); | |
| 128 | offs_t maxpc = startpc + MIN(m_window_end, 0xffffffff - startpc); | |
| 198 | 129 | while (pcstackptr != &pcstack[0]) |
| 199 | 130 | { |
| 131 | // if we've already hit this PC, just mark it a branch target and continue | |
| 200 | 132 | pc_stack_entry *curstack = --pcstackptr; |
| 201 | opcode_desc *curdesc; | |
| 202 | offs_t curpc; | |
| 203 | ||
| 204 | /* if we've already hit this PC, just mark it a branch target and continue */ | |
| 205 | curdesc = drcfe->desc_array[curstack->targetpc - minpc]; | |
| 133 | opcode_desc *curdesc = m_desc_array[curstack->targetpc - minpc]; | |
| 206 | 134 | if (curdesc != NULL) |
| 207 | 135 | { |
| 208 | 136 | curdesc->flags |= OPFLAG_IS_BRANCH_TARGET; |
| 209 | 137 | |
| 210 | /* if the branch crosses a page boundary, mark the target as needing to revalidate */ | |
| 211 | if (drcfe->pageshift != 0 && ((curstack->srcpc ^ curdesc->pc) >> drcfe->pageshift) != 0) | |
| 138 | // if the branch crosses a page boundary, mark the target as needing to revalidate | |
| 139 | if (m_pageshift != 0 && ((curstack->srcpc ^ curdesc->pc) >> m_pageshift) != 0) | |
| 212 | 140 | curdesc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION; |
| 213 | 141 | |
| 214 | / | |
| 142 | // continue processing | |
| 215 | 143 | continue; |
| 216 | 144 | } |
| 217 | 145 | |
| 218 | /* loop until we exit the block */ | |
| 219 | for (curpc = curstack->targetpc; curpc >= minpc && curpc < maxpc && drcfe->desc_array[curpc - minpc] == NULL; curpc += drcfe->desc_array[curpc - minpc]->length) | |
| 146 | // loop until we exit the block | |
| 147 | for (offs_t curpc = curstack->targetpc; curpc >= minpc && curpc < maxpc && m_desc_array[curpc - minpc] == NULL; curpc += m_desc_array[curpc - minpc]->length) | |
| 220 | 148 | { |
| 221 | /* allocate a new description and describe this instruction */ | |
| 222 | drcfe->desc_array[curpc - minpc] = curdesc = describe_one(drcfe, curpc, curdesc); | |
| 149 | // allocate a new description and describe this instruction | |
| 150 | m_desc_array[curpc - minpc] = curdesc = describe_one(curpc, curdesc); | |
| 223 | 151 | |
| 224 | / | |
| 152 | // first instruction in a sequence is always a branch target | |
| 225 | 153 | if (curpc == curstack->targetpc) |
| 226 | 154 | curdesc->flags |= OPFLAG_IS_BRANCH_TARGET; |
| 227 | 155 | |
| 228 | / | |
| 156 | // stop if we hit a page fault | |
| 229 | 157 | if (curdesc->flags & OPFLAG_COMPILER_PAGE_FAULT) |
| 230 | 158 | break; |
| 231 | 159 | |
| 232 | /* if we are the first instruction in the whole window, we must validate the TLB */ | |
| 233 | if (curpc == startpc && drcfe->pageshift != 0) | |
| 160 | // if we are the first instruction in the whole window, we must validate the TLB | |
| 161 | if (curpc == startpc && m_pageshift != 0) | |
| 234 | 162 | curdesc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION; |
| 235 | 163 | |
| 236 | / | |
| 164 | // if we are a branch within the block range, add the branch target to our stack | |
| 237 | 165 | if ((curdesc->flags & OPFLAG_IS_BRANCH) && curdesc->targetpc >= minpc && curdesc->targetpc < maxpc && pcstackptr < &pcstack[MAX_STACK_DEPTH]) |
| 238 | 166 | { |
| 239 | 167 | curdesc->flags |= OPFLAG_INTRABLOCK_BRANCH; |
| r9922 | r9923 | |
| 242 | 170 | pcstackptr++; |
| 243 | 171 | } |
| 244 | 172 | |
| 245 | / | |
| 173 | // if we're done, we're done | |
| 246 | 174 | if (curdesc->flags & OPFLAG_END_SEQUENCE) |
| 247 | 175 | break; |
| 248 | 176 | } |
| 249 | 177 | } |
| 250 | 178 | |
| 251 | /* now build the list of descriptions in order */ | |
| 252 | /* first from startpc -> maxpc, then from minpc -> startpc */ | |
| 253 | tailptr = build_sequence(drcfe, &drcfe->desc_live_list, startpc - minpc, maxpc - minpc, OPFLAG_REDISPATCH); | |
| 254 | tailptr = build_sequence(drcfe, tailptr, minpc - minpc, startpc - minpc, OPFLAG_RETURN_TO_START); | |
| 255 | return drcfe->desc_live_list; | |
| 179 | // now build the list of descriptions in order | |
| 180 | // first from startpc -> maxpc, then from minpc -> startpc | |
| 181 | build_sequence(startpc - minpc, maxpc - minpc, OPFLAG_REDISPATCH); | |
| 182 | build_sequence(minpc - minpc, startpc - minpc, OPFLAG_RETURN_TO_START); | |
| 183 | return m_desc_live_list.first(); | |
| 256 | 184 | } |
| 257 | 185 | |
| 258 | 186 | |
| 187 | //------------------------------------------------- | |
| 188 | // describe_one - describe a single instruction, | |
| 189 | // recursively describing opcodes in delay | |
| 190 | // slots of branches as well | |
| 191 | //------------------------------------------------- | |
| 259 | 192 | |
| 260 | /*************************************************************************** | |
| 261 | INTERNAL HELPERS | |
| 262 | ***************************************************************************/ | |
| 263 | ||
| 264 | /*------------------------------------------------- | |
| 265 | describe_one - describe a single instruction, | |
| 266 | recursively describing opcodes in delay | |
| 267 | slots of branches as well | |
| 268 | -------------------------------------------------*/ | |
| 269 | ||
| 270 | static opcode_desc *describe_one(drcfe_state *drcfe, offs_t curpc, const opcode_desc *prevdesc) | |
| 193 | opcode_desc *drc_frontend::describe_one(offs_t curpc, const opcode_desc *prevdesc) | |
| 271 | 194 | { |
| 272 | opcode_desc *desc = desc_alloc(drcfe); | |
| 273 | ||
| 274 | /* initialize the description */ | |
| 195 | // initialize the description | |
| 196 | opcode_desc *desc = m_desc_allocator.alloc(); | |
| 275 | 197 | memset(desc, 0, sizeof(*desc)); |
| 276 | 198 | desc->pc = curpc; |
| 277 | 199 | desc->physpc = curpc; |
| 278 | 200 | desc->targetpc = BRANCH_TARGET_DYNAMIC; |
| 279 | 201 | |
| 280 | /* call the callback to describe an instruction */ | |
| 281 | if (!(*drcfe->describe)(drcfe->param, desc, prevdesc)) | |
| 202 | // call the callback to describe an instruction | |
| 203 | if (!describe(*desc, prevdesc)) | |
| 282 | 204 | { |
| 283 | 205 | desc->flags |= OPFLAG_WILL_CAUSE_EXCEPTION | OPFLAG_INVALID_OPCODE; |
| 284 | 206 | return desc; |
| 285 | 207 | } |
| 286 | 208 | |
| 287 | /* validate the TLB if we are exactly at the start of a page, or if we cross a page boundary */ | |
| 288 | if (drcfe->pageshift != 0 && (((curpc - 1) ^ (curpc + desc->length - 1)) >> drcfe->pageshift) != 0) | |
| 209 | // validate the TLB if we are exactly at the start of a page, or if we cross a page boundary | |
| 210 | if (m_pageshift != 0 && (((curpc - 1) ^ (curpc + desc->length - 1)) >> m_pageshift) != 0) | |
| 289 | 211 | desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION; |
| 290 | 212 | |
| 291 | / | |
| 213 | // validate stuff | |
| 292 | 214 | assert(desc->length > 0 || (desc->flags & OPFLAG_VIRTUAL_NOOP) != 0); |
| 293 | 215 | |
| 294 | / | |
| 216 | // if we are a branch with delay slots, recursively walk those | |
| 295 | 217 | if (desc->flags & OPFLAG_IS_BRANCH) |
| 296 | 218 | { |
| 297 | | |
| 219 | // | |
| 298 | 220 | offs_t delaypc = curpc + desc->length; |
| 299 | 221 | opcode_desc *prev = desc; |
| 300 | UINT8 slotnum; | |
| 301 | ||
| 302 | /* iterate over slots and describe them */ | |
| 303 | for (slotnum = 0; slotnum < desc->delayslots; slotnum++) | |
| 222 | for (UINT8 slotnum = 0; slotnum < desc->delayslots; slotnum++) | |
| 304 | 223 | { |
| 305 | /* recursively describe the next instruction */ | |
| 306 | *tailptr = describe_one(drcfe, delaypc, prev); | |
| 307 | if (*tailptr == NULL) | |
| 224 | // recursively describe the next instruction | |
| 225 | opcode_desc *delaydesc = describe_one(delaypc, prev); | |
| 226 | if (delaydesc == NULL) | |
| 308 | 227 | break; |
| 228 | desc->delay.append(*delaydesc); | |
| 229 | prev = desc; | |
| 309 | 230 | |
| 310 | /* set the delay slot flag and a pointer back to the original branch */ | |
| 311 | (*tailptr)->flags |= OPFLAG_IN_DELAY_SLOT; | |
| 312 | (*tailptr)->branch = desc; | |
| 313 | (*tailptr)->prev = prev; | |
| 314 | prev = *tailptr; | |
| 231 | // set the delay slot flag and a pointer back to the original branch | |
| 232 | delaydesc->flags |= OPFLAG_IN_DELAY_SLOT; | |
| 233 | delaydesc->branch = desc; | |
| 315 | 234 | |
| 316 | /* stop if we hit a page fault */ | |
| 317 | if ((*tailptr)->flags & OPFLAG_COMPILER_PAGE_FAULT) | |
| 235 | // stop if we hit a page fault | |
| 236 | if (delaydesc->flags & OPFLAG_COMPILER_PAGE_FAULT) | |
| 318 | 237 | break; |
| 319 | 238 | |
| 320 | /* otherwise, advance */ | |
| 321 | delaypc += (*tailptr)->length; | |
| 322 | tailptr = &(*tailptr)->next; | |
| 239 | // otherwise, advance | |
| 240 | delaypc += delaydesc->length; | |
| 323 | 241 | } |
| 324 | 242 | } |
| 325 | ||
| 326 | 243 | return desc; |
| 327 | 244 | } |
| 328 | 245 | |
| 329 | 246 | |
| 330 | /*------------------------------------------------- | |
| 331 | build_sequence - build an ordered sequence | |
| 332 | of instructions | |
| 333 | -------------------------------------------------*/ | |
| 247 | //------------------------------------------------- | |
| 248 | // build_sequence - build an ordered sequence | |
| 249 | // of instructions | |
| 250 | //------------------------------------------------- | |
| 334 | 251 | |
| 335 | ||
| 252 | vo | |
| 336 | 253 | { |
| 337 | o | |
| 254 | // iterate in or | |
| 338 | 255 | int consecutive = 0; |
| 339 | 256 | int seqstart = -1; |
| 340 | 257 | int skipsleft = 0; |
| 341 | int descnum; | |
| 342 | ||
| 343 | /* iterate in order from start to end, picking up all non-NULL instructions */ | |
| 344 | for (descnum = start; descnum < end; descnum++) | |
| 345 | if (drcfe->desc_array[descnum] != NULL) | |
| 258 | for (int descnum = start; descnum < end; descnum++) | |
| 259 | if (m_desc_array[descnum] != NULL) | |
| 346 | 260 | { |
| 347 | opcode_desc *curdesc = drcfe->desc_array[descnum]; | |
| 348 | opcode_desc *nextdesc = NULL; | |
| 349 | int nextdescnum; | |
| 350 | UINT8 skipnum; | |
| 351 | ||
| 352 | /* determine the next instruction, taking skips into account */ | |
| 353 | nextdescnum = descnum + curdesc->length; | |
| 354 | nextdesc = (nextdescnum < end) ? drcfe->desc_array[nextdescnum] : NULL; | |
| 355 | for (skipnum = 0; skipnum < curdesc->skipslots && nextdesc != NULL; skipnum++) | |
| 261 | // determine the next instruction, taking skips into account | |
| 262 | opcode_desc *curdesc = m_desc_array[descnum]; | |
| 263 | int nextdescnum = descnum + curdesc->length; | |
| 264 | opcode_desc *nextdesc = (nextdescnum < end) ? m_desc_array[nextdescnum] : NULL; | |
| 265 | for (UINT8 skipnum = 0; skipnum < curdesc->skipslots && nextdesc != NULL; skipnum++) | |
| 356 | 266 | { |
| 357 | 267 | nextdescnum = nextdescnum + nextdesc->length; |
| 358 | nextdesc = (nextdescnum < end) ? | |
| 268 | nextdesc = (nextdescnum < end) ? m_ | |
| 359 | 269 | } |
| 360 | 270 | |
| 361 | / | |
| 271 | // start a new sequence if we aren't already in the middle of one | |
| 362 | 272 | if (seqstart == -1 && skipsleft == 0) |
| 363 | 273 | { |
| 364 | / | |
| 274 | // tag all start-of-sequence instructions as needing TLB verification | |
| 365 | 275 | curdesc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION; |
| 366 | 276 | seqstart = descnum; |
| 367 | 277 | } |
| 368 | 278 | |
| 369 | / | |
| 279 | // if we are the last instruction, indicate end-of-sequence and redispatch | |
| 370 | 280 | if (nextdesc == NULL) |
| 371 | 281 | { |
| 372 | 282 | curdesc->flags |= OPFLAG_END_SEQUENCE; |
| r9922 | r9923 | |
| 374 | 284 | curdesc->flags |= endflag; |
| 375 | 285 | } |
| 376 | 286 | |
| 377 | / | |
| 287 | // otherwise, do some analysis based on the next instruction | |
| 378 | 288 | else |
| 379 | 289 | { |
| 380 | | |
| 290 | // if ther | |
| 381 | 291 | int scandescnum; |
| 382 | ||
| 383 | /* if there are instructions between us and the next instruction, we must end our sequence here */ | |
| 292 | opcode_desc *scandesc = NULL; | |
| 384 | 293 | for (scandescnum = descnum + 1; scandescnum < end; scandescnum++) |
| 385 | 294 | { |
| 386 | scandesc = | |
| 295 | scandesc = m_ | |
| 387 | 296 | if (scandesc != NULL || scandesc == nextdesc) |
| 388 | 297 | break; |
| 389 | 298 | } |
| 390 | 299 | if (scandesc != nextdesc) |
| 391 | 300 | curdesc->flags |= OPFLAG_END_SEQUENCE; |
| 392 | 301 | |
| 393 | / | |
| 302 | // if the next instruction is a branch target, mark this instruction as end of sequence | |
| 394 | 303 | if (nextdesc->flags & OPFLAG_IS_BRANCH_TARGET) |
| 395 | 304 | curdesc->flags |= OPFLAG_END_SEQUENCE; |
| 396 | 305 | } |
| 397 | 306 | |
| 398 | /* if we exceed the maximum consecutive count, cut off the sequence */ | |
| 399 | if (++consecutive >= drcfe->max_sequence) | |
| 307 | // if we exceed the maximum consecutive count, cut off the sequence | |
| 308 | if (++consecutive >= m_max_sequence) | |
| 400 | 309 | curdesc->flags |= OPFLAG_END_SEQUENCE; |
| 401 | 310 | if (curdesc->flags & OPFLAG_END_SEQUENCE) |
| 402 | 311 | consecutive = 0; |
| 403 | 312 | |
| 404 | / | |
| 313 | // if this is the end of a sequence, work backwards | |
| 405 | 314 | if (curdesc->flags & OPFLAG_END_SEQUENCE) |
| 406 | 315 | { |
| 316 | // figure out which registers we *must* generate, assuming at the end all must be | |
| 407 | 317 | UINT32 reqmask[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; |
| 408 | int backdesc; | |
| 409 | ||
| 410 | /* figure out which registers we *must* generate, assuming at the end all must be */ | |
| 411 | 318 | if (seqstart != -1) |
| 412 | for (backdesc = descnum; backdesc != seqstart - 1; backdesc--) | |
| 413 | if (drcfe->desc_array[backdesc] != NULL) | |
| 414 | accumulate_required_backwards(drcfe->desc_array[backdesc], reqmask); | |
| 319 | for (int backdesc = descnum; backdesc != seqstart - 1; backdesc--) | |
| 320 | if (m_desc_array[backdesc] != NULL) | |
| 321 | accumulate_required_backwards(*m_desc_array[backdesc], reqmask); | |
| 415 | 322 | |
| 416 | / | |
| 323 | // reset the register states | |
| 417 | 324 | seqstart = -1; |
| 418 | 325 | } |
| 419 | 326 | |
| 420 | /* if we have instructions remaining to be skipped, and this instruction is a branch target */ | |
| 421 | /* belay the skip order */ | |
| 327 | // if we have instructions remaining to be skipped, and this instruction is a branch target | |
| 328 | // belay the skip order | |
| 422 | 329 | if (skipsleft > 0 && (curdesc->flags & OPFLAG_IS_BRANCH_TARGET)) |
| 423 | 330 | skipsleft = 0; |
| 424 | 331 | |
| 425 | / | |
| 332 | // if we're not getting skipped, add us to the end of the list and clear our array slot | |
| 426 | 333 | if (skipsleft == 0) |
| 427 | { | |
| 428 | *tailptr = curdesc; | |
| 429 | tailptr = &curdesc->next; | |
| 430 | curdesc->prev = prev; | |
| 431 | prev = curdesc; | |
| 432 | } | |
| 334 | m_desc_live_list.append(*curdesc); | |
| 433 | 335 | else |
| 434 | desc_ | |
| 336 | m_desc_allocator. | |
| 435 | 337 | |
| 436 | /* if the current instruction starts skipping, reset our skip count */ | |
| 437 | /* otherwise, just decrement */ | |
| 338 | // if the current instruction starts skipping, reset our skip count | |
| 339 | // otherwise, just decrement | |
| 438 | 340 | if (curdesc->skipslots > 0) |
| 439 | 341 | skipsleft = curdesc->skipslots; |
| 440 | 342 | else if (skipsleft > 0) |
| 441 | 343 | skipsleft--; |
| 442 | 344 | } |
| 443 | 345 | |
| 444 | /* zap the array */ | |
| 445 | memset(&drcfe->desc_array[start], 0, (end - start) * sizeof(drcfe->desc_array[0])); | |
| 446 | ||
| 447 | /* return the final tailptr */ | |
| 448 | return tailptr; | |
| 346 | // zap the array | |
| 347 | memset(&m_desc_array[start], 0, (end - start) * sizeof(m_desc_array[0])); | |
| 449 | 348 | } |
| 450 | 349 | |
| 451 | 350 | |
| 452 | /*------------------------------------------------- | |
| 453 | accumulate_required_backwards - recursively | |
| 454 | accumulate live register liveness information | |
| 455 | walking in a backwards direction | |
| 456 | -------------------------------------------------*/ | |
| 351 | //------------------------------------------------- | |
| 352 | // accumulate_required_backwards - recursively | |
| 353 | // accumulate live register liveness information | |
| 354 | // walking in a backwards direction | |
| 355 | //------------------------------------------------- | |
| 457 | 356 | |
| 458 | ||
| 357 | ||
| 459 | 358 | { |
| 460 | /* recursively handle delay slots */ | |
| 461 | if (desc->delay != NULL) | |
| 462 | accumulate_required_backwards(desc->delay, reqmask); | |
| 359 | // recursively handle delay slots | |
| 360 | if (desc.delay.first() != NULL) | |
| 361 | accumulate_required_backwards(*desc.delay.first(), reqmask); | |
| 463 | 362 | |
| 464 | /* if this is a branch, we have to reset our requests */ | |
| 465 | if (desc->flags & OPFLAG_IS_BRANCH) | |
| 363 | // if this is a branch, we have to reset our requests | |
| 364 | if (desc.flags & OPFLAG_IS_BRANCH) | |
| 466 | 365 | reqmask[0] = reqmask[1] = reqmask[2] = reqmask[3] = 0xffffffff; |
| 467 | 366 | |
| 468 | /* determine the required registers */ | |
| 469 | desc->regreq[0] = desc->regout[0] & reqmask[0]; | |
| 470 | desc->regreq[1] = desc->regout[1] & reqmask[1]; | |
| 471 | desc->regreq[2] = desc->regout[2] & reqmask[2]; | |
| 472 | desc->regreq[3] = desc->regout[3] & reqmask[3]; | |
| 367 | // determine the required registers | |
| 368 | desc.regreq[0] = desc.regout[0] & reqmask[0]; | |
| 369 | desc.regreq[1] = desc.regout[1] & reqmask[1]; | |
| 370 | desc.regreq[2] = desc.regout[2] & reqmask[2]; | |
| 371 | desc.regreq[3] = desc.regout[3] & reqmask[3]; | |
| 473 | 372 | |
| 474 | /* any registers modified by this instruction aren't required upstream until referenced */ | |
| 475 | reqmask[0] &= ~desc->regout[0]; | |
| 476 | reqmask[1] &= ~desc->regout[1]; | |
| 477 | reqmask[2] &= ~desc->regout[2]; | |
| 478 | reqmask[3] &= ~desc->regout[3]; | |
| 373 | // any registers modified by this instruction aren't required upstream until referenced | |
| 374 | reqmask[0] &= ~desc.regout[0]; | |
| 375 | reqmask[1] &= ~desc.regout[1]; | |
| 376 | reqmask[2] &= ~desc.regout[2]; | |
| 377 | reqmask[3] &= ~desc.regout[3]; | |
| 479 | 378 | |
| 480 | /* any registers required by this instruction now get marked required */ | |
| 481 | reqmask[0] |= desc->regin[0]; | |
| 482 | reqmask[1] |= desc->regin[1]; | |
| 483 | reqmask[2] |= desc->regin[2]; | |
| 484 | reqmask[3] |= desc->regin[3]; | |
| 379 | // any registers required by this instruction now get marked required | |
| 380 | reqmask[0] |= desc.regin[0]; | |
| 381 | reqmask[1] |= desc.regin[1]; | |
| 382 | reqmask[2] |= desc.regin[2]; | |
| 383 | reqmask[3] |= desc.regin[3]; | |
| 485 | 384 | } |
| 486 | 385 | |
| 487 | 386 | |
| 488 | /*------------------------------------------------- | |
| 489 | release_descriptions - release any | |
| 490 | descriptions we've allocated back to the | |
| 491 | free list | |
| 492 | ------------------------------------------------*/ | |
| 387 | //------------------------------------------------- | |
| 388 | // release_descriptions - release any | |
| 389 | // descriptions we've allocated back to the | |
| 390 | // free list | |
| 391 | //------------------------------------------------ | |
| 493 | 392 | |
| 494 | ||
| 393 | ||
| 495 | 394 | { |
| 496 | /* loop while we still have valid entries */ | |
| 497 | while (desc != NULL) | |
| 498 | { | |
| 499 | opcode_desc *freeme = desc; | |
| 500 | ||
| 501 | /* recursively release delay slots */ | |
| 502 | if (desc->delay != NULL) | |
| 503 | release_descriptions(drcfe, desc->delay); | |
| 504 | desc = desc->next; | |
| 505 | desc_free(drcfe, freeme); | |
| 506 | } | |
| 395 | // release all delay slots first | |
| 396 | for (opcode_desc *curdesc = m_desc_live_list.first(); curdesc != NULL; curdesc = curdesc->next()) | |
| 397 | m_desc_allocator.reclaim_all(curdesc->delay); | |
| 398 | ||
| 399 | // reclaim all the descriptors | |
| 400 | m_desc_allocator.reclaim_all(m_desc_live_list); | |
| 507 | 401 | } |
| r9922 | r9923 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Generic dynamic recompiler frontend structures and utilities. |
| 6 | 6 | |
| 7 | **************************************************************************** | |
| 8 | ||
| 7 | 9 | Copyright Aaron Giles |
| 8 | Released for general non-commercial use under the MAME license | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 10 | All rights reserved. | |
| 10 | 11 | |
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | **************************************************************************** |
| 12 | 39 | |
| 13 | 40 | Concepts: |
| r9922 | r9923 | |
| 37 | 64 | #define __DRCFE_H__ |
| 38 | 65 | |
| 39 | 66 | |
| 40 | /*************************************************************************** | |
| 41 | CONSTANTS | |
| 42 | ***************************************************************************/ | |
| 67 | //************************************************************************** | |
| 68 | // CONSTANTS | |
| 69 | //************************************************************************** | |
| 43 | 70 | |
| 44 | /* this defines a branch targetpc that is dynamic at runtime */ | |
| 45 | #define BRANCH_TARGET_DYNAMIC (~0) | |
| 71 | // this defines a branch targetpc that is dynamic at runtime | |
| 72 | const offs_t BRANCH_TARGET_DYNAMIC = ~0; | |
| 46 | 73 | |
| 47 | 74 | |
| 48 | /* opcode branch flags */ | |
| 49 | #define OPFLAG_IS_UNCONDITIONAL_BRANCH 0x00000001 /* instruction is unconditional branch */ | |
| 50 | #define OPFLAG_IS_CONDITIONAL_BRANCH 0x00000002 /* instruction is conditional branch */ | |
| 51 | #define OPFLAG_IS_BRANCH (OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_IS_CONDITIONAL_BRANCH) | |
| 52 | #define OPFLAG_IS_BRANCH_TARGET 0x00000004 /* instruction is the target of a branch */ | |
| 53 | #define OPFLAG_IN_DELAY_SLOT 0x00000008 /* instruction is in the delay slot of a branch */ | |
| 54 | #define OPFLAG_INTRABLOCK_BRANCH 0x00000010 /* instruction branches within the block */ | |
| 75 | // opcode branch flags | |
| 76 | const UINT32 OPFLAG_IS_UNCONDITIONAL_BRANCH = 0x00000001; // instruction is unconditional branch | |
| 77 | const UINT32 OPFLAG_IS_CONDITIONAL_BRANCH = 0x00000002; // instruction is conditional branch | |
| 78 | const UINT32 OPFLAG_IS_BRANCH = (OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_IS_CONDITIONAL_BRANCH); | |
| 79 | const UINT32 OPFLAG_IS_BRANCH_TARGET = 0x00000004; // instruction is the target of a branch | |
| 80 | const UINT32 OPFLAG_IN_DELAY_SLOT = 0x00000008; // instruction is in the delay slot of a branch | |
| 81 | const UINT32 OPFLAG_INTRABLOCK_BRANCH = 0x00000010; // instruction branches within the block | |
| 55 | 82 | |
| 56 | /* opcode exception flags */ | |
| 57 | #define OPFLAG_CAN_TRIGGER_SW_INT 0x00000020 /* instruction can trigger a software interrupt */ | |
| 58 | #define OPFLAG_CAN_EXPOSE_EXTERNAL_INT 0x00000040 /* instruction can expose an external interrupt */ | |
| 59 | #define OPFLAG_CAN_CAUSE_EXCEPTION 0x00000080 /* instruction may generate exception */ | |
| 60 | #define OPFLAG_WILL_CAUSE_EXCEPTION 0x00000100 /* instruction will generate exception */ | |
| 61 | #define OPFLAG_PRIVILEGED 0x00000200 /* instruction is privileged */ | |
| 83 | // opcode exception flags | |
| 84 | const UINT32 OPFLAG_CAN_TRIGGER_SW_INT = 0x00000020; // instruction can trigger a software interrupt | |
| 85 | const UINT32 OPFLAG_CAN_EXPOSE_EXTERNAL_INT = 0x00000040; // instruction can expose an external interrupt | |
| 86 | const UINT32 OPFLAG_CAN_CAUSE_EXCEPTION = 0x00000080; // instruction may generate exception | |
| 87 | const UINT32 OPFLAG_WILL_CAUSE_EXCEPTION = 0x00000100; // instruction will generate exception | |
| 88 | const UINT32 OPFLAG_PRIVILEGED = 0x00000200; // instruction is privileged | |
| 62 | 89 | |
| 63 | /* opcode virtual->physical translation flags */ | |
| 64 | #define OPFLAG_VALIDATE_TLB 0x00000400 /* instruction must validate TLB before execution */ | |
| 65 | #define OPFLAG_MODIFIES_TRANSLATION 0x00000800 /* instruction modifies the TLB */ | |
| 66 | #define OPFLAG_COMPILER_PAGE_FAULT 0x00001000 /* compiler hit a page fault when parsing */ | |
| 67 | #define OPFLAG_COMPILER_UNMAPPED 0x00002000 /* compiler hit unmapped memory when parsing */ | |
| 90 | // opcode virtual->physical translation flags | |
| 91 | const UINT32 OPFLAG_VALIDATE_TLB = 0x00000400; // instruction must validate TLB before execution | |
| 92 | const UINT32 OPFLAG_MODIFIES_TRANSLATION = 0x00000800; // instruction modifies the TLB | |
| 93 | const UINT32 OPFLAG_COMPILER_PAGE_FAULT = 0x00001000; // compiler hit a page fault when parsing | |
| 94 | const UINT32 OPFLAG_COMPILER_UNMAPPED = 0x00002000; // compiler hit unmapped memory when parsing | |
| 68 | 95 | |
| 69 | /* opcode flags */ | |
| 70 | #define OPFLAG_INVALID_OPCODE 0x00004000 /* instruction is invalid */ | |
| 71 | #define OPFLAG_VIRTUAL_NOOP 0x00008000 /* instruction is a virtual no-op */ | |
| 96 | // opcode flags | |
| 97 | const UINT32 OPFLAG_INVALID_OPCODE = 0x00004000; // instruction is invalid | |
| 98 | const UINT32 OPFLAG_VIRTUAL_NOOP = 0x00008000; // instruction is a virtual no-op | |
| 72 | 99 | |
| 73 | /* opcode sequence flow flags */ | |
| 74 | #define OPFLAG_REDISPATCH 0x00010000 /* instruction must redispatch after completion */ | |
| 75 | #define OPFLAG_RETURN_TO_START 0x00020000 /* instruction must jump back to the beginning after completion */ | |
| 76 | #define OPFLAG_END_SEQUENCE 0x00040000 /* this is the last instruction in a sequence */ | |
| 77 | #define OPFLAG_CAN_CHANGE_MODES 0x00080000 /* instruction can change modes */ | |
| 100 | // opcode sequence flow flags | |
| 101 | const UINT32 OPFLAG_REDISPATCH = 0x00010000; // instruction must redispatch after completion | |
| 102 | const UINT32 OPFLAG_RETURN_TO_START = 0x00020000; // instruction must jump back to the beginning after completion | |
| 103 | const UINT32 OPFLAG_END_SEQUENCE = 0x00040000; // this is the last instruction in a sequence | |
| 104 | const UINT32 OPFLAG_CAN_CHANGE_MODES = 0x00080000; // instruction can change modes | |
| 78 | 105 | |
| 79 | /* execution semantics */ | |
| 80 | #define OPFLAG_READS_MEMORY 0x00100000 /* instruction reads memory */ | |
| 81 | #define OPFLAG_WRITES_MEMORY 0x00200000 /* instruction writes memory */ | |
| 106 | // execution semantics | |
| 107 | const UINT32 OPFLAG_READS_MEMORY = 0x00100000; // instruction reads memory | |
| 108 | const UINT32 OPFLAG_WRITES_MEMORY = 0x00200000; // instruction writes memory | |
| 82 | 109 | |
| 83 | 110 | |
| 84 | 111 | |
| 85 | /*************************************************************************** | |
| 86 | TYPE DEFINITIONS | |
| 87 | ***************************************************************************/ | |
| 112 | //************************************************************************** | |
| 113 | // TYPE DEFINITIONS | |
| 114 | //************************************************************************** | |
| 88 | 115 | |
| 89 | /* opaque internal state */ | |
| 90 | typedef struct _drcfe_state drcfe_state; | |
| 116 | // description of a given opcode | |
| 117 | struct opcode_desc | |
| 118 | { | |
| 119 | opcode_desc *next() const { return m_next; } | |
| 91 | 120 | |
| 121 | // links to other descriptions | |
| 122 | opcode_desc * m_next; // pointer to next description | |
| 123 | opcode_desc * branch; // pointer back to branch description for delay slots | |
| 124 | simple_list<opcode_desc> delay; // pointer to delay slot description | |
| 92 | 125 | |
| 93 | /* description of a given opcode */ | |
| 94 | typedef struct _opcode_desc opcode_desc; | |
| 95 | struct _opcode_desc | |
| 96 | { | |
| 97 | /* links to other descriptions */ | |
| 98 | opcode_desc * next; /* pointer to next description */ | |
| 99 | opcode_desc * prev; /* pointer to previous description */ | |
| 100 | opcode_desc * branch; /* pointer back to branch description for delay slots */ | |
| 101 | opcode_desc * delay; /* pointer to delay slot description */ | |
| 126 | // information about the current PC | |
| 127 | offs_t pc; // PC of this opcode | |
| 128 | offs_t physpc; // physical PC of this opcode | |
| 129 | offs_t targetpc; // target PC if we are a branch, or BRANCH_TARGET_DYNAMIC | |
| 102 | 130 | |
| 103 | /* information about the current PC */ | |
| 104 | offs_t pc; /* PC of this opcode */ | |
| 105 | offs_t physpc; /* physical PC of this opcode */ | |
| 106 | offs_t targetpc; /* target PC if we are a branch, or BRANCH_TARGET_DYNAMIC */ | |
| 107 | ||
| 108 | /* copy of up to 16 bytes of opcode */ | |
| 131 | // copy of up to 16 bytes of opcode | |
| 109 | 132 | union |
| 110 | 133 | { |
| 111 | 134 | UINT8 b[16]; |
| 112 | 135 | UINT16 w[8]; |
| 113 | 136 | UINT32 l[4]; |
| 114 | 137 | UINT64 q[2]; |
| 115 | } opptr; / | |
| 138 | } opptr; // pointer to opcode memory | |
| 116 | 139 | |
| 117 | /* information about this instruction's execution */ | |
| 118 | UINT8 length; /* length in bytes of this opcode */ | |
| 119 | UINT8 delayslots; /* number of delay slots (for branches) */ | |
| 120 | UINT8 skipslots; /* number of skip slots (for branches) */ | |
| 121 | UINT32 flags; /* OPFLAG_* opcode flags */ | |
| 122 | UINT32 cycles; /* number of cycles needed to execute */ | |
| 140 | // information about this instruction's execution | |
| 141 | UINT8 length; // length in bytes of this opcode | |
| 142 | UINT8 delayslots; // number of delay slots (for branches) | |
| 143 | UINT8 skipslots; // number of skip slots (for branches) | |
| 144 | UINT32 flags; // OPFLAG_* opcode flags | |
| 145 | UINT32 cycles; // number of cycles needed to execute | |
| 123 | 146 | |
| 124 | /* register usage information */ | |
| 125 | UINT32 regin[4]; /* input registers */ | |
| 126 | UINT32 regout[4]; /* output registers */ | |
| 127 | UINT32 regreq[4]; /* required output registers */ | |
| 147 | // register usage information | |
| 148 | UINT32 regin[4]; // input registers | |
| 149 | UINT32 regout[4]; // output registers | |
| 150 | UINT32 regreq[4]; // required output registers | |
| 128 | 151 | }; |
| 129 | 152 | |
| 130 | 153 | |
| 131 | /* callback function that is used to describe a single opcode */ | |
| 132 | typedef int (*drcfe_describe_func)(void *param, opcode_desc *desc, const opcode_desc *prev); | |
| 133 | ||
| 134 | ||
| 135 | /* description of a given opcode */ | |
| 136 | typedef struct _drcfe_config drcfe_config; | |
| 137 | struct _drcfe_config | |
| 154 | // DRC frontend state | |
| 155 | class drc_frontend | |
| 138 | 156 | { |
| 139 | UINT32 window_start; /* code window start offset = startpc - window_start */ | |
| 140 | UINT32 window_end; /* code window end offset = startpc + window_end */ | |
| 141 | UINT32 max_sequence; /* maximum instructions to include in a sequence */ | |
| 142 | drcfe_describe_func describe; /* callback to describe a single instruction */ | |
| 143 | }; | |
| 157 | public: | |
| 158 | // construction/destruction | |
| 159 | drc_frontend(device_t &cpu, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); | |
| 160 | virtual ~drc_frontend(); | |
| 161 | ||
| 162 | // describe a block | |
| 163 | const opcode_desc *describe_code(offs_t startpc); | |
| 144 | 164 | |
| 165 | protected: | |
| 166 | // required overrides | |
| 167 | virtual bool describe(opcode_desc &desc, const opcode_desc *prev) = 0; | |
| 145 | 168 | |
| 169 | private: | |
| 170 | // internal helpers | |
| 171 | opcode_desc *describe_one(offs_t curpc, const opcode_desc *prevdesc); | |
| 172 | void build_sequence(int start, int end, UINT32 endflag); | |
| 173 | void accumulate_required_backwards(opcode_desc &desc, UINT32 *reqmask); | |
| 174 | void release_descriptions(); | |
| 146 | 175 | |
| 147 | /*************************************************************************** | |
| 148 | FUNCTION PROTOTYPES | |
| 149 | ***************************************************************************/ | |
| 176 | // configuration parameters | |
| 177 | UINT32 m_window_start; // code window start offset = startpc - window_start | |
| 178 | UINT32 m_window_end; // code window end offset = startpc + window_end | |
| 179 | UINT32 m_max_sequence; // maximum instructions to include in a sequence | |
| 150 | 180 | |
| 151 | /* initializate the drcfe state */ | |
| 152 | drcfe_state *drcfe_init(device_t *cpu, const drcfe_config *config, void *param); | |
| 181 | // CPU parameters | |
| 182 | cpu_device & m_cpudevice; // CPU device object | |
| 183 | address_space * m_program; // program address space for this CPU | |
| 184 | offs_t m_pageshift; // shift to convert address to a page index | |
| 153 | 185 | |
| 154 | /* clean up after ourselves */ | |
| 155 | void drcfe_exit(drcfe_state *drcfe); | |
| 186 | // opcode descriptor arrays | |
| 187 | simple_list<opcode_desc> m_desc_live_list; // list of live descriptions | |
| 188 | fixed_allocator<opcode_desc> m_desc_allocator; // fixed allocator for descriptions | |
| 189 | opcode_desc ** m_desc_array; // array of descriptions in PC order | |
| 190 | }; | |
| 156 | 191 | |
| 157 | /* describe a sequence of code that falls within the configured window relative to the specified startpc */ | |
| 158 | const opcode_desc *drcfe_describe_code(drcfe_state *drcfe, offs_t startpc); | |
| 159 | 192 | |
| 160 | ||
| 161 | 193 | #endif /* __DRCFE_H__ */ |
| r9922 | r9923 | |
|---|---|---|
| 276 | 276 | |
| 277 | 277 | x86code * debug_cpu_instruction_hook;/* debugger callback */ |
| 278 | 278 | x86code * debug_log_hashjmp; /* hashjmp debugging */ |
| 279 | x86code * debug_log_hashjmp_fail; /* hashjmp debugging */ | |
| 279 | 280 | x86code * drcmap_get_value; /* map lookup helper */ |
| 280 | 281 | data_accessors accessors[ADDRESS_SPACES]; /* memory accessors */ |
| 281 | 282 | address_space * space[ADDRESS_SPACES]; /* address spaces */ |
| r9922 | r9923 | |
| 316 | 317 | |
| 317 | 318 | /* private helper functions */ |
| 318 | 319 | static void fixup_label(void *parameter, drccodeptr labelcodeptr); |
| 319 | static void debug_log_hashjmp(int mode, offs_t pc); | |
| 320 | static void debug_log_hashjmp(offs_t pc, int mode); | |
| 321 | static void debug_log_hashjmp_fail(); | |
| 320 | 322 | |
| 321 | 323 | |
| 322 | 324 | |
| r9922 | r9923 | |
| 731 | 733 | /* get pointers to C functions we need to call */ |
| 732 | 734 | drcbe->debug_cpu_instruction_hook = (x86code *)debugger_instruction_hook; |
| 733 | 735 | if (LOG_HASHJMPS) |
| 736 | { | |
| 734 | 737 | drcbe->debug_log_hashjmp = (x86code *)debug_log_hashjmp; |
| 738 | drcbe->debug_log_hashjmp_fail = (x86code *)debug_log_hashjmp_fail; | |
| 739 | } | |
| 735 | 740 | drcbe->drcmap_get_value = (x86code *)drcmap_get_value; |
| 736 | 741 | |
| 737 | 742 | /* allocate hash tables */ |
| r9922 | r9923 | |
| 2983 | 2988 | logging of hashjmps |
| 2984 | 2989 | -------------------------------------------------*/ |
| 2985 | 2990 | |
| 2986 | static void debug_log_hashjmp( | |
| 2991 | static void debug_log_hashjmp( | |
| 2987 | 2992 | { |
| 2988 | 2993 | printf("mode=%d PC=%08X\n", mode, pc); |
| 2989 | 2994 | } |
| 2990 | 2995 | |
| 2991 | 2996 | |
| 2997 | /*------------------------------------------------- | |
| 2998 | debug_log_hashjmp - callback to handle | |
| 2999 | logging of hashjmps | |
| 3000 | -------------------------------------------------*/ | |
| 2992 | 3001 | |
| 3002 | static void debug_log_hashjmp_fail() | |
| 3003 | { | |
| 3004 | printf(" (FAIL)\n"); | |
| 3005 | } | |
| 3006 | ||
| 3007 | ||
| 3008 | ||
| 2993 | 3009 | /*************************************************************************** |
| 2994 | 3010 | COMPILE-TIME OPCODES |
| 2995 | 3011 | ***************************************************************************/ |
| r9922 | r9923 | |
| 3249 | 3265 | } |
| 3250 | 3266 | |
| 3251 | 3267 | /* in all cases, if there is no code, we return here to generate the exception */ |
| 3268 | if (LOG_HASHJMPS) | |
| 3269 | emit_smart_call_m64(drcbe, &dst, &drcbe->debug_log_hashjmp_fail); | |
| 3270 | ||
| 3252 | 3271 | emit_mov_m32_p32(drcbe, &dst, MABS(drcbe, &drcbe->state.exp), &pcp); // mov [exp],param |
| 3253 | 3272 | emit_sub_r64_imm(&dst, REG_RSP, 8); // sub rsp,8 |
| 3254 | 3273 | emit_call_m64(&dst, MABS(drcbe, exp.value)); // call [exp] |
| r9922 | r9923 | |
|---|---|---|
| 1 | ||
| 1 | ||
| 2 | 2 | |
| 3 | 3 | rspfe.c |
| 4 | 4 | |
| r9922 | r9923 | |
| 14 | 14 | #include "rspfe.h" |
| 15 | 15 | #include "rsp.h" |
| 16 | 16 | |
| 17 | /*************************************************************************** | |
| 18 | FUNCTION PROTOTYPES | |
| 19 | ***************************************************************************/ | |
| 17 | //************************************************************************** | |
| 18 | // RSP FRONTEND | |
| 19 | //************************************************************************** | |
| 20 | 20 | |
| 21 | static int describe_instruction_special(rsp_state *rsp, UINT32 op, opcode_desc *desc); | |
| 22 | static int describe_instruction_regimm(rsp_state *rsp, UINT32 op, opcode_desc *desc); | |
| 23 | static int describe_instruction_cop0(rsp_state *rsp, UINT32 op, opcode_desc *desc); | |
| 24 | static int describe_instruction_cop2(rsp_state *rsp, UINT32 op, opcode_desc *desc); | |
| 21 | //------------------------------------------------- | |
| 22 | // rsp_frontend - constructor | |
| 23 | //------------------------------------------------- | |
| 25 | 24 | |
| 26 | /*************************************************************************** | |
| 27 | INSTRUCTION PARSERS | |
| 28 | ***************************************************************************/ | |
| 25 | rsp_frontend::rsp_frontend(rsp_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) | |
| 26 | : drc_frontend(*state.device, window_start, window_end, max_sequence), | |
| 27 | m_context(state) | |
| 28 | { | |
| 29 | } | |
| 29 | 30 | |
| 30 | /*------------------------------------------------- | |
| 31 | describe_instruction - build a description | |
| 32 | of a single instruction | |
| 33 | -------------------------------------------------*/ | |
| 34 | 31 | |
| 35 | int rspfe_describe(void *param, opcode_desc *desc, const opcode_desc *prev) | |
| 32 | //------------------------------------------------- | |
| 33 | // describe - build a description of a single | |
| 34 | // instruction | |
| 35 | //------------------------------------------------- | |
| 36 | ||
| 37 | bool rsp_frontend::describe(opcode_desc &desc, const opcode_desc *prev) | |
| 36 | 38 | { |
| 37 | rsp_state *rsp = (rsp_state *)param; | |
| 38 | 39 | UINT32 op, opswitch; |
| 39 | 40 | |
| 40 | /* fetch the opcode */ | |
| 41 | op = desc->opptr.l[0] = rsp->direct->read_decrypted_dword(desc->physpc | 0x1000); | |
| 41 | // fetch the opcode | |
| 42 | op = desc.opptr.l[0] = m_context.direct->read_decrypted_dword(desc.physpc | 0x1000); | |
| 42 | 43 | |
| 43 | /* all instructions are 4 bytes and default to a single cycle each */ | |
| 44 | desc->length = 4; | |
| 45 | desc->cycles = 1; | |
| 44 | // all instructions are 4 bytes and default to a single cycle each | |
| 45 | desc.length = 4; | |
| 46 | desc.cycles = 1; | |
| 46 | 47 | |
| 47 | / | |
| 48 | // parse the instruction | |
| 48 | 49 | opswitch = op >> 26; |
| 49 | 50 | switch (opswitch) |
| 50 | 51 | { |
| 51 | case 0x00: /* SPECIAL */ | |
| 52 | return describe_instruction_special(rsp, op, desc); | |
| 52 | case 0x00: // SPECIAL | |
| 53 | return describe_special(op, desc); | |
| 53 | 54 | |
| 54 | case 0x01: /* REGIMM */ | |
| 55 | return describe_instruction_regimm(rsp, op, desc); | |
| 55 | case 0x01: // REGIMM | |
| 56 | return describe_regimm(op, desc); | |
| 56 | 57 | |
| 57 | case 0x10: /* COP0 */ | |
| 58 | return describe_instruction_cop0(rsp, op, desc); | |
| 58 | case 0x10: // COP0 | |
| 59 | return describe_cop0(op, desc); | |
| 59 | 60 | |
| 60 | case 0x12: /* COP2 */ | |
| 61 | return describe_instruction_cop2(rsp, op, desc); | |
| 61 | case 0x12: // COP2 | |
| 62 | return describe_cop2(op, desc); | |
| 62 | 63 | |
| 63 | case 0x02: /* J */ | |
| 64 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 65 | desc->targetpc = ((UIMM26 << 2) & 0x00000fff) | 0x1000; | |
| 66 | desc->delayslots = 1; | |
| 67 | return TRUE; | |
| 64 | case 0x02: // J | |
| 65 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 66 | desc.targetpc = ((LIMMVAL << 2) & 0x00000fff) | 0x1000; | |
| 67 | desc.delayslots = 1; | |
| 68 | return true; | |
| 68 | 69 | |
| 69 | case 0x03: /* JAL */ | |
| 70 | desc->regout[0] |= REGFLAG_R(31); | |
| 71 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 72 | desc->targetpc = ((UIMM26 << 2) & 0x00000fff) | 0x1000; | |
| 73 | desc->delayslots = 1; | |
| 74 | return TRUE; | |
| 70 | case 0x03: // JAL | |
| 71 | desc.regout[0] |= REGFLAG_R(31); | |
| 72 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 73 | desc.targetpc = ((LIMMVAL << 2) & 0x00000fff) | 0x1000; | |
| 74 | desc.delayslots = 1; | |
| 75 | return true; | |
| 75 | 76 | |
| 76 | case 0x04: /* BEQ */ | |
| 77 | case 0x05: /* BNE */ | |
| 77 | case 0x04: // BEQ | |
| 78 | case 0x05: // BNE | |
| 78 | 79 | if ((opswitch == 0x04 || opswitch == 0x14) && RSREG == RTREG) |
| 79 | desc | |
| 80 | desc. | |
| 80 | 81 | else |
| 81 | 82 | { |
| 82 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 83 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 83 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 84 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 84 | 85 | } |
| 85 | desc->targetpc = ((desc->pc + 4 + (SIMM16 << 2)) & 0x00000fff) | 0x1000; | |
| 86 | desc->delayslots = 1; | |
| 87 | desc->skipslots = (opswitch & 0x10) ? 1 : 0; | |
| 88 | return TRUE; | |
| 86 | desc.targetpc = ((desc.pc + 4 + (SIMMVAL << 2)) & 0x00000fff) | 0x1000; | |
| 87 | desc.delayslots = 1; | |
| 88 | desc.skipslots = (opswitch & 0x10) ? 1 : 0; | |
| 89 | return true; | |
| 89 | 90 | |
| 90 | case 0x06: /* BLEZ */ | |
| 91 | case 0x07: /* BGTZ */ | |
| 91 | case 0x06: // BLEZ | |
| 92 | case 0x07: // BGTZ | |
| 92 | 93 | if ((opswitch == 0x06 || opswitch == 0x16) && RSREG == 0) |
| 93 | desc | |
| 94 | desc. | |
| 94 | 95 | else |
| 95 | 96 | { |
| 96 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 97 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 97 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 98 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 98 | 99 | } |
| 99 | desc->targetpc = ((desc->pc + 4 + (SIMM16 << 2)) & 0x00000fff) | 0x1000; | |
| 100 | desc->delayslots = 1; | |
| 101 | desc->skipslots = (opswitch & 0x10) ? 1 : 0; | |
| 102 | return TRUE; | |
| 100 | desc.targetpc = ((desc.pc + 4 + (SIMMVAL << 2)) & 0x00000fff) | 0x1000; | |
| 101 | desc.delayslots = 1; | |
| 102 | desc.skipslots = (opswitch & 0x10) ? 1 : 0; | |
| 103 | return true; | |
| 103 | 104 | |
| 104 | case 0x08: /* ADDI */ | |
| 105 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 106 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 107 | return TRUE; | |
| 105 | case 0x08: // ADDI | |
| 106 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 107 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 108 | return true; | |
| 108 | 109 | |
| 109 | case 0x09: /* ADDIU */ | |
| 110 | case 0x0a: /* SLTI */ | |
| 111 | case 0x0b: /* SLTIU */ | |
| 112 | case 0x0c: /* ANDI */ | |
| 113 | case 0x0d: /* ORI */ | |
| 114 | case 0x0e: /* XORI */ | |
| 115 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 116 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 117 | return TRUE; | |
| 110 | case 0x09: // ADDIU | |
| 111 | case 0x0a: // SLTI | |
| 112 | case 0x0b: // SLTIU | |
| 113 | case 0x0c: // ANDI | |
| 114 | case 0x0d: // ORI | |
| 115 | case 0x0e: // XORI | |
| 116 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 117 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 118 | return true; | |
| 118 | 119 | |
| 119 | case 0x0f: /* LUI */ | |
| 120 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 121 | return TRUE; | |
| 120 | case 0x0f: // LUI | |
| 121 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 122 | return true; | |
| 122 | 123 | |
| 123 | case 0x20: /* LB */ | |
| 124 | case 0x21: /* LH */ | |
| 125 | case 0x23: /* LW */ | |
| 126 | case 0x24: /* LBU */ | |
| 127 | case 0x25: /* LHU */ | |
| 128 | case 0x27: /* LWU */ | |
| 129 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 130 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 131 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 132 | return TRUE; | |
| 124 | case 0x20: // LB | |
| 125 | case 0x21: // LH | |
| 126 | case 0x23: // LW | |
| 127 | case 0x24: // LBU | |
| 128 | case 0x25: // LHU | |
| 129 | case 0x27: // LWU | |
| 130 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 131 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 132 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 133 | return true; | |
| 133 | 134 | |
| 134 | case 0x28: /* SB */ | |
| 135 | case 0x29: /* SH */ | |
| 136 | case 0x2b: /* SW */ | |
| 137 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 138 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 139 | return TRUE; | |
| 135 | case 0x28: // SB | |
| 136 | case 0x29: // SH | |
| 137 | case 0x2b: // SW | |
| 138 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 139 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 140 | return true; | |
| 140 | 141 | |
| 141 | case 0x32: /* LWC2 */ | |
| 142 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 143 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 144 | return TRUE; | |
| 142 | case 0x32: // LWC2 | |
| 143 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 144 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 145 | return true; | |
| 145 | 146 | |
| 146 | case 0x3a: /* SWC2 */ | |
| 147 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 148 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 149 | return TRUE; | |
| 147 | case 0x3a: // SWC2 | |
| 148 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 149 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 150 | return true; | |
| 150 | 151 | } |
| 151 | 152 | |
| 152 | return | |
| 153 | return false; | |
| 153 | 154 | } |
| 154 | 155 | |
| 155 | 156 | |
| 156 | /*------------------------------------------------- | |
| 157 | describe_instruction_special - build a | |
| 158 | description of a single instruction in the | |
| 159 | 'special' group | |
| 160 | -------------------------------------------------*/ | |
| 157 | //------------------------------------------------- | |
| 158 | // describe_special - build a description of a | |
| 159 | // single instruction in the 'special' group | |
| 160 | //------------------------------------------------- | |
| 161 | 161 | |
| 162 | ||
| 162 | bool | |
| 163 | 163 | { |
| 164 | 164 | switch (op & 63) |
| 165 | 165 | { |
| 166 | case 0x00: /* SLL */ | |
| 167 | case 0x02: /* SRL */ | |
| 168 | case 0x03: /* SRA */ | |
| 169 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 170 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 171 | return TRUE; | |
| 166 | case 0x00: // SLL | |
| 167 | case 0x02: // SRL | |
| 168 | case 0x03: // SRA | |
| 169 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 170 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 171 | return true; | |
| 172 | 172 | |
| 173 | case 0x04: /* SLLV */ | |
| 174 | case 0x06: /* SRLV */ | |
| 175 | case 0x07: /* SRAV */ | |
| 176 | case 0x21: /* ADDU */ | |
| 177 | case 0x23: /* SUBU */ | |
| 178 | case 0x24: /* AND */ | |
| 179 | case 0x25: /* OR */ | |
| 180 | case 0x26: /* XOR */ | |
| 181 | case 0x27: /* NOR */ | |
| 182 | case 0x2a: /* SLT */ | |
| 183 | case 0x2b: /* SLTU */ | |
| 184 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 185 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 186 | return TRUE; | |
| 173 | case 0x04: // SLLV | |
| 174 | case 0x06: // SRLV | |
| 175 | case 0x07: // SRAV | |
| 176 | case 0x21: // ADDU | |
| 177 | case 0x23: // SUBU | |
| 178 | case 0x24: // AND | |
| 179 | case 0x25: // OR | |
| 180 | case 0x26: // XOR | |
| 181 | case 0x27: // NOR | |
| 182 | case 0x2a: // SLT | |
| 183 | case 0x2b: // SLTU | |
| 184 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 185 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 186 | return true; | |
| 187 | 187 | |
| 188 | case 0x20: /* ADD */ | |
| 189 | case 0x22: /* SUB */ | |
| 190 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 191 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 192 | return TRUE; | |
| 188 | case 0x20: // ADD | |
| 189 | case 0x22: // SUB | |
| 190 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 191 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 192 | return true; | |
| 193 | 193 | |
| 194 | case 0x08: /* JR */ | |
| 195 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 196 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 197 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 198 | desc->delayslots = 1; | |
| 199 | return TRUE; | |
| 194 | case 0x08: // JR | |
| 195 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 196 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 197 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 198 | desc.delayslots = 1; | |
| 199 | return true; | |
| 200 | 200 | |
| 201 | case 0x09: /* JALR */ | |
| 202 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 203 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 204 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 205 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 206 | desc->delayslots = 1; | |
| 207 | return TRUE; | |
| 201 | case 0x09: // JALR | |
| 202 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 203 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 204 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 205 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 206 | desc.delayslots = 1; | |
| 207 | return true; | |
| 208 | 208 | |
| 209 | case 0x0d: /* BREAK */ | |
| 210 | desc->flags |= OPFLAG_END_SEQUENCE; | |
| 211 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 212 | return TRUE; | |
| 209 | case 0x0d: // BREAK | |
| 210 | desc.flags |= OPFLAG_END_SEQUENCE; | |
| 211 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 212 | return true; | |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | return | |
| 215 | return false; | |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
| 219 | /*------------------------------------------------- | |
| 220 | describe_instruction_regimm - build a | |
| 221 | description of a single instruction in the | |
| 222 | 'regimm' group | |
| 223 | -------------------------------------------------*/ | |
| 219 | //------------------------------------------------- | |
| 220 | // describe_regimm - build a description of a | |
| 221 | // single instruction in the 'regimm' group | |
| 222 | //------------------------------------------------- | |
| 224 | 223 | |
| 225 | ||
| 224 | bool | |
| 226 | 225 | { |
| 227 | 226 | switch (RTREG) |
| 228 | 227 | { |
| 229 | case 0x00: /* BLTZ */ | |
| 230 | case 0x01: /* BGEZ */ | |
| 228 | case 0x00: // BLTZ | |
| 229 | case 0x01: // BGEZ | |
| 231 | 230 | if (RTREG == 0x01 && RSREG == 0) |
| 232 | desc | |
| 231 | desc. | |
| 233 | 232 | else |
| 234 | 233 | { |
| 235 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 236 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 234 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 235 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 237 | 236 | } |
| 238 | desc->targetpc = ((desc->pc + 4 + (SIMM16 << 2)) & 0x00000fff) | 0x1000; | |
| 239 | desc->delayslots = 1; | |
| 240 | desc->skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 241 | return TRUE; | |
| 237 | desc.targetpc = ((desc.pc + 4 + (SIMMVAL << 2)) & 0x00000fff) | 0x1000; | |
| 238 | desc.delayslots = 1; | |
| 239 | desc.skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 240 | return true; | |
| 242 | 241 | |
| 243 | case 0x10: /* BLTZAL */ | |
| 244 | case 0x11: /* BGEZAL */ | |
| 242 | case 0x10: // BLTZAL | |
| 243 | case 0x11: // BGEZAL | |
| 245 | 244 | if (RTREG == 0x11 && RSREG == 0) |
| 246 | desc | |
| 245 | desc. | |
| 247 | 246 | else |
| 248 | 247 | { |
| 249 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 250 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 248 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 249 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 251 | 250 | } |
| 252 | desc->regout[0] |= REGFLAG_R(31); | |
| 253 | desc->targetpc = ((desc->pc + 4 + (SIMM16 << 2)) & 0x00000fff) | 0x1000; | |
| 254 | desc->delayslots = 1; | |
| 255 | desc->skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 256 | return TRUE; | |
| 251 | desc.regout[0] |= REGFLAG_R(31); | |
| 252 | desc.targetpc = ((desc.pc + 4 + (SIMMVAL << 2)) & 0x00000fff) | 0x1000; | |
| 253 | desc.delayslots = 1; | |
| 254 | desc.skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 255 | return true; | |
| 257 | 256 | } |
| 258 | 257 | |
| 259 | return | |
| 258 | return false; | |
| 260 | 259 | } |
| 261 | 260 | |
| 262 | 261 | |
| 263 | /*------------------------------------------------- | |
| 264 | describe_instruction_cop0 - build a | |
| 265 | description of a single instruction in the | |
| 266 | COP0 group | |
| 267 | -------------------------------------------------*/ | |
| 262 | //------------------------------------------------- | |
| 263 | // describe_cop0 - build a description of a | |
| 264 | // single instruction in the COP0 group | |
| 265 | //------------------------------------------------- | |
| 268 | 266 | |
| 269 | ||
| 267 | bool | |
| 270 | 268 | { |
| 271 | 269 | switch (RSREG) |
| 272 | 270 | { |
| 273 | case 0x00: /* MFCz */ | |
| 274 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 275 | return TRUE; | |
| 271 | case 0x00: // MFCz | |
| 272 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 273 | return true; | |
| 276 | 274 | |
| 277 | case 0x04: /* MTCz */ | |
| 278 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 279 | return TRUE; | |
| 275 | case 0x04: // MTCz | |
| 276 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 277 | return true; | |
| 280 | 278 | } |
| 281 | 279 | |
| 282 | return | |
| 280 | return false; | |
| 283 | 281 | } |
| 284 | 282 | |
| 285 | /*------------------------------------------------- | |
| 286 | describe_instruction_cop2 - build a | |
| 287 | description of a single instruction in the | |
| 288 | COP2 group | |
| 289 | -------------------------------------------------*/ | |
| 283 | //------------------------------------------------- | |
| 284 | // describe_cop2 - build a description of a | |
| 285 | // single instruction in the COP2 group | |
| 286 | //------------------------------------------------- | |
| 290 | 287 | |
| 291 | ||
| 288 | bool | |
| 292 | 289 | { |
| 293 | 290 | switch (RSREG) |
| 294 | 291 | { |
| 295 | case 0x00: /* MFCz */ | |
| 296 | case 0x02: /* CFCz */ | |
| 297 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 298 | return TRUE; | |
| 292 | case 0x00: // MFCz | |
| 293 | case 0x02: // CFCz | |
| 294 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 295 | return true; | |
| 299 | 296 | |
| 300 | case 0x04: /* MTCz */ | |
| 301 | case 0x06: /* CTCz */ | |
| 302 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 303 | return TRUE; | |
| 297 | case 0x04: // MTCz | |
| 298 | case 0x06: // CTCz | |
| 299 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 300 | return true; | |
| 304 | 301 | } |
| 305 | 302 | |
| 306 | return | |
| 303 | return false; | |
| 307 | 304 | } |
| r9922 | r9923 | |
|---|---|---|
| 37 | 37 | return (rsp_state *)downcast<legacy_cpu_device *>(device)->token(); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | #define SIMM16 ((INT32)(INT16)(op)) | |
| 41 | #define UIMM16 ((UINT16)(op)) | |
| 42 | #define UIMM26 (op & 0x03ffffff) | |
| 43 | ||
| 40 | 44 | #define JUMP_ABS(addr) { rsp->nextpc = 0x04001000 | (((addr) << 2) & 0xfff); } |
| 41 | 45 | #define JUMP_ABS_L(addr,l) { rsp->nextpc = 0x04001000 | (((addr) << 2) & 0xfff); rsp->r[l] = rsp->pc + 4; } |
| 42 | 46 | #define JUMP_REL(offset) { rsp->nextpc = 0x04001000 | ((rsp->pc + ((offset) << 2)) & 0xfff); } |
| r9922 | r9923 | |
|---|---|---|
| 15 | 15 | #ifndef __RSPFE_H__ |
| 16 | 16 | #define __RSPFE_H__ |
| 17 | 17 | |
| 18 | #include "rsp.h" | |
| 18 | 19 | #include "cpu/drcfe.h" |
| 19 | 20 | |
| 20 | 21 | |
| 21 | /*************************************************************************** | |
| 22 | CONSTANTS | |
| 23 | ***************************************************************************/ | |
| 22 | //************************************************************************** | |
| 23 | // CONSTANTS | |
| 24 | //************************************************************************** | |
| 24 | 25 | |
| 25 | / | |
| 26 | // register flags 0 | |
| 26 | 27 | #define REGFLAG_R(n) (((n) == 0) ? 0 : (1 << (n))) |
| 27 | 28 | |
| 28 | /*************************************************************************** | |
| 29 | FUNCTION PROTOTYPES | |
| 30 | ***************************************************************************/ | |
| 31 | 29 | |
| 32 | int rspfe_describe(void *param, opcode_desc *desc, const opcode_desc *prev); | |
| 33 | 30 | |
| 31 | //************************************************************************** | |
| 32 | // TYPE DEFINITIONS | |
| 33 | //************************************************************************** | |
| 34 | ||
| 35 | class rsp_frontend : public drc_frontend | |
| 36 | { | |
| 37 | public: | |
| 38 | // construction/destruction | |
| 39 | rsp_frontend(rsp_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); | |
| 40 | ||
| 41 | protected: | |
| 42 | // required overrides | |
| 43 | virtual bool describe(opcode_desc &desc, const opcode_desc *prev); | |
| 44 | ||
| 45 | private: | |
| 46 | // internal helpers | |
| 47 | bool describe_special(UINT32 op, opcode_desc &desc); | |
| 48 | bool describe_regimm(UINT32 op, opcode_desc &desc); | |
| 49 | bool describe_cop0(UINT32 op, opcode_desc &desc); | |
| 50 | bool describe_cop2(UINT32 op, opcode_desc &desc); | |
| 51 | ||
| 52 | // internal state | |
| 53 | rsp_state &m_context; | |
| 54 | }; | |
| 55 | ||
| 56 | ||
| 57 | ||
| 34 | 58 | #endif /* __RSPFE_H__ */ |
| r9922 | r9923 | |
|---|---|---|
| 117 | 117 | #define IS_FLOAT(o) (((o) & (1 << 23)) == 0) |
| 118 | 118 | #define IS_INTEGRAL(o) (((o) & (1 << 23)) != 0) |
| 119 | 119 | |
| 120 | #define SIMM16 ((INT16)(op)) | |
| 121 | #define UIMM16 ((UINT16)(op)) | |
| 122 | #define UIMM26 (op & 0x03ffffff) | |
| 120 | #define SIMMVAL ((INT16)op) | |
| 121 | #define UIMMVAL ((UINT16)op) | |
| 122 | #define LIMMVAL (op & 0x03ffffff) | |
| 123 | 123 | |
| 124 | 124 | #define RSP_STATUS_HALT 0x0001 |
| 125 | 125 | #define RSP_STATUS_BROKE 0x0002 |
| r9922 | r9923 | |
|---|---|---|
| 106 | 106 | /* core state */ |
| 107 | 107 | drccache * cache; /* pointer to the DRC code cache */ |
| 108 | 108 | drcuml_state * drcuml; /* DRC UML generator state */ |
| 109 | | |
| 109 | | |
| 110 | 110 | UINT32 drcoptions; /* configurable DRC options */ |
| 111 | 111 | |
| 112 | 112 | /* internal stuff */ |
| r9922 | r9923 | |
| 151 | 151 | static void cfunc_cfc2(void *param); |
| 152 | 152 | static void cfunc_mtc2(void *param); |
| 153 | 153 | static void cfunc_ctc2(void *param); |
| 154 | //static void cfunc_swc2(void *param); | |
| 155 | //static void cfunc_lwc2(void *param); | |
| 154 | 156 | static void cfunc_sp_set_status_cb(void *param); |
| 155 | 157 | |
| 156 | 158 | static void cfunc_rsp_lbv(void *param); |
| r9922 | r9923 | |
| 516 | 518 | |
| 517 | 519 | /*****************************************************************************/ |
| 518 | 520 | |
| 521 | /* Legacy. Going forward, this will be transitioned into unrolled opcode decodes. */ | |
| 522 | static const int vector_elements_1[16][8] = | |
| 523 | { | |
| 524 | { 0, 1, 2, 3, 4, 5, 6, 7 }, // none | |
| 525 | { 0, 1, 2, 3, 4, 5, 6 ,7 }, // ??? | |
| 526 | { 1, 3, 5, 7, 0, 2, 4, 6 }, // 0q | |
| 527 | { 0, 2, 4, 6, 1, 3, 5, 7 }, // 1q | |
| 528 | { 1, 2, 3, 5, 6, 7, 0, 4 }, // 0h | |
| 529 | { 0, 2, 3, 4, 6, 7, 1, 5 }, // 1h | |
| 530 | { 0, 1, 3, 4, 5, 7, 2, 6 }, // 2h | |
| 531 | { 0, 1, 2, 4, 5, 6, 3, 7 }, // 3h | |
| 532 | { 1, 2, 3, 4, 5, 6, 7, 0 }, // 0 | |
| 533 | { 0, 2, 3, 4, 5, 6, 7, 1 }, // 1 | |
| 534 | { 0, 1, 3, 4, 5, 6, 7, 2 }, // 2 | |
| 535 | { 0, 1, 2, 4, 5, 6, 7, 3 }, // 3 | |
| 536 | { 0, 1, 2, 3, 5, 6, 7, 4 }, // 4 | |
| 537 | { 0, 1, 2, 3, 4, 6, 7, 5 }, // 5 | |
| 538 | { 0, 1, 2, 3, 4, 5, 7, 6 }, // 6 | |
| 539 | { 0, 1, 2, 3, 4, 5, 6, 7 }, // 7 | |
| 540 | }; | |
| 541 | ||
| 542 | /* Legacy. Going forward, this will be transitioned into unrolled opcode decodes. */ | |
| 519 | 543 | static const int vector_elements_2[16][8] = |
| 520 | 544 | { |
| 521 | 545 | { 0, 1, 2, 3, 4, 5, 6, 7 }, // none |
| r9922 | r9923 | |
| 579 | 603 | |
| 580 | 604 | static CPU_INIT( rsp ) |
| 581 | 605 | { |
| 582 | drcfe_config feconfig = | |
| 583 | { | |
| 584 | COMPILE_BACKWARDS_BYTES, /* code window start offset = startpc - window_start */ | |
| 585 | COMPILE_FORWARDS_BYTES, /* code window end offset = startpc + window_end */ | |
| 586 | COMPILE_MAX_SEQUENCE, /* maximum instructions to include in a sequence */ | |
| 587 | rspfe_describe /* callback to describe a single instruction */ | |
| 588 | }; | |
| 589 | 606 | rsp_state *rsp; |
| 590 | 607 | drccache *cache; |
| 591 | 608 | UINT32 flags = 0; |
| r9922 | r9923 | |
| 645 | 662 | drcuml_symbol_add(rsp->impstate->drcuml, &rsp->impstate->numcycles, sizeof(rsp->impstate->numcycles), "numcycles"); |
| 646 | 663 | |
| 647 | 664 | /* initialize the front-end helper */ |
| 648 | if (SINGLE_INSTRUCTION_MODE) | |
| 649 | { | |
| 650 | feconfig.max_sequence = 1; | |
| 651 | } | |
| 652 | rsp->impstate->drcfe = drcfe_init(device, &feconfig, rsp); | |
| 665 | rsp->impstate->drcfe = auto_alloc(device->machine, rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE)); | |
| 653 | 666 | |
| 654 | 667 | /* compute the register parameters */ |
| 655 | 668 | for (regnum = 0; regnum < 32; regnum++) |
| r9922 | r9923 | |
| 697 | 710 | rsp_state *rsp = get_safe_token(device); |
| 698 | 711 | |
| 699 | 712 | /* clean up the DRC */ |
| 700 | | |
| 713 | auto_fre | |
| 701 | 714 | drcuml_free(rsp->impstate->drcuml); |
| 702 | 715 | drccache_free(rsp->impstate->cache); |
| 703 | 716 | } |
| r9922 | r9923 | |
| 757 | 770 | |
| 758 | 771 | int end = index + 2; |
| 759 | 772 | |
| 760 | if(end > 16) printf("LSV past end\n"); | |
| 761 | ||
| 762 | 773 | for (int i = index; i < end; i++) |
| 763 | 774 | { |
| 764 | 775 | VREG_B(dest, i) = READ8(rsp, ea); |
| r9922 | r9923 | |
| 790 | 801 | |
| 791 | 802 | int end = index + 4; |
| 792 | 803 | |
| 793 | if(end > 16) printf("LLV past end\n"); | |
| 794 | ||
| 795 | 804 | for (int i = index; i < end; i++) |
| 796 | 805 | { |
| 797 | 806 | VREG_B(dest, i) = READ8(rsp, ea); |
| r9922 | r9923 | |
| 823 | 832 | |
| 824 | 833 | int end = index + 8; |
| 825 | 834 | |
| 826 | if(end > 16) printf("LDV past end\n"); | |
| 827 | ||
| 828 | 835 | for (int i = index; i < end; i++) |
| 829 | 836 | { |
| 830 | 837 | VREG_B(dest, i) = READ8(rsp, ea); |
| r9922 | r9923 | |
| 1221 | 1228 | |
| 1222 | 1229 | int end = index + 2; |
| 1223 | 1230 | |
| 1224 | if(end > 16) printf("SSV past end\n"); | |
| 1225 | ||
| 1226 | 1231 | for (int i = index; i < end; i++) |
| 1227 | 1232 | { |
| 1228 | 1233 | WRITE8(rsp, ea, VREG_B(dest, i)); |
| r9922 | r9923 | |
| 1254 | 1259 | |
| 1255 | 1260 | int end = index + 4; |
| 1256 | 1261 | |
| 1257 | if(end > 16) printf("SLV past end\n"); | |
| 1258 | ||
| 1259 | 1262 | for (int i = index; i < end; i++) |
| 1260 | 1263 | { |
| 1261 | 1264 | WRITE8(rsp, ea, VREG_B(dest, i)); |
| r9922 | r9923 | |
| 1287 | 1290 | |
| 1288 | 1291 | end = index + 8; |
| 1289 | 1292 | |
| 1290 | if(end > 16) printf("SDV past end\n"); | |
| 1291 | ||
| 1292 | 1293 | for (int i = index; i < end; i++) |
| 1293 | 1294 | { |
| 1294 | 1295 | WRITE8(rsp, ea, VREG_B(dest, i)); |
| r9922 | r9923 | |
| 3467 | 3468 | g_profiler.start(PROFILER_DRC_COMPILE); |
| 3468 | 3469 | |
| 3469 | 3470 | /* get a description of this sequence */ |
| 3470 | desclist = | |
| 3471 | desclist = | |
| 3471 | 3472 | |
| 3472 | 3473 | /* if we get an error back, flush the cache and try again */ |
| 3473 | 3474 | if (setjmp(errorbuf) != 0) |
| r9922 | r9923 | |
| 3479 | 3480 | block = drcuml_block_begin(drcuml, 8192, &errorbuf); |
| 3480 | 3481 | |
| 3481 | 3482 | /* loop until we get through all instruction sequences */ |
| 3482 | for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next) | |
| 3483 | for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next()) | |
| 3483 | 3484 | { |
| 3484 | 3485 | const opcode_desc *curdesc; |
| 3485 | 3486 | UINT32 nextpc; |
| r9922 | r9923 | |
| 3489 | 3490 | UML_COMMENT(block, "-------------------------"); // comment |
| 3490 | 3491 | |
| 3491 | 3492 | /* determine the last instruction in this sequence */ |
| 3492 | for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next) | |
| 3493 | for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next()) | |
| 3493 | 3494 | if (seqlast->flags & OPFLAG_END_SEQUENCE) |
| 3494 | 3495 | break; |
| 3495 | 3496 | assert(seqlast != NULL); |
| r9922 | r9923 | |
| 3524 | 3525 | UML_LABEL(block, seqhead->pc | 0x80000000); // label seqhead->pc |
| 3525 | 3526 | |
| 3526 | 3527 | /* iterate over instructions in the sequence and compile them */ |
| 3527 | for (curdesc = seqhead; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 3528 | for (curdesc = seqhead; curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 3528 | 3529 | generate_sequence_instruction(rsp, block, &compiler, curdesc); |
| 3529 | 3530 | |
| 3530 | 3531 | /* if we need to return to the start, do it */ |
| r9922 | r9923 | |
| 3539 | 3540 | generate_update_cycles(rsp, block, &compiler, IMM(nextpc), TRUE); // <subtract cycles> |
| 3540 | 3541 | |
| 3541 | 3542 | /* if the last instruction can change modes, use a variable mode; otherwise, assume the same mode */ |
| 3542 | if (seqlast->next == NULL || seqlast->next->pc != nextpc) | |
| 3543 | if (seqlast->next() == NULL || seqlast->next()->pc != nextpc) | |
| 3543 | 3544 | UML_HASHJMP(block, IMM(0), IMM(nextpc), rsp->impstate->nocode); // hashjmp <mode>,nextpc,nocode |
| 3544 | 3545 | } |
| 3545 | 3546 | |
| r9922 | r9923 | |
| 3788 | 3789 | UML_COMMENT(block, "[Validation for %08X]", seqhead->pc | 0x1000); // comment |
| 3789 | 3790 | } |
| 3790 | 3791 | /* loose verify or single instruction: just compare and fail */ |
| 3791 | if (!(rsp->impstate->drcoptions & RSPDRC_STRICT_VERIFY) || seqhead->next == NULL) | |
| 3792 | if (!(rsp->impstate->drcoptions & RSPDRC_STRICT_VERIFY) || seqhead->next() == NULL) | |
| 3792 | 3793 | { |
| 3793 | 3794 | if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) |
| 3794 | 3795 | { |
| r9922 | r9923 | |
| 3806 | 3807 | void *base = rsp->direct->read_decrypted_ptr(seqhead->physpc | 0x1000); |
| 3807 | 3808 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,0,dword |
| 3808 | 3809 | sum += seqhead->opptr.l[0]; |
| 3809 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 3810 | for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 3810 | 3811 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 3811 | 3812 | { |
| 3812 | 3813 | base = rsp->direct->read_decrypted_ptr(curdesc->physpc | 0x1000); |
| 3813 | 3814 | UML_LOAD(block, IREG(1), base, IMM(0), DWORD); // load i1,base,dword |
| 3814 | 3815 | UML_ADD(block, IREG(0), IREG(0), IREG(1)); // add i0,i0,i1 |
| 3815 | 3816 | sum += curdesc->opptr.l[0]; |
| 3816 | ||
| 3817 | if (curdesc->delay != NULL && (curdesc == seqlast || (curdesc->next != NULL && curdesc->next->physpc != curdesc->delay->physpc))) | |
| 3818 | { | |
| 3819 | base = rsp->direct->read_decrypted_ptr(curdesc->delay->physpc | 0x1000); | |
| 3820 | UML_LOAD(block, IREG(1), base, IMM(0), DWORD); // load i1,base,dword | |
| 3821 | UML_ADD(block, IREG(0), IREG(0), IREG(1)); // add i0,i0,i1 | |
| 3822 | sum += curdesc->delay->opptr.l[0]; | |
| 3823 | } | |
| 3824 | 3817 | } |
| 3825 | 3818 | UML_CMP(block, IREG(0), IMM(sum)); // cmp i0,sum |
| 3826 | 3819 | UML_EXHc(block, IF_NE, rsp->impstate->nocode, IMM(epc(seqhead))); // exne nocode,seqhead->pc |
| r9922 | r9923 | |
| 3905 | 3898 | } |
| 3906 | 3899 | |
| 3907 | 3900 | /* compile the delay slot using temporary compiler state */ |
| 3908 | assert(desc->delay != NULL); | |
| 3909 | generate_sequence_instruction(rsp, block, &compiler_temp, desc->delay); // <next instruction> | |
| 3901 | assert(desc->delay.first() != NULL); | |
| 3902 | generate_sequence_instruction(rsp, block, &compiler_temp, desc->delay.first()); // <next instruction> | |
| 3910 | 3903 | |
| 3911 | 3904 | /* update the cycles and jump through the hash table to the target */ |
| 3912 | 3905 | if (desc->targetpc != BRANCH_TARGET_DYNAMIC) |
| r9922 | r9923 | |
| 4217 | 4210 | |
| 4218 | 4211 | case 0x0f: /* LUI - MIPS I */ |
| 4219 | 4212 | if (RTREG != 0) |
| 4220 | UML_MOV(block, R32(RTREG), IMM(SIMM | |
| 4213 | UML_MOV(block, R32(RTREG), IMM(SIMMVAL << 16)); // dmov <rtreg>,SIMMVAL << 16 | |
| 4221 | 4214 | return TRUE; |
| 4222 | 4215 | |
| 4223 | 4216 | case 0x08: /* ADDI - MIPS I */ |
| 4224 | 4217 | case 0x09: /* ADDIU - MIPS I */ |
| 4225 | 4218 | if (RTREG != 0) |
| 4226 | 4219 | { |
| 4227 | UML_ADD(block, R32(RTREG), R32(RSREG), IMM(SIMM | |
| 4220 | UML_ADD(block, R32(RTREG), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL,V | |
| 4228 | 4221 | } |
| 4229 | 4222 | return TRUE; |
| 4230 | 4223 | |
| 4231 | 4224 | case 0x0a: /* SLTI - MIPS I */ |
| 4232 | 4225 | if (RTREG != 0) |
| 4233 | 4226 | { |
| 4234 | UML_CMP(block, R32(RSREG), IMM(SIMM | |
| 4227 | UML_CMP(block, R32(RSREG), IMM(SIMMVAL)); // dcmp <rsreg>,SIMMVAL | |
| 4235 | 4228 | UML_SETc(block, IF_L, R32(RTREG)); // dset <rtreg>,l |
| 4236 | 4229 | } |
| 4237 | 4230 | return TRUE; |
| r9922 | r9923 | |
| 4239 | 4232 | case 0x0b: /* SLTIU - MIPS I */ |
| 4240 | 4233 | if (RTREG != 0) |
| 4241 | 4234 | { |
| 4242 | UML_CMP(block, R32(RSREG), IMM(SIMM | |
| 4235 | UML_CMP(block, R32(RSREG), IMM(SIMMVAL)); // dcmp <rsreg>,SIMMVAL | |
| 4243 | 4236 | UML_SETc(block, IF_B, R32(RTREG)); // dset <rtreg>,b |
| 4244 | 4237 | } |
| 4245 | 4238 | return TRUE; |
| r9922 | r9923 | |
| 4247 | 4240 | |
| 4248 | 4241 | case 0x0c: /* ANDI - MIPS I */ |
| 4249 | 4242 | if (RTREG != 0) |
| 4250 | UML_AND(block, R32(RTREG), R32(RSREG), IMM(UIMM | |
| 4243 | UML_AND(block, R32(RTREG), R32(RSREG), IMM(UIMMVAL)); // dand <rtreg>,<rsreg>,UIMMVAL | |
| 4251 | 4244 | return TRUE; |
| 4252 | 4245 | |
| 4253 | 4246 | case 0x0d: /* ORI - MIPS I */ |
| 4254 | 4247 | if (RTREG != 0) |
| 4255 | UML_OR(block, R32(RTREG), R32(RSREG), IMM(UIMM | |
| 4248 | UML_OR(block, R32(RTREG), R32(RSREG), IMM(UIMMVAL)); // dor <rtreg>,<rsreg>,UIMMVAL | |
| 4256 | 4249 | return TRUE; |
| 4257 | 4250 | |
| 4258 | 4251 | case 0x0e: /* XORI - MIPS I */ |
| 4259 | 4252 | if (RTREG != 0) |
| 4260 | UML_XOR(block, R32(RTREG), R32(RSREG), IMM(UIMM | |
| 4253 | UML_XOR(block, R32(RTREG), R32(RSREG), IMM(UIMMVAL)); // dxor <rtreg>,<rsreg>,UIMMVAL | |
| 4261 | 4254 | return TRUE; |
| 4262 | 4255 | |
| 4263 | 4256 | /* ----- memory load operations ----- */ |
| 4264 | 4257 | |
| 4265 | 4258 | case 0x20: /* LB - MIPS I */ |
| 4266 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMM | |
| 4259 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL | |
| 4267 | 4260 | UML_CALLH(block, rsp->impstate->read8); // callh read8 |
| 4268 | 4261 | if (RTREG != 0) |
| 4269 | 4262 | UML_SEXT(block, R32(RTREG), IREG(0), BYTE); // dsext <rtreg>,i0,byte |
| r9922 | r9923 | |
| 4272 | 4265 | return TRUE; |
| 4273 | 4266 | |
| 4274 | 4267 | case 0x21: /* LH - MIPS I */ |
| 4275 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMM | |
| 4268 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL | |
| 4276 | 4269 | UML_CALLH(block, rsp->impstate->read16); // callh read16 |
| 4277 | 4270 | if (RTREG != 0) |
| 4278 | 4271 | UML_SEXT(block, R32(RTREG), IREG(0), WORD); // dsext <rtreg>,i0,word |
| r9922 | r9923 | |
| 4281 | 4274 | return TRUE; |
| 4282 | 4275 | |
| 4283 | 4276 | case 0x23: /* LW - MIPS I */ |
| 4284 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMM | |
| 4277 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL | |
| 4285 | 4278 | UML_CALLH(block, rsp->impstate->read32); // callh read32 |
| 4286 | 4279 | if (RTREG != 0) |
| 4287 | 4280 | UML_MOV(block, R32(RTREG), IREG(0)); |
| r9922 | r9923 | |
| 4290 | 4283 | return TRUE; |
| 4291 | 4284 | |
| 4292 | 4285 | case 0x24: /* LBU - MIPS I */ |
| 4293 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMM | |
| 4286 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL | |
| 4294 | 4287 | UML_CALLH(block, rsp->impstate->read8); // callh read8 |
| 4295 | 4288 | if (RTREG != 0) |
| 4296 | 4289 | UML_AND(block, R32(RTREG), IREG(0), IMM(0xff)); // dand <rtreg>,i0,0xff |
| r9922 | r9923 | |
| 4299 | 4292 | return TRUE; |
| 4300 | 4293 | |
| 4301 | 4294 | case 0x25: /* LHU - MIPS I */ |
| 4302 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMM | |
| 4295 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL | |
| 4303 | 4296 | UML_CALLH(block, rsp->impstate->read16); // callh read16 |
| 4304 | 4297 | if (RTREG != 0) |
| 4305 | 4298 | UML_AND(block, R32(RTREG), IREG(0), IMM(0xffff)); // dand <rtreg>,i0,0xffff |
| r9922 | r9923 | |
| 4314 | 4307 | /* ----- memory store operations ----- */ |
| 4315 | 4308 | |
| 4316 | 4309 | case 0x28: /* SB - MIPS I */ |
| 4317 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMM | |
| 4310 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL | |
| 4318 | 4311 | UML_MOV(block, IREG(1), R32(RTREG)); // mov i1,<rtreg> |
| 4319 | 4312 | UML_CALLH(block, rsp->impstate->write8); // callh write8 |
| 4320 | 4313 | if (!in_delay_slot) |
| r9922 | r9923 | |
| 4322 | 4315 | return TRUE; |
| 4323 | 4316 | |
| 4324 | 4317 | case 0x29: /* SH - MIPS I */ |
| 4325 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMM | |
| 4318 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL | |
| 4326 | 4319 | UML_MOV(block, IREG(1), R32(RTREG)); // mov i1,<rtreg> |
| 4327 | 4320 | UML_CALLH(block, rsp->impstate->write16); // callh write16 |
| 4328 | 4321 | if (!in_delay_slot) |
| r9922 | r9923 | |
| 4330 | 4323 | return TRUE; |
| 4331 | 4324 | |
| 4332 | 4325 | case 0x2b: /* SW - MIPS I */ |
| 4333 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMM | |
| 4326 | UML_ADD(block, IREG(0), R32(RSREG), IMM(SIMMVAL)); // add i0,<rsreg>,SIMMVAL | |
| 4334 | 4327 | UML_MOV(block, IREG(1), R32(RTREG)); // mov i1,<rtreg> |
| 4335 | 4328 | UML_CALLH(block, rsp->impstate->write32); // callh write32 |
| 4336 | 4329 | if (!in_delay_slot) |
| r9922 | r9923 | |
| 4669 | 4662 | rsp_state *rsp = (rsp_state*)param; |
| 4670 | 4663 | UINT32 op = rsp->impstate->arg0; |
| 4671 | 4664 | int el = (op >> 7) & 0xf; |
| 4672 | VREG_B(RDREG, (el+0) & 0xf) = (RTVAL >> 8) & 0xff; | |
| 4673 | VREG_B(RDREG, (el+1) & 0xf) = (RTVAL >> 0) & 0xff; | |
| 4665 | VREG_B(VS1REG, (el+0) & 0xf) = (RTVAL >> 8) & 0xff; | |
| 4666 | VREG_B(VS1REG, (el+1) & 0xf) = (RTVAL >> 0) & 0xff; | |
| 4674 | 4667 | } |
| 4675 | 4668 | |
| 4676 | 4669 | static void cfunc_ctc2(void *param) |
| r9922 | r9923 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Front-end for PowerPC recompiler |
| 6 | 6 | |
| 7 | **************************************************************************** | |
| 8 | ||
| 7 | 9 | Copyright Aaron Giles |
| 8 | Released for general non-commercial use under the MAME license | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 10 | All rights reserved. | |
| 10 | 11 | |
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | ***************************************************************************/ |
| 12 | 39 | |
| 13 | 40 | #ifndef __PPCFE_H__ |
| 14 | 41 | #define __PPCFE_H__ |
| 15 | 42 | |
| 43 | #include "ppccom.h" | |
| 16 | 44 | #include "cpu/drcfe.h" |
| 17 | 45 | |
| 18 | 46 | |
| 19 | /*************************************************************************** | |
| 20 | CONSTANTS | |
| 21 | ***************************************************************************/ | |
| 47 | //************************************************************************** | |
| 48 | // MACROS | |
| 49 | //************************************************************************** | |
| 22 | 50 | |
| 23 | / | |
| 51 | // register flags 0 | |
| 24 | 52 | #define REGFLAG_R(n) (1 << (n)) |
| 25 | 53 | #define REGFLAG_RZ(n) (((n) == 0) ? 0 : REGFLAG_R(n)) |
| 26 | 54 | |
| 27 | / | |
| 55 | // register flags 1 | |
| 28 | 56 | #define REGFLAG_FR(n) (1 << (n)) |
| 29 | 57 | |
| 30 | / | |
| 58 | // register flags 2 | |
| 31 | 59 | #define REGFLAG_CR(n) (0xf0000000 >> (4 * (n))) |
| 32 | 60 | #define REGFLAG_CR_BIT(n) (0x80000000 >> (n)) |
| 33 | 61 | |
| 34 | / | |
| 62 | // register flags 3 | |
| 35 | 63 | #define REGFLAG_XER_CA (1 << 0) |
| 36 | 64 | #define REGFLAG_XER_OV (1 << 1) |
| 37 | 65 | #define REGFLAG_XER_SO (1 << 2) |
| r9922 | r9923 | |
| 42 | 70 | |
| 43 | 71 | |
| 44 | 72 | |
| 45 | /*************************************************************************** | |
| 46 | FUNCTION PROTOTYPES | |
| 47 | ***************************************************************************/ | |
| 73 | //************************************************************************** | |
| 74 | // TYPE DEFINITIONS | |
| 75 | //************************************************************************** | |
| 48 | 76 | |
| 49 | int ppcfe_describe(void *param, opcode_desc *desc, const opcode_desc *prev); | |
| 77 | class ppc_frontend : public drc_frontend | |
| 78 | { | |
| 79 | public: | |
| 80 | // construction/destruction | |
| 81 | ppc_frontend(powerpc_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); | |
| 50 | 82 | |
| 83 | protected: | |
| 84 | // required overrides | |
| 85 | virtual bool describe(opcode_desc &desc, const opcode_desc *prev); | |
| 86 | ||
| 87 | private: | |
| 88 | // inlines | |
| 89 | UINT32 compute_spr(UINT32 spr) const { return ((spr >> 5) | (spr << 5)) & 0x3ff; } | |
| 90 | bool is_403_class() const { return (m_context.flavor == PPC_MODEL_403GA || m_context.flavor == PPC_MODEL_403GB || m_context.flavor == PPC_MODEL_403GC || m_context.flavor == PPC_MODEL_403GCX || m_context.flavor == PPC_MODEL_405GP); } | |
| 91 | bool is_601_class() const { return (m_context.flavor == PPC_MODEL_601); } | |
| 92 | bool is_602_class() const { return (m_context.flavor == PPC_MODEL_602); } | |
| 93 | bool is_603_class() const { return (m_context.flavor == PPC_MODEL_603 || m_context.flavor == PPC_MODEL_603E || m_context.flavor == PPC_MODEL_603EV || m_context.flavor == PPC_MODEL_603R); } | |
| 94 | ||
| 95 | // internal helpers | |
| 96 | bool describe_13(UINT32 op, opcode_desc &desc, const opcode_desc *prev); | |
| 97 | bool describe_1f(UINT32 op, opcode_desc &desc, const opcode_desc *prev); | |
| 98 | bool describe_3b(UINT32 op, opcode_desc &desc, const opcode_desc *prev); | |
| 99 | bool describe_3f(UINT32 op, opcode_desc &desc, const opcode_desc *prev); | |
| 100 | ||
| 101 | // internal state | |
| 102 | powerpc_state &m_context; | |
| 103 | }; | |
| 104 | ||
| 105 | ||
| 51 | 106 | #endif /* __PPCFE_H__ */ |
| r9922 | r9923 | |
|---|---|---|
| 165 | 165 | /* core state */ |
| 166 | 166 | drccache * cache; /* pointer to the DRC code cache */ |
| 167 | 167 | drcuml_state * drcuml; /* DRC UML generator state */ |
| 168 | | |
| 168 | ppc | |
| 169 | 169 | UINT32 drcoptions; /* configurable DRC options */ |
| 170 | 170 | |
| 171 | 171 | /* parameters for subroutines */ |
| r9922 | r9923 | |
| 548 | 548 | |
| 549 | 549 | static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_callback irqcallback) |
| 550 | 550 | { |
| 551 | drcfe_config feconfig = | |
| 552 | { | |
| 553 | COMPILE_BACKWARDS_BYTES, /* code window start offset = startpc - window_start */ | |
| 554 | COMPILE_FORWARDS_BYTES, /* code window end offset = startpc + window_end */ | |
| 555 | COMPILE_MAX_SEQUENCE, /* maximum instructions to include in a sequence */ | |
| 556 | ppcfe_describe /* callback to describe a single instruction */ | |
| 557 | }; | |
| 558 | 551 | powerpc_state *ppc; |
| 559 | 552 | drcbe_info beinfo; |
| 560 | 553 | UINT32 flags = 0; |
| r9922 | r9923 | |
| 633 | 626 | drcuml_symbol_add(ppc->impstate->drcuml, &ppc->impstate->fcmp_cr_table, sizeof(ppc->impstate->fcmp_cr_table), "fcmp_cr_table"); |
| 634 | 627 | |
| 635 | 628 | /* initialize the front-end helper */ |
| 636 | if (SINGLE_INSTRUCTION_MODE) | |
| 637 | feconfig.max_sequence = 1; | |
| 638 | ppc->impstate->drcfe = drcfe_init(device, &feconfig, ppc); | |
| 629 | ppc->impstate->drcfe = auto_alloc(device->machine, ppc_frontend(*ppc, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE)); | |
| 639 | 630 | |
| 640 | 631 | /* initialize the implementation state tables */ |
| 641 | 632 | memcpy(ppc->impstate->fpmode, fpmode_source, sizeof(fpmode_source)); |
| r9922 | r9923 | |
| 738 | 729 | ppccom_exit(ppc); |
| 739 | 730 | |
| 740 | 731 | /* clean up the DRC */ |
| 741 | | |
| 732 | auto_fre | |
| 742 | 733 | drcuml_free(ppc->impstate->drcuml); |
| 743 | 734 | drccache_free(ppc->impstate->cache); |
| 744 | 735 | } |
| r9922 | r9923 | |
| 946 | 937 | int override = FALSE; |
| 947 | 938 | drcuml_block *block; |
| 948 | 939 | jmp_buf errorbuf; |
| 949 | ||
| 940 | logerror("Compile %08X\n", pc); | |
| 950 | 941 | g_profiler.start(PROFILER_DRC_COMPILE); |
| 951 | 942 | |
| 952 | 943 | /* get a description of this sequence */ |
| 953 | desclist = | |
| 944 | desclist = | |
| 954 | 945 | if (LOG_UML || LOG_NATIVE) |
| 955 | 946 | log_opcode_desc(drcuml, desclist, 0); |
| 956 | 947 | |
| r9922 | r9923 | |
| 962 | 953 | block = drcuml_block_begin(drcuml, 4096, &errorbuf); |
| 963 | 954 | |
| 964 | 955 | /* loop until we get through all instruction sequences */ |
| 965 | for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next) | |
| 956 | for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next()) | |
| 966 | 957 | { |
| 967 | 958 | const opcode_desc *curdesc; |
| 968 | 959 | UINT32 nextpc; |
| r9922 | r9923 | |
| 972 | 963 | UML_COMMENT(block, "-------------------------"); // comment |
| 973 | 964 | |
| 974 | 965 | /* determine the last instruction in this sequence */ |
| 975 | for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next) | |
| 966 | for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next()) | |
| 976 | 967 | if (seqlast->flags & OPFLAG_END_SEQUENCE) |
| 977 | 968 | break; |
| 978 | 969 | assert(seqlast != NULL); |
| r9922 | r9923 | |
| 1007 | 998 | UML_LABEL(block, seqhead->pc | 0x80000000); // label seqhead->pc | 0x80000000 |
| 1008 | 999 | |
| 1009 | 1000 | /* iterate over instructions in the sequence and compile them */ |
| 1010 | for (curdesc = seqhead; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 1001 | for (curdesc = seqhead; curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 1011 | 1002 | generate_sequence_instruction(ppc, block, &compiler, curdesc); // <instruction> |
| 1012 | 1003 | |
| 1013 | 1004 | /* if we need to return to the start, do it */ |
| r9922 | r9923 | |
| 1024 | 1015 | /* if the last instruction can change modes, use a variable mode; otherwise, assume the same mode */ |
| 1025 | 1016 | if (seqlast->flags & OPFLAG_CAN_CHANGE_MODES) |
| 1026 | 1017 | UML_HASHJMP(block, MEM(&ppc->impstate->mode), IMM(nextpc), ppc->impstate->nocode);// hashjmp <mode>,nextpc,nocode |
| 1027 | else if (seqlast->next == NULL || seqlast->next->pc != nextpc) | |
| 1018 | else if (seqlast->next() == NULL || seqlast->next()->pc != nextpc) | |
| 1028 | 1019 | UML_HASHJMP(block, IMM(ppc->impstate->mode), IMM(nextpc), ppc->impstate->nocode);// hashjmp <mode>,nextpc,nocode |
| 1029 | 1020 | } |
| 1030 | 1021 | |
| r9922 | r9923 | |
| 1233 | 1224 | drcuml_state *drcuml = ppc->impstate->drcuml; |
| 1234 | 1225 | drcuml_block *block; |
| 1235 | 1226 | jmp_buf errorbuf; |
| 1236 | int isi, label = 1; | |
| 1227 | int isi, exit, label = 1; | |
| 1237 | 1228 | |
| 1238 | 1229 | /* if we get an error back, we're screwed */ |
| 1239 | 1230 | if (setjmp(errorbuf) != 0) |
| r9922 | r9923 | |
| 1251 | 1242 | alloc_handle(drcuml, &ppc->impstate->tlb_mismatch, "tlb_mismatch"); |
| 1252 | 1243 | UML_HANDLE(block, ppc->impstate->tlb_mismatch); // handle tlb_mismatch |
| 1253 | 1244 | UML_RECOVER(block, IREG(0), MAPVAR_PC); // recover i0,PC |
| 1245 | UML_SHR(block, IREG(1), IREG(0), IMM(12)); // shr i1,i0,12 | |
| 1246 | UML_LOAD(block, IREG(2), (void *)vtlb_table(ppc->vtlb), IREG(1), DWORD); // load i2,[vtlb],i1,dword | |
| 1254 | 1247 | UML_MOV(block, MEM(&ppc->param0), IREG(0)); // mov [param0],i0 |
| 1255 | 1248 | UML_MOV(block, MEM(&ppc->param1), IMM(TRANSLATE_FETCH)); // mov [param1],TRANSLATE_FETCH |
| 1256 | 1249 | UML_CALLC(block, ppccom_tlb_fill, ppc); // callc tlbfill,ppc |
| 1257 | UML_SHR(block, IREG(1), IREG(0), IMM(12)); // shr i1,i0,12 | |
| 1258 | 1250 | UML_LOAD(block, IREG(1), (void *)vtlb_table(ppc->vtlb), IREG(1), DWORD); // load i1,[vtlb],i1,dword |
| 1259 | 1251 | UML_TEST(block, IREG(1), IMM(VTLB_FETCH_ALLOWED)); // test i1,VTLB_FETCH_ALLOWED |
| 1260 | 1252 | UML_JMPc(block, IF_Z, isi = label++); // jmp isi,z |
| 1253 | UML_CMP(block, IREG(2), IMM(0)); // cmp i2,0 | |
| 1254 | UML_JMPc(block, IF_NZ, exit = label++); // jmp exit,nz | |
| 1255 | UML_HASHJMP(block, MEM(&ppc->impstate->mode), IREG(0), ppc->impstate->nocode); // hashjmp <mode>,i0,nocode | |
| 1256 | UML_LABEL(block, exit); // exit: | |
| 1261 | 1257 | UML_MOV(block, MEM(&ppc->pc), IREG(0)); // mov <pc>,i0 |
| 1262 | 1258 | save_fast_iregs(ppc, block); // <save fastregs> |
| 1263 | 1259 | UML_EXIT(block, IMM(EXECUTE_MISSING_CODE)); // exit EXECUTE_MISSING_CODE |
| r9922 | r9923 | |
| 2093 | 2089 | UML_COMMENT(block, "[Validation for %08X]", seqhead->pc); // comment |
| 2094 | 2090 | |
| 2095 | 2091 | /* loose verify or single instruction: just compare and fail */ |
| 2096 | if (!(ppc->impstate->drcoptions & PPCDRC_STRICT_VERIFY) || seqhead->next == NULL) | |
| 2092 | if (!(ppc->impstate->drcoptions & PPCDRC_STRICT_VERIFY) || seqhead->next() == NULL) | |
| 2097 | 2093 | { |
| 2098 | 2094 | if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2099 | 2095 | { |
| r9922 | r9923 | |
| 2108 | 2104 | else |
| 2109 | 2105 | { |
| 2110 | 2106 | #if 0 |
| 2111 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 2107 | for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 2112 | 2108 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2113 | 2109 | { |
| 2114 | 2110 | void *base = ppc->direct->read_decrypted_ptr(seqhead->physpc, ppc->codexor); |
| r9922 | r9923 | |
| 2121 | 2117 | void *base = ppc->direct->read_decrypted_ptr(seqhead->physpc, ppc->codexor); |
| 2122 | 2118 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,dword |
| 2123 | 2119 | sum += seqhead->opptr.l[0]; |
| 2124 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 2120 | for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 2125 | 2121 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 2126 | 2122 | { |
| 2127 | 2123 | base = ppc->direct->read_decrypted_ptr(curdesc->physpc, ppc->codexor); |
| r9922 | r9923 | |
| 4240 | 4236 | drcuml_log_printf(drcuml, "\nDescriptor list @ %08X\n", desclist->pc); |
| 4241 | 4237 | |
| 4242 | 4238 | /* output each descriptor */ |
| 4243 | for ( ; desclist != NULL; desclist = desclist->next) | |
| 4239 | for ( ; desclist != NULL; desclist = desclist->next()) | |
| 4244 | 4240 | { |
| 4245 | 4241 | char buffer[100]; |
| 4246 | 4242 | |
| r9922 | r9923 | |
| 4263 | 4259 | drcuml_log_printf(drcuml, "\n"); |
| 4264 | 4260 | |
| 4265 | 4261 | /* if we have a delay slot, output it recursively */ |
| 4266 | if (desclist->delay != NULL) | |
| 4267 | log_opcode_desc(drcuml, desclist->delay, indent + 1); | |
| 4262 | if (desclist->delay.first() != NULL) | |
| 4263 | log_opcode_desc(drcuml, desclist->delay.first(), indent + 1); | |
| 4268 | 4264 | |
| 4269 | 4265 | /* at the end of a sequence add a dividing line */ |
| 4270 | 4266 | if (desclist->flags & OPFLAG_END_SEQUENCE) |
| r9922 | r9923 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Front-end for PowerPC recompiler |
| 6 | 6 | |
| 7 | **************************************************************************** | |
| 8 | ||
| 7 | 9 | Copyright Aaron Giles |
| 8 | Released for general non-commercial use under the MAME license | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 10 | All rights reserved. | |
| 10 | 11 | |
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | ***************************************************************************/ |
| 12 | 39 | |
| 13 | 40 | #include "emu.h" |
| r9922 | r9923 | |
| 15 | 42 | #include "ppccom.h" |
| 16 | 43 | |
| 17 | 44 | |
| 18 | /*************************************************************************** | |
| 19 | MACROS | |
| 20 | ***************************************************************************/ | |
| 45 | //************************************************************************** | |
| 46 | // MACROS | |
| 47 | //************************************************************************** | |
| 21 | 48 | |
| 22 | #define GPR_USED(desc, x) do { (desc)->regin[0] |= REGFLAG_R(x); } while (0) | |
| 23 | #define GPR_USED_OR_ZERO(desc, x) do { (desc)->regin[0] |= ((x) == 0 ? 0 : REGFLAG_R(x)); } while (0) | |
| 24 | #define GPR_MODIFIED(desc, x) do { (desc)->regout[0] |= REGFLAG_R(x); } while (0) | |
| 49 | #define GPR_USED(desc, x) do { (desc).regin[0] |= REGFLAG_R(x); } while (0) | |
| 50 | #define GPR_USED_OR_ZERO(desc, x) do { (desc).regin[0] |= ((x) == 0 ? 0 : REGFLAG_R(x)); } while (0) | |
| 51 | #define GPR_MODIFIED(desc, x) do { (desc).regout[0] |= REGFLAG_R(x); } while (0) | |
| 25 | 52 | |
| 26 | #define FPR_USED(desc, x) do { (desc)->regin[1] |= REGFLAG_FR(x); } while (0) | |
| 27 | #define FPR_MODIFIED(desc, x) do { (desc)->regout[1] |= REGFLAG_FR(x); } while (0) | |
| 53 | #define FPR_USED(desc, x) do { (desc).regin[1] |= REGFLAG_FR(x); } while (0) | |
| 54 | #define FPR_MODIFIED(desc, x) do { (desc).regout[1] |= REGFLAG_FR(x); } while (0) | |
| 28 | 55 | |
| 29 | #define CR_USED(desc, x) do { (desc)->regin[2] |= REGFLAG_CR(x); } while (0) | |
| 30 | #define CR_BIT_USED(desc, x) do { (desc)->regin[2] |= REGFLAG_CR_BIT(x); } while (0) | |
| 31 | #define CR_MODIFIED(desc, x) do { (desc)->regout[2] |= REGFLAG_CR(x); } while (0) | |
| 32 | #define CR_BIT_MODIFIED(desc, x) do { (desc)->regout[2] |= REGFLAG_CR_BIT(x); } while (0) | |
| 56 | #define CR_USED(desc, x) do { (desc).regin[2] |= REGFLAG_CR(x); } while (0) | |
| 57 | #define CR_BIT_USED(desc, x) do { (desc).regin[2] |= REGFLAG_CR_BIT(x); } while (0) | |
| 58 | #define CR_MODIFIED(desc, x) do { (desc).regout[2] |= REGFLAG_CR(x); } while (0) | |
| 59 | #define CR_BIT_MODIFIED(desc, x) do { (desc).regout[2] |= REGFLAG_CR_BIT(x); } while (0) | |
| 33 | 60 | |
| 34 | #define XER_CA_USED(desc) do { (desc)->regin[3] |= REGFLAG_XER_CA; } while (0) | |
| 35 | #define XER_OV_USED(desc) do { (desc)->regin[3] |= REGFLAG_XER_OV; } while (0) | |
| 36 | #define XER_SO_USED(desc) do { (desc)->regin[3] |= REGFLAG_XER_SO; } while (0) | |
| 37 | #define XER_COUNT_USED(desc) do { (desc)->regin[3] |= REGFLAG_XER_COUNT; } while (0) | |
| 38 | #define XER_CA_MODIFIED(desc) do { (desc)->regout[3] |= REGFLAG_XER_CA; } while (0) | |
| 39 | #define XER_OV_MODIFIED(desc) do { (desc)->regout[3] |= REGFLAG_XER_OV; } while (0) | |
| 40 | #define XER_SO_MODIFIED(desc) do { (desc)->regout[3] |= REGFLAG_XER_SO; } while (0) | |
| 41 | #define XER_COUNT_MODIFIED(desc) do { (desc)->regout[3] |= REGFLAG_XER_COUNT; } while (0) | |
| 61 | #define XER_CA_USED(desc) do { (desc).regin[3] |= REGFLAG_XER_CA; } while (0) | |
| 62 | #define XER_OV_USED(desc) do { (desc).regin[3] |= REGFLAG_XER_OV; } while (0) | |
| 63 | #define XER_SO_USED(desc) do { (desc).regin[3] |= REGFLAG_XER_SO; } while (0) | |
| 64 | #define XER_COUNT_USED(desc) do { (desc).regin[3] |= REGFLAG_XER_COUNT; } while (0) | |
| 65 | #define XER_CA_MODIFIED(desc) do { (desc).regout[3] |= REGFLAG_XER_CA; } while (0) | |
| 66 | #define XER_OV_MODIFIED(desc) do { (desc).regout[3] |= REGFLAG_XER_OV; } while (0) | |
| 67 | #define XER_SO_MODIFIED(desc) do { (desc).regout[3] |= REGFLAG_XER_SO; } while (0) | |
| 68 | #define XER_COUNT_MODIFIED(desc) do { (desc).regout[3] |= REGFLAG_XER_COUNT; } while (0) | |
| 42 | 69 | |
| 43 | #define CTR_USED(desc) do { (desc)->regin[3] |= REGFLAG_CTR; } while (0) | |
| 44 | #define CTR_MODIFIED(desc) do { (desc)->regout[3] |= REGFLAG_CTR; } while (0) | |
| 45 | #define LR_USED(desc) do { (desc)->regin[3] |= REGFLAG_LR; } while (0) | |
| 46 | #define LR_MODIFIED(desc) do { (desc)->regout[3] |= REGFLAG_LR; } while (0) | |
| 70 | #define CTR_USED(desc) do { (desc).regin[3] |= REGFLAG_CTR; } while (0) | |
| 71 | #define CTR_MODIFIED(desc) do { (desc).regout[3] |= REGFLAG_CTR; } while (0) | |
| 72 | #define LR_USED(desc) do { (desc).regin[3] |= REGFLAG_LR; } while (0) | |
| 73 | #define LR_MODIFIED(desc) do { (desc).regout[3] |= REGFLAG_LR; } while (0) | |
| 47 | 74 | |
| 48 | #define FPSCR_USED(desc, x) do { (desc)->regin[3] |= REGFLAG_FPSCR(x); } while (0) | |
| 49 | #define FPSCR_MODIFIED(desc, x) do { (desc)->regout[3] |= REGFLAG_FPSCR(x); } while (0) | |
| 75 | #define FPSCR_USED(desc, x) do { (desc).regin[3] |= REGFLAG_FPSCR(x); } while (0) | |
| 76 | #define FPSCR_MODIFIED(desc, x) do { (desc).regout[3] |= REGFLAG_FPSCR(x); } while (0) | |
| 50 | 77 | |
| 51 | 78 | |
| 52 | 79 | |
| 53 | /*************************************************************************** | |
| 54 | FUNCTION PROTOTYPES | |
| 55 | ***************************************************************************/ | |
| 80 | //************************************************************************** | |
| 81 | // PPC FRONTEND | |
| 82 | //************************************************************************** | |
| 56 | 83 | |
| 57 | static int describe_instruction_13(powerpc_state *ppc, UINT32 op, opcode_desc *desc, const opcode_desc *prev); | |
| 58 | static int describe_instruction_1f(powerpc_state *ppc, UINT32 op, opcode_desc *desc, const opcode_desc *prev); | |
| 59 | static int describe_instruction_3b(powerpc_state *ppc, UINT32 op, opcode_desc *desc, const opcode_desc *prev); | |
| 60 | static int describe_instruction_3f(powerpc_state *ppc, UINT32 op, opcode_desc *desc, const opcode_desc *prev); | |
| 84 | //------------------------------------------------- | |
| 85 | // ppc_frontend - constructor | |
| 86 | //------------------------------------------------- | |
| 61 | 87 | |
| 62 | ||
| 63 | ||
| 64 | /*************************************************************************** | |
| 65 | INLINE FUNCTIONS | |
| 66 | ***************************************************************************/ | |
| 67 | ||
| 68 | /*------------------------------------------------- | |
| 69 | compute_spr - compute the SPR index from the | |
| 70 | SPR field of an opcode | |
| 71 | -------------------------------------------------*/ | |
| 72 | ||
| 73 | INLINE UINT32 compute_spr(UINT32 spr) | |
| 88 | ppc_frontend::ppc_frontend(powerpc_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) | |
| 89 | : drc_frontend(*state.device, window_start, window_end, max_sequence), | |
| 90 | m_context(state) | |
| 74 | 91 | { |
| 75 | return ((spr >> 5) | (spr << 5)) & 0x3ff; | |
| 76 | 92 | } |
| 77 | 93 | |
| 78 | 94 | |
| 79 | /*------------------------------------------------- | |
| 80 | is_403_class - are we one of the 403 variants? | |
| 81 | -------------------------------------------------*/ | |
| 95 | //------------------------------------------------- | |
| 96 | // describe - build a description of a single | |
| 97 | // instruction | |
| 98 | //------------------------------------------------- | |
| 82 | 99 | |
| 83 | ||
| 100 | bool | |
| 84 | 101 | { |
| 85 | return (ppc->flavor == PPC_MODEL_403GA || ppc->flavor == PPC_MODEL_403GB || ppc->flavor == PPC_MODEL_403GC || ppc->flavor == PPC_MODEL_403GCX || ppc->flavor == PPC_MODEL_405GP); | |
| 86 | } | |
| 87 | ||
| 88 | ||
| 89 | /*------------------------------------------------- | |
| 90 | is_601_class - are we one of the 601 variants? | |
| 91 | -------------------------------------------------*/ | |
| 92 | ||
| 93 | INLINE int is_601_class(const powerpc_state *ppc) | |
| 94 | { | |
| 95 | return (ppc->flavor == PPC_MODEL_601); | |
| 96 | } | |
| 97 | ||
| 98 | ||
| 99 | /*------------------------------------------------- | |
| 100 | is_602_class - are we one of the 602 variants? | |
| 101 | -------------------------------------------------*/ | |
| 102 | ||
| 103 | INLINE int is_602_class(const powerpc_state *ppc) | |
| 104 | { | |
| 105 | return (ppc->flavor == PPC_MODEL_602); | |
| 106 | } | |
| 107 | ||
| 108 | ||
| 109 | /*------------------------------------------------- | |
| 110 | is_603_class - are we one of the 603 variants? | |
| 111 | -------------------------------------------------*/ | |
| 112 | ||
| 113 | INLINE int is_603_class(const powerpc_state *ppc) | |
| 114 | { | |
| 115 | return (ppc->flavor == PPC_MODEL_603 || ppc->flavor == PPC_MODEL_603E || ppc->flavor == PPC_MODEL_603EV || ppc->flavor == PPC_MODEL_603R); | |
| 116 | } | |
| 117 | ||
| 118 | ||
| 119 | ||
| 120 | /*************************************************************************** | |
| 121 | INSTRUCTION PARSERS | |
| 122 | ***************************************************************************/ | |
| 123 | ||
| 124 | /*------------------------------------------------- | |
| 125 | ppcfe_describe - build a description | |
| 126 | of a single instruction | |
| 127 | -------------------------------------------------*/ | |
| 128 | ||
| 129 | int ppcfe_describe(void *param, opcode_desc *desc, const opcode_desc *prev) | |
| 130 | { | |
| 131 | powerpc_state *ppc = (powerpc_state *)param; | |
| 132 | 102 | UINT32 op, opswitch; |
| 133 | 103 | int regnum; |
| 134 | 104 | |
| 135 | /* compute the physical PC */ | |
| 136 | if (!ppccom_translate_address(ppc, ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &desc->physpc)) | |
| 105 | // compute the physical PC | |
| 106 | if (!ppccom_translate_address(&m_context, ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &desc.physpc)) | |
| 137 | 107 | { |
| 138 | /* uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and */ | |
| 139 | /* mark as needing to validate; otherwise, just end the sequence here */ | |
| 140 | desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_PAGE_FAULT | OPFLAG_VIRTUAL_NOOP | OPFLAG_END_SEQUENCE; | |
| 141 | return TRUE; | |
| 108 | // uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and | |
| 109 | // mark as needing to validate; otherwise, just end the sequence here | |
| 110 | desc.flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_PAGE_FAULT | OPFLAG_VIRTUAL_NOOP | OPFLAG_END_SEQUENCE; | |
| 111 | return true; | |
| 142 | 112 | } |
| 143 | 113 | |
| 144 | /* fetch the opcode */ | |
| 145 | op = desc->opptr.l[0] = ppc->direct->read_decrypted_dword(desc->physpc, ppc->codexor); | |
| 114 | // fetch the opcode | |
| 115 | op = desc.opptr.l[0] = m_context.direct->read_decrypted_dword(desc.physpc, m_context.codexor); | |
| 146 | 116 | |
| 147 | /* all instructions are 4 bytes and default to a single cycle each */ | |
| 148 | desc->length = 4; | |
| 149 | desc->cycles = 1; | |
| 117 | // all instructions are 4 bytes and default to a single cycle each | |
| 118 | desc.length = 4; | |
| 119 | desc.cycles = 1; | |
| 150 | 120 | |
| 151 | / | |
| 121 | // parse the instruction | |
| 152 | 122 | opswitch = op >> 26; |
| 153 | 123 | switch (opswitch) |
| 154 | 124 | { |
| 155 | case 0x02: /* TDI - 64-bit only */ | |
| 156 | case 0x1e: /* 0x1e group - 64-bit only */ | |
| 157 | case 0x3a: /* 0x3a group - 64-bit only */ | |
| 158 | case 0x3e: /* 0x3e group - 64-bit only */ | |
| 159 | return FALSE; | |
| 125 | case 0x02: // TDI - 64-bit only | |
| 126 | case 0x1e: // 0x1e group - 64-bit only | |
| 127 | case 0x3a: // 0x3a group - 64-bit only | |
| 128 | case 0x3e: // 0x3e group - 64-bit only | |
| 129 | return false; | |
| 160 | 130 | |
| 161 | case 0x03: / | |
| 131 | case 0x03: // TWI | |
| 162 | 132 | GPR_USED(desc, G_RA(op)); |
| 163 | desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 164 | if (is_603_class(ppc)) | |
| 165 | desc->cycles = 2; /* 603 */ | |
| 166 | return TRUE; | |
| 133 | desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 134 | if (is_603_class()) | |
| 135 | desc.cycles = 2; // 603 | |
| 136 | return true; | |
| 167 | 137 | |
| 168 | case 0x07: / | |
| 138 | case 0x07: // MULLI | |
| 169 | 139 | GPR_USED(desc, G_RA(op)); |
| 170 | 140 | GPR_MODIFIED(desc, G_RD(op)); |
| 171 | if (is_403_class(ppc)) | |
| 172 | desc->cycles = 4; /* 4XX */ | |
| 173 | else if (is_601_class(ppc)) | |
| 174 | desc->cycles = 5; /* 601 */ | |
| 175 | else if (is_603_class(ppc)) | |
| 176 | desc->cycles = 2; /* 603: 2-3 */ | |
| 141 | if (is_403_class()) | |
| 142 | desc.cycles = 4; // 4XX | |
| 143 | else if (is_601_class()) | |
| 144 | desc.cycles = 5; // 601 | |
| 145 | else if (is_603_class()) | |
| 146 | desc.cycles = 2; // 603: 2-3 | |
| 177 | 147 | else |
| 178 | desc->cycles = 2; /* ??? */ | |
| 179 | return TRUE; | |
| 148 | desc.cycles = 2; // ??? | |
| 149 | return true; | |
| 180 | 150 | |
| 181 | case 0x0e: /* ADDI */ | |
| 182 | case 0x0f: /* ADDIS */ | |
| 151 | case 0x0e: // ADDI | |
| 152 | case 0x0f: // ADDIS | |
| 183 | 153 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 184 | 154 | GPR_MODIFIED(desc, G_RD(op)); |
| 185 | return | |
| 155 | return true; | |
| 186 | 156 | |
| 187 | case 0x0a: /* CMPLI */ | |
| 188 | case 0x0b: /* CMPI */ | |
| 157 | case 0x0a: // CMPLI | |
| 158 | case 0x0b: // CMPI | |
| 189 | 159 | GPR_USED(desc, G_RA(op)); |
| 190 | 160 | XER_SO_USED(desc); |
| 191 | 161 | CR_MODIFIED(desc, G_CRFD(op)); |
| 192 | return | |
| 162 | return true; | |
| 193 | 163 | |
| 194 | case 0x08: /* SUBFIC */ | |
| 195 | case 0x0c: /* ADDIC */ | |
| 164 | case 0x08: // SUBFIC | |
| 165 | case 0x0c: // ADDIC | |
| 196 | 166 | GPR_USED(desc, G_RA(op)); |
| 197 | 167 | GPR_MODIFIED(desc, G_RD(op)); |
| 198 | 168 | XER_CA_MODIFIED(desc); |
| 199 | return | |
| 169 | return true; | |
| 200 | 170 | |
| 201 | case 0x0d: / | |
| 171 | case 0x0d: // ADDIC. | |
| 202 | 172 | GPR_USED(desc, G_RA(op)); |
| 203 | 173 | XER_SO_USED(desc); |
| 204 | 174 | GPR_MODIFIED(desc, G_RT(op)); |
| 205 | 175 | XER_CA_MODIFIED(desc); |
| 206 | 176 | CR_MODIFIED(desc, 0); |
| 207 | return | |
| 177 | return true; | |
| 208 | 178 | |
| 209 | case 0x10: / | |
| 179 | case 0x10: // BCx | |
| 210 | 180 | if (!(G_BO(op) & 0x10)) |
| 211 | 181 | { |
| 212 | 182 | CR_BIT_USED(desc, G_BI(op)); |
| 213 | / | |
| 183 | // branch folding | |
| 214 | 184 | if (prev == NULL || prev->regout[2] == 0) |
| 215 | desc | |
| 185 | desc. | |
| 216 | 186 | } |
| 217 | 187 | if (!(G_BO(op) & 0x04)) |
| 218 | 188 | { |
| r9922 | r9923 | |
| 222 | 192 | if (op & M_LK) |
| 223 | 193 | LR_MODIFIED(desc); |
| 224 | 194 | if ((G_BO(op) & 0x14) == 0x14) |
| 225 | desc | |
| 195 | desc. | |
| 226 | 196 | else |
| 227 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 228 | desc->targetpc = (INT16)(G_BD(op) << 2) + ((op & M_AA) ? 0 : desc->pc); | |
| 229 | if (desc->targetpc == desc->pc && desc->cycles == 0) | |
| 230 | desc->cycles = 1; | |
| 231 | return TRUE; | |
| 197 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 198 | desc.targetpc = (INT16)(G_BD(op) << 2) + ((op & M_AA) ? 0 : desc.pc); | |
| 199 | if (desc.targetpc == desc.pc && desc.cycles == 0) | |
| 200 | desc.cycles = 1; | |
| 201 | return true; | |
| 232 | 202 | |
| 233 | case 0x11: /* SC */ | |
| 234 | if (!(ppc->cap & (PPCCAP_OEA | PPCCAP_4XX))) | |
| 235 | return FALSE; | |
| 236 | desc->flags |= OPFLAG_WILL_CAUSE_EXCEPTION; | |
| 237 | if (is_601_class(ppc)) | |
| 238 | desc->cycles = 16; /* 601 */ | |
| 239 | else if (is_603_class(ppc)) | |
| 240 | desc->cycles = 3; /* 603 */ | |
| 203 | case 0x11: // SC | |
| 204 | if (!(m_context.cap & (PPCCAP_OEA | PPCCAP_4XX))) | |
| 205 | return false; | |
| 206 | desc.flags |= OPFLAG_WILL_CAUSE_EXCEPTION; | |
| 207 | if (is_601_class()) | |
| 208 | desc.cycles = 16; // 601 | |
| 209 | else if (is_603_class()) | |
| 210 | desc.cycles = 3; // 603 | |
| 241 | 211 | else |
| 242 | desc->cycles = 3; /* ??? */ | |
| 243 | return TRUE; | |
| 212 | desc.cycles = 3; // ??? | |
| 213 | return true; | |
| 244 | 214 | |
| 245 | case 0x12: / | |
| 215 | case 0x12: // Bx | |
| 246 | 216 | if (op & M_LK) |
| 247 | 217 | LR_MODIFIED(desc); |
| 248 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 249 | desc->targetpc = ((INT32)(G_LI(op) << 8) >> 6) + ((op & M_AA) ? 0 : desc->pc); | |
| 250 | /* branch folding */ | |
| 251 | if (desc->targetpc != desc->pc) | |
| 252 | desc->cycles = 0; | |
| 253 | return TRUE; | |
| 218 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 219 | desc.targetpc = ((INT32)(G_LI(op) << 8) >> 6) + ((op & M_AA) ? 0 : desc.pc); | |
| 220 | // branch folding | |
| 221 | if (desc.targetpc != desc.pc) | |
| 222 | desc.cycles = 0; | |
| 223 | return true; | |
| 254 | 224 | |
| 255 | case 0x13: /* 0x13 group */ | |
| 256 | return describe_instruction_13(ppc, op, desc, prev); | |
| 225 | case 0x13: // 0x13 group | |
| 226 | return describe_13(op, desc, prev); | |
| 257 | 227 | |
| 258 | case 0x14: / | |
| 228 | case 0x14: // RLWIMIx | |
| 259 | 229 | GPR_USED(desc, G_RS(op)); |
| 260 | 230 | GPR_USED(desc, G_RA(op)); |
| 261 | 231 | GPR_MODIFIED(desc, G_RA(op)); |
| r9922 | r9923 | |
| 264 | 234 | XER_SO_USED(desc); |
| 265 | 235 | CR_MODIFIED(desc, 0); |
| 266 | 236 | } |
| 267 | return | |
| 237 | return true; | |
| 268 | 238 | |
| 269 | case 0x15: / | |
| 239 | case 0x15: // RLWINMx | |
| 270 | 240 | GPR_USED(desc, G_RS(op)); |
| 271 | 241 | GPR_MODIFIED(desc, G_RA(op)); |
| 272 | 242 | if (op & M_RC) |
| r9922 | r9923 | |
| 274 | 244 | XER_SO_USED(desc); |
| 275 | 245 | CR_MODIFIED(desc, 0); |
| 276 | 246 | } |
| 277 | return | |
| 247 | return true; | |
| 278 | 248 | |
| 279 | case 0x17: / | |
| 249 | case 0x17: // RLWNMx | |
| 280 | 250 | GPR_USED(desc, G_RS(op)); |
| 281 | 251 | GPR_USED(desc, G_RB(op)); |
| 282 | 252 | GPR_MODIFIED(desc, G_RA(op)); |
| r9922 | r9923 | |
| 285 | 255 | XER_SO_USED(desc); |
| 286 | 256 | CR_MODIFIED(desc, 0); |
| 287 | 257 | } |
| 288 | return | |
| 258 | return true; | |
| 289 | 259 | |
| 290 | case 0x18: /* ORI */ | |
| 291 | case 0x19: /* ORIS */ | |
| 292 | case 0x1a: /* XORI */ | |
| 293 | case 0x1b: /* XORIS */ | |
| 260 | case 0x18: // ORI | |
| 261 | case 0x19: // ORIS | |
| 262 | case 0x1a: // XORI | |
| 263 | case 0x1b: // XORIS | |
| 294 | 264 | GPR_USED(desc, G_RS(op)); |
| 295 | 265 | GPR_MODIFIED(desc, G_RA(op)); |
| 296 | return | |
| 266 | return true; | |
| 297 | 267 | |
| 298 | case 0x1c: /* ANDI. */ | |
| 299 | case 0x1d: /* ANDIS. */ | |
| 268 | case 0x1c: // ANDI. | |
| 269 | case 0x1d: // ANDIS. | |
| 300 | 270 | GPR_USED(desc, G_RS(op)); |
| 301 | 271 | XER_SO_USED(desc); |
| 302 | 272 | GPR_MODIFIED(desc, G_RA(op)); |
| 303 | 273 | CR_MODIFIED(desc, 0); |
| 304 | return | |
| 274 | return true; | |
| 305 | 275 | |
| 306 | case 0x1f: /* 0x1f group */ | |
| 307 | return describe_instruction_1f(ppc, op, desc, prev); | |
| 276 | case 0x1f: // 0x1f group | |
| 277 | return describe_1f(op, desc, prev); | |
| 308 | 278 | |
| 309 | case 0x20: /* LWZ */ | |
| 310 | case 0x22: /* LBZ */ | |
| 311 | case 0x28: /* LHZ */ | |
| 312 | case 0x2a: /* LHA */ | |
| 279 | case 0x20: // LWZ | |
| 280 | case 0x22: // LBZ | |
| 281 | case 0x28: // LHZ | |
| 282 | case 0x2a: // LHA | |
| 313 | 283 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 314 | 284 | GPR_MODIFIED(desc, G_RD(op)); |
| 315 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 316 | return TRUE; | |
| 285 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 286 | return true; | |
| 317 | 287 | |
| 318 | case 0x21: /* LWZU */ | |
| 319 | case 0x23: /* LBZU */ | |
| 320 | case 0x29: /* LHZU */ | |
| 321 | case 0x2b: /* LHAU */ | |
| 288 | case 0x21: // LWZU | |
| 289 | case 0x23: // LBZU | |
| 290 | case 0x29: // LHZU | |
| 291 | case 0x2b: // LHAU | |
| 322 | 292 | if (G_RA(op) == 0 || G_RA(op) == G_RD(op)) |
| 323 | return | |
| 293 | return false; | |
| 324 | 294 | GPR_USED(desc, G_RA(op)); |
| 325 | 295 | GPR_MODIFIED(desc, G_RD(op)); |
| 326 | 296 | GPR_MODIFIED(desc, G_RA(op)); |
| 327 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 328 | return TRUE; | |
| 297 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 298 | return true; | |
| 329 | 299 | |
| 330 | case 0x24: /* STW */ | |
| 331 | case 0x26: /* STB */ | |
| 332 | case 0x2c: /* STH */ | |
| 300 | case 0x24: // STW | |
| 301 | case 0x26: // STB | |
| 302 | case 0x2c: // STH | |
| 333 | 303 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 334 | 304 | GPR_USED(desc, G_RS(op)); |
| 335 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 336 | return TRUE; | |
| 305 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 306 | return true; | |
| 337 | 307 | |
| 338 | case 0x25: /* STWU */ | |
| 339 | case 0x27: /* STBU */ | |
| 340 | case 0x2d: /* STHU */ | |
| 308 | case 0x25: // STWU | |
| 309 | case 0x27: // STBU | |
| 310 | case 0x2d: // STHU | |
| 341 | 311 | if (G_RA(op) == 0) |
| 342 | return | |
| 312 | return false; | |
| 343 | 313 | GPR_USED(desc, G_RA(op)); |
| 344 | 314 | GPR_USED(desc, G_RS(op)); |
| 345 | 315 | GPR_MODIFIED(desc, G_RA(op)); |
| 346 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 347 | return TRUE; | |
| 316 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 317 | return true; | |
| 348 | 318 | |
| 349 | case 0x2e: / | |
| 319 | case 0x2e: // LMW | |
| 350 | 320 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 351 | 321 | for (regnum = G_RD(op); regnum < 32; regnum++) |
| 352 | 322 | GPR_MODIFIED(desc, regnum); |
| 353 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 354 | desc->cycles = 32 - G_RD(op); | |
| 355 | return TRUE; | |
| 323 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 324 | desc.cycles = 32 - G_RD(op); | |
| 325 | return true; | |
| 356 | 326 | |
| 357 | case 0x2f: / | |
| 327 | case 0x2f: // STMW | |
| 358 | 328 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 359 | 329 | for (regnum = G_RS(op); regnum < 32; regnum++) |
| 360 | 330 | GPR_USED(desc, regnum); |
| 361 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 362 | desc->cycles = 32 - G_RS(op); | |
| 363 | return TRUE; | |
| 331 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 332 | desc.cycles = 32 - G_RS(op); | |
| 333 | return true; | |
| 364 | 334 | |
| 365 | case 0x30: /* LFS */ | |
| 366 | case 0x32: /* LFD */ | |
| 367 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 368 | return FALSE; | |
| 335 | case 0x30: // LFS | |
| 336 | case 0x32: // LFD | |
| 337 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 338 | return false; | |
| 369 | 339 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 370 | 340 | FPR_MODIFIED(desc, G_RD(op)); |
| 371 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 372 | return TRUE; | |
| 341 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 342 | return true; | |
| 373 | 343 | |
| 374 | case 0x31: /* LFSU */ | |
| 375 | case 0x33: /* LFDU */ | |
| 376 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 377 | return FALSE; | |
| 344 | case 0x31: // LFSU | |
| 345 | case 0x33: // LFDU | |
| 346 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 347 | return false; | |
| 378 | 348 | if (G_RA(op) == 0) |
| 379 | return | |
| 349 | return false; | |
| 380 | 350 | GPR_USED(desc, G_RA(op)); |
| 381 | 351 | GPR_MODIFIED(desc, G_RA(op)); |
| 382 | 352 | FPR_MODIFIED(desc, G_RD(op)); |
| 383 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 384 | return TRUE; | |
| 353 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 354 | return true; | |
| 385 | 355 | |
| 386 | case 0x34: /* STFS */ | |
| 387 | case 0x36: /* STFD */ | |
| 388 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 389 | return FALSE; | |
| 356 | case 0x34: // STFS | |
| 357 | case 0x36: // STFD | |
| 358 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 359 | return false; | |
| 390 | 360 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 391 | 361 | FPR_USED(desc, G_RS(op)); |
| 392 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 393 | return TRUE; | |
| 362 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 363 | return true; | |
| 394 | 364 | |
| 395 | case 0x35: /* STFSU */ | |
| 396 | case 0x37: /* STFDU */ | |
| 397 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 398 | return FALSE; | |
| 365 | case 0x35: // STFSU | |
| 366 | case 0x37: // STFDU | |
| 367 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 368 | return false; | |
| 399 | 369 | if (G_RA(op) == 0) |
| 400 | return | |
| 370 | return false; | |
| 401 | 371 | GPR_USED(desc, G_RA(op)); |
| 402 | 372 | GPR_MODIFIED(desc, G_RA(op)); |
| 403 | 373 | FPR_USED(desc, G_RS(op)); |
| 404 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 405 | return TRUE; | |
| 374 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 375 | return true; | |
| 406 | 376 | |
| 407 | case 0x3b: /* 0x3b group */ | |
| 408 | return describe_instruction_3b(ppc, op, desc, prev); | |
| 377 | case 0x3b: // 0x3b group | |
| 378 | return describe_3b(op, desc, prev); | |
| 409 | 379 | |
| 410 | case 0x3f: /* 0x3f group */ | |
| 411 | return describe_instruction_3f(ppc, op, desc, prev); | |
| 380 | case 0x3f: // 0x3f group | |
| 381 | return describe_3f(op, desc, prev); | |
| 412 | 382 | } |
| 413 | 383 | |
| 414 | return | |
| 384 | return false; | |
| 415 | 385 | } |
| 416 | 386 | |
| 417 | 387 | |
| r9922 | r9923 | |
| 421 | 391 | 0x13 group |
| 422 | 392 | -------------------------------------------------*/ |
| 423 | 393 | |
| 424 | ||
| 394 | bool | |
| 425 | 395 | { |
| 426 | 396 | UINT32 opswitch = (op >> 1) & 0x3ff; |
| 427 | 397 | |
| 428 | 398 | switch (opswitch) |
| 429 | 399 | { |
| 430 | case 0x000: / | |
| 400 | case 0x000: // MTCRF | |
| 431 | 401 | CR_USED(desc, G_CRFS(op)); |
| 432 | 402 | CR_MODIFIED(desc, G_CRFD(op)); |
| 433 | / | |
| 403 | // CR logical folding | |
| 434 | 404 | if (prev == NULL || prev->regout[2] == 0) |
| 435 | desc->cycles = 0; | |
| 436 | return TRUE; | |
| 405 | desc.cycles = 0; | |
| 406 | return true; | |
| 437 | 407 | |
| 438 | case 0x010: / | |
| 408 | case 0x010: // BCLRx | |
| 439 | 409 | LR_USED(desc); |
| 440 | 410 | if (!(G_BO(op) & 0x10)) |
| 441 | 411 | CR_BIT_USED(desc, G_BI(op)); |
| r9922 | r9923 | |
| 447 | 417 | if (op & M_LK) |
| 448 | 418 | LR_MODIFIED(desc); |
| 449 | 419 | if ((G_BO(op) & 0x14) == 0x14) |
| 450 | desc | |
| 420 | desc. | |
| 451 | 421 | else |
| 452 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 453 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 454 | return TRUE; | |
| 422 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 423 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 424 | return true; | |
| 455 | 425 | |
| 456 | case 0x021: /* CRNOR */ | |
| 457 | case 0x081: /* CRANDC */ | |
| 458 | case 0x0c1: /* CRXOR */ | |
| 459 | case 0x0e1: /* CRNAND */ | |
| 460 | case 0x101: /* CRAND */ | |
| 461 | case 0x121: /* CREQV */ | |
| 462 | case 0x1a1: /* CRORC */ | |
| 463 | case 0x1c1: /* CROR */ | |
| 426 | case 0x021: // CRNOR | |
| 427 | case 0x081: // CRANDC | |
| 428 | case 0x0c1: // CRXOR | |
| 429 | case 0x0e1: // CRNAND | |
| 430 | case 0x101: // CRAND | |
| 431 | case 0x121: // CREQV | |
| 432 | case 0x1a1: // CRORC | |
| 433 | case 0x1c1: // CROR | |
| 464 | 434 | CR_BIT_USED(desc, G_CRBA(op)); |
| 465 | 435 | CR_BIT_USED(desc, G_CRBB(op)); |
| 466 | 436 | CR_BIT_MODIFIED(desc, G_CRBD(op)); |
| 467 | / | |
| 437 | // CR logical folding | |
| 468 | 438 | if (prev == NULL || prev->regout[2] == 0) |
| 469 | desc->cycles = 0; | |
| 470 | return TRUE; | |
| 439 | desc.cycles = 0; | |
| 440 | return true; | |
| 471 | 441 | |
| 472 | case 0x032: /* RFI */ | |
| 473 | if (!(ppc->cap & (PPCCAP_OEA | PPCCAP_4XX))) | |
| 474 | return FALSE; | |
| 475 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CHANGE_MODES | OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 476 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 477 | if (is_601_class(ppc)) | |
| 478 | desc->cycles = 13; /* 601 */ | |
| 479 | else if (is_603_class(ppc)) | |
| 480 | desc->cycles = 3; /* 603 */ | |
| 442 | case 0x032: // RFI | |
| 443 | if (!(m_context.cap & (PPCCAP_OEA | PPCCAP_4XX))) | |
| 444 | return false; | |
| 445 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CHANGE_MODES | OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 446 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 447 | if (is_601_class()) | |
| 448 | desc.cycles = 13; // 601 | |
| 449 | else if (is_603_class()) | |
| 450 | desc.cycles = 3; // 603 | |
| 481 | 451 | else |
| 482 | desc->cycles = 3; /* ??? */ | |
| 483 | return TRUE; | |
| 452 | desc.cycles = 3; // ??? | |
| 453 | return true; | |
| 484 | 454 | |
| 485 | case 0x033: /* RFCI */ | |
| 486 | if (!(ppc->cap & PPCCAP_4XX)) | |
| 487 | return FALSE; | |
| 488 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CHANGE_MODES | OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 489 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 490 | return TRUE; | |
| 455 | case 0x033: // RFCI | |
| 456 | if (!(m_context.cap & PPCCAP_4XX)) | |
| 457 | return false; | |
| 458 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CHANGE_MODES | OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 459 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 460 | return true; | |
| 491 | 461 | |
| 492 | case 0x096: /* ISYNC */ | |
| 493 | if (!(ppc->cap & (PPCCAP_VEA | PPCCAP_4XX))) | |
| 494 | return FALSE; | |
| 495 | if (is_601_class(ppc)) | |
| 496 | desc->cycles = 6; /* 601 */ | |
| 497 | return TRUE; | |
| 462 | case 0x096: // ISYNC | |
| 463 | if (!(m_context.cap & (PPCCAP_VEA | PPCCAP_4XX))) | |
| 464 | return false; | |
| 465 | if (is_601_class()) | |
| 466 | desc.cycles = 6; // 601 | |
| 467 | return true; | |
| 498 | 468 | |
| 499 | case 0x210: / | |
| 469 | case 0x210: // BCCTRx | |
| 500 | 470 | CTR_USED(desc); |
| 501 | 471 | if (!(G_BO(op) & 0x10)) |
| 502 | 472 | CR_BIT_USED(desc, G_BI(op)); |
| 503 | 473 | if (!(G_BO(op) & 0x04)) |
| 504 | return | |
| 474 | return false; | |
| 505 | 475 | if (op & M_LK) |
| 506 | 476 | LR_MODIFIED(desc); |
| 507 | 477 | if ((G_BO(op) & 0x14) == 0x14) |
| 508 | desc | |
| 478 | desc. | |
| 509 | 479 | else |
| 510 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 511 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 512 | return TRUE; | |
| 480 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 481 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 482 | return true; | |
| 513 | 483 | } |
| 514 | 484 | |
| 515 | return | |
| 485 | return false; | |
| 516 | 486 | } |
| 517 | 487 | |
| 518 | 488 | |
| r9922 | r9923 | |
| 522 | 492 | 0x1f group |
| 523 | 493 | -------------------------------------------------*/ |
| 524 | 494 | |
| 525 | ||
| 495 | bool | |
| 526 | 496 | { |
| 527 | 497 | UINT32 opswitch = (op >> 1) & 0x3ff; |
| 528 | 498 | int spr, regnum; |
| 529 | 499 | |
| 530 | 500 | switch (opswitch) |
| 531 | 501 | { |
| 532 | case 0x009: /* MULHDUx - 64-bit only */ | |
| 533 | case 0x015: /* LDX - 64-bit only */ | |
| 534 | case 0x01b: /* SLDx - 64-bit only */ | |
| 535 | case 0x035: /* LDUX - 64-bit only */ | |
| 536 | case 0x03a: /* CNTLZDx - 64-bit only */ | |
| 537 | case 0x044: /* TD - 64-bit only */ | |
| 538 | case 0x049: /* MULHDx - 64-bit only */ | |
| 539 | case 0x054: /* LDARX - 64-bit only */ | |
| 540 | case 0x095: /* STDX - 64-bit only */ | |
| 541 | case 0x0b5: /* STDUX - 64-bit only */ | |
| 542 | case 0x0d6: /* STDCX. - 64-bit only */ | |
| 543 | case 0x0e9: /* MULLD - 64-bit only */ | |
| 544 | case 0x2e9: /* MULLDO - 64-bit only */ | |
| 545 | case 0x155: /* LWAX - 64-bit only */ | |
| 546 | case 0x175: /* LWAUX - 64-bit only */ | |
| 547 | case 0x33a: /* SRADIx - 64-bit only */ | |
| 548 | case 0x33b: /* SRADIx - 64-bit only */ | |
| 549 | case 0x1b2: /* SLBIE - 64-bit only */ | |
| 550 | case 0x1c9: /* DIVDUx - 64-bit only */ | |
| 551 | case 0x3c9: /* DIVDUOx - 64-bit only */ | |
| 552 | case 0x1e9: /* DIVDx - 64-bit only */ | |
| 553 | case 0x3e9: /* DIVDOx - 64-bit only */ | |
| 554 | case 0x1f2: /* SLBIA - 64-bit only */ | |
| 555 | case 0x21b: /* SRDx - 64-bit only */ | |
| 556 | case 0x31a: /* SRADx - 64-bit only */ | |
| 557 | case 0x3da: /* EXTSW - 64-bit only */ | |
| 558 | return FALSE; | |
| 502 | case 0x009: // MULHDUx - 64-bit only | |
| 503 | case 0x015: // LDX - 64-bit only | |
| 504 | case 0x01b: // SLDx - 64-bit only | |
| 505 | case 0x035: // LDUX - 64-bit only | |
| 506 | case 0x03a: // CNTLZDx - 64-bit only | |
| 507 | case 0x044: // TD - 64-bit only | |
| 508 | case 0x049: // MULHDx - 64-bit only | |
| 509 | case 0x054: // LDARX - 64-bit only | |
| 510 | case 0x095: // STDX - 64-bit only | |
| 511 | case 0x0b5: // STDUX - 64-bit only | |
| 512 | case 0x0d6: // STDCX. - 64-bit only | |
| 513 | case 0x0e9: // MULLD - 64-bit only | |
| 514 | case 0x2e9: // MULLDO - 64-bit only | |
| 515 | case 0x155: // LWAX - 64-bit only | |
| 516 | case 0x175: // LWAUX - 64-bit only | |
| 517 | case 0x33a: // SRADIx - 64-bit only | |
| 518 | case 0x33b: // SRADIx - 64-bit only | |
| 519 | case 0x1b2: // SLBIE - 64-bit only | |
| 520 | case 0x1c9: // DIVDUx - 64-bit only | |
| 521 | case 0x3c9: // DIVDUOx - 64-bit only | |
| 522 | case 0x1e9: // DIVDx - 64-bit only | |
| 523 | case 0x3e9: // DIVDOx - 64-bit only | |
| 524 | case 0x1f2: // SLBIA - 64-bit only | |
| 525 | case 0x21b: // SRDx - 64-bit only | |
| 526 | case 0x31a: // SRADx - 64-bit only | |
| 527 | case 0x3da: // EXTSW - 64-bit only | |
| 528 | return false; | |
| 559 | 529 | |
| 560 | case 0x000: /* CMP */ | |
| 561 | case 0x020: /* CMPL */ | |
| 530 | case 0x000: // CMP | |
| 531 | case 0x020: // CMPL | |
| 562 | 532 | GPR_USED(desc, G_RA(op)); |
| 563 | 533 | GPR_USED(desc, G_RB(op)); |
| 564 | 534 | XER_SO_USED(desc); |
| 565 | 535 | CR_MODIFIED(desc, G_CRFD(op)); |
| 566 | return | |
| 536 | return true; | |
| 567 | 537 | |
| 568 | case 0x004: / | |
| 538 | case 0x004: // TW | |
| 569 | 539 | GPR_USED(desc, G_RA(op)); |
| 570 | 540 | GPR_USED(desc, G_RB(op)); |
| 571 | desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 572 | if (is_603_class(ppc)) | |
| 573 | desc->cycles = 2; /* 603 */ | |
| 574 | return TRUE; | |
| 541 | desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 542 | if (is_603_class()) | |
| 543 | desc.cycles = 2; // 603 | |
| 544 | return true; | |
| 575 | 545 | |
| 576 | case 0x008: /* SUBFCx */ | |
| 577 | case 0x00a: /* ADDCx */ | |
| 546 | case 0x008: // SUBFCx | |
| 547 | case 0x00a: // ADDCx | |
| 578 | 548 | GPR_USED(desc, G_RA(op)); |
| 579 | 549 | GPR_USED(desc, G_RB(op)); |
| 580 | 550 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 584 | 554 | XER_SO_USED(desc); |
| 585 | 555 | CR_MODIFIED(desc, 0); |
| 586 | 556 | } |
| 587 | return | |
| 557 | return true; | |
| 588 | 558 | |
| 589 | case 0x088: /* SUBFEx */ | |
| 590 | case 0x08a: /* ADDEx */ | |
| 559 | case 0x088: // SUBFEx | |
| 560 | case 0x08a: // ADDEx | |
| 591 | 561 | GPR_USED(desc, G_RA(op)); |
| 592 | 562 | GPR_USED(desc, G_RB(op)); |
| 593 | 563 | XER_CA_USED(desc); |
| r9922 | r9923 | |
| 598 | 568 | XER_SO_USED(desc); |
| 599 | 569 | CR_MODIFIED(desc, 0); |
| 600 | 570 | } |
| 601 | return | |
| 571 | return true; | |
| 602 | 572 | |
| 603 | case 0x0c8: /* SUBFZEx */ | |
| 604 | case 0x0ca: /* ADDZEx */ | |
| 605 | case 0x0e8: /* SUBFMEx */ | |
| 606 | case 0x0ea: /* ADDMEx */ | |
| 573 | case 0x0c8: // SUBFZEx | |
| 574 | case 0x0ca: // ADDZEx | |
| 575 | case 0x0e8: // SUBFMEx | |
| 576 | case 0x0ea: // ADDMEx | |
| 607 | 577 | GPR_USED(desc, G_RA(op)); |
| 608 | 578 | XER_CA_USED(desc); |
| 609 | 579 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 613 | 583 | XER_SO_USED(desc); |
| 614 | 584 | CR_MODIFIED(desc, 0); |
| 615 | 585 | } |
| 616 | return | |
| 586 | return true; | |
| 617 | 587 | |
| 618 | case 0x00b: /* MULHWUx */ | |
| 619 | case 0x04b: /* MULHWx */ | |
| 620 | case 0x0eb: /* MULLWx */ | |
| 588 | case 0x00b: // MULHWUx | |
| 589 | case 0x04b: // MULHWx | |
| 590 | case 0x0eb: // MULLWx | |
| 621 | 591 | GPR_USED(desc, G_RA(op)); |
| 622 | 592 | GPR_USED(desc, G_RB(op)); |
| 623 | 593 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 626 | 596 | XER_SO_USED(desc); |
| 627 | 597 | CR_MODIFIED(desc, 0); |
| 628 | 598 | } |
| 629 | if (is_403_class(ppc)) | |
| 630 | desc->cycles = 4; /* 4XX */ | |
| 631 | else if (is_601_class(ppc)) | |
| 632 | desc->cycles = 5; /* 601: 5/9/10 */ | |
| 633 | else if (is_603_class(ppc)) | |
| 634 | desc->cycles = 2; /* 603: 2,3,4,5,6 */ | |
| 599 | if (is_403_class()) | |
| 600 | desc.cycles = 4; // 4XX | |
| 601 | else if (is_601_class()) | |
| 602 | desc.cycles = 5; // 601: 5/9/10 | |
| 603 | else if (is_603_class()) | |
| 604 | desc.cycles = 2; // 603: 2,3,4,5,6 | |
| 635 | 605 | else |
| 636 | desc->cycles = 2; /* ??? */ | |
| 637 | return TRUE; | |
| 606 | desc.cycles = 2; // ??? | |
| 607 | return true; | |
| 638 | 608 | |
| 639 | case 0x1cb: /* DIVWUx */ | |
| 640 | case 0x1eb: /* DIVWx */ | |
| 609 | case 0x1cb: // DIVWUx | |
| 610 | case 0x1eb: // DIVWx | |
| 641 | 611 | GPR_USED(desc, G_RA(op)); |
| 642 | 612 | GPR_USED(desc, G_RB(op)); |
| 643 | 613 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 646 | 616 | XER_SO_USED(desc); |
| 647 | 617 | CR_MODIFIED(desc, 0); |
| 648 | 618 | } |
| 649 | if (is_403_class(ppc)) | |
| 650 | desc->cycles = 33; /* 4XX */ | |
| 651 | else if (is_601_class(ppc)) | |
| 652 | desc->cycles = 36; /* 601 */ | |
| 653 | else if (is_603_class(ppc)) | |
| 654 | desc->cycles = 37; /* 603 */ | |
| 619 | if (is_403_class()) | |
| 620 | desc.cycles = 33; // 4XX | |
| 621 | else if (is_601_class()) | |
| 622 | desc.cycles = 36; // 601 | |
| 623 | else if (is_603_class()) | |
| 624 | desc.cycles = 37; // 603 | |
| 655 | 625 | else |
| 656 | desc->cycles = 33; /* ??? */ | |
| 657 | return TRUE; | |
| 626 | desc.cycles = 33; // ??? | |
| 627 | return true; | |
| 658 | 628 | |
| 659 | case 0x028: /* SUBFx */ | |
| 660 | case 0x10a: /* ADDx */ | |
| 629 | case 0x028: // SUBFx | |
| 630 | case 0x10a: // ADDx | |
| 661 | 631 | GPR_USED(desc, G_RA(op)); |
| 662 | 632 | GPR_USED(desc, G_RB(op)); |
| 663 | 633 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 666 | 636 | XER_SO_USED(desc); |
| 667 | 637 | CR_MODIFIED(desc, 0); |
| 668 | 638 | } |
| 669 | return | |
| 639 | return true; | |
| 670 | 640 | |
| 671 | case 0x208: /* SUBFCOx */ | |
| 672 | case 0x20a: /* ADDCOx */ | |
| 641 | case 0x208: // SUBFCOx | |
| 642 | case 0x20a: // ADDCOx | |
| 673 | 643 | GPR_USED(desc, G_RA(op)); |
| 674 | 644 | GPR_USED(desc, G_RB(op)); |
| 675 | 645 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 678 | 648 | XER_CA_MODIFIED(desc); |
| 679 | 649 | if (op & M_RC) |
| 680 | 650 | CR_MODIFIED(desc, 0); |
| 681 | return | |
| 651 | return true; | |
| 682 | 652 | |
| 683 | case 0x288: /* SUBFEOx */ | |
| 684 | case 0x28a: /* ADDEOx */ | |
| 653 | case 0x288: // SUBFEOx | |
| 654 | case 0x28a: // ADDEOx | |
| 685 | 655 | GPR_USED(desc, G_RA(op)); |
| 686 | 656 | GPR_USED(desc, G_RB(op)); |
| 687 | 657 | XER_CA_USED(desc); |
| r9922 | r9923 | |
| 691 | 661 | XER_CA_MODIFIED(desc); |
| 692 | 662 | if (op & M_RC) |
| 693 | 663 | CR_MODIFIED(desc, 0); |
| 694 | return | |
| 664 | return true; | |
| 695 | 665 | |
| 696 | case 0x2c8: /* SUBFZEOx */ | |
| 697 | case 0x2ca: /* ADDZEOx */ | |
| 698 | case 0x2e8: /* SUBFMEOx */ | |
| 699 | case 0x2ea: /* ADDMEOx */ | |
| 666 | case 0x2c8: // SUBFZEOx | |
| 667 | case 0x2ca: // ADDZEOx | |
| 668 | case 0x2e8: // SUBFMEOx | |
| 669 | case 0x2ea: // ADDMEOx | |
| 700 | 670 | GPR_USED(desc, G_RA(op)); |
| 701 | 671 | XER_CA_USED(desc); |
| 702 | 672 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 705 | 675 | XER_CA_MODIFIED(desc); |
| 706 | 676 | if (op & M_RC) |
| 707 | 677 | CR_MODIFIED(desc, 0); |
| 708 | return | |
| 678 | return true; | |
| 709 | 679 | |
| 710 | case 0x2eb: / | |
| 680 | case 0x2eb: // MULLWOx | |
| 711 | 681 | GPR_USED(desc, G_RA(op)); |
| 712 | 682 | GPR_USED(desc, G_RB(op)); |
| 713 | 683 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 715 | 685 | XER_SO_MODIFIED(desc); |
| 716 | 686 | if (op & M_RC) |
| 717 | 687 | CR_MODIFIED(desc, 0); |
| 718 | if (is_403_class(ppc)) | |
| 719 | desc->cycles = 4; /* 4XX */ | |
| 720 | else if (is_601_class(ppc)) | |
| 721 | desc->cycles = 5; /* 601: 5/9/10 */ | |
| 722 | else if (is_603_class(ppc)) | |
| 723 | desc->cycles = 2; /* 603: 2,3,4,5,6 */ | |
| 688 | if (is_403_class()) | |
| 689 | desc.cycles = 4; // 4XX | |
| 690 | else if (is_601_class()) | |
| 691 | desc.cycles = 5; // 601: 5/9/10 | |
| 692 | else if (is_603_class()) | |
| 693 | desc.cycles = 2; // 603: 2,3,4,5,6 | |
| 724 | 694 | else |
| 725 | desc->cycles = 2; /* ??? */ | |
| 726 | return TRUE; | |
| 695 | desc.cycles = 2; // ??? | |
| 696 | return true; | |
| 727 | 697 | |
| 728 | case 0x3cb: /* DIVWUOx */ | |
| 729 | case 0x3eb: /* DIVWOx */ | |
| 698 | case 0x3cb: // DIVWUOx | |
| 699 | case 0x3eb: // DIVWOx | |
| 730 | 700 | GPR_USED(desc, G_RA(op)); |
| 731 | 701 | GPR_USED(desc, G_RB(op)); |
| 732 | 702 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 734 | 704 | XER_SO_MODIFIED(desc); |
| 735 | 705 | if (op & M_RC) |
| 736 | 706 | CR_MODIFIED(desc, 0); |
| 737 | if (is_403_class(ppc)) | |
| 738 | desc->cycles = 33; /* 4XX */ | |
| 739 | else if (is_601_class(ppc)) | |
| 740 | desc->cycles = 36; /* 601 */ | |
| 741 | else if (is_603_class(ppc)) | |
| 742 | desc->cycles = 37; /* 603 */ | |
| 707 | if (is_403_class()) | |
| 708 | desc.cycles = 33; // 4XX | |
| 709 | else if (is_601_class()) | |
| 710 | desc.cycles = 36; // 601 | |
| 711 | else if (is_603_class()) | |
| 712 | desc.cycles = 37; // 603 | |
| 743 | 713 | else |
| 744 | desc->cycles = 33; /* ??? */ | |
| 745 | return TRUE; | |
| 714 | desc.cycles = 33; // ??? | |
| 715 | return true; | |
| 746 | 716 | |
| 747 | case 0x228: /* SUBFOx */ | |
| 748 | case 0x30a: /* ADDOx */ | |
| 717 | case 0x228: // SUBFOx | |
| 718 | case 0x30a: // ADDOx | |
| 749 | 719 | GPR_USED(desc, G_RA(op)); |
| 750 | 720 | GPR_USED(desc, G_RB(op)); |
| 751 | 721 | GPR_MODIFIED(desc, G_RD(op)); |
| r9922 | r9923 | |
| 753 | 723 | XER_SO_MODIFIED(desc); |
| 754 | 724 | if (op & M_RC) |
| 755 | 725 | CR_MODIFIED(desc, 0); |
| 756 | return | |
| 726 | return true; | |
| 757 | 727 | |
| 758 | case 0x013: / | |
| 728 | case 0x013: // MFCR | |
| 759 | 729 | CR_USED(desc, 0); |
| 760 | 730 | CR_USED(desc, 1); |
| 761 | 731 | CR_USED(desc, 2); |
| r9922 | r9923 | |
| 765 | 735 | CR_USED(desc, 6); |
| 766 | 736 | CR_USED(desc, 7); |
| 767 | 737 | GPR_MODIFIED(desc, G_RD(op)); |
| 768 | return | |
| 738 | return true; | |
| 769 | 739 | |
| 770 | case 0x136: /* ECIWX */ | |
| 771 | if (!(ppc->cap & PPCCAP_VEA)) | |
| 772 | return FALSE; | |
| 773 | case 0x014: /* LWARX */ | |
| 774 | case 0x017: /* LWZX */ | |
| 775 | case 0x057: /* LBZX */ | |
| 776 | case 0x117: /* LHZX */ | |
| 777 | case 0x157: /* LHAX */ | |
| 778 | case 0x216: /* LWBRX */ | |
| 779 | case 0x316: /* LHBRX */ | |
| 740 | case 0x136: // ECIWX | |
| 741 | if (!(m_context.cap & PPCCAP_VEA)) | |
| 742 | return false; | |
| 743 | case 0x014: // LWARX | |
| 744 | case 0x017: // LWZX | |
| 745 | case 0x057: // LBZX | |
| 746 | case 0x117: // LHZX | |
| 747 | case 0x157: // LHAX | |
| 748 | case 0x216: // LWBRX | |
| 749 | case 0x316: // LHBRX | |
| 780 | 750 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 781 | 751 | GPR_USED(desc, G_RB(op)); |
| 782 | 752 | GPR_MODIFIED(desc, G_RD(op)); |
| 783 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 784 | return TRUE; | |
| 753 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 754 | return true; | |
| 785 | 755 | |
| 786 | case 0x018: /* SLWx */ | |
| 787 | case 0x01c: /* ANDx */ | |
| 788 | case 0x03c: /* ANDCx */ | |
| 789 | case 0x07c: /* NORx */ | |
| 790 | case 0x11c: /* EQVx */ | |
| 791 | case 0x13c: /* XORx */ | |
| 792 | case 0x19c: /* ORCx */ | |
| 793 | case 0x1bc: /* ORx */ | |
| 794 | case 0x1dc: /* NANDx */ | |
| 756 | case 0x018: // SLWx | |
| 757 | case 0x01c: // ANDx | |
| 758 | case 0x03c: // ANDCx | |
| 759 | case 0x07c: // NORx | |
| 760 | case 0x11c: // EQVx | |
| 761 | case 0x13c: // XORx | |
| 762 | case 0x19c: // ORCx | |
| 763 | case 0x1bc: // ORx | |
| 764 | case 0x1dc: // NANDx | |
| 795 | 765 | GPR_USED(desc, G_RS(op)); |
| 796 | 766 | GPR_USED(desc, G_RB(op)); |
| 797 | 767 | GPR_MODIFIED(desc, G_RA(op)); |
| r9922 | r9923 | |
| 800 | 770 | XER_SO_USED(desc); |
| 801 | 771 | CR_MODIFIED(desc, 0); |
| 802 | 772 | } |
| 803 | return | |
| 773 | return true; | |
| 804 | 774 | |
| 805 | case 0x218: /* SRWx */ | |
| 806 | case 0x318: /* SRAWx */ | |
| 775 | case 0x218: // SRWx | |
| 776 | case 0x318: // SRAWx | |
| 807 | 777 | GPR_USED(desc, G_RS(op)); |
| 808 | 778 | GPR_USED(desc, G_RB(op)); |
| 809 | 779 | GPR_MODIFIED(desc, G_RA(op)); |
| r9922 | r9923 | |
| 813 | 783 | XER_SO_USED(desc); |
| 814 | 784 | CR_MODIFIED(desc, 0); |
| 815 | 785 | } |
| 816 | return | |
| 786 | return true; | |
| 817 | 787 | |
| 818 | case 0x01a: /* CNTLZWx */ | |
| 819 | case 0x39a: /* EXTSHx */ | |
| 820 | case 0x3ba: /* EXTSBx */ | |
| 788 | case 0x01a: // CNTLZWx | |
| 789 | case 0x39a: // EXTSHx | |
| 790 | case 0x3ba: // EXTSBx | |
| 821 | 791 | GPR_USED(desc, G_RS(op)); |
| 822 | 792 | GPR_MODIFIED(desc, G_RA(op)); |
| 823 | 793 | if (op & M_RC) |
| r9922 | r9923 | |
| 825 | 795 | XER_SO_USED(desc); |
| 826 | 796 | CR_MODIFIED(desc, 0); |
| 827 | 797 | } |
| 828 | return | |
| 798 | return true; | |
| 829 | 799 | |
| 830 | case 0x036: /* DCBST */ | |
| 831 | case 0x056: /* DCBF */ | |
| 832 | case 0x0f6: /* DCBTST */ | |
| 833 | case 0x116: /* DCBT */ | |
| 834 | case 0x2f6: /* DCBA */ | |
| 835 | case 0x3d6: /* ICBI */ | |
| 836 | if (!(ppc->cap & (PPCCAP_VEA | PPCCAP_4XX))) | |
| 837 | return FALSE; | |
| 800 | case 0x036: // DCBST | |
| 801 | case 0x056: // DCBF | |
| 802 | case 0x0f6: // DCBTST | |
| 803 | case 0x116: // DCBT | |
| 804 | case 0x2f6: // DCBA | |
| 805 | case 0x3d6: // ICBI | |
| 806 | if (!(m_context.cap & (PPCCAP_VEA | PPCCAP_4XX))) | |
| 807 | return false; | |
| 838 | 808 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 839 | 809 | GPR_USED(desc, G_RB(op)); |
| 840 | return | |
| 810 | return true; | |
| 841 | 811 | |
| 842 | case 0x1d6: /* DCBI */ | |
| 843 | if (!(ppc->cap & (PPCCAP_OEA | PPCCAP_4XX))) | |
| 844 | return FALSE; | |
| 812 | case 0x1d6: // DCBI | |
| 813 | if (!(m_context.cap & (PPCCAP_OEA | PPCCAP_4XX))) | |
| 814 | return false; | |
| 845 | 815 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 846 | 816 | GPR_USED(desc, G_RB(op)); |
| 847 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 848 | return TRUE; | |
| 817 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 818 | return true; | |
| 849 | 819 | |
| 850 | case 0x037: /* LWZUX */ | |
| 851 | case 0x077: /* LBZUX */ | |
| 852 | case 0x137: /* LHZUX */ | |
| 853 | case 0x177: /* LHAUX */ | |
| 820 | case 0x037: // LWZUX | |
| 821 | case 0x077: // LBZUX | |
| 822 | case 0x137: // LHZUX | |
| 823 | case 0x177: // LHAUX | |
| 854 | 824 | if (G_RA(op) == 0 || G_RA(op) == G_RD(op)) |
| 855 | return | |
| 825 | return false; | |
| 856 | 826 | GPR_USED(desc, G_RA(op)); |
| 857 | 827 | GPR_USED(desc, G_RB(op)); |
| 858 | 828 | GPR_MODIFIED(desc, G_RD(op)); |
| 859 | 829 | GPR_MODIFIED(desc, G_RA(op)); |
| 860 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 861 | return TRUE; | |
| 830 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 831 | return true; | |
| 862 | 832 | |
| 863 | case 0x153: / | |
| 833 | case 0x153: // MFSPR | |
| 864 | 834 | GPR_MODIFIED(desc, G_RD(op)); |
| 865 | 835 | spr = compute_spr(G_SPR(op)); |
| 866 | 836 | if (spr == SPR_LR) |
| r9922 | r9923 | |
| 875 | 845 | XER_SO_USED(desc); |
| 876 | 846 | } |
| 877 | 847 | if (spr & 0x010) |
| 878 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 879 | if ((ppc->cap & PPCCAP_4XX) && spr == SPR4XX_TBLU) | |
| 880 | desc->cycles = POWERPC_COUNT_READ_TBL; | |
| 881 | else if ((ppc->cap & PPCCAP_VEA) && spr == SPRVEA_TBL_R) | |
| 882 | desc->cycles = POWERPC_COUNT_READ_TBL; | |
| 883 | else if ((ppc->cap & PPCCAP_OEA) && spr == SPROEA_DEC) | |
| 884 | desc->cycles = POWERPC_COUNT_READ_DEC; | |
| 885 | return TRUE; | |
| 848 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 849 | if ((m_context.cap & PPCCAP_4XX) && spr == SPR4XX_TBLU) | |
| 850 | desc.cycles = POWERPC_COUNT_READ_TBL; | |
| 851 | else if ((m_context.cap & PPCCAP_VEA) && spr == SPRVEA_TBL_R) | |
| 852 | desc.cycles = POWERPC_COUNT_READ_TBL; | |
| 853 | else if ((m_context.cap & PPCCAP_OEA) && spr == SPROEA_DEC) | |
| 854 | desc.cycles = POWERPC_COUNT_READ_DEC; | |
| 855 | return true; | |
| 886 | 856 | |
| 887 | case 0x053: / | |
| 857 | case 0x053: // MFMSR | |
| 888 | 858 | GPR_MODIFIED(desc, G_RD(op)); |
| 889 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 890 | if (is_601_class(ppc)) | |
| 891 | desc->cycles = 2; /* 601 */ | |
| 892 | return TRUE; | |
| 859 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 860 | if (is_601_class()) | |
| 861 | desc.cycles = 2; // 601 | |
| 862 | return true; | |
| 893 | 863 | |
| 894 | case 0x253: / | |
| 864 | case 0x253: // MFSR | |
| 895 | 865 | GPR_MODIFIED(desc, G_RD(op)); |
| 896 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 897 | return TRUE; | |
| 866 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 867 | return true; | |
| 898 | 868 | |
| 899 | case 0x293: / | |
| 869 | case 0x293: // MFSRIN | |
| 900 | 870 | GPR_USED(desc, G_RB(op)); |
| 901 | 871 | GPR_MODIFIED(desc, G_RD(op)); |
| 902 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 903 | return TRUE; | |
| 872 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 873 | return true; | |
| 904 | 874 | |
| 905 | case 0x173: /* MFTB */ | |
| 906 | if (!(ppc->cap & PPCCAP_VEA)) | |
| 907 | return FALSE; | |
| 875 | case 0x173: // MFTB | |
| 876 | if (!(m_context.cap & PPCCAP_VEA)) | |
| 877 | return false; | |
| 908 | 878 | GPR_MODIFIED(desc, G_RD(op)); |
| 909 | 879 | spr = compute_spr(G_SPR(op)); |
| 910 | 880 | if (spr == SPRVEA_TBL_R) |
| 911 | desc->cycles = POWERPC_COUNT_READ_TBL; | |
| 912 | return TRUE; | |
| 881 | desc.cycles = POWERPC_COUNT_READ_TBL; | |
| 882 | return true; | |
| 913 | 883 | |
| 914 | case 0x068: / | |
| 884 | case 0x068: // NEGx | |
| 915 | 885 | GPR_USED(desc, G_RA(op)); |
| 916 | 886 | GPR_MODIFIED(desc, G_RD(op)); |
| 917 | 887 | if (op & M_RC) |
| r9922 | r9923 | |
| 919 | 889 | XER_SO_USED(desc); |
| 920 | 890 | CR_MODIFIED(desc, 0); |
| 921 | 891 | } |
| 922 | return | |
| 892 | return true; | |
| 923 | 893 | |
| 924 | case 0x268: / | |
| 894 | case 0x268: // NEGOx | |
| 925 | 895 | GPR_USED(desc, G_RA(op)); |
| 926 | 896 | GPR_MODIFIED(desc, G_RD(op)); |
| 927 | 897 | XER_OV_MODIFIED(desc); |
| 928 | 898 | XER_SO_MODIFIED(desc); |
| 929 | 899 | if (op & M_RC) |
| 930 | 900 | CR_MODIFIED(desc, 0); |
| 931 | return | |
| 901 | return true; | |
| 932 | 902 | |
| 933 | case 0x090: / | |
| 903 | case 0x090: // MTCRF | |
| 934 | 904 | GPR_USED(desc, G_RS(op)); |
| 935 | 905 | if (G_CRM(op) & 0x80) CR_MODIFIED(desc, 0); |
| 936 | 906 | if (G_CRM(op) & 0x40) CR_MODIFIED(desc, 1); |
| r9922 | r9923 | |
| 940 | 910 | if (G_CRM(op) & 0x04) CR_MODIFIED(desc, 5); |
| 941 | 911 | if (G_CRM(op) & 0x02) CR_MODIFIED(desc, 6); |
| 942 | 912 | if (G_CRM(op) & 0x01) CR_MODIFIED(desc, 7); |
| 943 | return | |
| 913 | return true; | |
| 944 | 914 | |
| 945 | case 0x092: / | |
| 915 | case 0x092: // MTMSR | |
| 946 | 916 | GPR_USED(desc, G_RS(op)); |
| 947 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_CAN_CHANGE_MODES | OPFLAG_END_SEQUENCE; | |
| 948 | if (is_601_class(ppc)) | |
| 949 | desc->cycles = 17; /* 601 */ | |
| 950 | else if (is_603_class(ppc)) | |
| 951 | desc->cycles = 2; /* 603 */ | |
| 952 | return TRUE; | |
| 917 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_CAN_CHANGE_MODES | OPFLAG_END_SEQUENCE; | |
| 918 | if (is_601_class()) | |
| 919 | desc.cycles = 17; // 601 | |
| 920 | else if (is_603_class()) | |
| 921 | desc.cycles = 2; // 603 | |
| 922 | return true; | |
| 953 | 923 | |
| 954 | case 0x0d2: /* MTSR */ | |
| 955 | if (!(ppc->cap & PPCCAP_OEA)) | |
| 956 | return FALSE; | |
| 924 | case 0x0d2: // MTSR | |
| 925 | if (!(m_context.cap & PPCCAP_OEA)) | |
| 926 | return false; | |
| 957 | 927 | GPR_USED(desc, G_RS(op)); |
| 958 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 959 | return TRUE; | |
| 928 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 929 | return true; | |
| 960 | 930 | |
| 961 | case 0x1d3: / | |
| 931 | case 0x1d3: // MTSPR | |
| 962 | 932 | GPR_USED(desc, G_RS(op)); |
| 963 | 933 | spr = compute_spr(G_SPR(op)); |
| 964 | 934 | if (spr == SPR_LR) |
| r9922 | r9923 | |
| 973 | 943 | XER_SO_MODIFIED(desc); |
| 974 | 944 | } |
| 975 | 945 | if (spr & 0x010) |
| 976 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 977 | return TRUE; | |
| 946 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 947 | return true; | |
| 978 | 948 | |
| 979 | case 0x1b6: /* ECOWX */ | |
| 980 | if (!(ppc->cap & PPCCAP_VEA)) | |
| 981 | return FALSE; | |
| 982 | case 0x096: /* STWCX. */ | |
| 983 | case 0x097: /* STWX */ | |
| 984 | case 0x0d7: /* STBX */ | |
| 985 | case 0x197: /* STHX */ | |
| 986 | case 0x296: /* STWBRX */ | |
| 987 | case 0x396: /* STHBRX */ | |
| 949 | case 0x1b6: // ECOWX | |
| 950 | if (!(m_context.cap & PPCCAP_VEA)) | |
| 951 | return false; | |
| 952 | case 0x096: // STWCX. | |
| 953 | case 0x097: // STWX | |
| 954 | case 0x0d7: // STBX | |
| 955 | case 0x197: // STHX | |
| 956 | case 0x296: // STWBRX | |
| 957 | case 0x396: // STHBRX | |
| 988 | 958 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 989 | 959 | GPR_USED(desc, G_RB(op)); |
| 990 | 960 | GPR_USED(desc, G_RS(op)); |
| 991 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 992 | return TRUE; | |
| 961 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 962 | return true; | |
| 993 | 963 | |
| 994 | case 0x0b7: /* STWUX */ | |
| 995 | case 0x0f7: /* STBUX */ | |
| 996 | case 0x1b7: /* STHUX */ | |
| 964 | case 0x0b7: // STWUX | |
| 965 | case 0x0f7: // STBUX | |
| 966 | case 0x1b7: // STHUX | |
| 997 | 967 | if (G_RA(op) == 0) |
| 998 | return | |
| 968 | return false; | |
| 999 | 969 | GPR_USED(desc, G_RA(op)); |
| 1000 | 970 | GPR_USED(desc, G_RB(op)); |
| 1001 | 971 | GPR_USED(desc, G_RS(op)); |
| 1002 | 972 | GPR_MODIFIED(desc, G_RA(op)); |
| 1003 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 1004 | return TRUE; | |
| 973 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 974 | return true; | |
| 1005 | 975 | |
| 1006 | case 0x0f2: /* MTSRIN */ | |
| 1007 | if (!(ppc->cap & PPCCAP_OEA)) | |
| 1008 | return FALSE; | |
| 976 | case 0x0f2: // MTSRIN | |
| 977 | if (!(m_context.cap & PPCCAP_OEA)) | |
| 978 | return false; | |
| 1009 | 979 | GPR_USED(desc, G_RS(op)); |
| 1010 | 980 | GPR_USED(desc, G_RB(op)); |
| 1011 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1012 | return TRUE; | |
| 981 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 982 | return true; | |
| 1013 | 983 | |
| 1014 | case 0x132: /* TLBIE */ | |
| 1015 | if (!(ppc->cap & PPCCAP_OEA)) | |
| 1016 | return FALSE; | |
| 984 | case 0x132: // TLBIE | |
| 985 | if (!(m_context.cap & PPCCAP_OEA)) | |
| 986 | return false; | |
| 1017 | 987 | GPR_USED(desc, G_RB(op)); |
| 1018 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1019 | return TRUE; | |
| 988 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 989 | return true; | |
| 1020 | 990 | |
| 1021 | case 0x172: /* TLBIA */ | |
| 1022 | if (!(ppc->cap & PPCCAP_OEA) || (ppc->cap & PPCCAP_603_MMU)) | |
| 1023 | return FALSE; | |
| 1024 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1025 | return TRUE; | |
| 991 | case 0x172: // TLBIA | |
| 992 | if (!(m_context.cap & PPCCAP_OEA) || (m_context.cap & PPCCAP_603_MMU)) | |
| 993 | return false; | |
| 994 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 995 | return true; | |
| 1026 | 996 | |
| 1027 | case 0x3d2: /* TLBLD */ | |
| 1028 | case 0x3f2: /* TLBLI */ | |
| 1029 | if (!(ppc->cap & PPCCAP_603_MMU) && !is_602_class(ppc)) | |
| 1030 | return FALSE; | |
| 1031 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1032 | return TRUE; | |
| 997 | case 0x3d2: // TLBLD | |
| 998 | case 0x3f2: // TLBLI | |
| 999 | if (!(m_context.cap & PPCCAP_603_MMU) && !is_602_class()) | |
| 1000 | return false; | |
| 1001 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1002 | return true; | |
| 1033 | 1003 | |
| 1034 | case 0x200: / | |
| 1004 | case 0x200: // MCRXR | |
| 1035 | 1005 | XER_CA_USED(desc); |
| 1036 | 1006 | XER_OV_USED(desc); |
| 1037 | 1007 | XER_SO_USED(desc); |
| r9922 | r9923 | |
| 1039 | 1009 | XER_CA_MODIFIED(desc); |
| 1040 | 1010 | XER_OV_MODIFIED(desc); |
| 1041 | 1011 | XER_SO_MODIFIED(desc); |
| 1042 | return | |
| 1012 | return true; | |
| 1043 | 1013 | |
| 1044 | case 0x215: / | |
| 1014 | case 0x215: // LSWX | |
| 1045 | 1015 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1046 | 1016 | GPR_USED(desc, G_RB(op)); |
| 1047 | 1017 | XER_COUNT_USED(desc); |
| 1048 | 1018 | for (regnum = 0; regnum < 32; regnum++) |
| 1049 | 1019 | GPR_MODIFIED(desc, regnum); |
| 1050 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 1051 | return TRUE; | |
| 1020 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 1021 | return true; | |
| 1052 | 1022 | |
| 1053 | case 0x217: /* LFSX */ | |
| 1054 | case 0x257: /* LFDX */ | |
| 1055 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 1056 | return FALSE; | |
| 1023 | case 0x217: // LFSX | |
| 1024 | case 0x257: // LFDX | |
| 1025 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 1026 | return false; | |
| 1057 | 1027 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1058 | 1028 | GPR_USED(desc, G_RB(op)); |
| 1059 | 1029 | FPR_MODIFIED(desc, G_RD(op)); |
| 1060 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 1061 | return TRUE; | |
| 1030 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 1031 | return true; | |
| 1062 | 1032 | |
| 1063 | case 0x236: /* TLBSYNC */ | |
| 1064 | if (!(ppc->cap & PPCCAP_OEA)) | |
| 1065 | return FALSE; | |
| 1066 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1067 | return TRUE; | |
| 1033 | case 0x236: // TLBSYNC | |
| 1034 | if (!(m_context.cap & PPCCAP_OEA)) | |
| 1035 | return false; | |
| 1036 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1037 | return true; | |
| 1068 | 1038 | |
| 1069 | case 0x256: /* SYNC */ | |
| 1070 | return TRUE; | |
| 1039 | case 0x256: // SYNC | |
| 1040 | return true; | |
| 1071 | 1041 | |
| 1072 | case 0x356: /* EIEIO */ | |
| 1073 | if (!(ppc->cap & PPCCAP_VEA)) | |
| 1074 | return FALSE; | |
| 1075 | return TRUE; | |
| 1042 | case 0x356: // EIEIO | |
| 1043 | if (!(m_context.cap & PPCCAP_VEA)) | |
| 1044 | return false; | |
| 1045 | return true; | |
| 1076 | 1046 | |
| 1077 | case 0x237: /* LFSUX */ | |
| 1078 | case 0x277: /* LFDUX */ | |
| 1079 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 1080 | return FALSE; | |
| 1047 | case 0x237: // LFSUX | |
| 1048 | case 0x277: // LFDUX | |
| 1049 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 1050 | return false; | |
| 1081 | 1051 | if (G_RA(op) == 0) |
| 1082 | return | |
| 1052 | return false; | |
| 1083 | 1053 | GPR_USED(desc, G_RA(op)); |
| 1084 | 1054 | GPR_USED(desc, G_RB(op)); |
| 1085 | 1055 | GPR_MODIFIED(desc, G_RA(op)); |
| 1086 | 1056 | FPR_MODIFIED(desc, G_RD(op)); |
| 1087 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 1088 | return TRUE; | |
| 1057 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 1058 | return true; | |
| 1089 | 1059 | |
| 1090 | case 0x255: / | |
| 1060 | case 0x255: // LSWI | |
| 1091 | 1061 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1092 | 1062 | for (regnum = 0; regnum < ((G_NB(op) - 1) & 0x1f) + 1; regnum += 4) |
| 1093 | 1063 | GPR_MODIFIED(desc, (G_RD(op) + regnum / 4) % 32); |
| 1094 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 1095 | desc->cycles = (((G_NB(op) - 1) & 0x1f) + 1 + 3) / 4; | |
| 1096 | return TRUE; | |
| 1064 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 1065 | desc.cycles = (((G_NB(op) - 1) & 0x1f) + 1 + 3) / 4; | |
| 1066 | return true; | |
| 1097 | 1067 | |
| 1098 | case 0x295: / | |
| 1068 | case 0x295: // STSWX | |
| 1099 | 1069 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1100 | 1070 | GPR_USED(desc, G_RB(op)); |
| 1101 | 1071 | XER_COUNT_USED(desc); |
| 1102 | 1072 | for (regnum = 0; regnum < 32; regnum++) |
| 1103 | 1073 | GPR_USED(desc, regnum); |
| 1104 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 1105 | return TRUE; | |
| 1074 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 1075 | return true; | |
| 1106 | 1076 | |
| 1107 | case 0x2d5: / | |
| 1077 | case 0x2d5: // STSWI | |
| 1108 | 1078 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1109 | 1079 | for (regnum = 0; regnum < ((G_NB(op) - 1) & 0x1f) + 1; regnum += 4) |
| 1110 | 1080 | GPR_USED(desc, (G_RD(op) + regnum / 4) % 32); |
| 1111 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 1112 | desc->cycles = (((G_NB(op) - 1) & 0x1f) + 1 + 3) / 4; | |
| 1113 | return TRUE; | |
| 1081 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 1082 | desc.cycles = (((G_NB(op) - 1) & 0x1f) + 1 + 3) / 4; | |
| 1083 | return true; | |
| 1114 | 1084 | |
| 1115 | case 0x297: /* STFSX */ | |
| 1116 | case 0x2d7: /* STFDX */ | |
| 1117 | case 0x3d7: /* STFIWX */ | |
| 1118 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 1119 | return FALSE; | |
| 1085 | case 0x297: // STFSX | |
| 1086 | case 0x2d7: // STFDX | |
| 1087 | case 0x3d7: // STFIWX | |
| 1088 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 1089 | return false; | |
| 1120 | 1090 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1121 | 1091 | GPR_USED(desc, G_RB(op)); |
| 1122 | 1092 | FPR_USED(desc, G_RS(op)); |
| 1123 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 1124 | return TRUE; | |
| 1093 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 1094 | return true; | |
| 1125 | 1095 | |
| 1126 | case 0x2b7: /* STFSUX */ | |
| 1127 | case 0x2f7: /* STFDUX */ | |
| 1128 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 1129 | return FALSE; | |
| 1096 | case 0x2b7: // STFSUX | |
| 1097 | case 0x2f7: // STFDUX | |
| 1098 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 1099 | return false; | |
| 1130 | 1100 | if (G_RA(op) == 0) |
| 1131 | return | |
| 1101 | return false; | |
| 1132 | 1102 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1133 | 1103 | GPR_USED(desc, G_RB(op)); |
| 1134 | 1104 | GPR_MODIFIED(desc, G_RA(op)); |
| 1135 | 1105 | FPR_USED(desc, G_RS(op)); |
| 1136 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 1137 | return TRUE; | |
| 1106 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 1107 | return true; | |
| 1138 | 1108 | |
| 1139 | case 0x338: / | |
| 1109 | case 0x338: // SRAWIx | |
| 1140 | 1110 | GPR_USED(desc, G_RS(op)); |
| 1141 | 1111 | GPR_MODIFIED(desc, G_RA(op)); |
| 1142 | 1112 | XER_CA_MODIFIED(desc); |
| r9922 | r9923 | |
| 1145 | 1115 | XER_SO_USED(desc); |
| 1146 | 1116 | CR_MODIFIED(desc, 0); |
| 1147 | 1117 | } |
| 1148 | return | |
| 1118 | return true; | |
| 1149 | 1119 | |
| 1150 | case 0x3f6: /* DCBZ */ | |
| 1151 | if (!(ppc->cap & (PPCCAP_VEA | PPCCAP_4XX))) | |
| 1152 | return FALSE; | |
| 1120 | case 0x3f6: // DCBZ | |
| 1121 | if (!(m_context.cap & (PPCCAP_VEA | PPCCAP_4XX))) | |
| 1122 | return false; | |
| 1153 | 1123 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1154 | 1124 | GPR_USED(desc, G_RB(op)); |
| 1155 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 1156 | return TRUE; | |
| 1125 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 1126 | return true; | |
| 1157 | 1127 | |
| 1158 | case 0x106: /* ICBT */ | |
| 1159 | case 0x1c6: /* DCCCI */ | |
| 1160 | case 0x3c6: /* ICCCI */ | |
| 1161 | if (!(ppc->cap & PPCCAP_4XX)) | |
| 1162 | return FALSE; | |
| 1128 | case 0x106: // ICBT | |
| 1129 | case 0x1c6: // DCCCI | |
| 1130 | case 0x3c6: // ICCCI | |
| 1131 | if (!(m_context.cap & PPCCAP_4XX)) | |
| 1132 | return false; | |
| 1163 | 1133 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1164 | 1134 | GPR_USED(desc, G_RB(op)); |
| 1165 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1166 | return TRUE; | |
| 1135 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1136 | return true; | |
| 1167 | 1137 | |
| 1168 | case 0x1e6: /* DCREAD */ | |
| 1169 | case 0x3e6: /* ICREAD */ | |
| 1170 | if (!(ppc->cap & PPCCAP_4XX)) | |
| 1171 | return FALSE; | |
| 1138 | case 0x1e6: // DCREAD | |
| 1139 | case 0x3e6: // ICREAD | |
| 1140 | if (!(m_context.cap & PPCCAP_4XX)) | |
| 1141 | return false; | |
| 1172 | 1142 | GPR_USED_OR_ZERO(desc, G_RA(op)); |
| 1173 | 1143 | GPR_USED(desc, G_RB(op)); |
| 1174 | 1144 | GPR_MODIFIED(desc, G_RT(op)); |
| 1175 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1176 | return TRUE; | |
| 1145 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1146 | return true; | |
| 1177 | 1147 | |
| 1178 | case 0x143: /* MFDCR */ | |
| 1179 | if (!(ppc->cap & PPCCAP_4XX)) | |
| 1180 | return FALSE; | |
| 1148 | case 0x143: // MFDCR | |
| 1149 | if (!(m_context.cap & PPCCAP_4XX)) | |
| 1150 | return false; | |
| 1181 | 1151 | GPR_MODIFIED(desc, G_RD(op)); |
| 1182 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1183 | return TRUE; | |
| 1152 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1153 | return true; | |
| 1184 | 1154 | |
| 1185 | case 0x1c3: /* MTDCR */ | |
| 1186 | if (!(ppc->cap & PPCCAP_4XX)) | |
| 1187 | return FALSE; | |
| 1155 | case 0x1c3: // MTDCR | |
| 1156 | if (!(m_context.cap & PPCCAP_4XX)) | |
| 1157 | return false; | |
| 1188 | 1158 | GPR_USED(desc, G_RS(op)); |
| 1189 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 1190 | return TRUE; | |
| 1159 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 1160 | return true; | |
| 1191 | 1161 | |
| 1192 | case 0x083: /* WRTEE */ | |
| 1193 | if (!(ppc->cap & PPCCAP_4XX)) | |
| 1194 | return FALSE; | |
| 1162 | case 0x083: // WRTEE | |
| 1163 | if (!(m_context.cap & PPCCAP_4XX)) | |
| 1164 | return false; | |
| 1195 | 1165 | GPR_USED(desc, G_RS(op)); |
| 1196 | desc->flags |= OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 1197 | return TRUE; | |
| 1166 | desc.flags |= OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 1167 | return true; | |
| 1198 | 1168 | |
| 1199 | case 0x0a3: /* WRTEEI */ | |
| 1200 | if (!(ppc->cap & PPCCAP_4XX)) | |
| 1201 | return FALSE; | |
| 1169 | case 0x0a3: // WRTEEI | |
| 1170 | if (!(m_context.cap & PPCCAP_4XX)) | |
| 1171 | return false; | |
| 1202 | 1172 | if (op & MSR_EE) |
| 1203 | desc->flags |= OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 1204 | return TRUE; | |
| 1173 | desc.flags |= OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 1174 | return true; | |
| 1205 | 1175 | |
| 1206 | case 0x254: /* ESA */ | |
| 1207 | case 0x274: /* DSA */ | |
| 1208 | if (!is_602_class(ppc)) | |
| 1209 | return FALSE; | |
| 1210 | desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1211 | return TRUE; | |
| 1176 | case 0x254: // ESA | |
| 1177 | case 0x274: // DSA | |
| 1178 | if (!is_602_class()) | |
| 1179 | return false; | |
| 1180 | desc.flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 1181 | return true; | |
| 1212 | 1182 | } |
| 1213 | 1183 | |
| 1214 | return | |
| 1184 | return false; | |
| 1215 | 1185 | } |
| 1216 | 1186 | |
| 1217 | 1187 | |
| r9922 | r9923 | |
| 1221 | 1191 | 0x3b group |
| 1222 | 1192 | -------------------------------------------------*/ |
| 1223 | 1193 | |
| 1224 | ||
| 1194 | bool | |
| 1225 | 1195 | { |
| 1226 | 1196 | UINT32 opswitch = (op >> 1) & 0x1f; |
| 1227 | 1197 | |
| 1228 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 1229 | return FALSE; | |
| 1198 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 1199 | return false; | |
| 1230 | 1200 | |
| 1231 | 1201 | switch (opswitch) |
| 1232 | 1202 | { |
| 1233 | case 0x12: / | |
| 1203 | case 0x12: // FDIVSx | |
| 1234 | 1204 | FPR_USED(desc, G_RA(op)); |
| 1235 | 1205 | FPR_USED(desc, G_RB(op)); |
| 1236 | 1206 | FPR_MODIFIED(desc, G_RD(op)); |
| 1237 | 1207 | if (op & M_RC) |
| 1238 | 1208 | CR_MODIFIED(desc, 1); |
| 1239 | if (is_601_class(ppc)) | |
| 1240 | desc->cycles = 17; /* 601 */ | |
| 1241 | else if (is_603_class(ppc)) | |
| 1242 | desc->cycles = 18; /* 603 */ | |
| 1209 | if (is_601_class()) | |
| 1210 | desc.cycles = 17; // 601 | |
| 1211 | else if (is_603_class()) | |
| 1212 | desc.cycles = 18; // 603 | |
| 1243 | 1213 | else |
| 1244 | desc | |
| 1214 | desc. | |
| 1245 | 1215 | FPSCR_MODIFIED(desc, 4); |
| 1246 | return | |
| 1216 | return true; | |
| 1247 | 1217 | |
| 1248 | case 0x14: /* FSUBSx */ | |
| 1249 | case 0x15: /* FADDSx */ | |
| 1218 | case 0x14: // FSUBSx | |
| 1219 | case 0x15: // FADDSx | |
| 1250 | 1220 | FPR_USED(desc, G_RA(op)); |
| 1251 | 1221 | FPR_USED(desc, G_RB(op)); |
| 1252 | 1222 | FPR_MODIFIED(desc, G_RD(op)); |
| 1253 | 1223 | if (op & M_RC) |
| 1254 | 1224 | CR_MODIFIED(desc, 1); |
| 1255 | 1225 | FPSCR_MODIFIED(desc, 4); |
| 1256 | return | |
| 1226 | return true; | |
| 1257 | 1227 | |
| 1258 | case 0x19: / | |
| 1228 | case 0x19: // FMULSx - not the same form as FSUB/FADD! | |
| 1259 | 1229 | FPR_USED(desc, G_RA(op)); |
| 1260 | 1230 | FPR_USED(desc, G_REGC(op)); |
| 1261 | 1231 | FPR_MODIFIED(desc, G_RD(op)); |
| 1262 | 1232 | if (op & M_RC) |
| 1263 | 1233 | CR_MODIFIED(desc, 1); |
| 1264 | 1234 | FPSCR_MODIFIED(desc, 4); |
| 1265 | return | |
| 1235 | return true; | |
| 1266 | 1236 | |
| 1267 | case 0x16: /* FSQRTSx */ | |
| 1268 | case 0x18: /* FRESx */ | |
| 1237 | case 0x16: // FSQRTSx | |
| 1238 | case 0x18: // FRESx | |
| 1269 | 1239 | FPR_USED(desc, G_RB(op)); |
| 1270 | 1240 | FPR_MODIFIED(desc, G_RD(op)); |
| 1271 | 1241 | if (op & M_RC) |
| 1272 | 1242 | CR_MODIFIED(desc, 1); |
| 1273 | 1243 | FPSCR_MODIFIED(desc, 4); |
| 1274 | return | |
| 1244 | return true; | |
| 1275 | 1245 | |
| 1276 | case 0x1c: /* FMSUBSx */ | |
| 1277 | case 0x1d: /* FMADDSx */ | |
| 1278 | case 0x1e: /* FNMSUBSx */ | |
| 1279 | case 0x1f: /* FNMADDSx */ | |
| 1246 | case 0x1c: // FMSUBSx | |
| 1247 | case 0x1d: // FMADDSx | |
| 1248 | case 0x1e: // FNMSUBSx | |
| 1249 | case 0x1f: // FNMADDSx | |
| 1280 | 1250 | FPR_USED(desc, G_RA(op)); |
| 1281 | 1251 | FPR_USED(desc, G_RB(op)); |
| 1282 | 1252 | FPR_USED(desc, G_REGC(op)); |
| r9922 | r9923 | |
| 1284 | 1254 | if (op & M_RC) |
| 1285 | 1255 | CR_MODIFIED(desc, 1); |
| 1286 | 1256 | FPSCR_MODIFIED(desc, 4); |
| 1287 | return | |
| 1257 | return true; | |
| 1288 | 1258 | } |
| 1289 | 1259 | |
| 1290 | return | |
| 1260 | return false; | |
| 1291 | 1261 | } |
| 1292 | 1262 | |
| 1293 | 1263 | |
| r9922 | r9923 | |
| 1297 | 1267 | 0x3f group |
| 1298 | 1268 | -------------------------------------------------*/ |
| 1299 | 1269 | |
| 1300 | ||
| 1270 | bool | |
| 1301 | 1271 | { |
| 1302 | 1272 | UINT32 opswitch = (op >> 1) & 0x3ff; |
| 1303 | 1273 | |
| 1304 | if (!(ppc->cap & PPCCAP_FPU)) | |
| 1305 | return FALSE; | |
| 1274 | if (!(m_context.cap & PPCCAP_FPU)) | |
| 1275 | return false; | |
| 1306 | 1276 | |
| 1307 | 1277 | if (opswitch & 0x10) |
| 1308 | 1278 | { |
| 1309 | 1279 | opswitch &= 0x1f; |
| 1310 | 1280 | switch (opswitch) |
| 1311 | 1281 | { |
| 1312 | case 0x12: / | |
| 1282 | case 0x12: // FDIVx | |
| 1313 | 1283 | FPR_USED(desc, G_RA(op)); |
| 1314 | 1284 | FPR_USED(desc, G_RB(op)); |
| 1315 | 1285 | FPR_MODIFIED(desc, G_RD(op)); |
| 1316 | 1286 | if (op & M_RC) |
| 1317 | 1287 | CR_MODIFIED(desc, 1); |
| 1318 | if (is_601_class(ppc)) | |
| 1319 | desc->cycles = 31; /* 601 */ | |
| 1320 | else if (is_603_class(ppc)) | |
| 1321 | desc->cycles = 33; /* 603 */ | |
| 1288 | if (is_601_class()) | |
| 1289 | desc.cycles = 31; // 601 | |
| 1290 | else if (is_603_class()) | |
| 1291 | desc.cycles = 33; // 603 | |
| 1322 | 1292 | else |
| 1323 | desc | |
| 1293 | desc. | |
| 1324 | 1294 | FPSCR_MODIFIED(desc, 4); |
| 1325 | return | |
| 1295 | return true; | |
| 1326 | 1296 | |
| 1327 | case 0x19: / | |
| 1297 | case 0x19: // FMULx | |
| 1328 | 1298 | FPR_USED(desc, G_RA(op)); |
| 1329 | 1299 | FPR_USED(desc, G_REGC(op)); |
| 1330 | 1300 | FPR_MODIFIED(desc, G_RD(op)); |
| 1331 | 1301 | if (op & M_RC) |
| 1332 | 1302 | CR_MODIFIED(desc, 1); |
| 1333 | desc | |
| 1303 | desc. | |
| 1334 | 1304 | FPSCR_MODIFIED(desc, 4); |
| 1335 | return | |
| 1305 | return true; | |
| 1336 | 1306 | |
| 1337 | case 0x14: /* FSUBx */ | |
| 1338 | case 0x15: /* FADDx */ | |
| 1307 | case 0x14: // FSUBx | |
| 1308 | case 0x15: // FADDx | |
| 1339 | 1309 | FPR_USED(desc, G_RA(op)); |
| 1340 | 1310 | FPR_USED(desc, G_RB(op)); |
| 1341 | 1311 | FPR_MODIFIED(desc, G_RD(op)); |
| 1342 | 1312 | if (op & M_RC) |
| 1343 | 1313 | CR_MODIFIED(desc, 1); |
| 1344 | 1314 | FPSCR_MODIFIED(desc, 4); |
| 1345 | return | |
| 1315 | return true; | |
| 1346 | 1316 | |
| 1347 | case 0x16: /* FSQRTx */ | |
| 1348 | case 0x1a: /* FSQRTEx */ | |
| 1317 | case 0x16: // FSQRTx | |
| 1318 | case 0x1a: // FSQRTEx | |
| 1349 | 1319 | FPR_USED(desc, G_RB(op)); |
| 1350 | 1320 | FPR_MODIFIED(desc, G_RD(op)); |
| 1351 | 1321 | if (op & M_RC) |
| 1352 | 1322 | CR_MODIFIED(desc, 1); |
| 1353 | 1323 | FPSCR_MODIFIED(desc, 4); |
| 1354 | return | |
| 1324 | return true; | |
| 1355 | 1325 | |
| 1356 | case 0x17: / | |
| 1326 | case 0x17: // FSELx | |
| 1357 | 1327 | FPR_USED(desc, G_RA(op)); |
| 1358 | 1328 | FPR_USED(desc, G_RB(op)); |
| 1359 | 1329 | FPR_USED(desc, G_REGC(op)); |
| 1360 | 1330 | FPR_MODIFIED(desc, G_RD(op)); |
| 1361 | 1331 | if (op & M_RC) |
| 1362 | 1332 | CR_MODIFIED(desc, 1); |
| 1363 | desc->cycles = 2; /* 601/603 */ | |
| 1364 | return TRUE; | |
| 1333 | desc.cycles = 2; // 601/603 | |
| 1334 | return true; | |
| 1365 | 1335 | |
| 1366 | case 0x1c: /* FMSUBx */ | |
| 1367 | case 0x1d: /* FMADDx */ | |
| 1368 | case 0x1e: /* FNMSUBx */ | |
| 1369 | case 0x1f: /* FNMADDx */ | |
| 1336 | case 0x1c: // FMSUBx | |
| 1337 | case 0x1d: // FMADDx | |
| 1338 | case 0x1e: // FNMSUBx | |
| 1339 | case 0x1f: // FNMADDx | |
| 1370 | 1340 | FPR_USED(desc, G_RA(op)); |
| 1371 | 1341 | FPR_USED(desc, G_RB(op)); |
| 1372 | 1342 | FPR_USED(desc, G_REGC(op)); |
| 1373 | 1343 | FPR_MODIFIED(desc, G_RD(op)); |
| 1374 | 1344 | if (op & M_RC) |
| 1375 | 1345 | CR_MODIFIED(desc, 1); |
| 1376 | desc | |
| 1346 | desc. | |
| 1377 | 1347 | FPSCR_MODIFIED(desc, 4); |
| 1378 | return | |
| 1348 | return true; | |
| 1379 | 1349 | } |
| 1380 | 1350 | } |
| 1381 | 1351 | else |
| 1382 | 1352 | { |
| 1383 | 1353 | switch (opswitch) |
| 1384 | 1354 | { |
| 1385 | case 0x32e: /* FCTIDx - 64-bit only */ | |
| 1386 | case 0x32f: /* FCTIDZx - 64-bit only */ | |
| 1387 | case 0x34e: /* FCFIDx - 64-bit only */ | |
| 1388 | return FALSE; | |
| 1355 | case 0x32e: // FCTIDx - 64-bit only | |
| 1356 | case 0x32f: // FCTIDZx - 64-bit only | |
| 1357 | case 0x34e: // FCFIDx - 64-bit only | |
| 1358 | return false; | |
| 1389 | 1359 | |
| 1390 | case 0x000: /* FCMPU */ | |
| 1391 | case 0x020: /* FCMPO */ | |
| 1360 | case 0x000: // FCMPU | |
| 1361 | case 0x020: // FCMPO | |
| 1392 | 1362 | FPR_USED(desc, G_RA(op)); |
| 1393 | 1363 | FPR_USED(desc, G_RB(op)); |
| 1394 | 1364 | CR_MODIFIED(desc, G_CRFD(op)); |
| 1395 | return | |
| 1365 | return true; | |
| 1396 | 1366 | |
| 1397 | case 0x00c: /* FRSPx */ | |
| 1398 | case 0x00e: /* FCTIWx */ | |
| 1399 | case 0x00f: /* FCTIWZx */ | |
| 1367 | case 0x00c: // FRSPx | |
| 1368 | case 0x00e: // FCTIWx | |
| 1369 | case 0x00f: // FCTIWZx | |
| 1400 | 1370 | FPSCR_MODIFIED(desc, 4); |
| 1401 | case 0x028: /* FNEGx */ | |
| 1402 | case 0x048: /* FMRx */ | |
| 1403 | case 0x088: /* FNABSx */ | |
| 1404 | case 0x108: /* FABSx */ | |
| 1371 | case 0x028: // FNEGx | |
| 1372 | case 0x048: // FMRx | |
| 1373 | case 0x088: // FNABSx | |
| 1374 | case 0x108: // FABSx | |
| 1405 | 1375 | FPR_USED(desc, G_RB(op)); |
| 1406 | 1376 | FPR_MODIFIED(desc, G_RD(op)); |
| 1407 | 1377 | if (op & M_RC) |
| 1408 | 1378 | CR_MODIFIED(desc, 1); |
| 1409 | return | |
| 1379 | return true; | |
| 1410 | 1380 | |
| 1411 | case 0x026: /* MTFSB1x */ | |
| 1412 | case 0x046: /* MTFSB0x */ | |
| 1381 | case 0x026: // MTFSB1x | |
| 1382 | case 0x046: // MTFSB0x | |
| 1413 | 1383 | FPSCR_MODIFIED(desc, G_CRBD(op) / 4); |
| 1414 | return | |
| 1384 | return true; | |
| 1415 | 1385 | |
| 1416 | case 0x040: / | |
| 1386 | case 0x040: // MCRFS | |
| 1417 | 1387 | FPSCR_USED(desc, G_CRFS(op)); |
| 1418 | 1388 | CR_MODIFIED(desc, G_CRFD(op)); |
| 1419 | return | |
| 1389 | return true; | |
| 1420 | 1390 | |
| 1421 | case 0x086: / | |
| 1391 | case 0x086: // MTFSFIx | |
| 1422 | 1392 | FPSCR_MODIFIED(desc, G_CRFD(op)); |
| 1423 | return | |
| 1393 | return true; | |
| 1424 | 1394 | |
| 1425 | case 0x247: / | |
| 1395 | case 0x247: // MFFSx | |
| 1426 | 1396 | FPSCR_USED(desc, 0); |
| 1427 | 1397 | FPSCR_USED(desc, 1); |
| 1428 | 1398 | FPSCR_USED(desc, 2); |
| r9922 | r9923 | |
| 1432 | 1402 | FPSCR_USED(desc, 6); |
| 1433 | 1403 | FPSCR_USED(desc, 7); |
| 1434 | 1404 | FPR_MODIFIED(desc, G_RD(op)); |
| 1435 | return | |
| 1405 | return true; | |
| 1436 | 1406 | |
| 1437 | case 0x2c7: / | |
| 1407 | case 0x2c7: // MTFSFx | |
| 1438 | 1408 | FPR_USED(desc, G_RB(op)); |
| 1439 | 1409 | if (G_CRM(op) & 0x80) FPSCR_MODIFIED(desc, 0); |
| 1440 | 1410 | if (G_CRM(op) & 0x40) FPSCR_MODIFIED(desc, 1); |
| r9922 | r9923 | |
| 1444 | 1414 | if (G_CRM(op) & 0x04) FPSCR_MODIFIED(desc, 5); |
| 1445 | 1415 | if (G_CRM(op) & 0x02) FPSCR_MODIFIED(desc, 6); |
| 1446 | 1416 | if (G_CRM(op) & 0x01) FPSCR_MODIFIED(desc, 7); |
| 1447 | return | |
| 1417 | return true; | |
| 1448 | 1418 | } |
| 1449 | 1419 | } |
| 1450 | 1420 | |
| 1451 | return | |
| 1421 | return false; | |
| 1452 | 1422 | } |
| r9922 | r9923 | |
|---|---|---|
| 21 | 21 | #include "cpu/drcfe.h" |
| 22 | 22 | #include "cpu/drcuml.h" |
| 23 | 23 | #include "cpu/drcumlsh.h" |
| 24 | class sh2_frontend; | |
| 24 | 25 | #endif |
| 25 | 26 | |
| 26 | 27 | #define SH2_CODE_XOR(a) ((a) ^ NATIVE_ENDIAN_VALUE_LE_BE(2,0)) |
| r9922 | r9923 | |
| 155 | 156 | #ifdef USE_SH2DRC |
| 156 | 157 | drccache * cache; /* pointer to the DRC code cache */ |
| 157 | 158 | drcuml_state * drcuml; /* DRC UML generator state */ |
| 158 | | |
| 159 | | |
| 159 | 160 | UINT32 drcoptions; /* configurable DRC options */ |
| 160 | 161 | |
| 161 | 162 | /* internal stuff */ |
| r9922 | r9923 | |
| 184 | 185 | #endif |
| 185 | 186 | } sh2_state; |
| 186 | 187 | |
| 188 | #ifdef USE_SH2DRC | |
| 189 | class sh2_frontend : public drc_frontend | |
| 190 | { | |
| 191 | public: | |
| 192 | sh2_frontend(sh2_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); | |
| 193 | ||
| 194 | protected: | |
| 195 | virtual bool describe(opcode_desc &desc, const opcode_desc *prev); | |
| 196 | ||
| 197 | private: | |
| 198 | bool describe_group_0(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); | |
| 199 | bool describe_group_2(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); | |
| 200 | bool describe_group_3(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); | |
| 201 | bool describe_group_4(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); | |
| 202 | bool describe_group_6(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); | |
| 203 | bool describe_group_8(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); | |
| 204 | bool describe_group_12(opcode_desc &desc, const opcode_desc *prev, UINT16 opcode); | |
| 205 | ||
| 206 | sh2_state &m_context; | |
| 207 | }; | |
| 208 | #endif | |
| 209 | ||
| 187 | 210 | void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_callback irqcallback); |
| 188 | 211 | void sh2_recalc_irq(sh2_state *sh2); |
| 189 | 212 | void sh2_set_irq_line(sh2_state *sh2, int irqline, int state); |
| r9922 | r9923 | |
|---|---|---|
| 674 | 674 | |
| 675 | 675 | static CPU_INIT( sh2 ) |
| 676 | 676 | { |
| 677 | drcfe_config feconfig = | |
| 678 | { | |
| 679 | COMPILE_BACKWARDS_BYTES, /* code window start offset = startpc - window_start */ | |
| 680 | COMPILE_FORWARDS_BYTES, /* code window end offset = startpc + window_end */ | |
| 681 | COMPILE_MAX_SEQUENCE, /* maximum instructions to include in a sequence */ | |
| 682 | sh2_describe /* callback to describe a single instruction */ | |
| 683 | }; | |
| 684 | 677 | sh2_state *sh2 = get_safe_token(device); |
| 685 | 678 | drccache *cache; |
| 686 | 679 | drcbe_info beinfo; |
| r9922 | r9923 | |
| 733 | 726 | drcuml_symbol_add(sh2->drcuml, &sh2->mach, sizeof(sh2->macl), "mach"); |
| 734 | 727 | |
| 735 | 728 | /* initialize the front-end helper */ |
| 736 | if (SINGLE_INSTRUCTION_MODE) | |
| 737 | feconfig.max_sequence = 1; | |
| 738 | sh2->drcfe = drcfe_init(device, &feconfig, sh2); | |
| 729 | sh2->drcfe = auto_alloc(device->machine, sh2_frontend(*sh2, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE)); | |
| 739 | 730 | |
| 740 | 731 | /* compute the register parameters */ |
| 741 | 732 | for (regnum = 0; regnum < 16; regnum++) |
| r9922 | r9923 | |
| 779 | 770 | sh2_state *sh2 = get_safe_token(device); |
| 780 | 771 | |
| 781 | 772 | /* clean up the DRC */ |
| 782 | | |
| 773 | auto_fre | |
| 783 | 774 | drcuml_free(sh2->drcuml); |
| 784 | 775 | drccache_free(sh2->cache); |
| 785 | 776 | } |
| r9922 | r9923 | |
| 941 | 932 | g_profiler.start(PROFILER_DRC_COMPILE); |
| 942 | 933 | |
| 943 | 934 | /* get a description of this sequence */ |
| 944 | desclist = drcfe | |
| 935 | desclist = sh2->drcfe->describe_code( | |
| 945 | 936 | if (LOG_UML || LOG_NATIVE) |
| 946 | 937 | log_opcode_desc(drcuml, desclist, 0); |
| 947 | 938 | |
| r9922 | r9923 | |
| 953 | 944 | block = drcuml_block_begin(drcuml, 4096, &errorbuf); |
| 954 | 945 | |
| 955 | 946 | /* loop until we get through all instruction sequences */ |
| 956 | for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next) | |
| 947 | for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next()) | |
| 957 | 948 | { |
| 958 | 949 | const opcode_desc *curdesc; |
| 959 | 950 | UINT32 nextpc; |
| r9922 | r9923 | |
| 963 | 954 | UML_COMMENT(block, "-------------------------"); // comment |
| 964 | 955 | |
| 965 | 956 | /* determine the last instruction in this sequence */ |
| 966 | for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next) | |
| 957 | for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next()) | |
| 967 | 958 | if (seqlast->flags & OPFLAG_END_SEQUENCE) |
| 968 | 959 | break; |
| 969 | 960 | assert(seqlast != NULL); |
| r9922 | r9923 | |
| 1000 | 991 | } |
| 1001 | 992 | |
| 1002 | 993 | /* iterate over instructions in the sequence and compile them */ |
| 1003 | for (curdesc = seqhead; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 994 | for (curdesc = seqhead; curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 1004 | 995 | { |
| 1005 | 996 | generate_sequence_instruction(sh2, block, &compiler, curdesc, 0xffffffff); |
| 1006 | 997 | } |
| r9922 | r9923 | |
| 1020 | 1011 | generate_update_cycles(sh2, block, &compiler, IMM(nextpc), TRUE); // <subtract cycles> |
| 1021 | 1012 | |
| 1022 | 1013 | /* SH2 has no modes */ |
| 1023 | if (seqlast->next == NULL || seqlast->next->pc != nextpc) | |
| 1014 | if (seqlast->next() == NULL || seqlast->next()->pc != nextpc) | |
| 1024 | 1015 | { |
| 1025 | 1016 | UML_HASHJMP(block, IMM(0), IMM(nextpc), sh2->nocode); |
| 1026 | 1017 | } |
| r9922 | r9923 | |
| 1390 | 1381 | drcuml_log_printf(drcuml, "\nDescriptor list @ %08X\n", desclist->pc); |
| 1391 | 1382 | |
| 1392 | 1383 | /* output each descriptor */ |
| 1393 | for ( ; desclist != NULL; desclist = desclist->next) | |
| 1384 | for ( ; desclist != NULL; desclist = desclist->next()) | |
| 1394 | 1385 | { |
| 1395 | 1386 | char buffer[100]; |
| 1396 | 1387 | |
| r9922 | r9923 | |
| 1411 | 1402 | drcuml_log_printf(drcuml, "\n"); |
| 1412 | 1403 | |
| 1413 | 1404 | /* if we have a delay slot, output it recursively */ |
| 1414 | if (desclist->delay != NULL) | |
| 1415 | log_opcode_desc(drcuml, desclist->delay, indent + 1); | |
| 1405 | if (desclist->delay.first() != NULL) | |
| 1406 | log_opcode_desc(drcuml, desclist->delay.first(), indent + 1); | |
| 1416 | 1407 | |
| 1417 | 1408 | /* at the end of a sequence add a dividing line */ |
| 1418 | 1409 | if (desclist->flags & OPFLAG_END_SEQUENCE) |
| r9922 | r9923 | |
| 1524 | 1515 | UML_COMMENT(block, "[Validation for %08X]", seqhead->pc); // comment |
| 1525 | 1516 | |
| 1526 | 1517 | /* loose verify or single instruction: just compare and fail */ |
| 1527 | if (!(sh2->drcoptions & SH2DRC_STRICT_VERIFY) || seqhead->next == NULL) | |
| 1518 | if (!(sh2->drcoptions & SH2DRC_STRICT_VERIFY) || seqhead->next() == NULL) | |
| 1528 | 1519 | { |
| 1529 | 1520 | if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1530 | 1521 | { |
| r9922 | r9923 | |
| 1539 | 1530 | else |
| 1540 | 1531 | { |
| 1541 | 1532 | #if 0 |
| 1542 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 1533 | for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 1543 | 1534 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1544 | 1535 | { |
| 1545 | 1536 | base = sh2->direct->read_decrypted_ptr(curdesc->physpc, SH2_CODE_XOR(0)); |
| r9922 | r9923 | |
| 1552 | 1543 | void *base = sh2->direct->read_decrypted_ptr(seqhead->physpc, SH2_CODE_XOR(0)); |
| 1553 | 1544 | UML_LOAD(block, IREG(0), base, IMM(0), WORD); // load i0,base,word |
| 1554 | 1545 | sum += seqhead->opptr.w[0]; |
| 1555 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 1546 | for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 1556 | 1547 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1557 | 1548 | { |
| 1558 | 1549 | base = sh2->direct->read_decrypted_ptr(curdesc->physpc, SH2_CODE_XOR(0)); |
| r9922 | r9923 | |
| 1661 | 1652 | compiler_state compiler_temp = *compiler; |
| 1662 | 1653 | |
| 1663 | 1654 | /* compile the delay slot using temporary compiler state */ |
| 1664 | assert(desc->delay != NULL); | |
| 1665 | generate_sequence_instruction(sh2, block, &compiler_temp, desc->delay, ovrpc); // <next instruction> | |
| 1655 | assert(desc->delay.first() != NULL); | |
| 1656 | generate_sequence_instruction(sh2, block, &compiler_temp, desc->delay.first(), ovrpc); // <next instruction> | |
| 1666 | 1657 | |
| 1667 | 1658 | /* update the label */ |
| 1668 | 1659 | compiler->labelnum = compiler_temp.labelnum; |
| r9922 | r9923 | |
|---|---|---|
| 14 | 14 | #include "sh2comn.h" |
| 15 | 15 | #include "cpu/drcfe.h" |
| 16 | 16 | |
| 17 | /*************************************************************************** | |
| 18 | FUNCTION PROTOTYPES | |
| 19 | ***************************************************************************/ | |
| 20 | 17 | |
| 21 | static int describe_group_0(sh2_state *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); | |
| 22 | static int describe_group_2(sh2_state *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); | |
| 23 | static int describe_group_3(sh2_state *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); | |
| 24 | static int describe_group_4(sh2_state *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); | |
| 25 | static int describe_group_6(sh2_state *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); | |
| 26 | static int describe_group_8(sh2_state *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); | |
| 27 | static int describe_group_12(sh2_state *context, opcode_desc *desc, const opcode_desc *prev, UINT16 opcode); | |
| 28 | ||
| 29 | ||
| 30 | ||
| 31 | 18 | /*************************************************************************** |
| 32 | 19 | INSTRUCTION PARSERS |
| 33 | 20 | ***************************************************************************/ |
| 34 | 21 | |
| 22 | sh2_frontend::sh2_frontend(sh2_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) | |
| 23 | : drc_frontend(*state.device, window_start, window_end, max_sequence), | |
| 24 | m_context(state) | |
| 25 | { | |
| 26 | } | |
| 27 | ||
| 35 | 28 | /*------------------------------------------------- |
| 36 | 29 | describe_instruction - build a description |
| 37 | 30 | of a single instruction |
| 38 | 31 | -------------------------------------------------*/ |
| 39 | 32 | |
| 40 | ||
| 33 | bool sh2_frontend::describe( | |
| 41 | 34 | { |
| 42 | sh2_state *context = (sh2_state *)param; | |
| 43 | 35 | UINT16 opcode; |
| 44 | 36 | |
| 45 | 37 | /* fetch the opcode */ |
| 46 | opcode = desc | |
| 38 | opcode = desc. | |
| 47 | 39 | |
| 48 | 40 | /* all instructions are 2 bytes and most are a single cycle */ |
| 49 | desc->length = 2; | |
| 50 | desc->cycles = 1; | |
| 41 | desc.length = 2; | |
| 42 | desc.cycles = 1; | |
| 51 | 43 | |
| 52 | 44 | switch (opcode>>12) |
| 53 | 45 | { |
| 54 | 46 | case 0: |
| 55 | return describe_group_0( | |
| 47 | return describe_group_0( | |
| 56 | 48 | |
| 57 | 49 | case 1: // MOVLS4 |
| 58 | desc->regin[0] |= REGFLAG_R(Rn) | REGFLAG_R(Rm); | |
| 59 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 60 | return TRUE; | |
| 50 | desc.regin[0] |= REGFLAG_R(Rn) | REGFLAG_R(Rm); | |
| 51 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 52 | return true; | |
| 61 | 53 | |
| 62 | 54 | case 2: |
| 63 | return describe_group_2( | |
| 55 | return describe_group_2( | |
| 64 | 56 | |
| 65 | 57 | case 3: |
| 66 | return describe_group_3( | |
| 58 | return describe_group_3( | |
| 67 | 59 | |
| 68 | 60 | case 4: |
| 69 | return describe_group_4( | |
| 61 | return describe_group_4( | |
| 70 | 62 | |
| 71 | 63 | case 5: // MOVLL4 |
| 72 | desc->regin[0] |= REGFLAG_R(Rm); | |
| 73 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 74 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 75 | return TRUE; | |
| 64 | desc.regin[0] |= REGFLAG_R(Rm); | |
| 65 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 66 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 67 | return true; | |
| 76 | 68 | |
| 77 | 69 | case 6: |
| 78 | return describe_group_6( | |
| 70 | return describe_group_6( | |
| 79 | 71 | |
| 80 | 72 | case 7: // ADDI |
| 81 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 82 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 83 | return TRUE; | |
| 73 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 74 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 75 | return true; | |
| 84 | 76 | |
| 85 | 77 | case 8: |
| 86 | return describe_group_8( | |
| 78 | return describe_group_8( | |
| 87 | 79 | |
| 88 | 80 | case 9: // MOVWI |
| 89 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 90 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 91 | return TRUE; | |
| 81 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 82 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 83 | return true; | |
| 92 | 84 | |
| 93 | 85 | case 11: // BSR |
| 94 | desc | |
| 86 | desc. | |
| 95 | 87 | // (intentional fallthrough - BSR is BRA with the addition of PR = the return address) |
| 96 | 88 | case 10: // BRA |
| 97 | 89 | { |
| 98 | 90 | INT32 disp = ((INT32)opcode << 20) >> 20; |
| 99 | 91 | |
| 100 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 101 | desc->targetpc = (desc->pc + 2) + disp * 2 + 2; | |
| 102 | desc->delayslots = 1; | |
| 103 | desc->cycles = 2; | |
| 104 | return TRUE; | |
| 92 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 93 | desc.targetpc = (desc.pc + 2) + disp * 2 + 2; | |
| 94 | desc.delayslots = 1; | |
| 95 | desc.cycles = 2; | |
| 96 | return true; | |
| 105 | 97 | } |
| 106 | 98 | |
| 107 | 99 | case 12: |
| 108 | return describe_group_12( | |
| 100 | return describe_group_12( | |
| 109 | 101 | |
| 110 | 102 | case 13: // MOVLI |
| 111 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 112 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 113 | return TRUE; | |
| 103 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 104 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 105 | return true; | |
| 114 | 106 | |
| 115 | 107 | case 14: // MOVI |
| 116 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 117 | return TRUE; | |
| 108 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 109 | return true; | |
| 118 | 110 | |
| 119 | 111 | case 15: // NOP |
| 120 | return | |
| 112 | return true; | |
| 121 | 113 | } |
| 122 | 114 | |
| 123 | return | |
| 115 | return false; | |
| 124 | 116 | } |
| 125 | 117 | |
| 126 | ||
| 118 | bool | |
| 127 | 119 | { |
| 128 | 120 | switch (opcode & 0x3F) |
| 129 | 121 | { |
| r9922 | r9923 | |
| 143 | 135 | case 0x39: // NOP(); |
| 144 | 136 | case 0x3a: // NOP(); |
| 145 | 137 | case 0x3b: // NOP(); |
| 146 | return | |
| 138 | return true; | |
| 147 | 139 | |
| 148 | 140 | case 0x02: // STCSR(Rn); |
| 149 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 150 | return TRUE; | |
| 141 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 142 | return true; | |
| 151 | 143 | |
| 152 | 144 | case 0x03: // BSRF(Rn); |
| 153 | desc | |
| 145 | desc. | |
| 154 | 146 | |
| 155 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 156 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 157 | desc->delayslots = 1; | |
| 147 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 148 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 149 | desc.delayslots = 1; | |
| 158 | 150 | |
| 159 | return | |
| 151 | return true; | |
| 160 | 152 | |
| 161 | 153 | case 0x04: // MOVBS0(Rm, Rn); |
| 162 | 154 | case 0x05: // MOVWS0(Rm, Rn); |
| r9922 | r9923 | |
| 170 | 162 | case 0x34: // MOVBS0(Rm, Rn); |
| 171 | 163 | case 0x35: // MOVWS0(Rm, Rn); |
| 172 | 164 | case 0x36: // MOVLS0(Rm, Rn); |
| 173 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn) | REGFLAG_R(0); | |
| 174 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 175 | return TRUE; | |
| 165 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn) | REGFLAG_R(0); | |
| 166 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 167 | return true; | |
| 176 | 168 | |
| 177 | 169 | case 0x07: // MULL(Rm, Rn); |
| 178 | 170 | case 0x17: // MULL(Rm, Rn); |
| 179 | 171 | case 0x27: // MULL(Rm, Rn); |
| 180 | 172 | case 0x37: // MULL(Rm, Rn); |
| 181 | desc->regin[0] |= REGFLAG_R(Rn) | REGFLAG_R(Rm); | |
| 182 | desc->regout[1] |= REGFLAG_MACL; | |
| 183 | desc->cycles = 2; | |
| 184 | return TRUE; | |
| 173 | desc.regin[0] |= REGFLAG_R(Rn) | REGFLAG_R(Rm); | |
| 174 | desc.regout[1] |= REGFLAG_MACL; | |
| 175 | desc.cycles = 2; | |
| 176 | return true; | |
| 185 | 177 | |
| 186 | 178 | case 0x08: // CLRT(); |
| 187 | desc->regout[1] |= REGFLAG_SR; | |
| 188 | return TRUE; | |
| 179 | desc.regout[1] |= REGFLAG_SR; | |
| 180 | return true; | |
| 189 | 181 | |
| 190 | 182 | case 0x0a: // STSMACH(Rn); |
| 191 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 192 | desc->regout[1] |= REGFLAG_MACH; | |
| 193 | return TRUE; | |
| 183 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 184 | desc.regout[1] |= REGFLAG_MACH; | |
| 185 | return true; | |
| 194 | 186 | |
| 195 | 187 | case 0x0b: // RTS(); |
| 196 | desc | |
| 188 | desc. | |
| 197 | 189 | |
| 198 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 199 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 200 | desc->delayslots = 1; | |
| 201 | desc->cycles = 2; | |
| 190 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 191 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 192 | desc.delayslots = 1; | |
| 193 | desc.cycles = 2; | |
| 202 | 194 | |
| 203 | return | |
| 195 | return true; | |
| 204 | 196 | |
| 205 | 197 | case 0x0c: // MOVBL0(Rm, Rn); |
| 206 | 198 | case 0x0d: // MOVWL0(Rm, Rn); |
| r9922 | r9923 | |
| 214 | 206 | case 0x3c: // MOVBL0(Rm, Rn); |
| 215 | 207 | case 0x3d: // MOVWL0(Rm, Rn); |
| 216 | 208 | case 0x3e: // MOVLL0(Rm, Rn); |
| 217 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(0); | |
| 218 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 219 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 220 | return TRUE; | |
| 209 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(0); | |
| 210 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 211 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 212 | return true; | |
| 221 | 213 | |
| 222 | 214 | case 0x0f: // MAC_L(Rm, Rn); |
| 223 | 215 | case 0x1f: // MAC_L(Rm, Rn); |
| 224 | 216 | case 0x2f: // MAC_L(Rm, Rn); |
| 225 | 217 | case 0x3f: // MAC_L(Rm, Rn); |
| 226 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 227 | desc->regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 228 | desc->cycles = 3; | |
| 229 | return TRUE; | |
| 218 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 219 | desc.regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 220 | desc.cycles = 3; | |
| 221 | return true; | |
| 230 | 222 | |
| 231 | 223 | case 0x12: // STCGBR(Rn); |
| 232 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 233 | desc->regin[1] |= REGFLAG_GBR; | |
| 234 | return TRUE; | |
| 224 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 225 | desc.regin[1] |= REGFLAG_GBR; | |
| 226 | return true; | |
| 235 | 227 | |
| 236 | 228 | case 0x18: // SETT(); |
| 237 | desc->regout[1] |= REGFLAG_SR; | |
| 238 | return TRUE; | |
| 229 | desc.regout[1] |= REGFLAG_SR; | |
| 230 | return true; | |
| 239 | 231 | |
| 240 | 232 | case 0x19: // DIV0U(); |
| 241 | desc->regout[1] |= REGFLAG_SR; | |
| 242 | return TRUE; | |
| 233 | desc.regout[1] |= REGFLAG_SR; | |
| 234 | return true; | |
| 243 | 235 | |
| 244 | 236 | case 0x1a: // STSMACL(Rn); |
| 245 | desc->regin[1] |= REGFLAG_MACL; | |
| 246 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 247 | return TRUE; | |
| 237 | desc.regin[1] |= REGFLAG_MACL; | |
| 238 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 239 | return true; | |
| 248 | 240 | |
| 249 | 241 | case 0x1b: // SLEEP(); |
| 250 | desc->cycles = 3; | |
| 251 | return TRUE; | |
| 242 | desc.cycles = 3; | |
| 243 | return true; | |
| 252 | 244 | |
| 253 | 245 | case 0x22: // STCVBR(Rn); |
| 254 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 255 | desc->regout[1] |= REGFLAG_VBR; | |
| 256 | return TRUE; | |
| 246 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 247 | desc.regout[1] |= REGFLAG_VBR; | |
| 248 | return true; | |
| 257 | 249 | |
| 258 | 250 | case 0x23: // BRAF(Rn); |
| 259 | desc->regin[0] |= REGFLAG_R(Rm); | |
| 260 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 261 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 262 | desc->delayslots = 1; | |
| 263 | desc->cycles = 2; | |
| 264 | return TRUE; | |
| 251 | desc.regin[0] |= REGFLAG_R(Rm); | |
| 252 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 253 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 254 | desc.delayslots = 1; | |
| 255 | desc.cycles = 2; | |
| 256 | return true; | |
| 265 | 257 | |
| 266 | 258 | case 0x28: // CLRMAC(); |
| 267 | desc->regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 268 | return TRUE; | |
| 259 | desc.regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 260 | return true; | |
| 269 | 261 | |
| 270 | 262 | case 0x29: // MOVT(Rn); |
| 271 | desc->regin[1] |= REGFLAG_SR; | |
| 272 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 273 | return TRUE; | |
| 263 | desc.regin[1] |= REGFLAG_SR; | |
| 264 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 265 | return true; | |
| 274 | 266 | |
| 275 | 267 | case 0x2a: // STSPR(Rn); |
| 276 | desc->regin[1] |= REGFLAG_PR; | |
| 277 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 278 | return TRUE; | |
| 268 | desc.regin[1] |= REGFLAG_PR; | |
| 269 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 270 | return true; | |
| 279 | 271 | |
| 280 | 272 | case 0x2b: // RTE(); |
| 281 | desc->regin[0] |= REGFLAG_R(15); | |
| 282 | desc->regout[0] |= REGFLAG_R(15); | |
| 273 | desc.regin[0] |= REGFLAG_R(15); | |
| 274 | desc.regout[0] |= REGFLAG_R(15); | |
| 283 | 275 | |
| 284 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE | OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 285 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 286 | desc->delayslots = 1; | |
| 287 | desc->cycles = 4; | |
| 276 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE | OPFLAG_CAN_EXPOSE_EXTERNAL_INT; | |
| 277 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 278 | desc.delayslots = 1; | |
| 279 | desc.cycles = 4; | |
| 288 | 280 | |
| 289 | return | |
| 281 | return true; | |
| 290 | 282 | } |
| 291 | 283 | |
| 292 | return | |
| 284 | return false; | |
| 293 | 285 | } |
| 294 | 286 | |
| 295 | ||
| 287 | bool | |
| 296 | 288 | { |
| 297 | 289 | switch (opcode & 15) |
| 298 | 290 | { |
| 299 | 291 | case 0: // MOVBS(Rm, Rn); |
| 300 | 292 | case 1: // MOVWS(Rm, Rn); |
| 301 | 293 | case 2: // MOVLS(Rm, Rn); |
| 302 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 303 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 304 | return TRUE; | |
| 294 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 295 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 296 | return true; | |
| 305 | 297 | |
| 306 | 298 | case 3: // NOP(); |
| 307 | return | |
| 299 | return true; | |
| 308 | 300 | |
| 309 | 301 | case 4: // MOVBM(Rm, Rn); |
| 310 | 302 | case 5: // MOVWM(Rm, Rn); |
| 311 | 303 | case 6: // MOVLM(Rm, Rn); |
| 312 | 304 | case 13: // XTRCT(Rm, Rn); |
| 313 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 314 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 315 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 316 | return TRUE; | |
| 305 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 306 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 307 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 308 | return true; | |
| 317 | 309 | |
| 318 | 310 | case 7: // DIV0S(Rm, Rn); |
| 319 | 311 | case 8: // TST(Rm, Rn); |
| 320 | 312 | case 12: // CMPSTR(Rm, Rn); |
| 321 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 322 | desc->regout[1] |= REGFLAG_SR; | |
| 323 | return TRUE; | |
| 313 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 314 | desc.regout[1] |= REGFLAG_SR; | |
| 315 | return true; | |
| 324 | 316 | |
| 325 | 317 | case 9: // AND(Rm, Rn); |
| 326 | 318 | case 10: // XOR(Rm, Rn); |
| 327 | 319 | case 11: // OR(Rm, Rn); |
| 328 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 329 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 330 | return TRUE; | |
| 320 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 321 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 322 | return true; | |
| 331 | 323 | |
| 332 | 324 | case 14: // MULU(Rm, Rn); |
| 333 | 325 | case 15: // MULS(Rm, Rn); |
| 334 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 335 | desc->regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 336 | desc->cycles = 2; | |
| 337 | return TRUE; | |
| 326 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 327 | desc.regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 328 | desc.cycles = 2; | |
| 329 | return true; | |
| 338 | 330 | } |
| 339 | 331 | |
| 340 | return | |
| 332 | return false; | |
| 341 | 333 | } |
| 342 | 334 | |
| 343 | ||
| 335 | bool | |
| 344 | 336 | { |
| 345 | 337 | switch (opcode & 15) |
| 346 | 338 | { |
| r9922 | r9923 | |
| 349 | 341 | case 3: // CMPGE(Rm, Rn); |
| 350 | 342 | case 6: // CMPHI(Rm, Rn); |
| 351 | 343 | case 7: // CMPGT(Rm, Rn); |
| 352 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 353 | desc->regout[1] |= REGFLAG_SR; | |
| 354 | return TRUE; | |
| 344 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 345 | desc.regout[1] |= REGFLAG_SR; | |
| 346 | return true; | |
| 355 | 347 | |
| 356 | 348 | case 1: // NOP(); |
| 357 | 349 | case 9: // NOP(); |
| 358 | return | |
| 350 | return true; | |
| 359 | 351 | |
| 360 | 352 | case 4: // DIV1(Rm, Rn); |
| 361 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 362 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 363 | desc->regout[1] |= REGFLAG_SR; | |
| 364 | return TRUE; | |
| 353 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 354 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 355 | desc.regout[1] |= REGFLAG_SR; | |
| 356 | return true; | |
| 365 | 357 | |
| 366 | 358 | case 5: // DMULU(Rm, Rn); |
| 367 | 359 | case 13: // DMULS(Rm, Rn); |
| 368 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 369 | desc->regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 370 | desc->cycles = 2; | |
| 371 | return TRUE; | |
| 360 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 361 | desc.regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 362 | desc.cycles = 2; | |
| 363 | return true; | |
| 372 | 364 | |
| 373 | 365 | case 8: // SUB(Rm, Rn); |
| 374 | 366 | case 12: // ADD(Rm, Rn); |
| 375 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 376 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 377 | return TRUE; | |
| 367 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 368 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 369 | return true; | |
| 378 | 370 | |
| 379 | 371 | case 10: // SUBC(Rm, Rn); |
| 380 | 372 | case 11: // SUBV(Rm, Rn); |
| 381 | 373 | case 14: // ADDC(Rm, Rn); |
| 382 | 374 | case 15: // ADDV(Rm, Rn); |
| 383 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 384 | desc->regin[1] |= REGFLAG_SR; | |
| 385 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 386 | desc->regout[1] |= REGFLAG_SR; | |
| 387 | return TRUE; | |
| 375 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 376 | desc.regin[1] |= REGFLAG_SR; | |
| 377 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 378 | desc.regout[1] |= REGFLAG_SR; | |
| 379 | return true; | |
| 388 | 380 | } |
| 389 | return | |
| 381 | return false; | |
| 390 | 382 | } |
| 391 | 383 | |
| 392 | ||
| 384 | bool | |
| 393 | 385 | { |
| 394 | 386 | switch (opcode & 0x3F) |
| 395 | 387 | { |
| r9922 | r9923 | |
| 397 | 389 | case 0x01: // SHLR(Rn); |
| 398 | 390 | case 0x04: // ROTL(Rn); |
| 399 | 391 | case 0x05: // ROTR(Rn); |
| 400 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 401 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 402 | desc->regout[1] |= REGFLAG_SR; | |
| 403 | return TRUE; | |
| 392 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 393 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 394 | desc.regout[1] |= REGFLAG_SR; | |
| 395 | return true; | |
| 404 | 396 | |
| 405 | 397 | case 0x02: // STSMMACH(Rn); |
| 406 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 407 | desc->regin[1] |= REGFLAG_MACH; | |
| 408 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 409 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 410 | return TRUE; | |
| 398 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 399 | desc.regin[1] |= REGFLAG_MACH; | |
| 400 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 401 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 402 | return true; | |
| 411 | 403 | |
| 412 | 404 | case 0x03: // STCMSR(Rn); |
| 413 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 414 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 415 | desc->cycles = 2; | |
| 416 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 417 | return TRUE; | |
| 405 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 406 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 407 | desc.cycles = 2; | |
| 408 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 409 | return true; | |
| 418 | 410 | |
| 419 | 411 | case 0x06: // LDSMMACH(Rn); |
| 420 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 421 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 422 | desc->regout[1] |= REGFLAG_MACH; | |
| 423 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 424 | return TRUE; | |
| 412 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 413 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 414 | desc.regout[1] |= REGFLAG_MACH; | |
| 415 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 416 | return true; | |
| 425 | 417 | |
| 426 | 418 | case 0x07: // LDCMSR(Rn); |
| 427 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 428 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 429 | desc->regout[1] |= REGFLAG_SR; | |
| 430 | desc->cycles = 3; | |
| 431 | desc->flags |= OPFLAG_READS_MEMORY | OPFLAG_CAN_EXPOSE_EXTERNAL_INT | OPFLAG_END_SEQUENCE; | |
| 432 | return TRUE; | |
| 419 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 420 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 421 | desc.regout[1] |= REGFLAG_SR; | |
| 422 | desc.cycles = 3; | |
| 423 | desc.flags |= OPFLAG_READS_MEMORY | OPFLAG_CAN_EXPOSE_EXTERNAL_INT | OPFLAG_END_SEQUENCE; | |
| 424 | return true; | |
| 433 | 425 | |
| 434 | 426 | case 0x08: // SHLL2(Rn); |
| 435 | 427 | case 0x09: // SHLR2(Rn); |
| r9922 | r9923 | |
| 437 | 429 | case 0x19: // SHLR8(Rn); |
| 438 | 430 | case 0x28: // SHLL16(Rn); |
| 439 | 431 | case 0x29: // SHLR16(Rn); |
| 440 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 441 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 442 | return TRUE; | |
| 432 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 433 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 434 | return true; | |
| 443 | 435 | |
| 444 | 436 | case 0x0a: // LDSMACH(Rn); |
| 445 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 446 | desc->regout[1] |= REGFLAG_MACH; | |
| 447 | return TRUE; | |
| 437 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 438 | desc.regout[1] |= REGFLAG_MACH; | |
| 439 | return true; | |
| 448 | 440 | |
| 449 | 441 | case 0x0b: // JSR(Rn); |
| 450 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 451 | desc->regout[1] |= REGFLAG_PR; | |
| 452 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 453 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 454 | desc->delayslots = 1; | |
| 455 | return TRUE; | |
| 442 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 443 | desc.regout[1] |= REGFLAG_PR; | |
| 444 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 445 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 446 | desc.delayslots = 1; | |
| 447 | return true; | |
| 456 | 448 | |
| 457 | 449 | case 0x0e: // LDCSR(Rn); |
| 458 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 459 | desc->regout[1] |= REGFLAG_SR; | |
| 460 | desc->flags |= OPFLAG_CAN_EXPOSE_EXTERNAL_INT | OPFLAG_END_SEQUENCE; | |
| 461 | return TRUE; | |
| 450 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 451 | desc.regout[1] |= REGFLAG_SR; | |
| 452 | desc.flags |= OPFLAG_CAN_EXPOSE_EXTERNAL_INT | OPFLAG_END_SEQUENCE; | |
| 453 | return true; | |
| 462 | 454 | |
| 463 | 455 | case 0x0f: // MAC_W(Rm, Rn); |
| 464 | 456 | case 0x1f: // MAC_W(Rm, Rn); |
| 465 | 457 | case 0x2f: // MAC_W(Rm, Rn); |
| 466 | 458 | case 0x3f: // MAC_W(Rm, Rn); |
| 467 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 468 | desc->regin[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 469 | desc->regout[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 470 | desc->regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 471 | desc->cycles = 3; | |
| 472 | return TRUE; | |
| 459 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 460 | desc.regin[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 461 | desc.regout[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 462 | desc.regout[1] |= REGFLAG_MACL | REGFLAG_MACH; | |
| 463 | desc.cycles = 3; | |
| 464 | return true; | |
| 473 | 465 | |
| 474 | 466 | case 0x10: // DT(Rn); |
| 475 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 476 | desc->regin[1] |= REGFLAG_SR; | |
| 477 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 478 | desc->regout[1] |= REGFLAG_SR; | |
| 479 | return TRUE; | |
| 467 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 468 | desc.regin[1] |= REGFLAG_SR; | |
| 469 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 470 | desc.regout[1] |= REGFLAG_SR; | |
| 471 | return true; | |
| 480 | 472 | |
| 481 | 473 | case 0x11: // CMPPZ(Rn); |
| 482 | 474 | case 0x15: // CMPPL(Rn); |
| 483 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 484 | desc->regin[1] |= REGFLAG_SR; | |
| 485 | desc->regout[1] |= REGFLAG_SR; | |
| 486 | return TRUE; | |
| 475 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 476 | desc.regin[1] |= REGFLAG_SR; | |
| 477 | desc.regout[1] |= REGFLAG_SR; | |
| 478 | return true; | |
| 487 | 479 | |
| 488 | 480 | case 0x12: // STSMMACL(Rn); |
| 489 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 490 | desc->regin[1] |= REGFLAG_MACL; | |
| 491 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 492 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 493 | return TRUE; | |
| 481 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 482 | desc.regin[1] |= REGFLAG_MACL; | |
| 483 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 484 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 485 | return true; | |
| 494 | 486 | |
| 495 | 487 | case 0x13: // STCMGBR(Rn); |
| 496 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 497 | desc->regin[1] |= REGFLAG_GBR; | |
| 498 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 499 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 500 | return TRUE; | |
| 488 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 489 | desc.regin[1] |= REGFLAG_GBR; | |
| 490 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 491 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 492 | return true; | |
| 501 | 493 | |
| 502 | 494 | case 0x16: // LDSMMACL(Rn); |
| 503 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 504 | desc->regout[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 505 | desc->regout[1] |= REGFLAG_MACL; | |
| 506 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 507 | return TRUE; | |
| 495 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 496 | desc.regout[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 497 | desc.regout[1] |= REGFLAG_MACL; | |
| 498 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 499 | return true; | |
| 508 | 500 | |
| 509 | 501 | case 0x17: // LDCMGBR(Rn); |
| 510 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 511 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 512 | desc->regout[1] |= REGFLAG_GBR; | |
| 513 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 514 | return TRUE; | |
| 502 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 503 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 504 | desc.regout[1] |= REGFLAG_GBR; | |
| 505 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 506 | return true; | |
| 515 | 507 | |
| 516 | 508 | case 0x1a: // LDSMACL(Rn); |
| 517 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 518 | desc->regout[1] |= REGFLAG_MACL; | |
| 519 | return TRUE; | |
| 509 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 510 | desc.regout[1] |= REGFLAG_MACL; | |
| 511 | return true; | |
| 520 | 512 | |
| 521 | 513 | case 0x1b: // TAS(Rn); |
| 522 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 523 | desc->regin[1] |= REGFLAG_SR; | |
| 524 | desc->regout[1] |= REGFLAG_SR; | |
| 525 | desc->cycles = 4; | |
| 526 | desc->flags |= OPFLAG_READS_MEMORY | OPFLAG_WRITES_MEMORY; | |
| 527 | return TRUE; | |
| 514 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 515 | desc.regin[1] |= REGFLAG_SR; | |
| 516 | desc.regout[1] |= REGFLAG_SR; | |
| 517 | desc.cycles = 4; | |
| 518 | desc.flags |= OPFLAG_READS_MEMORY | OPFLAG_WRITES_MEMORY; | |
| 519 | return true; | |
| 528 | 520 | |
| 529 | 521 | case 0x1e: // LDCGBR(Rn); |
| 530 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 531 | desc->regout[1] |= REGFLAG_GBR; | |
| 532 | return TRUE; | |
| 522 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 523 | desc.regout[1] |= REGFLAG_GBR; | |
| 524 | return true; | |
| 533 | 525 | |
| 534 | 526 | case 0x20: // SHAL(Rn); |
| 535 | 527 | case 0x21: // SHAR(Rn); |
| 536 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 537 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 538 | desc->regout[1] |= REGFLAG_SR; | |
| 539 | return TRUE; | |
| 528 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 529 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 530 | desc.regout[1] |= REGFLAG_SR; | |
| 531 | return true; | |
| 540 | 532 | |
| 541 | 533 | case 0x22: // STSMPR(Rn); |
| 542 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 543 | desc->regin[1] |= REGFLAG_PR; | |
| 544 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 545 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 546 | return TRUE; | |
| 534 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 535 | desc.regin[1] |= REGFLAG_PR; | |
| 536 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 537 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 538 | return true; | |
| 547 | 539 | |
| 548 | 540 | case 0x23: // STCMVBR(Rn); |
| 549 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 550 | desc->regin[1] |= REGFLAG_VBR; | |
| 551 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 552 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 553 | return TRUE; | |
| 541 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 542 | desc.regin[1] |= REGFLAG_VBR; | |
| 543 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 544 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 545 | return true; | |
| 554 | 546 | |
| 555 | 547 | case 0x24: // ROTCL(Rn); |
| 556 | 548 | case 0x25: // ROTCR(Rn); |
| 557 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 558 | desc->regin[1] |= REGFLAG_SR; | |
| 559 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 560 | desc->regout[1] |= REGFLAG_SR; | |
| 561 | return TRUE; | |
| 549 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 550 | desc.regin[1] |= REGFLAG_SR; | |
| 551 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 552 | desc.regout[1] |= REGFLAG_SR; | |
| 553 | return true; | |
| 562 | 554 | |
| 563 | 555 | case 0x26: // LDSMPR(Rn); |
| 564 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 565 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 566 | desc->regout[1] |= REGFLAG_PR; | |
| 567 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 568 | return TRUE; | |
| 556 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 557 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 558 | desc.regout[1] |= REGFLAG_PR; | |
| 559 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 560 | return true; | |
| 569 | 561 | |
| 570 | 562 | case 0x27: // LDCMVBR(Rn); |
| 571 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 572 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 573 | desc->regout[1] |= REGFLAG_VBR; | |
| 574 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 575 | return TRUE; | |
| 563 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 564 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 565 | desc.regout[1] |= REGFLAG_VBR; | |
| 566 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 567 | return true; | |
| 576 | 568 | |
| 577 | 569 | case 0x2a: // LDSPR(Rn); |
| 578 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 579 | desc->regout[1] |= REGFLAG_PR; | |
| 580 | return TRUE; | |
| 570 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 571 | desc.regout[1] |= REGFLAG_PR; | |
| 572 | return true; | |
| 581 | 573 | |
| 582 | 574 | case 0x2b: // JMP(Rm); |
| 583 | desc->regin[0] |= REGFLAG_R(Rm); | |
| 584 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 585 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 586 | desc->delayslots = 1; | |
| 587 | return TRUE; | |
| 575 | desc.regin[0] |= REGFLAG_R(Rm); | |
| 576 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 577 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 578 | desc.delayslots = 1; | |
| 579 | return true; | |
| 588 | 580 | |
| 589 | 581 | case 0x2e: // LDCVBR(Rn); |
| 590 | desc->regin[0] |= REGFLAG_R(Rn); | |
| 591 | desc->regout[1] |= REGFLAG_VBR; | |
| 592 | return TRUE; | |
| 582 | desc.regin[0] |= REGFLAG_R(Rn); | |
| 583 | desc.regout[1] |= REGFLAG_VBR; | |
| 584 | return true; | |
| 593 | 585 | |
| 594 | 586 | case 0x0c: // NOP(); |
| 595 | 587 | case 0x0d: // NOP(); |
| r9922 | r9923 | |
| 613 | 605 | case 0x3c: // NOP(); |
| 614 | 606 | case 0x3d: // NOP(); |
| 615 | 607 | case 0x3e: // NOP(); |
| 616 | return | |
| 608 | return true; | |
| 617 | 609 | } |
| 618 | 610 | |
| 619 | return | |
| 611 | return false; | |
| 620 | 612 | } |
| 621 | 613 | |
| 622 | ||
| 614 | bool | |
| 623 | 615 | { |
| 624 | 616 | switch (opcode & 15) |
| 625 | 617 | { |
| r9922 | r9923 | |
| 634 | 626 | case 13: // EXTUW(Rm, Rn); |
| 635 | 627 | case 14: // EXTSB(Rm, Rn); |
| 636 | 628 | case 15: // EXTSW(Rm, Rn); |
| 637 | desc->regin[0] |= REGFLAG_R(Rm); | |
| 638 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 639 | return TRUE; | |
| 629 | desc.regin[0] |= REGFLAG_R(Rm); | |
| 630 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 631 | return true; | |
| 640 | 632 | |
| 641 | 633 | case 4: // MOVBP(Rm, Rn); |
| 642 | 634 | case 5: // MOVWP(Rm, Rn); |
| 643 | 635 | case 6: // MOVLP(Rm, Rn); |
| 644 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 645 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 646 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 647 | return TRUE; | |
| 636 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 637 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 638 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 639 | return true; | |
| 648 | 640 | |
| 649 | 641 | case 8: // SWAPB(Rm, Rn); |
| 650 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 651 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 652 | return TRUE; | |
| 642 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(Rn); | |
| 643 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 644 | return true; | |
| 653 | 645 | |
| 654 | 646 | case 10: // NEGC(Rm, Rn); |
| 655 | desc->regin[0] |= REGFLAG_R(Rm); | |
| 656 | desc->regout[0] |= REGFLAG_R(Rn); | |
| 657 | desc->regout[1] |= REGFLAG_SR; | |
| 658 | return TRUE; | |
| 647 | desc.regin[0] |= REGFLAG_R(Rm); | |
| 648 | desc.regout[0] |= REGFLAG_R(Rn); | |
| 649 | desc.regout[1] |= REGFLAG_SR; | |
| 650 | return true; | |
| 659 | 651 | } |
| 660 | return | |
| 652 | return false; | |
| 661 | 653 | } |
| 662 | 654 | |
| 663 | ||
| 655 | bool | |
| 664 | 656 | { |
| 665 | 657 | INT32 disp; |
| 666 | 658 | |
| r9922 | r9923 | |
| 668 | 660 | { |
| 669 | 661 | case 0 << 8: // MOVBS4(opcode & 0x0f, Rm); |
| 670 | 662 | case 1 << 8: // MOVWS4(opcode & 0x0f, Rm); |
| 671 | desc->regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(0); | |
| 672 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 673 | return TRUE; | |
| 663 | desc.regin[0] |= REGFLAG_R(Rm) | REGFLAG_R(0); | |
| 664 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 665 | return true; | |
| 674 | 666 | |
| 675 | 667 | case 2<< 8: // NOP(); |
| 676 | 668 | case 3<< 8: // NOP(); |
| r9922 | r9923 | |
| 679 | 671 | case 10<< 8: // NOP(); |
| 680 | 672 | case 12<< 8: // NOP(); |
| 681 | 673 | case 14<< 8: // NOP(); |
| 682 | return | |
| 674 | return true; | |
| 683 | 675 | |
| 684 | 676 | case 4<< 8: // MOVBL4(Rm, opcode & 0x0f); |
| 685 | 677 | case 5<< 8: // MOVWL4(Rm, opcode & 0x0f); |
| 686 | desc->regin[0] |= REGFLAG_R(Rm); | |
| 687 | desc->regout[0] |= REGFLAG_R(0); | |
| 688 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 689 | return TRUE; | |
| 678 | desc.regin[0] |= REGFLAG_R(Rm); | |
| 679 | desc.regout[0] |= REGFLAG_R(0); | |
| 680 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 681 | return true; | |
| 690 | 682 | |
| 691 | 683 | case 8<< 8: // CMPIM(opcode & 0xff); |
| 692 | desc->regin[0] |= REGFLAG_R(Rm); | |
| 693 | desc->regin[1] |= REGFLAG_SR; | |
| 694 | desc->regout[1] |= REGFLAG_SR; | |
| 695 | return TRUE; | |
| 684 | desc.regin[0] |= REGFLAG_R(Rm); | |
| 685 | desc.regin[1] |= REGFLAG_SR; | |
| 686 | desc.regout[1] |= REGFLAG_SR; | |
| 687 | return true; | |
| 696 | 688 | |
| 697 | 689 | case 9<< 8: // BT(opcode & 0xff); |
| 698 | 690 | case 11<< 8: // BF(opcode & 0xff); |
| 699 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 700 | desc->cycles = 3; | |
| 691 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 692 | desc.cycles = 3; | |
| 701 | 693 | disp = ((INT32)opcode << 24) >> 24; |
| 702 | desc->targetpc = (desc->pc + 2) + disp * 2 + 2; | |
| 703 | return TRUE; | |
| 694 | desc.targetpc = (desc.pc + 2) + disp * 2 + 2; | |
| 695 | return true; | |
| 704 | 696 | |
| 705 | 697 | case 13<< 8: // BTS(opcode & 0xff); |
| 706 | 698 | case 15<< 8: // BFS(opcode & 0xff); |
| 707 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 708 | desc->cycles = 2; | |
| 699 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 700 | desc.cycles = 2; | |
| 709 | 701 | disp = ((INT32)opcode << 24) >> 24; |
| 710 | desc->targetpc = (desc->pc + 2) + disp * 2 + 2; | |
| 711 | desc->delayslots = 1; | |
| 712 | return TRUE; | |
| 702 | desc.targetpc = (desc.pc + 2) + disp * 2 + 2; | |
| 703 | desc.delayslots = 1; | |
| 704 | return true; | |
| 713 | 705 | } |
| 714 | 706 | |
| 715 | return | |
| 707 | return false; | |
| 716 | 708 | } |
| 717 | 709 | |
| 718 | ||
| 710 | bool | |
| 719 | 711 | { |
| 720 | 712 | switch (opcode & (15<<8)) |
| 721 | 713 | { |
| 722 | 714 | case 0<<8: // MOVBSG(opcode & 0xff); |
| 723 | 715 | case 1<<8: // MOVWSG(opcode & 0xff); |
| 724 | 716 | case 2<<8: // MOVLSG(opcode & 0xff); |
| 725 | desc->regin[0] |= REGFLAG_R(0); | |
| 726 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 727 | return TRUE; | |
| 717 | desc.regin[0] |= REGFLAG_R(0); | |
| 718 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 719 | return true; | |
| 728 | 720 | |
| 729 | 721 | case 3<<8: // TRAPA(opcode & 0xff); |
| 730 | desc->regin[0] |= REGFLAG_R(15); | |
| 731 | desc->regin[1] |= REGFLAG_VBR; | |
| 732 | desc->regout[0] |= REGFLAG_R(15); | |
| 733 | desc->cycles = 8; | |
| 734 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 735 | desc->flags |= OPFLAG_READS_MEMORY | OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 736 | return TRUE; | |
| 722 | desc.regin[0] |= REGFLAG_R(15); | |
| 723 | desc.regin[1] |= REGFLAG_VBR; | |
| 724 | desc.regout[0] |= REGFLAG_R(15); | |
| 725 | desc.cycles = 8; | |
| 726 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 727 | desc.flags |= OPFLAG_READS_MEMORY | OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 728 | return true; | |
| 737 | 729 | |
| 738 | 730 | case 4<<8: // MOVBLG(opcode & 0xff); |
| 739 | 731 | case 5<<8: // MOVWLG(opcode & 0xff); |
| 740 | 732 | case 6<<8: // MOVLLG(opcode & 0xff); |
| 741 | 733 | case 7<<8: // MOVA(opcode & 0xff); |
| 742 | desc->regout[0] |= REGFLAG_R(0); | |
| 743 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 744 | return TRUE; | |
| 734 | desc.regout[0] |= REGFLAG_R(0); | |
| 735 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 736 | return true; | |
| 745 | 737 | |
| 746 | 738 | case 8<<8: // TSTI(opcode & 0xff); |
| 747 | desc->regin[0] |= REGFLAG_R(0); | |
| 748 | desc->regin[1] |= REGFLAG_SR; | |
| 749 | desc->regout[1] |= REGFLAG_SR; | |
| 750 | return TRUE; | |
| 739 | desc.regin[0] |= REGFLAG_R(0); | |
| 740 | desc.regin[1] |= REGFLAG_SR; | |
| 741 | desc.regout[1] |= REGFLAG_SR; | |
| 742 | return true; | |
| 751 | 743 | |
| 752 | 744 | case 9<<8: // ANDI(opcode & 0xff); |
| 753 | 745 | case 10<<8: // XORI(opcode & 0xff); |
| 754 | 746 | case 11<<8: // ORI(opcode & 0xff); |
| 755 | desc->regin[0] |= REGFLAG_R(0); | |
| 756 | desc->regout[0] |= REGFLAG_R(0); | |
| 757 | return TRUE; | |
| 747 | desc.regin[0] |= REGFLAG_R(0); | |
| 748 | desc.regout[0] |= REGFLAG_R(0); | |
| 749 | return true; | |
| 758 | 750 | |
| 759 | 751 | case 12<<8: // TSTM(opcode & 0xff); |
| 760 | 752 | case 13<<8: // ANDM(opcode & 0xff); |
| 761 | 753 | case 14<<8: // XORM(opcode & 0xff); |
| 762 | 754 | case 15<<8: // ORM(opcode & 0xff); |
| 763 | desc->regin[0] |= REGFLAG_R(0); | |
| 764 | desc->regin[1] |= REGFLAG_SR | REGFLAG_GBR; | |
| 765 | desc->regout[1] |= REGFLAG_SR; | |
| 766 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 767 | return TRUE; | |
| 755 | desc.regin[0] |= REGFLAG_R(0); | |
| 756 | desc.regin[1] |= REGFLAG_SR | REGFLAG_GBR; | |
| 757 | desc.regout[1] |= REGFLAG_SR; | |
| 758 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 759 | return true; | |
| 768 | 760 | } |
| 769 | 761 | |
| 770 | return | |
| 762 | return false; | |
| 771 | 763 | } |
| 772 | 764 |
| r9922 | r9923 | |
|---|---|---|
| 1105 | 1105 | break; |
| 1106 | 1106 | |
| 1107 | 1107 | case PARAM_SFREG: |
| 1108 | d8 = FETCHD(); | |
| 1109 | s += sprintf( s, "%s", nec_sfreg[d8] ); | |
| 1108 | i8 = FETCHD(); | |
| 1109 | s += sprintf( s, "%s", nec_sfreg[i8] ); | |
| 1110 | 1110 | break; |
| 1111 | 1111 | |
| 1112 | 1112 | case PARAM_1: |
| r9922 | r9923 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Front-end for MIPS3 recompiler |
| 6 | 6 | |
| 7 | **************************************************************************** | |
| 8 | ||
| 7 | 9 | Copyright Aaron Giles |
| 8 | Released for general non-commercial use under the MAME license | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 10 | All rights reserved. | |
| 10 | 11 | |
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | ***************************************************************************/ |
| 12 | 39 | |
| 13 | 40 | #include "emu.h" |
| r9922 | r9923 | |
| 15 | 42 | #include "mips3com.h" |
| 16 | 43 | |
| 17 | 44 | |
| 18 | /*************************************************************************** | |
| 19 | FUNCTION PROTOTYPES | |
| 20 | ***************************************************************************/ | |
| 45 | //************************************************************************** | |
| 46 | // MIPS3 FRONTEND | |
| 47 | //************************************************************************** | |
| 21 | 48 | |
| 22 | static int describe_instruction_special(mips3_state *mips, UINT32 op, opcode_desc *desc); | |
| 23 | static int describe_instruction_regimm(mips3_state *mips, UINT32 op, opcode_desc *desc); | |
| 24 | static int describe_instruction_idt(mips3_state *mips, UINT32 op, opcode_desc *desc); | |
| 25 | static int describe_instruction_cop0(mips3_state *mips, UINT32 op, opcode_desc *desc); | |
| 26 | static int describe_instruction_cop1(mips3_state *mips, UINT32 op, opcode_desc *desc); | |
| 27 | static int describe_instruction_cop1x(mips3_state *mips, UINT32 op, opcode_desc *desc); | |
| 28 | static int describe_instruction_cop2(mips3_state *mips, UINT32 op, opcode_desc *desc); | |
| 49 | //------------------------------------------------- | |
| 50 | // mips3_frontend - constructor | |
| 51 | //------------------------------------------------- | |
| 29 | 52 | |
| 53 | mips3_frontend::mips3_frontend(mips3_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence) | |
| 54 | : drc_frontend(*state.device, window_start, window_end, max_sequence), | |
| 55 | m_context(state) | |
| 56 | { | |
| 57 | } | |
| 30 | 58 | |
| 31 | 59 | |
| 32 | /*************************************************************************** | |
| 33 | INSTRUCTION PARSERS | |
| 34 | ***************************************************************************/ | |
| 60 | //------------------------------------------------- | |
| 61 | // describe - build a description of a single | |
| 62 | // instruction | |
| 63 | //------------------------------------------------- | |
| 35 | 64 | |
| 36 | /*------------------------------------------------- | |
| 37 | describe_instruction - build a description | |
| 38 | of a single instruction | |
| 39 | -------------------------------------------------*/ | |
| 40 | ||
| 41 | int mips3fe_describe(void *param, opcode_desc *desc, const opcode_desc *prev) | |
| 65 | bool mips3_frontend::describe(opcode_desc &desc, const opcode_desc *prev) | |
| 42 | 66 | { |
| 43 | mips3_state *mips = (mips3_state *)param; | |
| 44 | 67 | UINT32 op, opswitch; |
| 45 | 68 | |
| 46 | /* compute the physical PC */ | |
| 47 | assert((desc->physpc & 3) == 0); | |
| 48 | if (!mips3com_translate_address(mips, ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &desc->physpc)) | |
| 69 | // compute the physical PC | |
| 70 | assert((desc.physpc & 3) == 0); | |
| 71 | if (!mips3com_translate_address(&m_context, ADDRESS_SPACE_PROGRAM, TRANSLATE_FETCH, &desc.physpc)) | |
| 49 | 72 | { |
| 50 | /* uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and */ | |
| 51 | /* mark as needing to validate; otherwise, just end the sequence here */ | |
| 52 | desc->flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_PAGE_FAULT | OPFLAG_VIRTUAL_NOOP | OPFLAG_END_SEQUENCE; | |
| 53 | return TRUE; | |
| 73 | // uh-oh: a page fault; leave the description empty and just if this is the first instruction, leave it empty and | |
| 74 | // mark as needing to validate; otherwise, just end the sequence here | |
| 75 | desc.flags |= OPFLAG_VALIDATE_TLB | OPFLAG_CAN_CAUSE_EXCEPTION | OPFLAG_COMPILER_PAGE_FAULT | OPFLAG_VIRTUAL_NOOP | OPFLAG_END_SEQUENCE; | |
| 76 | return true; | |
| 54 | 77 | } |
| 55 | 78 | |
| 56 | /* fetch the opcode */ | |
| 57 | assert((desc->physpc & 3) == 0); | |
| 58 | op = desc->opptr.l[0] = mips->direct->read_decrypted_dword(desc->physpc); | |
| 79 | // fetch the opcode | |
| 80 | assert((desc.physpc & 3) == 0); | |
| 81 | op = desc.opptr.l[0] = m_context.direct->read_decrypted_dword(desc.physpc); | |
| 59 | 82 | |
| 60 | /* all instructions are 4 bytes and default to a single cycle each */ | |
| 61 | desc->length = 4; | |
| 62 | desc->cycles = 1; | |
| 83 | // all instructions are 4 bytes and default to a single cycle each | |
| 84 | desc.length = 4; | |
| 85 | desc.cycles = 1; | |
| 63 | 86 | |
| 64 | / | |
| 87 | // parse the instruction | |
| 65 | 88 | opswitch = op >> 26; |
| 66 | 89 | switch (opswitch) |
| 67 | 90 | { |
| 68 | case 0x00: /* SPECIAL */ | |
| 69 | return describe_instruction_special(mips, op, desc); | |
| 91 | case 0x00: // SPECIAL | |
| 92 | return describe_special(op, desc); | |
| 70 | 93 | |
| 71 | case 0x01: /* REGIMM */ | |
| 72 | return describe_instruction_regimm(mips, op, desc); | |
| 94 | case 0x01: // REGIMM | |
| 95 | return describe_regimm(op, desc); | |
| 73 | 96 | |
| 74 | case 0x10: /* COP0 */ | |
| 75 | return describe_instruction_cop0(mips, op, desc); | |
| 97 | case 0x10: // COP0 | |
| 98 | return describe_cop0(op, desc); | |
| 76 | 99 | |
| 77 | case 0x11: /* COP1 */ | |
| 78 | return describe_instruction_cop1(mips, op, desc); | |
| 100 | case 0x11: // COP1 | |
| 101 | return describe_cop1(op, desc); | |
| 79 | 102 | |
| 80 | case 0x12: /* COP2 */ | |
| 81 | return describe_instruction_cop2(mips, op, desc); | |
| 103 | case 0x12: // COP2 | |
| 104 | return describe_cop2(op, desc); | |
| 82 | 105 | |
| 83 | case 0x13: /* COP1X - MIPS IV */ | |
| 84 | if (mips->flavor < MIPS3_TYPE_MIPS_IV) | |
| 85 | return FALSE; | |
| 86 | return describe_instruction_cop1x(mips, op, desc); | |
| 106 | case 0x13: // COP1X - MIPS IV | |
| 107 | if (m_context.flavor < MIPS3_TYPE_MIPS_IV) | |
| 108 | return false; | |
| 109 | return describe_cop1x(op, desc); | |
| 87 | 110 | |
| 88 | case 0x1c: /* IDT-specific opcodes: mad/madu/mul on R4640/4650, msub on RC32364 */ | |
| 89 | return describe_instruction_idt(mips, op, desc); | |
| 111 | case 0x1c: // IDT-specific opcodes: mad/madu/mul on R4640/4650, msub on RC32364 | |
| 112 | return describe_idt(op, desc); | |
| 90 | 113 | |
| 91 | case 0x02: /* J */ | |
| 92 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 93 | desc->targetpc = (desc->pc & 0xf0000000) | (LIMMVAL << 2); | |
| 94 | desc->delayslots = 1; | |
| 95 | return TRUE; | |
| 114 | case 0x02: // J | |
| 115 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 116 | desc.targetpc = (desc.pc & 0xf0000000) | (LIMMVAL << 2); | |
| 117 | desc.delayslots = 1; | |
| 118 | return true; | |
| 96 | 119 | |
| 97 | case 0x03: /* JAL */ | |
| 98 | desc->regout[0] |= REGFLAG_R(31); | |
| 99 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 100 | desc->targetpc = (desc->pc & 0xf0000000) | (LIMMVAL << 2); | |
| 101 | desc->delayslots = 1; | |
| 102 | return TRUE; | |
| 120 | case 0x03: // JAL | |
| 121 | desc.regout[0] |= REGFLAG_R(31); | |
| 122 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 123 | desc.targetpc = (desc.pc & 0xf0000000) | (LIMMVAL << 2); | |
| 124 | desc.delayslots = 1; | |
| 125 | return true; | |
| 103 | 126 | |
| 104 | case 0x04: /* BEQ */ | |
| 105 | case 0x05: /* BNE */ | |
| 106 | case 0x14: /* BEQL */ | |
| 107 | case 0x15: /* BNEL */ | |
| 127 | case 0x04: // BEQ | |
| 128 | case 0x05: // BNE | |
| 129 | case 0x14: // BEQL | |
| 130 | case 0x15: // BNEL | |
| 108 | 131 | if ((opswitch == 0x04 || opswitch == 0x14) && RSREG == RTREG) |
| 109 | desc | |
| 132 | desc. | |
| 110 | 133 | else |
| 111 | 134 | { |
| 112 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 113 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 135 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 136 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 114 | 137 | } |
| 115 | desc->targetpc = desc->pc + 4 + (SIMMVAL << 2); | |
| 116 | desc->delayslots = 1; | |
| 117 | desc->skipslots = (opswitch & 0x10) ? 1 : 0; | |
| 118 | return TRUE; | |
| 138 | desc.targetpc = desc.pc + 4 + (SIMMVAL << 2); | |
| 139 | desc.delayslots = 1; | |
| 140 | desc.skipslots = (opswitch & 0x10) ? 1 : 0; | |
| 141 | return true; | |
| 119 | 142 | |
| 120 | case 0x06: /* BLEZ */ | |
| 121 | case 0x07: /* BGTZ */ | |
| 122 | case 0x16: /* BLEZL */ | |
| 123 | case 0x17: /* BGTZL */ | |
| 143 | case 0x06: // BLEZ | |
| 144 | case 0x07: // BGTZ | |
| 145 | case 0x16: // BLEZL | |
| 146 | case 0x17: // BGTZL | |
| 124 | 147 | if ((opswitch == 0x06 || opswitch == 0x16) && RSREG == 0) |
| 125 | desc | |
| 148 | desc. | |
| 126 | 149 | else |
| 127 | 150 | { |
| 128 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 129 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 151 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 152 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 130 | 153 | } |
| 131 | desc->targetpc = desc->pc + 4 + (SIMMVAL << 2); | |
| 132 | desc->delayslots = 1; | |
| 133 | desc->skipslots = (opswitch & 0x10) ? 1 : 0; | |
| 134 | return TRUE; | |
| 154 | desc.targetpc = desc.pc + 4 + (SIMMVAL << 2); | |
| 155 | desc.delayslots = 1; | |
| 156 | desc.skipslots = (opswitch & 0x10) ? 1 : 0; | |
| 157 | return true; | |
| 135 | 158 | |
| 136 | case 0x08: /* ADDI */ | |
| 137 | case 0x18: /* DADDI */ | |
| 138 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 139 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 140 | desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 141 | return TRUE; | |
| 159 | case 0x08: // ADDI | |
| 160 | case 0x18: // DADDI | |
| 161 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 162 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 163 | desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 164 | return true; | |
| 142 | 165 | |
| 143 | case 0x09: /* ADDIU */ | |
| 144 | case 0x0a: /* SLTI */ | |
| 145 | case 0x0b: /* SLTIU */ | |
| 146 | case 0x0c: /* ANDI */ | |
| 147 | case 0x0d: /* ORI */ | |
| 148 | case 0x0e: /* XORI */ | |
| 149 | case 0x19: /* DADDIU */ | |
| 150 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 151 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 152 | return TRUE; | |
| 166 | case 0x09: // ADDIU | |
| 167 | case 0x0a: // SLTI | |
| 168 | case 0x0b: // SLTIU | |
| 169 | case 0x0c: // ANDI | |
| 170 | case 0x0d: // ORI | |
| 171 | case 0x0e: // XORI | |
| 172 | case 0x19: // DADDIU | |
| 173 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 174 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 175 | return true; | |
| 153 | 176 | |
| 154 | case 0x0f: /* LUI */ | |
| 155 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 156 | return TRUE; | |
| 177 | case 0x0f: // LUI | |
| 178 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 179 | return true; | |
| 157 | 180 | |
| 158 | case 0x1a: /* LDL */ | |
| 159 | case 0x1b: /* LDR */ | |
| 160 | case 0x22: /* LWL */ | |
| 161 | case 0x26: /* LWR */ | |
| 162 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 163 | case 0x20: /* LB */ | |
| 164 | case 0x21: /* LH */ | |
| 165 | case 0x23: /* LW */ | |
| 166 | case 0x24: /* LBU */ | |
| 167 | case 0x25: /* LHU */ | |
| 168 | case 0x27: /* LWU */ | |
| 169 | case 0x30: /* LL */ | |
| 170 | case 0x34: /* LLD */ | |
| 171 | case 0x37: /* LD */ | |
| 172 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 173 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 174 | desc->flags |= OPFLAG_READS_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 175 | return TRUE; | |
| 181 | case 0x1a: // LDL | |
| 182 | case 0x1b: // LDR | |
| 183 | case 0x22: // LWL | |
| 184 | case 0x26: // LWR | |
| 185 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 186 | case 0x20: // LB | |
| 187 | case 0x21: // LH | |
| 188 | case 0x23: // LW | |
| 189 | case 0x24: // LBU | |
| 190 | case 0x25: // LHU | |
| 191 | case 0x27: // LWU | |
| 192 | case 0x30: // LL | |
| 193 | case 0x34: // LLD | |
| 194 | case 0x37: // LD | |
| 195 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 196 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 197 | desc.flags |= OPFLAG_READS_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 198 | return true; | |
| 176 | 199 | |
| 177 | case 0x28: /* SB */ | |
| 178 | case 0x29: /* SH */ | |
| 179 | case 0x2a: /* SWL */ | |
| 180 | case 0x2b: /* SW */ | |
| 181 | case 0x2c: /* SDL */ | |
| 182 | case 0x2d: /* SDR */ | |
| 183 | case 0x2e: /* SWR */ | |
| 184 | case 0x3f: /* SD */ | |
| 185 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 186 | desc->flags |= OPFLAG_WRITES_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 187 | return TRUE; | |
| 200 | case 0x28: // SB | |
| 201 | case 0x29: // SH | |
| 202 | case 0x2a: // SWL | |
| 203 | case 0x2b: // SW | |
| 204 | case 0x2c: // SDL | |
| 205 | case 0x2d: // SDR | |
| 206 | case 0x2e: // SWR | |
| 207 | case 0x3f: // SD | |
| 208 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 209 | desc.flags |= OPFLAG_WRITES_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 210 | return true; | |
| 188 | 211 | |
| 189 | case 0x38: /* SC */ | |
| 190 | case 0x3c: /* SCD */ | |
| 191 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 192 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 193 | desc->flags |= OPFLAG_WRITES_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 194 | return TRUE; | |
| 212 | case 0x38: // SC | |
| 213 | case 0x3c: // SCD | |
| 214 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 215 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 216 | desc.flags |= OPFLAG_WRITES_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 217 | return true; | |
| 195 | 218 | |
| 196 | case 0x31: /* LWC1 */ | |
| 197 | case 0x35: /* LDC1 */ | |
| 198 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 199 | desc->regout[1] |= REGFLAG_CPR1(RTREG); | |
| 200 | desc->flags |= OPFLAG_READS_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 201 | return TRUE; | |
| 219 | case 0x31: // LWC1 | |
| 220 | case 0x35: // LDC1 | |
| 221 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 222 | desc.regout[1] |= REGFLAG_CPR1(RTREG); | |
| 223 | desc.flags |= OPFLAG_READS_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 224 | return true; | |
| 202 | 225 | |
| 203 | case 0x39: /* SWC1 */ | |
| 204 | case 0x3d: /* SDC1 */ | |
| 205 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 206 | desc->regin[1] |= REGFLAG_CPR1(RTREG); | |
| 207 | desc->flags |= OPFLAG_WRITES_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 208 | return TRUE; | |
| 226 | case 0x39: // SWC1 | |
| 227 | case 0x3d: // SDC1 | |
| 228 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 229 | desc.regin[1] |= REGFLAG_CPR1(RTREG); | |
| 230 | desc.flags |= OPFLAG_WRITES_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 231 | return true; | |
| 209 | 232 | |
| 210 | case 0x32: /* LWC2 */ | |
| 211 | case 0x36: /* LDC2 */ | |
| 212 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 213 | desc->flags |= OPFLAG_READS_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 214 | return TRUE; | |
| 233 | case 0x32: // LWC2 | |
| 234 | case 0x36: // LDC2 | |
| 235 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 236 | desc.flags |= OPFLAG_READS_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 237 | return true; | |
| 215 | 238 | |
| 216 | case 0x3a: /* SWC2 */ | |
| 217 | case 0x3e: /* SDC2 */ | |
| 218 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 219 | desc->flags |= OPFLAG_WRITES_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 220 | return TRUE; | |
| 239 | case 0x3a: // SWC2 | |
| 240 | case 0x3e: // SDC2 | |
| 241 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 242 | desc.flags |= OPFLAG_WRITES_MEMORY | OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 243 | return true; | |
| 221 | 244 | |
| 222 | case 0x33: /* PREF */ | |
| 223 | if (mips->flavor < MIPS3_TYPE_MIPS_IV) | |
| 224 | return FALSE; | |
| 225 | case 0x2f: /* CACHE */ | |
| 226 | /* effective no-op */ | |
| 227 | return TRUE; | |
| 245 | case 0x33: // PREF | |
| 246 | if (m_context.flavor < MIPS3_TYPE_MIPS_IV) | |
| 247 | return false; | |
| 248 | case 0x2f: // CACHE | |
| 249 | // effective no-op | |
| 250 | return true; | |
| 228 | 251 | } |
| 229 | 252 | |
| 230 | return | |
| 253 | return false; | |
| 231 | 254 | } |
| 232 | 255 | |
| 233 | 256 | |
| 234 | /*------------------------------------------------- | |
| 235 | describe_instruction_special - build a | |
| 236 | description of a single instruction in the | |
| 237 | 'special' group | |
| 238 | -------------------------------------------------*/ | |
| 257 | //------------------------------------------------- | |
| 258 | // describe_special - build a description of a | |
| 259 | // single instruction in the 'special' group | |
| 260 | //------------------------------------------------- | |
| 239 | 261 | |
| 240 | ||
| 262 | bool | |
| 241 | 263 | { |
| 242 | 264 | switch (op & 63) |
| 243 | 265 | { |
| 244 | case 0x00: /* SLL */ | |
| 245 | case 0x02: /* SRL */ | |
| 246 | case 0x03: /* SRA */ | |
| 247 | case 0x38: /* DSLL */ | |
| 248 | case 0x3a: /* DSRL */ | |
| 249 | case 0x3b: /* DSRA */ | |
| 250 | case 0x3c: /* DSLL32 */ | |
| 251 | case 0x3e: /* DSRL32 */ | |
| 252 | case 0x3f: /* DSRA32 */ | |
| 253 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 254 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 255 | return TRUE; | |
| 266 | case 0x00: // SLL | |
| 267 | case 0x02: // SRL | |
| 268 | case 0x03: // SRA | |
| 269 | case 0x38: // DSLL | |
| 270 | case 0x3a: // DSRL | |
| 271 | case 0x3b: // DSRA | |
| 272 | case 0x3c: // DSLL32 | |
| 273 | case 0x3e: // DSRL32 | |
| 274 | case 0x3f: // DSRA32 | |
| 275 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 276 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 277 | return true; | |
| 256 | 278 | |
| 257 | case 0x0a: /* MOVZ - MIPS IV */ | |
| 258 | case 0x0b: /* MOVN - MIPS IV */ | |
| 259 | if (mips->flavor < MIPS3_TYPE_MIPS_IV) | |
| 260 | return FALSE; | |
| 261 | desc->regin[0] |= REGFLAG_R(RDREG); | |
| 262 | case 0x04: /* SLLV */ | |
| 263 | case 0x06: /* SRLV */ | |
| 264 | case 0x07: /* SRAV */ | |
| 265 | case 0x14: /* DSLLV */ | |
| 266 | case 0x16: /* DSRLV */ | |
| 267 | case 0x17: /* DSRAV */ | |
| 268 | case 0x21: /* ADDU */ | |
| 269 | case 0x23: /* SUBU */ | |
| 270 | case 0x24: /* AND */ | |
| 271 | case 0x25: /* OR */ | |
| 272 | case 0x26: /* XOR */ | |
| 273 | case 0x27: /* NOR */ | |
| 274 | case 0x2a: /* SLT */ | |
| 275 | case 0x2b: /* SLTU */ | |
| 276 | case 0x2d: /* DADDU */ | |
| 277 | case 0x2f: /* DSUBU */ | |
| 278 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 279 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 280 | return TRUE; | |
| 279 | case 0x0a: // MOVZ - MIPS IV | |
| 280 | case 0x0b: // MOVN - MIPS IV | |
| 281 | if (m_context.flavor < MIPS3_TYPE_MIPS_IV) | |
| 282 | return false; | |
| 283 | desc.regin[0] |= REGFLAG_R(RDREG); | |
| 284 | case 0x04: // SLLV | |
| 285 | case 0x06: // SRLV | |
| 286 | case 0x07: // SRAV | |
| 287 | case 0x14: // DSLLV | |
| 288 | case 0x16: // DSRLV | |
| 289 | case 0x17: // DSRAV | |
| 290 | case 0x21: // ADDU | |
| 291 | case 0x23: // SUBU | |
| 292 | case 0x24: // AND | |
| 293 | case 0x25: // OR | |
| 294 | case 0x26: // XOR | |
| 295 | case 0x27: // NOR | |
| 296 | case 0x2a: // SLT | |
| 297 | case 0x2b: // SLTU | |
| 298 | case 0x2d: // DADDU | |
| 299 | case 0x2f: // DSUBU | |
| 300 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 301 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 302 | return true; | |
| 281 | 303 | |
| 282 | case 0x20: /* ADD */ | |
| 283 | case 0x22: /* SUB */ | |
| 284 | case 0x2c: /* DADD */ | |
| 285 | case 0x2e: /* DSUB */ | |
| 286 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 287 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 288 | desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 289 | return TRUE; | |
| 304 | case 0x20: // ADD | |
| 305 | case 0x22: // SUB | |
| 306 | case 0x2c: // DADD | |
| 307 | case 0x2e: // DSUB | |
| 308 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 309 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 310 | desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 311 | return true; | |
| 290 | 312 | |
| 291 | case 0x30: /* TGE */ | |
| 292 | case 0x31: /* TGEU */ | |
| 293 | case 0x32: /* TLT */ | |
| 294 | case 0x33: /* TLTU */ | |
| 295 | case 0x34: /* TEQ */ | |
| 296 | case 0x36: /* TNE */ | |
| 297 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 298 | desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 299 | return TRUE; | |
| 313 | case 0x30: // TGE | |
| 314 | case 0x31: // TGEU | |
| 315 | case 0x32: // TLT | |
| 316 | case 0x33: // TLTU | |
| 317 | case 0x34: // TEQ | |
| 318 | case 0x36: // TNE | |
| 319 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 320 | desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 321 | return true; | |
| 300 | 322 | |
| 301 | case 0x01: /* MOVF - MIPS IV */ | |
| 302 | if (mips->flavor < MIPS3_TYPE_MIPS_IV) | |
| 303 | return FALSE; | |
| 304 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 305 | desc->regin[2] |= REGFLAG_FCC; | |
| 306 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 307 | return TRUE; | |
| 323 | case 0x01: // MOVF - MIPS IV | |
| 324 | if (m_context.flavor < MIPS3_TYPE_MIPS_IV) | |
| 325 | return false; | |
| 326 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 327 | desc.regin[2] |= REGFLAG_FCC; | |
| 328 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 329 | return true; | |
| 308 | 330 | |
| 309 | case 0x08: /* JR */ | |
| 310 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 311 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 312 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 313 | desc->delayslots = 1; | |
| 314 | return TRUE; | |
| 331 | case 0x08: // JR | |
| 332 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 333 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 334 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 335 | desc.delayslots = 1; | |
| 336 | return true; | |
| 315 | 337 | |
| 316 | case 0x09: /* JALR */ | |
| 317 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 318 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 319 | desc->flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 320 | desc->targetpc = BRANCH_TARGET_DYNAMIC; | |
| 321 | desc->delayslots = 1; | |
| 322 | return TRUE; | |
| 338 | case 0x09: // JALR | |
| 339 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 340 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 341 | desc.flags |= OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 342 | desc.targetpc = BRANCH_TARGET_DYNAMIC; | |
| 343 | desc.delayslots = 1; | |
| 344 | return true; | |
| 323 | 345 | |
| 324 | case 0x10: /* MFHI */ | |
| 325 | desc->regin[0] |= REGFLAG_HI; | |
| 326 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 327 | return TRUE; | |
| 346 | case 0x10: // MFHI | |
| 347 | desc.regin[0] |= REGFLAG_HI; | |
| 348 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 349 | return true; | |
| 328 | 350 | |
| 329 | case 0x11: /* MTHI */ | |
| 330 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 331 | desc->regout[0] |= REGFLAG_HI; | |
| 332 | return TRUE; | |
| 351 | case 0x11: // MTHI | |
| 352 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 353 | desc.regout[0] |= REGFLAG_HI; | |
| 354 | return true; | |
| 333 | 355 | |
| 334 | case 0x12: /* MFLO */ | |
| 335 | desc->regin[2] |= REGFLAG_LO; | |
| 336 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 337 | return TRUE; | |
| 356 | case 0x12: // MFLO | |
| 357 | desc.regin[2] |= REGFLAG_LO; | |
| 358 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 359 | return true; | |
| 338 | 360 | |
| 339 | case 0x13: /* MTLO */ | |
| 340 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 341 | desc->regout[2] |= REGFLAG_LO; | |
| 342 | return TRUE; | |
| 361 | case 0x13: // MTLO | |
| 362 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 363 | desc.regout[2] |= REGFLAG_LO; | |
| 364 | return true; | |
| 343 | 365 | |
| 344 | case 0x18: /* MULT */ | |
| 345 | case 0x19: /* MULTU */ | |
| 346 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 347 | desc->regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 348 | desc->cycles = 3; | |
| 349 | return TRUE; | |
| 366 | case 0x18: // MULT | |
| 367 | case 0x19: // MULTU | |
| 368 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 369 | desc.regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 370 | desc.cycles = 3; | |
| 371 | return true; | |
| 350 | 372 | |
| 351 | case 0x1a: /* DIV */ | |
| 352 | case 0x1b: /* DIVU */ | |
| 353 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 354 | desc->regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 355 | desc->cycles = 35; | |
| 356 | return TRUE; | |
| 373 | case 0x1a: // DIV | |
| 374 | case 0x1b: // DIVU | |
| 375 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 376 | desc.regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 377 | desc.cycles = 35; | |
| 378 | return true; | |
| 357 | 379 | |
| 358 | case 0x1c: /* DMULT */ | |
| 359 | case 0x1d: /* DMULTU */ | |
| 360 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 361 | desc->regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 362 | desc->cycles = 7; | |
| 363 | return TRUE; | |
| 380 | case 0x1c: // DMULT | |
| 381 | case 0x1d: // DMULTU | |
| 382 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 383 | desc.regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 384 | desc.cycles = 7; | |
| 385 | return true; | |
| 364 | 386 | |
| 365 | case 0x1e: /* DDIV */ | |
| 366 | case 0x1f: /* DDIVU */ | |
| 367 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 368 | desc->regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 369 | desc->cycles = 67; | |
| 370 | return TRUE; | |
| 387 | case 0x1e: // DDIV | |
| 388 | case 0x1f: // DDIVU | |
| 389 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 390 | desc.regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 391 | desc.cycles = 67; | |
| 392 | return true; | |
| 371 | 393 | |
| 372 | case 0x0c: /* SYSCALL */ | |
| 373 | case 0x0d: /* BREAK */ | |
| 374 | desc->flags |= OPFLAG_WILL_CAUSE_EXCEPTION | OPFLAG_END_SEQUENCE; | |
| 375 | return TRUE; | |
| 394 | case 0x0c: // SYSCALL | |
| 395 | case 0x0d: // BREAK | |
| 396 | desc.flags |= OPFLAG_WILL_CAUSE_EXCEPTION | OPFLAG_END_SEQUENCE; | |
| 397 | return true; | |
| 376 | 398 | |
| 377 | case 0x0f: /* SYNC */ | |
| 378 | /* effective no-op */ | |
| 379 | return TRUE; | |
| 399 | case 0x0f: // SYNC | |
| 400 | // effective no-op | |
| 401 | return true; | |
| 380 | 402 | } |
| 381 | 403 | |
| 382 | return | |
| 404 | return false; | |
| 383 | 405 | } |
| 384 | 406 | |
| 385 | 407 | |
| 386 | /*------------------------------------------------- | |
| 387 | describe_instruction_regimm - build a | |
| 388 | description of a single instruction in the | |
| 389 | 'regimm' group | |
| 390 | -------------------------------------------------*/ | |
| 408 | //------------------------------------------------- | |
| 409 | // describe_regimm - build a description of a | |
| 410 | // single instruction in the 'regimm' group | |
| 411 | //------------------------------------------------- | |
| 391 | 412 | |
| 392 | ||
| 413 | bool | |
| 393 | 414 | { |
| 394 | 415 | switch (RTREG) |
| 395 | 416 | { |
| 396 | case 0x00: /* BLTZ */ | |
| 397 | case 0x01: /* BGEZ */ | |
| 398 | case 0x02: /* BLTZL */ | |
| 399 | case 0x03: /* BGEZL */ | |
| 417 | case 0x00: // BLTZ | |
| 418 | case 0x01: // BGEZ | |
| 419 | case 0x02: // BLTZL | |
| 420 | case 0x03: // BGEZL | |
| 400 | 421 | if (RTREG == 0x01 && RSREG == 0) |
| 401 | desc | |
| 422 | desc. | |
| 402 | 423 | else |
| 403 | 424 | { |
| 404 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 405 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 425 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 426 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 406 | 427 | } |
| 407 | desc->targetpc = desc->pc + 4 + (SIMMVAL << 2); | |
| 408 | desc->delayslots = 1; | |
| 409 | desc->skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 410 | return TRUE; | |
| 428 | desc.targetpc = desc.pc + 4 + (SIMMVAL << 2); | |
| 429 | desc.delayslots = 1; | |
| 430 | desc.skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 431 | return true; | |
| 411 | 432 | |
| 412 | case 0x08: /* TGEI */ | |
| 413 | case 0x09: /* TGEIU */ | |
| 414 | case 0x0a: /* TLTI */ | |
| 415 | case 0x0b: /* TLTIU */ | |
| 416 | case 0x0c: /* TEQI */ | |
| 417 | case 0x0e: /* TNEI */ | |
| 418 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 419 | desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 420 | return TRUE; | |
| 433 | case 0x08: // TGEI | |
| 434 | case 0x09: // TGEIU | |
| 435 | case 0x0a: // TLTI | |
| 436 | case 0x0b: // TLTIU | |
| 437 | case 0x0c: // TEQI | |
| 438 | case 0x0e: // TNEI | |
| 439 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 440 | desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 441 | return true; | |
| 421 | 442 | |
| 422 | case 0x10: /* BLTZAL */ | |
| 423 | case 0x11: /* BGEZAL */ | |
| 424 | case 0x12: /* BLTZALL */ | |
| 425 | case 0x13: /* BGEZALL */ | |
| 443 | case 0x10: // BLTZAL | |
| 444 | case 0x11: // BGEZAL | |
| 445 | case 0x12: // BLTZALL | |
| 446 | case 0x13: // BGEZALL | |
| 426 | 447 | if (RTREG == 0x11 && RSREG == 0) |
| 427 | desc | |
| 448 | desc. | |
| 428 | 449 | else |
| 429 | 450 | { |
| 430 | desc->regin[0] |= REGFLAG_R(RSREG); | |
| 431 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 451 | desc.regin[0] |= REGFLAG_R(RSREG); | |
| 452 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 432 | 453 | } |
| 433 | desc->regout[0] |= REGFLAG_R(31); | |
| 434 | desc->targetpc = desc->pc + 4 + (SIMMVAL << 2); | |
| 435 | desc->delayslots = 1; | |
| 436 | desc->skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 437 | return TRUE; | |
| 454 | desc.regout[0] |= REGFLAG_R(31); | |
| 455 | desc.targetpc = desc.pc + 4 + (SIMMVAL << 2); | |
| 456 | desc.delayslots = 1; | |
| 457 | desc.skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 458 | return true; | |
| 438 | 459 | } |
| 439 | 460 | |
| 440 | return | |
| 461 | return false; | |
| 441 | 462 | } |
| 442 | 463 | |
| 443 | 464 | |
| 444 | /*------------------------------------------------- | |
| 445 | describe_instruction_idt - build a | |
| 446 | description of a single instruction in the | |
| 447 | IDT-specific group | |
| 448 | -------------------------------------------------*/ | |
| 465 | //------------------------------------------------- | |
| 466 | // describe_idt - build a description of a single | |
| 467 | // instruction in the IDT-specific group | |
| 468 | //------------------------------------------------- | |
| 449 | 469 | |
| 450 | ||
| 470 | bool | |
| 451 | 471 | { |
| 452 | /* only on the R4650 */ | |
| 453 | if (mips->flavor != MIPS3_TYPE_R4650) | |
| 454 | return FALSE; | |
| 472 | // only on the R4650 | |
| 473 | if (m_context.flavor != MIPS3_TYPE_R4650) | |
| 474 | return false; | |
| 455 | 475 | |
| 456 | 476 | switch (op & 0x1f) |
| 457 | 477 | { |
| 458 | case 0: /* MAD */ | |
| 459 | case 1: /* MADU */ | |
| 460 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 461 | desc->regin[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 462 | desc->regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 463 | return TRUE; | |
| 478 | case 0: // MAD | |
| 479 | case 1: // MADU | |
| 480 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 481 | desc.regin[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 482 | desc.regout[2] |= REGFLAG_LO | REGFLAG_HI; | |
| 483 | return true; | |
| 464 | 484 | |
| 465 | case 2: /* MUL */ | |
| 466 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 467 | desc->regout[0] |= REGFLAG_R(RDREG); | |
| 468 | desc->cycles = 3; | |
| 469 | return TRUE; | |
| 485 | case 2: // MUL | |
| 486 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 487 | desc.regout[0] |= REGFLAG_R(RDREG); | |
| 488 | desc.cycles = 3; | |
| 489 | return true; | |
| 470 | 490 | } |
| 471 | 491 | |
| 472 | return | |
| 492 | return false; | |
| 473 | 493 | } |
| 474 | 494 | |
| 475 | 495 | |
| 476 | /*------------------------------------------------- | |
| 477 | describe_instruction_cop0 - build a | |
| 478 | description of a single instruction in the | |
| 479 | COP0 group | |
| 480 | -------------------------------------------------*/ | |
| 496 | //------------------------------------------------- | |
| 497 | // describe_cop0 - build a description of a | |
| 498 | // single instruction in the COP0 group | |
| 499 | //------------------------------------------------- | |
| 481 | 500 | |
| 482 | ||
| 501 | bool | |
| 483 | 502 | { |
| 484 | /* any COP0 instruction can potentially cause an exception */ | |
| 485 | desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 503 | // any COP0 instruction can potentially cause an exception | |
| 504 | desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 486 | 505 | |
| 487 | 506 | switch (RSREG) |
| 488 | 507 | { |
| 489 | case 0x00: /* MFCz */ | |
| 490 | case 0x01: /* DMFCz */ | |
| 508 | case 0x00: // MFCz | |
| 509 | case 0x01: // DMFCz | |
| 491 | 510 | if (RDREG == COP0_Count) |
| 492 | desc | |
| 511 | desc. | |
| 493 | 512 | if (RDREG == COP0_Cause) |
| 494 | desc->cycles += MIPS3_CAUSE_READ_CYCLES; | |
| 495 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 496 | return TRUE; | |
| 513 | desc.cycles += MIPS3_CAUSE_READ_CYCLES; | |
| 514 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 515 | return true; | |
| 497 | 516 | |
| 498 | case 0x02: /* CFCz */ | |
| 499 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 500 | return TRUE; | |
| 517 | case 0x02: // CFCz | |
| 518 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 519 | return true; | |
| 501 | 520 | |
| 502 | case 0x04: /* MTCz */ | |
| 503 | case 0x05: /* DMTCz */ | |
| 504 | case 0x06: /* CTCz */ | |
| 505 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 521 | case 0x04: // MTCz | |
| 522 | case 0x05: // DMTCz | |
| 523 | case 0x06: // CTCz | |
| 524 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 506 | 525 | if (RSREG == 0x04 || RSREG == 0x05) |
| 507 | 526 | { |
| 508 | 527 | if (RDREG == COP0_Cause) |
| 509 | desc | |
| 528 | desc. | |
| 510 | 529 | if (RDREG == COP0_Status) |
| 511 | desc | |
| 530 | desc. | |
| 512 | 531 | } |
| 513 | return | |
| 532 | return true; | |
| 514 | 533 | |
| 515 | case 0x08: / | |
| 534 | case 0x08: // BC | |
| 516 | 535 | switch (RTREG) |
| 517 | 536 | { |
| 518 | case 0x00: /* BCzF */ | |
| 519 | case 0x01: /* BCzT */ | |
| 520 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 521 | desc->targetpc = desc->pc + 4 + (SIMMVAL << 2); | |
| 522 | desc->delayslots = 1; | |
| 523 | return TRUE; | |
| 537 | case 0x00: // BCzF | |
| 538 | case 0x01: // BCzT | |
| 539 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 540 | desc.targetpc = desc.pc + 4 + (SIMMVAL << 2); | |
| 541 | desc.delayslots = 1; | |
| 542 | return true; | |
| 524 | 543 | } |
| 525 | return | |
| 544 | return false; | |
| 526 | 545 | |
| 527 | 546 | case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: |
| 528 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: / | |
| 547 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: // COP | |
| 529 | 548 | switch (op & 0x01ffffff) |
| 530 | 549 | { |
| 531 | case 0x01: /* TLBR */ | |
| 532 | case 0x08: /* TLBP */ | |
| 533 | case 0x20: /* WAIT */ | |
| 534 | return TRUE; | |
| 550 | case 0x01: // TLBR | |
| 551 | case 0x08: // TLBP | |
| 552 | case 0x20: // WAIT | |
| 553 | return true; | |
| 535 | 554 | |
| 536 | case 0x02: /* TLBWI */ | |
| 537 | case 0x06: /* TLBWR */ | |
| 538 | desc->flags |= OPFLAG_MODIFIES_TRANSLATION; | |
| 539 | return TRUE; | |
| 555 | case 0x02: // TLBWI | |
| 556 | case 0x06: // TLBWR | |
| 557 | desc.flags |= OPFLAG_MODIFIES_TRANSLATION; | |
| 558 | return true; | |
| 540 | 559 | |
| 541 | case 0x18: /* ERET */ | |
| 542 | desc->flags |= OPFLAG_CAN_CHANGE_MODES | OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 543 | return TRUE; | |
| 560 | case 0x18: // ERET | |
| 561 | desc.flags |= OPFLAG_CAN_CHANGE_MODES | OPFLAG_IS_UNCONDITIONAL_BRANCH | OPFLAG_END_SEQUENCE; | |
| 562 | return true; | |
| 544 | 563 | } |
| 545 | return | |
| 564 | return false; | |
| 546 | 565 | } |
| 547 | 566 | |
| 548 | return | |
| 567 | return false; | |
| 549 | 568 | } |
| 550 | 569 | |
| 551 | 570 | |
| 552 | /*------------------------------------------------- | |
| 553 | describe_instruction_cop1 - build a | |
| 554 | description of a single instruction in the | |
| 555 | COP1 group | |
| 556 | -------------------------------------------------*/ | |
| 571 | //------------------------------------------------- | |
| 572 | // describe_cop1 - build a description of a | |
| 573 | // single instruction in the COP1 group | |
| 574 | //------------------------------------------------- | |
| 557 | 575 | |
| 558 | ||
| 576 | bool | |
| 559 | 577 | { |
| 560 | /* any COP1 instruction can potentially cause an exception */ | |
| 561 | // desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 578 | // any COP1 instruction can potentially cause an exception | |
| 579 | // desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 562 | 580 | |
| 563 | 581 | switch (RSREG) |
| 564 | 582 | { |
| 565 | case 0x00: /* MFCz */ | |
| 566 | case 0x01: /* DMFCz */ | |
| 567 | desc->regin[1] |= REGFLAG_CPR1(RDREG); | |
| 568 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 569 | return TRUE; | |
| 583 | case 0x00: // MFCz | |
| 584 | case 0x01: // DMFCz | |
| 585 | desc.regin[1] |= REGFLAG_CPR1(RDREG); | |
| 586 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 587 | return true; | |
| 570 | 588 | |
| 571 | case 0x02: /* CFCz */ | |
| 572 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 573 | return TRUE; | |
| 589 | case 0x02: // CFCz | |
| 590 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 591 | return true; | |
| 574 | 592 | |
| 575 | case 0x04: /* MTCz */ | |
| 576 | case 0x05: /* DMTCz */ | |
| 577 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 578 | desc->regout[1] |= REGFLAG_CPR1(RDREG); | |
| 579 | return TRUE; | |
| 593 | case 0x04: // MTCz | |
| 594 | case 0x05: // DMTCz | |
| 595 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 596 | desc.regout[1] |= REGFLAG_CPR1(RDREG); | |
| 597 | return true; | |
| 580 | 598 | |
| 581 | case 0x06: /* CTCz */ | |
| 582 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 583 | return TRUE; | |
| 599 | case 0x06: // CTCz | |
| 600 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 601 | return true; | |
| 584 | 602 | |
| 585 | case 0x08: / | |
| 603 | case 0x08: // BC | |
| 586 | 604 | switch (RTREG & 3) |
| 587 | 605 | { |
| 588 | case 0x00: /* BCzF */ | |
| 589 | case 0x01: /* BCzT */ | |
| 590 | case 0x02: /* BCzFL */ | |
| 591 | case 0x03: /* BCzTL */ | |
| 592 | desc->regin[2] |= REGFLAG_FCC; | |
| 593 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 594 | desc->targetpc = desc->pc + 4 + (SIMMVAL << 2); | |
| 595 | desc->delayslots = 1; | |
| 596 | desc->skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 597 | return TRUE; | |
| 606 | case 0x00: // BCzF | |
| 607 | case 0x01: // BCzT | |
| 608 | case 0x02: // BCzFL | |
| 609 | case 0x03: // BCzTL | |
| 610 | desc.regin[2] |= REGFLAG_FCC; | |
| 611 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 612 | desc.targetpc = desc.pc + 4 + (SIMMVAL << 2); | |
| 613 | desc.delayslots = 1; | |
| 614 | desc.skipslots = (RTREG & 0x02) ? 1 : 0; | |
| 615 | return true; | |
| 598 | 616 | } |
| 599 | return | |
| 617 | return false; | |
| 600 | 618 | |
| 601 | 619 | case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: |
| 602 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: / | |
| 620 | case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: case 0x1d: case 0x1e: case 0x1f: // COP | |
| 603 | 621 | switch (op & 0x3f) |
| 604 | 622 | { |
| 605 | case 0x12: /* MOVZ - MIPS IV */ | |
| 606 | case 0x13: /* MOVN - MIPS IV */ | |
| 607 | if (mips->flavor < MIPS3_TYPE_MIPS_IV) | |
| 608 | return FALSE; | |
| 609 | case 0x00: /* ADD */ | |
| 610 | case 0x01: /* SUB */ | |
| 611 | case 0x02: /* MUL */ | |
| 612 | case 0x03: /* DIV */ | |
| 613 | desc->regin[1] |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG); | |
| 614 | desc->regout[1] |= REGFLAG_CPR1(FDREG); | |
| 615 | return TRUE; | |
| 623 | case 0x12: // MOVZ - MIPS IV | |
| 624 | case 0x13: // MOVN - MIPS IV | |
| 625 | if (m_context.flavor < MIPS3_TYPE_MIPS_IV) | |
| 626 | return false; | |
| 627 | case 0x00: // ADD | |
| 628 | case 0x01: // SUB | |
| 629 | case 0x02: // MUL | |
| 630 | case 0x03: // DIV | |
| 631 | desc.regin[1] |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG); | |
| 632 | desc.regout[1] |= REGFLAG_CPR1(FDREG); | |
| 633 | return true; | |
| 616 | 634 | |
| 617 | case 0x15: /* RECIP - MIPS IV */ | |
| 618 | case 0x16: /* RSQRT - MIPS IV */ | |
| 619 | if (mips->flavor < MIPS3_TYPE_MIPS_IV) | |
| 620 | return FALSE; | |
| 621 | case 0x04: /* SQRT */ | |
| 622 | case 0x05: /* ABS */ | |
| 623 | case 0x06: /* MOV */ | |
| 624 | case 0x07: /* NEG */ | |
| 625 | case 0x08: /* ROUND.L */ | |
| 626 | case 0x09: /* TRUNC.L */ | |
| 627 | case 0x0a: /* CEIL.L */ | |
| 628 | case 0x0b: /* FLOOR.L */ | |
| 629 | case 0x0c: /* ROUND.W */ | |
| 630 | case 0x0d: /* TRUNC.W */ | |
| 631 | case 0x0e: /* CEIL.W */ | |
| 632 | case 0x0f: /* FLOOR.W */ | |
| 633 | case 0x20: /* CVT.S */ | |
| 634 | case 0x21: /* CVT.D */ | |
| 635 | case 0x24: /* CVT.W */ | |
| 636 | case 0x25: /* CVT.L */ | |
| 637 | desc->regin[1] |= REGFLAG_CPR1(FSREG); | |
| 638 | desc->regout[1] |= REGFLAG_CPR1(FDREG); | |
| 639 | return TRUE; | |
| 635 | case 0x15: // RECIP - MIPS IV | |
| 636 | case 0x16: // RSQRT - MIPS IV | |
| 637 | if (m_context.flavor < MIPS3_TYPE_MIPS_IV) | |
| 638 | return false; | |
| 639 | case 0x04: // SQRT | |
| 640 | case 0x05: // ABS | |
| 641 | case 0x06: // MOV | |
| 642 | case 0x07: // NEG | |
| 643 | case 0x08: // ROUND.L | |
| 644 | case 0x09: // TRUNC.L | |
| 645 | case 0x0a: // CEIL.L | |
| 646 | case 0x0b: // FLOOR.L | |
| 647 | case 0x0c: // ROUND.W | |
| 648 | case 0x0d: // TRUNC.W | |
| 649 | case 0x0e: // CEIL.W | |
| 650 | case 0x0f: // FLOOR.W | |
| 651 | case 0x20: // CVT.S | |
| 652 | case 0x21: // CVT.D | |
| 653 | case 0x24: // CVT.W | |
| 654 | case 0x25: // CVT.L | |
| 655 | desc.regin[1] |= REGFLAG_CPR1(FSREG); | |
| 656 | desc.regout[1] |= REGFLAG_CPR1(FDREG); | |
| 657 | return true; | |
| 640 | 658 | |
| 641 | case 0x11: /* MOVT/F - MIPS IV */ | |
| 642 | if (mips->flavor < MIPS3_TYPE_MIPS_IV) | |
| 643 | return FALSE; | |
| 644 | desc->regin[1] |= REGFLAG_CPR1(FSREG); | |
| 645 | desc->regin[2] |= REGFLAG_FCC; | |
| 646 | desc->regout[1] |= REGFLAG_CPR1(FDREG); | |
| 647 | return TRUE; | |
| 659 | case 0x11: // MOVT/F - MIPS IV | |
| 660 | if (m_context.flavor < MIPS3_TYPE_MIPS_IV) | |
| 661 | return false; | |
| 662 | desc.regin[1] |= REGFLAG_CPR1(FSREG); | |
| 663 | desc.regin[2] |= REGFLAG_FCC; | |
| 664 | desc.regout[1] |= REGFLAG_CPR1(FDREG); | |
| 665 | return true; | |
| 648 | 666 | |
| 649 | case 0x30: case 0x38: /* C.F */ | |
| 650 | case 0x31: case 0x39: /* C.UN */ | |
| 651 | desc->regout[2] |= REGFLAG_FCC; | |
| 652 | return TRUE; | |
| 667 | case 0x30: case 0x38: // C.F | |
| 668 | case 0x31: case 0x39: // C.UN | |
| 669 | desc.regout[2] |= REGFLAG_FCC; | |
| 670 | return true; | |
| 653 | 671 | |
| 654 | case 0x32: case 0x3a: /* C.EQ */ | |
| 655 | case 0x33: case 0x3b: /* C.UEQ */ | |
| 656 | case 0x34: case 0x3c: /* C.OLT */ | |
| 657 | case 0x35: case 0x3d: /* C.ULT */ | |
| 658 | case 0x36: case 0x3e: /* C.OLE */ | |
| 659 | case 0x37: case 0x3f: /* C.ULE */ | |
| 660 | desc->regin[1] |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG); | |
| 661 | desc->regout[2] |= REGFLAG_FCC; | |
| 662 | return TRUE; | |
| 672 | case 0x32: case 0x3a: // C.EQ | |
| 673 | case 0x33: case 0x3b: // C.UEQ | |
| 674 | case 0x34: case 0x3c: // C.OLT | |
| 675 | case 0x35: case 0x3d: // C.ULT | |
| 676 | case 0x36: case 0x3e: // C.OLE | |
| 677 | case 0x37: case 0x3f: // C.ULE | |
| 678 | desc.regin[1] |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG); | |
| 679 | desc.regout[2] |= REGFLAG_FCC; | |
| 680 | return true; | |
| 663 | 681 | } |
| 664 | return | |
| 682 | return false; | |
| 665 | 683 | } |
| 666 | 684 | |
| 667 | return | |
| 685 | return false; | |
| 668 | 686 | } |
| 669 | 687 | |
| 670 | 688 | |
| 671 | /*------------------------------------------------- | |
| 672 | describe_instruction_cop1x - build a | |
| 673 | description of a single instruction in the | |
| 674 | COP1X group | |
| 675 | -------------------------------------------------*/ | |
| 689 | //------------------------------------------------- | |
| 690 | // describe_cop1x - build a description of a | |
| 691 | // single instruction in the COP1X group | |
| 692 | //------------------------------------------------- | |
| 676 | 693 | |
| 677 | ||
| 694 | bool | |
| 678 | 695 | { |
| 679 | /* any COP1 instruction can potentially cause an exception */ | |
| 680 | // desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 696 | // any COP1 instruction can potentially cause an exception | |
| 697 | // desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 681 | 698 | |
| 682 | 699 | switch (op & 0x3f) |
| 683 | 700 | { |
| 684 | case 0x00: /* LWXC1 */ | |
| 685 | case 0x01: /* LDXC1 */ | |
| 686 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 687 | desc->regout[1] |= REGFLAG_CPR1(FDREG); | |
| 688 | desc->flags |= OPFLAG_READS_MEMORY; | |
| 689 | return TRUE; | |
| 701 | case 0x00: // LWXC1 | |
| 702 | case 0x01: // LDXC1 | |
| 703 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 704 | desc.regout[1] |= REGFLAG_CPR1(FDREG); | |
| 705 | desc.flags |= OPFLAG_READS_MEMORY; | |
| 706 | return true; | |
| 690 | 707 | |
| 691 | case 0x08: /* SWXC1 */ | |
| 692 | case 0x09: /* SDXC1 */ | |
| 693 | desc->regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 694 | desc->regin[1] |= REGFLAG_CPR1(FDREG); | |
| 695 | desc->flags |= OPFLAG_WRITES_MEMORY; | |
| 696 | return TRUE; | |
| 708 | case 0x08: // SWXC1 | |
| 709 | case 0x09: // SDXC1 | |
| 710 | desc.regin[0] |= REGFLAG_R(RSREG) | REGFLAG_R(RTREG); | |
| 711 | desc.regin[1] |= REGFLAG_CPR1(FDREG); | |
| 712 | desc.flags |= OPFLAG_WRITES_MEMORY; | |
| 713 | return true; | |
| 697 | 714 | |
| 698 | case 0x0f: /* PREFX */ | |
| 699 | /* effective no-op */ | |
| 700 | return TRUE; | |
| 715 | case 0x0f: // PREFX | |
| 716 | // effective no-op | |
| 717 | return true; | |
| 701 | 718 | |
| 702 | case 0x20: case 0x21: /* MADD */ | |
| 703 | case 0x28: case 0x29: /* MSUB */ | |
| 704 | case 0x30: case 0x31: /* NMADD */ | |
| 705 | case 0x38: case 0x39: /* NMSUB */ | |
| 706 | desc->regin[1] |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG) | REGFLAG_CPR1(FRREG); | |
| 707 | desc->regout[1] |= REGFLAG_CPR1(FDREG); | |
| 708 | return TRUE; | |
| 719 | case 0x20: case 0x21: // MADD | |
| 720 | case 0x28: case 0x29: // MSUB | |
| 721 | case 0x30: case 0x31: // NMADD | |
| 722 | case 0x38: case 0x39: // NMSUB | |
| 723 | desc.regin[1] |= REGFLAG_CPR1(FSREG) | REGFLAG_CPR1(FTREG) | REGFLAG_CPR1(FRREG); | |
| 724 | desc.regout[1] |= REGFLAG_CPR1(FDREG); | |
| 725 | return true; | |
| 709 | 726 | } |
| 710 | 727 | |
| 711 | return | |
| 728 | return false; | |
| 712 | 729 | } |
| 713 | 730 | |
| 714 | 731 | |
| 715 | /*------------------------------------------------- | |
| 716 | describe_instruction_cop2 - build a | |
| 717 | description of a single instruction in the | |
| 718 | COP2 group | |
| 719 | -------------------------------------------------*/ | |
| 732 | //------------------------------------------------- | |
| 733 | // describe_cop2 - build a description of a | |
| 734 | // single instruction in the COP2 group | |
| 735 | //------------------------------------------------- | |
| 720 | 736 | |
| 721 | ||
| 737 | bool | |
| 722 | 738 | { |
| 723 | /* any COP2 instruction can potentially cause an exception */ | |
| 724 | desc->flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 739 | // any COP2 instruction can potentially cause an exception | |
| 740 | desc.flags |= OPFLAG_CAN_CAUSE_EXCEPTION; | |
| 725 | 741 | |
| 726 | 742 | switch (RSREG) |
| 727 | 743 | { |
| 728 | case 0x00: /* MFCz */ | |
| 729 | case 0x01: /* DMFCz */ | |
| 730 | case 0x02: /* CFCz */ | |
| 731 | desc->regout[0] |= REGFLAG_R(RTREG); | |
| 732 | return TRUE; | |
| 744 | case 0x00: // MFCz | |
| 745 | case 0x01: // DMFCz | |
| 746 | case 0x02: // CFCz | |
| 747 | desc.regout[0] |= REGFLAG_R(RTREG); | |
| 748 | return true; | |
| 733 | 749 | |
| 734 | case 0x04: /* MTCz */ | |
| 735 | case 0x05: /* DMTCz */ | |
| 736 | case 0x06: /* CTCz */ | |
| 737 | desc->regin[0] |= REGFLAG_R(RTREG); | |
| 738 | return TRUE; | |
| 750 | case 0x04: // MTCz | |
| 751 | case 0x05: // DMTCz | |
| 752 | case 0x06: // CTCz | |
| 753 | desc.regin[0] |= REGFLAG_R(RTREG); | |
| 754 | return true; | |
| 739 | 755 | |
| 740 | case 0x08: / | |
| 756 | case 0x08: // BC | |
| 741 | 757 | switch (RTREG) |
| 742 | 758 | { |
| 743 | case 0x00: /* BCzF */ | |
| 744 | case 0x01: /* BCzT */ | |
| 745 | desc->flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 746 | desc->targetpc = desc->pc + 4 + (SIMMVAL << 2); | |
| 747 | desc->delayslots = 1; | |
| 748 | return TRUE; | |
| 759 | case 0x00: // BCzF | |
| 760 | case 0x01: // BCzT | |
| 761 | desc.flags |= OPFLAG_IS_CONDITIONAL_BRANCH; | |
| 762 | desc.targetpc = desc.pc + 4 + (SIMMVAL << 2); | |
| 763 | desc.delayslots = 1; | |
| 764 | return true; | |
| 749 | 765 | } |
| 750 | return | |
| 766 | return false; | |
| 751 | 767 | } |
| 752 | 768 | |
| 753 | return | |
| 769 | return false; | |
| 754 | 770 | } |
| r9922 | r9923 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Front-end for MIPS3 recompiler |
| 6 | 6 | |
| 7 | **************************************************************************** | |
| 8 | ||
| 7 | 9 | Copyright Aaron Giles |
| 8 | Released for general non-commercial use under the MAME license | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 10 | All rights reserved. | |
| 10 | 11 | |
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | ***************************************************************************/ |
| 12 | 39 | |
| 13 | 40 | #pragma once |
| r9922 | r9923 | |
| 15 | 42 | #ifndef __MIPS3FE_H__ |
| 16 | 43 | #define __MIPS3FE_H__ |
| 17 | 44 | |
| 45 | #include "mips3com.h" | |
| 18 | 46 | #include "cpu/drcfe.h" |
| 19 | 47 | |
| 20 | 48 | |
| 21 | /*************************************************************************** | |
| 22 | CONSTANTS | |
| 23 | ***************************************************************************/ | |
| 49 | //************************************************************************** | |
| 50 | // MACROS | |
| 51 | //************************************************************************** | |
| 24 | 52 | |
| 25 | / | |
| 53 | // register flags 0 | |
| 26 | 54 | #define REGFLAG_R(n) (((n) == 0) ? 0 : (1 << (n))) |
| 27 | 55 | |
| 28 | / | |
| 56 | // register flags 1 | |
| 29 | 57 | #define REGFLAG_CPR1(n) (1 << (n)) |
| 30 | 58 | |
| 31 | / | |
| 59 | // register flags 2 | |
| 32 | 60 | #define REGFLAG_LO (1 << 0) |
| 33 | 61 | #define REGFLAG_HI (1 << 1) |
| 34 | 62 | #define REGFLAG_FCC (1 << 2) |
| 35 | 63 | |
| 36 | 64 | |
| 37 | 65 | |
| 38 | /*************************************************************************** | |
| 39 | FUNCTION PROTOTYPES | |
| 40 | ***************************************************************************/ | |
| 66 | //************************************************************************** | |
| 67 | // TYPE DEFINITIONS | |
| 68 | //************************************************************************** | |
| 41 | 69 | |
| 42 | int mips3fe_describe(void *param, opcode_desc *desc, const opcode_desc *prev); | |
| 70 | class mips3_frontend : public drc_frontend | |
| 71 | { | |
| 72 | public: | |
| 73 | // construction/destruction | |
| 74 | mips3_frontend(mips3_state &state, UINT32 window_start, UINT32 window_end, UINT32 max_sequence); | |
| 43 | 75 | |
| 76 | protected: | |
| 77 | // required overrides | |
| 78 | virtual bool describe(opcode_desc &desc, const opcode_desc *prev); | |
| 79 | ||
| 80 | private: | |
| 81 | // internal helpers | |
| 82 | bool describe_special(UINT32 op, opcode_desc &desc); | |
| 83 | bool describe_regimm(UINT32 op, opcode_desc &desc); | |
| 84 | bool describe_idt(UINT32 op, opcode_desc &desc); | |
| 85 | bool describe_cop0(UINT32 op, opcode_desc &desc); | |
| 86 | bool describe_cop1(UINT32 op, opcode_desc &desc); | |
| 87 | bool describe_cop1x(UINT32 op, opcode_desc &desc); | |
| 88 | bool describe_cop2(UINT32 op, opcode_desc &desc); | |
| 89 | ||
| 90 | // internal state | |
| 91 | mips3_state &m_context; | |
| 92 | }; | |
| 93 | ||
| 94 | ||
| 44 | 95 | #endif /* __MIPS3FE_H__ */ |
| r9922 | r9923 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Universal machine language-based MIPS III/IV emulator. |
| 6 | 6 | |
| 7 | **************************************************************************** | |
| 8 | ||
| 7 | 9 | Copyright Aaron Giles |
| 8 | Released for general non-commercial use under the MAME license | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 10 | All rights reserved. | |
| 10 | 11 | |
| 12 | Redistribution and use in source and binary forms, with or without | |
| 13 | modification, are permitted provided that the following conditions are | |
| 14 | met: | |
| 15 | ||
| 16 | * Redistributions of source code must retain the above copyright | |
| 17 | notice, this list of conditions and the following disclaimer. | |
| 18 | * Redistributions in binary form must reproduce the above copyright | |
| 19 | notice, this list of conditions and the following disclaimer in | |
| 20 | the documentation and/or other materials provided with the | |
| 21 | distribution. | |
| 22 | * Neither the name 'MAME' nor the names of its contributors may be | |
| 23 | used to endorse or promote products derived from this software | |
| 24 | without specific prior written permission. | |
| 25 | ||
| 26 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR | |
| 27 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
| 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| 29 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, | |
| 30 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
| 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| 32 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| 33 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| 34 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| 35 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| 36 | POSSIBILITY OF SUCH DAMAGE. | |
| 37 | ||
| 11 | 38 | **************************************************************************** |
| 12 | 39 | |
| 13 | 40 | Future improvements/changes: |
| r9922 | r9923 | |
| 159 | 186 | /* core state */ |
| 160 | 187 | drccache * cache; /* pointer to the DRC code cache */ |
| 161 | 188 | drcuml_state * drcuml; /* DRC UML generator state */ |
| 162 | | |
| 189 | mip | |
| 163 | 190 | UINT32 drcoptions; /* configurable DRC options */ |
| 164 | 191 | |
| 165 | 192 | /* internal stuff */ |
| r9922 | r9923 | |
| 360 | 387 | |
| 361 | 388 | static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_callback irqcallback) |
| 362 | 389 | { |
| 363 | drcfe_config feconfig = | |
| 364 | { | |
| 365 | COMPILE_BACKWARDS_BYTES, /* code window start offset = startpc - window_start */ | |
| 366 | COMPILE_FORWARDS_BYTES, /* code window end offset = startpc + window_end */ | |
| 367 | COMPILE_MAX_SEQUENCE, /* maximum instructions to include in a sequence */ | |
| 368 | mips3fe_describe /* callback to describe a single instruction */ | |
| 369 | }; | |
| 370 | 390 | mips3_state *mips3; |
| 371 | 391 | drccache *cache; |
| 372 | 392 | drcbe_info beinfo; |
| r9922 | r9923 | |
| 445 | 465 | drcuml_symbol_add(mips3->impstate->drcuml, &mips3->impstate->fpmode, sizeof(mips3->impstate->fpmode), "fpmode"); |
| 446 | 466 | |
| 447 | 467 | /* initialize the front-end helper */ |
| 448 | if (SINGLE_INSTRUCTION_MODE) | |
| 449 | feconfig.max_sequence = 1; | |
| 450 | mips3->impstate->drcfe = drcfe_init(device, &feconfig, mips3); | |
| 468 | mips3->impstate->drcfe = auto_alloc(device->machine, mips3_frontend(*mips3, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE)); | |
| 451 | 469 | |
| 452 | 470 | /* allocate memory for cache-local state and initialize it */ |
| 453 | 471 | memcpy(mips3->impstate->fpmode, fpmode_source, sizeof(fpmode_source)); |
| r9922 | r9923 | |
| 546 | 564 | mips3com_exit(mips3); |
| 547 | 565 | |
| 548 | 566 | /* clean up the DRC */ |
| 549 | | |
| 567 | auto_fre | |
| 550 | 568 | drcuml_free(mips3->impstate->drcuml); |
| 551 | 569 | drccache_free(mips3->impstate->cache); |
| 552 | 570 | } |
| r9922 | r9923 | |
| 745 | 763 | g_profiler.start(PROFILER_DRC_COMPILE); |
| 746 | 764 | |
| 747 | 765 | /* get a description of this sequence */ |
| 748 | desclist = | |
| 766 | desclist = | |
| 749 | 767 | if (LOG_UML || LOG_NATIVE) |
| 750 | 768 | log_opcode_desc(drcuml, desclist, 0); |
| 751 | 769 | |
| r9922 | r9923 | |
| 757 | 775 | block = drcuml_block_begin(drcuml, 4096, &errorbuf); |
| 758 | 776 | |
| 759 | 777 | /* loop until we get through all instruction sequences */ |
| 760 | for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next) | |
| 778 | for (seqhead = desclist; seqhead != NULL; seqhead = seqlast->next()) | |
| 761 | 779 | { |
| 762 | 780 | const opcode_desc *curdesc; |
| 763 | 781 | UINT32 nextpc; |
| r9922 | r9923 | |
| 767 | 785 | UML_COMMENT(block, "-------------------------"); // comment |
| 768 | 786 | |
| 769 | 787 | /* determine the last instruction in this sequence */ |
| 770 | for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next) | |
| 788 | for (seqlast = seqhead; seqlast != NULL; seqlast = seqlast->next()) | |
| 771 | 789 | if (seqlast->flags & OPFLAG_END_SEQUENCE) |
| 772 | 790 | break; |
| 773 | 791 | assert(seqlast != NULL); |
| r9922 | r9923 | |
| 802 | 820 | UML_LABEL(block, seqhead->pc | 0x80000000); // label seqhead->pc | 0x80000000 |
| 803 | 821 | |
| 804 | 822 | /* iterate over instructions in the sequence and compile them */ |
| 805 | for (curdesc = seqhead; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 823 | for (curdesc = seqhead; curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 806 | 824 | generate_sequence_instruction(mips3, block, &compiler, curdesc); |
| 807 | 825 | |
| 808 | 826 | /* if we need to return to the start, do it */ |
| r9922 | r9923 | |
| 820 | 838 | if (seqlast->flags & OPFLAG_CAN_CHANGE_MODES) |
| 821 | 839 | UML_HASHJMP(block, MEM(&mips3->impstate->mode), IMM(nextpc), mips3->impstate->nocode); |
| 822 | 840 | // hashjmp <mode>,nextpc,nocode |
| 823 | else if (seqlast->next == NULL || seqlast->next->pc != nextpc) | |
| 841 | else if (seqlast->next() == NULL || seqlast->next()->pc != nextpc) | |
| 824 | 842 | UML_HASHJMP(block, IMM(mips3->impstate->mode), IMM(nextpc), mips3->impstate->nocode); |
| 825 | 843 | // hashjmp <mode>,nextpc,nocode |
| 826 | 844 | } |
| r9922 | r9923 | |
| 1521 | 1539 | UML_COMMENT(block, "[Validation for %08X]", seqhead->pc); // comment |
| 1522 | 1540 | |
| 1523 | 1541 | /* loose verify or single instruction: just compare and fail */ |
| 1524 | if (!(mips3->impstate->drcoptions & MIPS3DRC_STRICT_VERIFY) || seqhead->next == NULL) | |
| 1542 | if (!(mips3->impstate->drcoptions & MIPS3DRC_STRICT_VERIFY) || seqhead->next() == NULL) | |
| 1525 | 1543 | { |
| 1526 | 1544 | if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1527 | 1545 | { |
| r9922 | r9923 | |
| 1536 | 1554 | else |
| 1537 | 1555 | { |
| 1538 | 1556 | #if 0 |
| 1539 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 1557 | for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 1540 | 1558 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1541 | 1559 | { |
| 1542 | 1560 | void *base = mips3->direct->read_decrypted_ptr(seqhead->physpc); |
| r9922 | r9923 | |
| 1549 | 1567 | void *base = mips3->direct->read_decrypted_ptr(seqhead->physpc); |
| 1550 | 1568 | UML_LOAD(block, IREG(0), base, IMM(0), DWORD); // load i0,base,0,dword |
| 1551 | 1569 | sum += seqhead->opptr.l[0]; |
| 1552 | for (curdesc = seqhead->next; curdesc != seqlast->next; curdesc = curdesc->next) | |
| 1570 | for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) | |
| 1553 | 1571 | if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) |
| 1554 | 1572 | { |
| 1555 | 1573 | base = mips3->direct->read_decrypted_ptr(curdesc->physpc); |
| r9922 | r9923 | |
| 1557 | 1575 | UML_ADD(block, IREG(0), IREG(0), IREG(1)); // add i0,i0,i1 |
| 1558 | 1576 | sum += curdesc->opptr.l[0]; |
| 1559 | 1577 | |
| 1560 | if (curdesc->delay != NULL && (curdesc == seqlast || (curdesc->next != NULL && curdesc->next->physpc != curdesc->delay->physpc))) | |
| 1578 | if (curdesc->delay.first() != NULL && (curdesc == seqlast || (curdesc->next() != NULL && curdesc->next()->physpc != curdesc->delay.first()->physpc))) | |
| 1561 | 1579 | { |
| 1562 | base = mips3->direct->read_decrypted_ptr(curdesc->delay->physpc); | |
| 1580 | base = mips3->direct->read_decrypted_ptr(curdesc->delay.first()->physpc); | |
| 1563 | 1581 | UML_LOAD(block, IREG(1), base, IMM(0), DWORD); // load i1,base,dword |
| 1564 | 1582 | UML_ADD(block, IREG(0), IREG(0), IREG(1)); // add i0,i0,i1 |
| 1565 | sum += curdesc->delay->opptr.l[0]; | |
| 1583 | sum += curdesc->delay.first()->opptr.l[0]; | |
| 1566 | 1584 | } |
| 1567 | 1585 | } |
| 1568 | 1586 | UML_CMP(block, IREG(0), IMM(sum)); // cmp i0,sum |
| r9922 | r9923 | |
| 1710 | 1728 | UML_DMOV(block, R64(linkreg), IMM((INT32)(desc->pc + 8))); // dmov <linkreg>,desc->pc + 8 |
| 1711 | 1729 | |
| 1712 | 1730 | /* compile the delay slot using temporary compiler state */ |
| 1713 | assert(desc->delay != NULL); | |
| 1714 | generate_sequence_instruction(mips3, block, &compiler_temp, desc->delay); // <next instruction> | |
| 1731 | assert(desc->delay.first() != NULL); | |
| 1732 | generate_sequence_instruction(mips3, block, &compiler_temp, desc->delay.first()); // <next instruction> | |
| 1715 | 1733 | |
| 1716 | 1734 | /* update the cycles and jump through the hash table to the target */ |
| 1717 | 1735 | if (desc->targetpc != BRANCH_TARGET_DYNAMIC) |
| r9922 | r9923 | |
| 3648 | 3666 | drcuml_log_printf(drcuml, "\nDescriptor list @ %08X\n", desclist->pc); |
| 3649 | 3667 | |
| 3650 | 3668 | /* output each descriptor */ |
| 3651 | for ( ; desclist != NULL; desclist = desclist->next) | |
| 3669 | for ( ; desclist != NULL; desclist = desclist->next()) | |
| 3652 | 3670 | { |
| 3653 | 3671 | char buffer[100]; |
| 3654 | 3672 | |
| r9922 | r9923 | |
| 3669 | 3687 | drcuml_log_printf(drcuml, "\n"); |
| 3670 | 3688 | |
| 3671 | 3689 | /* if we have a delay slot, output it recursively */ |
| 3672 | if (desclist->delay != NULL) | |
| 3673 | log_opcode_desc(drcuml, desclist->delay, indent + 1); | |
| 3690 | if (desclist->delay.first() != NULL) | |
| 3691 | log_opcode_desc(drcuml, desclist->delay.first(), indent + 1); | |
| 3674 | 3692 | |
| 3675 | 3693 | /* at the end of a sequence add a dividing line */ |
| 3676 | 3694 | if (desclist->flags & OPFLAG_END_SEQUENCE) |
| r9922 | r9923 | |
|---|---|---|
| 1187 | 1187 | if (rd == eR15) |
| 1188 | 1188 | { |
| 1189 | 1189 | R15 = newval + 8; |
| 1190 | // extra cycles for LDR(H,SH,SB) PC (5 total cycles) | |
| 1191 | ARM7_ICOUNT -= 2; | |
| 1190 | 1192 | } |
| 1191 | 1193 | else |
| 1192 | 1194 | { |
| r9922 | r9923 | |
| 1423 | 1425 | UINT32 op2, sc = 0, rd, rn, opcode; |
| 1424 | 1426 | UINT32 by, rdn; |
| 1425 | 1427 | |
| 1428 | // Normal Data Processing : 1S | |
| 1429 | // Data Processing with register specified shift : 1S + 1I | |
| 1430 | // Data Processing with PC written : 2S + 1N | |
| 1431 | // Data Processing with register specified shift and PC written : 2S + 1N + 1I | |
| 1432 | ||
| 1426 | 1433 | opcode = (insn & INSN_OPCODE) >> INSN_OPCODE_SHIFT; |
| 1427 | 1434 | |
| 1428 | 1435 | rd = 0; |
| r9922 | r9923 | |
| 1455 | 1462 | // LD TODO sc will always be 0 if this applies |
| 1456 | 1463 | if (!(insn & INSN_S)) |
| 1457 | 1464 | sc = 0; |
| 1465 | ||
| 1466 | // extra cycle (register specified shift) | |
| 1467 | ARM7_ICOUNT -= 1; | |
| 1458 | 1468 | } |
| 1459 | 1469 | |
| 1460 | 1470 | // LD TODO this comment is wrong |
| r9922 | r9923 | |
| 1553 | 1563 | { |
| 1554 | 1564 | R15 = (R15 & ~0x03FFFFFC) | (rd & 0x03FFFFFC); |
| 1555 | 1565 | } |
| 1566 | // extra cycles (PC written) | |
| 1567 | ARM7_ICOUNT -= 2; | |
| 1556 | 1568 | } |
| 1557 | 1569 | else |
| 1558 | 1570 | { |
| r9922 | r9923 | |
| 1584 | 1596 | SwitchMode( cpustate, temp & 3); |
| 1585 | 1597 | } |
| 1586 | 1598 | |
| 1599 | // extra cycles (PC written) | |
| 1600 | ARM7_ICOUNT -= 2; | |
| 1601 | ||
| 1587 | 1602 | /* IRQ masks may have changed in this instruction */ |
| 1588 | 1603 | // ARM7_CHECKIRQ; |
| 1589 | 1604 | } |
| r9922 | r9923 | |
| 1620 | 1635 | LOG(("%08x: TST class on R15 no s bit set\n", R15)); |
| 1621 | 1636 | #endif |
| 1622 | 1637 | } |
| 1638 | // extra cycles (PC written) | |
| 1639 | ARM7_ICOUNT -= 2; | |
| 1623 | 1640 | } |
| 1641 | ||
| 1642 | // compensate for the -3 at the end | |
| 1643 | ARM7_ICOUNT += 2; | |
| 1624 | 1644 | } |
| 1625 | 1645 | |
| 1626 | 1646 | static void HandleMul(arm_state *cpustate, UINT32 insn) |
| 1627 | 1647 | { |
| 1628 | UINT32 r; | |
| 1648 | UINT32 r, rm, rs; | |
| 1629 | 1649 | |
| 1650 | // MUL takes 1S + mI and MLA 1S + (m+1)I cycles to execute, where S and I are as | |
| 1651 | // defined in 6.2 Cycle Types on page 6-2. | |
| 1652 | // m is the number of 8 bit multiplier array cycles required to complete the | |
| 1653 | // multiply, which is controlled by the value of the multiplier operand | |
| 1654 | // specified by Rs. | |
| 1655 | ||
| 1656 | rm = GET_REGISTER(cpustate, insn & INSN_MUL_RM); | |
| 1657 | rs = GET_REGISTER(cpustate, (insn & INSN_MUL_RS) >> INSN_MUL_RS_SHIFT); | |
| 1658 | ||
| 1630 | 1659 | /* Do the basic multiply of Rm and Rs */ |
| 1631 | r = GET_REGISTER(cpustate, insn & INSN_MUL_RM) * | |
| 1632 | GET_REGISTER(cpustate, (insn & INSN_MUL_RS) >> INSN_MUL_RS_SHIFT); | |
| 1660 | r = rm * rs; | |
| 1633 | 1661 | |
| 1634 | 1662 | #if ARM7_DEBUG_CORE |
| 1635 | 1663 | if ((insn & INSN_MUL_RM) == 0xf || |
| r9922 | r9923 | |
| 1642 | 1670 | if (insn & INSN_MUL_A) |
| 1643 | 1671 | { |
| 1644 | 1672 | r += GET_REGISTER(cpustate, (insn & INSN_MUL_RN) >> INSN_MUL_RN_SHIFT); |
| 1673 | // extra cycle for MLA | |
| 1674 | ARM7_ICOUNT -= 1; | |
| 1645 | 1675 | } |
| 1646 | 1676 | |
| 1647 | 1677 | /* Write the result */ |
| r9922 | r9923 | |
| 1652 | 1682 | { |
| 1653 | 1683 | SET_CPSR((GET_CPSR & ~(N_MASK | Z_MASK)) | HandleALUNZFlags(r)); |
| 1654 | 1684 | } |
| 1685 | ||
| 1686 | if (rs & SIGN_BIT) rs = -rs; | |
| 1687 | if (rs < 0x00000100) ARM7_ICOUNT -= 1 + 1; | |
| 1688 | else if (rs < 0x00010000) ARM7_ICOUNT -= 1 + 2; | |
| 1689 | else if (rs < 0x01000000) ARM7_ICOUNT -= 1 + 3; | |
| 1690 | else ARM7_ICOUNT -= 1 + 4; | |
| 1691 | ||
| 1692 | ARM7_ICOUNT += 3; | |
| 1655 | 1693 | } |
| 1656 | 1694 | |
| 1657 | 1695 | // todo: add proper cycle counts |
| r9922 | r9923 | |
| 1661 | 1699 | UINT32 rhi, rlo; |
| 1662 | 1700 | INT64 res = 0; |
| 1663 | 1701 | |
| 1702 | // MULL takes 1S + (m+1)I and MLAL 1S + (m+2)I cycles to execute, where m is the | |
| 1703 | // number of 8 bit multiplier array cycles required to complete the multiply, which is | |
| 1704 | // controlled by the value of the multiplier operand specified by Rs. | |
| 1705 | ||
| 1664 | 1706 | rm = (INT32)GET_REGISTER(cpustate, insn & 0xf); |
| 1665 | 1707 | rs = (INT32)GET_REGISTER(cpustate, ((insn >> 8) & 0xf)); |
| 1666 | 1708 | rhi = (insn >> 16) & 0xf; |
| r9922 | r9923 | |
| 1679 | 1721 | { |
| 1680 | 1722 | INT64 acum = (INT64)((((INT64)(GET_REGISTER(cpustate, rhi))) << 32) | GET_REGISTER(cpustate, rlo)); |
| 1681 | 1723 | res += acum; |
| 1724 | // extra cycle for MLA | |
| 1725 | ARM7_ICOUNT -= 1; | |
| 1682 | 1726 | } |
| 1683 | 1727 | |
| 1684 | 1728 | /* Write the result (upper dword goes to RHi, lower to RLo) */ |
| r9922 | r9923 | |
| 1690 | 1734 | { |
| 1691 | 1735 | SET_CPSR((GET_CPSR & ~(N_MASK | Z_MASK)) | HandleLongALUNZFlags(res)); |
| 1692 | 1736 | } |
| 1737 | ||
| 1738 | if (rs < 0) rs = -rs; | |
| 1739 | if (rs < 0x00000100) ARM7_ICOUNT -= 1 + 1 + 1; | |
| 1740 | else if (rs < 0x00010000) ARM7_ICOUNT -= 1 + 2 + 1; | |
| 1741 | else if (rs < 0x01000000) ARM7_ICOUNT -= 1 + 3 + 1; | |
| 1742 | else ARM7_ICOUNT -= 1 + 4 + 1; | |
| 1743 | ||
| 1744 | ARM7_ICOUNT += 3; | |
| 1693 | 1745 | } |
| 1694 | 1746 | |
| 1695 | 1747 | // todo: add proper cycle counts |
| r9922 | r9923 | |
| 1699 | 1751 | UINT32 rhi, rlo; |
| 1700 | 1752 | UINT64 res = 0; |
| 1701 | 1753 | |
| 1754 | // MULL takes 1S + (m+1)I and MLAL 1S + (m+2)I cycles to execute, where m is the | |
| 1755 | // number of 8 bit multiplier array cycles required to complete the multiply, which is | |
| 1756 | // controlled by the value of the multiplier operand specified by Rs. | |
| 1757 | ||
| 1702 | 1758 | rm = (INT32)GET_REGISTER(cpustate, insn & 0xf); |
| 1703 | 1759 | rs = (INT32)GET_REGISTER(cpustate, ((insn >> 8) & 0xf)); |
| 1704 | 1760 | rhi = (insn >> 16) & 0xf; |
| r9922 | r9923 | |
| 1717 | 1773 | { |
| 1718 | 1774 | UINT64 acum = (UINT64)((((UINT64)(GET_REGISTER(cpustate, rhi))) << 32) | GET_REGISTER(cpustate, rlo)); |
| 1719 | 1775 | res += acum; |
| 1776 | // extra cycle for MLA | |
| 1777 | ARM7_ICOUNT -= 1; | |
| 1720 | 1778 | } |
| 1721 | 1779 | |
| 1722 | 1780 | /* Write the result (upper dword goes to RHi, lower to RLo) */ |
| r9922 | r9923 | |
| 1728 | 1786 | { |
| 1729 | 1787 | SET_CPSR((GET_CPSR & ~(N_MASK | Z_MASK)) | HandleLongALUNZFlags(res)); |
| 1730 | 1788 | } |
| 1789 | ||
| 1790 | if (rs < 0x00000100) ARM7_ICOUNT -= 1 + 1 + 1; | |
| 1791 | else if (rs < 0x00010000) ARM7_ICOUNT -= 1 + 2 + 1; | |
| 1792 | else if (rs < 0x01000000) ARM7_ICOUNT -= 1 + 3 + 1; | |
| 1793 | else ARM7_ICOUNT -= 1 + 4 + 1; | |
| 1794 | ||
| 1795 | ARM7_ICOUNT += 3; | |
| 1731 | 1796 | } |
| 1732 | 1797 | |
| 1733 | 1798 | static void HandleMemBlock(arm_state *cpustate, UINT32 insn) |
| r9922 | r9923 | |
| 1741 | 1806 | LOG(("%08x: Unaligned Mem Transfer @ %08x\n", R15, rbp)); |
| 1742 | 1807 | #endif |
| 1743 | 1808 | |
| 1809 | // Normal LDM instructions take nS + 1N + 1I and LDM PC takes (n+1)S + 2N + 1I | |
| 1810 | // incremental cycles, where S,N and I are as defined in 6.2 Cycle Types on page 6-2. | |
| 1811 | // STM instructions take (n-1)S + 2N incremental cycles to execute, where n is the | |
| 1812 | // number of words transferred. | |
| 1813 | ||
| 1744 | 1814 | if (insn & INSN_BDT_L) |
| 1745 | 1815 | { |
| 1746 | 1816 | /* Loading */ |
| r9922 | r9923 | |
| 1795 | 1865 | SwitchMode(cpustate, temp & 3); |
| 1796 | 1866 | } |
| 1797 | 1867 | } |
| 1868 | // LDM PC - takes 2 extra cycles | |
| 1869 | ARM7_ICOUNT -= 2; | |
| 1798 | 1870 | } |
| 1799 | ||
| 1800 | // note: the next statement should be located within the previous "if" statement (right?), however, doing so will break "39in1" | |
| 1801 | ||
| 1802 | // LDM PC - takes 1 extra cycle | |
| 1803 | ARM7_ICOUNT -= 1; | |
| 1804 | 1871 | } |
| 1805 | 1872 | else |
| 1806 | 1873 | { |
| r9922 | r9923 | |
| 1851 | 1918 | SwitchMode(cpustate, temp & 3); |
| 1852 | 1919 | } |
| 1853 | 1920 | } |
| 1854 | // LDM PC - takes 1 extra cycle | |
| 1855 | ARM7_ICOUNT -= 1; | |
| 1921 | // LDM PC - takes 2 extra cycles | |
| 1922 | ARM7_ICOUNT -= 2; | |
| 1856 | 1923 | } |
| 1857 | ||
| 1858 | // LDM (NO PC) takes nS + 1n + 1I cycles (n = # of register transfers) | |
| 1859 | ARM7_ICOUNT -= result + 1 + 1; | |
| 1860 | 1924 | } |
| 1925 | // LDM (NO PC) takes (n)S + 1N + 1I cycles (n = # of register transfers) | |
| 1926 | ARM7_ICOUNT -= result + 1 + 1; | |
| 1861 | 1927 | } /* Loading */ |
| 1862 | 1928 | else |
| 1863 | 1929 | { |
| r9922 | r9923 | |
| 1929 | 1995 | if (insn & (1 << eR15)) |
| 1930 | 1996 | R15 -= 12; |
| 1931 | 1997 | |
| 1932 | // STM takes (n+1)S+2N+1I cycles (n = # of register transfers) | |
| 1933 | ARM7_ICOUNT -= (result + 1) + 2 + 1; | |
| 1998 | // STM takes (n-1)S + 2N cycles (n = # of register transfers) | |
| 1999 | ARM7_ICOUNT -= (result - 1) + 2; | |
| 1934 | 2000 | } |
| 1935 | 2001 | |
| 1936 | 2002 | // We will specify the cycle count for each case, so remove the -3 that occurs at the end |
| r9922 | r9923 | |
|---|---|---|
| 159 | 159 | { "cheat;c", "0", OPTION_BOOLEAN, "enable cheat subsystem" }, |
| 160 | 160 | { "skip_gameinfo", "0", OPTION_BOOLEAN, "skip displaying the information screen at startup" }, |
| 161 | 161 | { "uifont", "default", 0, "specify a font to use" }, |
| 162 | { "ramsize;ram", NULL, 0, "size of RAM (if supported by driver)" }, | |
| 163 | #ifdef MESS | |
| 164 | { "newui;nu", "0", OPTION_BOOLEAN, "use the new MESS UI" }, | |
| 165 | #endif | |
| 162 | 166 | |
| 163 | 167 | /* image device options */ |
| 164 | 168 | { OPTION_ADDED_DEVICE_OPTIONS, "0", OPTION_BOOLEAN | OPTION_INTERNAL, "image device-specific options have been added" }, |
| r9922 | r9923 | |
| 306 | 310 | |
| 307 | 311 | /* we need to dynamically add options when the device name is parsed */ |
| 308 | 312 | options_set_option_callback(opts, OPTION_GAMENAME, image_driver_name_callback); |
| 309 | ||
| 310 | #ifdef MESS | |
| 311 | mess_options_init(opts); | |
| 312 | #endif /* MESS */ | |
| 313 | ||
| 314 | 313 | return opts; |
| 315 | 314 | } |
| r9922 | r9923 | |
|---|---|---|
| 153 | 153 | #define OPTION_CHEAT "cheat" |
| 154 | 154 | #define OPTION_SKIP_GAMEINFO "skip_gameinfo" |
| 155 | 155 | #define OPTION_UI_FONT "uifont" |
| 156 | #define OPTION_RAMSIZE "ramsize" | |
| 156 | 157 | |
| 157 | 158 | /* image device options */ |
| 158 | 159 | #define OPTION_ADDED_DEVICE_OPTIONS "added_device_options" |
| r9922 | r9923 | |
|---|---|---|
| 1725 | 1725 | |
| 1726 | 1726 | /* add if we match the group and we have a valid name */ |
| 1727 | 1727 | if (name != NULL && input_condition_true(machine, &field->condition) && |
| 1728 | #ifdef MESS | |
| 1729 | 1728 | (field->category == 0 || input_category_active(machine, field->category)) && |
| 1730 | #endif /* MESS */ | |
| 1731 | 1729 | ((field->type == IPT_OTHER && field->name != NULL) || input_type_group(machine, field->type, field->player) != IPG_INVALID)) |
| 1732 | 1730 | { |
| 1733 | 1731 | input_seq_type seqtype; |
| r9922 | r9923 | |
|---|---|---|
| 4706 | 4706 | int input_machine_has_keyboard(running_machine *machine) |
| 4707 | 4707 | { |
| 4708 | 4708 | int have_keyboard = FALSE; |
| 4709 | #ifdef MESS | |
| 4710 | 4709 | const input_field_config *field; |
| 4711 | 4710 | const input_port_config *port; |
| 4712 | 4711 | for (port = machine->m_portlist.first(); port != NULL; port = port->next()) |
| r9922 | r9923 | |
| 4720 | 4719 | } |
| 4721 | 4720 | } |
| 4722 | 4721 | } |
| 4723 | #endif | |
| 4724 | ||
| 4725 | 4722 | return have_keyboard; |
| 4726 | 4723 | } |
| 4727 | 4724 |
| r9922 | r9923 | |
|---|---|---|
| 39 | 39 | static void task_check(discrete_task *task, discrete_task *dest_task) |
| 40 | 40 | { |
| 41 | 41 | int inputnum; |
| 42 | const linked_list_entry *node_entry; | |
| 43 | const linked_list_entry *step_entry; | |
| 44 | 42 | |
| 45 | 43 | /* Determine, which nodes in the task are referenced by nodes in dest_task |
| 46 | 44 | * and add them to the list of nodes to be buffered for further processing |
| 47 | 45 | */ |
| 48 | for | |
| 46 | for_each(node_de | |
| 49 | 47 | { |
| 50 | | |
| 48 | | |
| 51 | 49 | |
| 52 | for | |
| 50 | for | |
| 53 | 51 | { |
| 54 | node_description *dest_node = | |
| 52 | node_description *dest_node = | |
| 55 | 53 | |
| 56 | 54 | /* loop over all active inputs */ |
| 57 | for (inputnum = 0; inputnum < dest_node->active_inputs; inputnum++) | |
| 55 | for (inputnum = 0; inputnum < dest_node->active_inputs(); inputnum++) | |
| 58 | 56 | { |
| 59 | int inputnode = dest_node-> | |
| 57 | int inputnode = dest_node-> | |
| 60 | 58 | if IS_VALUE_A_NODE(inputnode) |
| 61 | 59 | { |
| 62 | if (NODE_DEFAULT_NODE(task_node->block | |
| 60 | if (NODE_DEFAULT_NODE(task_node->block_ | |
| 63 | 61 | { |
| 64 | 62 | discrete_source_node *source; |
| 65 | 63 | int i, found = -1; |
| 66 | 64 | |
| 67 | 65 | for (i = 0; i < task->numbuffered; i++) |
| 68 | if (task->nodes[i]->block | |
| 66 | if (task->nodes[i]->block_ | |
| 69 | 67 | { |
| 70 | 68 | found = i; |
| 71 | 69 | break; |
| r9922 | r9923 | |
| 83 | 81 | i = task->numbuffered; |
| 84 | 82 | task->numbuffered++; |
| 85 | 83 | } |
| 86 | discrete_log(task_node->info, "dso_task_start - buffering %d(%d) in task %p group %d referenced by %d group %d", NODE_INDEX(inputnode), NODE_CHILD_NODE_NUM(inputnode), task, task->task_group, | |
| 84 | discrete_log(task_node->info, "dso_task_start - buffering %d(%d) in task %p group %d referenced by %d group %d", NODE_INDEX(inputnode), NODE_CHILD_NODE_NUM(inputnode), task, task->task_group, | |
| 87 | 85 | |
| 88 | 86 | /* register into source list */ |
| 89 | 87 | source = auto_alloc(dest_node->info->device->machine, discrete_source_node); |
| 90 | linked_list_add(dest_node->info, | |
| 91 | &dest_task->source_list, | |
| 92 | source); | |
| 88 | dest_task->source_list.add_tail(source); | |
| 93 | 89 | source->task = task; |
| 94 | 90 | source->output_node = i; |
| 95 | 91 | |
| r9922 | r9923 | |
| 109 | 105 | { |
| 110 | 106 | DISCRETE_DECLARE_TASK |
| 111 | 107 | |
| 112 | const linked_list_entry *task_entry; | |
| 113 | ||
| 114 | 108 | task->task_group = (int) DISCRETE_INPUT(0); |
| 115 | 109 | |
| 116 | 110 | if (task->task_group < 0 || task->task_group >= DISCRETE_MAX_TASK_GROUPS) |
| 117 | 111 | fatalerror("discrete_dso_task: illegal task_group %d", task->task_group); |
| 118 | 112 | |
| 119 | for | |
| 113 | for_each(discrete_task *, dest_task, & | |
| 120 | 114 | { |
| 121 | discrete_task *dest_task = (discrete_task *) task_entry->ptr; | |
| 122 | ||
| 123 | if (task->task_group > dest_task->task_group) | |
| 124 | task_check(dest_task, task); | |
| 115 | if (task->task_group > dest_task.item()->task_group) | |
| 116 | task_check(dest_task.item(), task); | |
| 125 | 117 | } |
| 126 | 118 | |
| 127 | 119 | } |
| r9922 | r9923 | |
| 140 | 132 | { |
| 141 | 133 | DISCRETE_DECLARE_TASK |
| 142 | 134 | |
| 143 | const linked_list_entry *entry; | |
| 144 | ||
| 145 | 135 | /* update source node buffer */ |
| 146 | for | |
| 136 | for_each(discre | |
| 147 | 137 | { |
| 148 | discrete_source_node *sn = (discrete_source_node *) entry->ptr; | |
| 149 | sn->buffer = *sn->ptr++; | |
| 138 | sn.item()->buffer = *sn.item()->ptr++; | |
| 150 | 139 | } |
| 151 | 140 | } |
| 152 | 141 | |
| r9922 | r9923 | |
| 179 | 168 | |
| 180 | 169 | int log_num, node_num; |
| 181 | 170 | |
| 182 | log_num = node_module_index(node); | |
| 171 | log_num = node->same_module_index(node->info->node_list); | |
| 183 | 172 | context->sample_num = 0; |
| 184 | 173 | |
| 185 | 174 | sprintf(context->name, "discrete_%s_%d.csv", node->info->device->tag(), log_num); |
| r9922 | r9923 | |
| 190 | 179 | fprintf(context->csv_file, "\"Sample Rate\", %d\n", node->info->sample_rate); |
| 191 | 180 | fprintf(context->csv_file, "\n"); |
| 192 | 181 | fprintf(context->csv_file, "\"Sample\""); |
| 193 | for (node_num = 0; node_num < node->active_inputs; node_num++) | |
| 182 | for (node_num = 0; node_num < node->active_inputs(); node_num++) | |
| 194 | 183 | { |
| 195 | fprintf(context->csv_file, ", \"NODE_%2d\"", NODE_INDEX(node-> | |
| 184 | fprintf(context->csv_file, ", \"NODE_%2d\"", NODE_INDEX(node-> | |
| 196 | 185 | } |
| 197 | 186 | fprintf(context->csv_file, "\n"); |
| 198 | 187 | } |
| r9922 | r9923 | |
| 214 | 203 | |
| 215 | 204 | /* Dump any csv logs */ |
| 216 | 205 | fprintf(context->csv_file, "%" I64FMT "d", ++context->sample_num); |
| 217 | for (nodenum = 0; nodenum < node->active_inputs; nodenum++) | |
| 206 | for (nodenum = 0; nodenum < node->active_inputs(); nodenum++) | |
| 218 | 207 | { |
| 219 | 208 | fprintf(context->csv_file, ", %f", *node->input[nodenum]); |
| 220 | 209 | } |
| r9922 | r9923 | |
| 227 | 216 | |
| 228 | 217 | int log_num; |
| 229 | 218 | |
| 230 | log_num = node_module_index(node); | |
| 219 | log_num = node->same_module_index(node->info->node_list); | |
| 231 | 220 | sprintf(context->name, "discrete_%s_%d.wav", node->info->device->tag(), log_num); |
| 232 | context->wavfile = wav_open(context->name, node->info->sample_rate, node->active_inputs/2); | |
| 221 | context->wavfile = wav_open(context->name, node->info->sample_rate, node->active_inputs()/2); | |
| 233 | 222 | } |
| 234 | 223 | |
| 235 | 224 | DISCRETE_STOP( dso_wavlog ) |
| r9922 | r9923 | |
| 253 | 242 | val = DISCRETE_INPUT(0) * DISCRETE_INPUT(1); |
| 254 | 243 | val = (val < -32768) ? -32768 : (val > 32767) ? 32767 : val; |
| 255 | 244 | wave_data_l = (INT16)val; |
| 256 | if (node->active_inputs == 2) | |
| 245 | if (node->active_inputs() == 2) | |
| 257 | 246 | { |
| 258 | 247 | /* DISCRETE_WAVLOG1 */ |
| 259 | 248 | wav_add_data_16(context->wavfile, &wave_data_l, 1); |
| r9922 | r9923 | |
|---|---|---|
| 44 | 44 | sound_stream *buffer_stream; |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | #if 0 | |
| 47 | 48 | INLINE discrete_info *get_safe_token(device_t *device) |
| 48 | 49 | { |
| 49 | 50 | assert(device != NULL); |
| 50 | 51 | assert(device->type() == DISCRETE); |
| 51 | 52 | return (discrete_info *)downcast<legacy_device_base *>(device)->token(); |
| 52 | 53 | } |
| 54 | #endif | |
| 53 | 55 | |
| 54 | 56 | READ8_DEVICE_HANDLER(discrete_sound_r) |
| 55 | 57 | { |
| 56 | discrete_info *info = get_safe_token(device); | |
| 57 | node_description *node = discrete_find_node(info, offset); | |
| 58 | ||
| 59 | UINT8 data = 0; | |
| 60 | ||
| 61 | /* Read the node input value if allowed */ | |
| 62 | if (node) | |
| 63 | { | |
| 64 | /* Bring the system up to now */ | |
| 65 | stream_update(info->discrete_stream); | |
| 66 | ||
| 67 | data = (UINT8) node->output[NODE_CHILD_NODE_NUM(offset)]; | |
| 68 | } | |
| 69 | else | |
| 70 | fatalerror("discrete_sound_r read from non-existent NODE_%02d\n", offset-NODE_00); | |
| 71 | ||
| 72 | return data; | |
| 58 | discrete_device *disc_device = downcast<discrete_device *>(device); | |
| 59 | return disc_device->read( *disc_device->machine->firstcpu->space(), offset, 0xff); | |
| 73 | 60 | } |
| 74 | 61 | |
| 75 | 62 | |
| 76 | 63 | WRITE8_DEVICE_HANDLER(discrete_sound_w) |
| 77 | 64 | { |
| 78 | discrete_info *info = get_safe_token(device); | |
| 79 | node_description *node = discrete_find_node(info, offset); | |
| 80 | ||
| 81 | /* Update the node input value if it's a proper input node */ | |
| 82 | if (node) | |
| 83 | { | |
| 84 | struct dss_input_context *context = (struct dss_input_context *)node->context; | |
| 85 | UINT8 new_data = 0; | |
| 86 | ||
| 87 | switch (node->module->type) | |
| 88 | { | |
| 89 | case DSS_INPUT_DATA: | |
| 90 | case DSS_INPUT_BUFFER: | |
| 91 | new_data = data; | |
| 92 | break; | |
| 93 | case DSS_INPUT_LOGIC: | |
| 94 | case DSS_INPUT_PULSE: | |
| 95 | new_data = data ? 1 : 0; | |
| 96 | break; | |
| 97 | case DSS_INPUT_NOT: | |
| 98 | new_data = data ? 0 : 1; | |
| 99 | break; | |
| 100 | } | |
| 101 | ||
| 102 | if (context->data != new_data) | |
| 103 | { | |
| 104 | if (context->is_buffered) | |
| 105 | { | |
| 106 | /* Bring the system up to now */ | |
| 107 | stream_update(context->buffer_stream); | |
| 108 | ||
| 109 | context->data = new_data; | |
| 110 | } | |
| 111 | else | |
| 112 | { | |
| 113 | /* Bring the system up to now */ | |
| 114 | stream_update(info->discrete_stream); | |
| 115 | ||
| 116 | context->data = new_data; | |
| 117 | ||
| 118 | /* Update the node output here so we don't have to do it each step */ | |
| 119 | node->output[0] = new_data * context->gain + context->offset; | |
| 120 | } | |
| 121 | } | |
| 122 | } | |
| 123 | else | |
| 124 | { | |
| 125 | discrete_log(info, "discrete_sound_w write to non-existent NODE_%02d\n", offset-NODE_00); | |
| 126 | } | |
| 65 | discrete_device *disc_device = downcast<discrete_device *>(device); | |
| 66 | disc_device->write(*disc_device->machine->firstcpu->space(), offset, data, 0xff); | |
| 127 | 67 | } |
| 128 | 68 | |
| 129 | 69 | /************************************************************************ |
| r9922 | r9923 | |
| 172 | 112 | |
| 173 | 113 | double min, max; |
| 174 | 114 | |
| 175 | context->port = node->info->device->machine->m_portlist.find((const char *)node->custom); | |
| 115 | context->port = node->info->device->machine->m_portlist.find((const char *)node->custom_data()); | |
| 176 | 116 | if (context->port == NULL) |
| 177 | fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag", | |
| 117 | fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag", | |
| 178 | 118 | |
| 179 | 119 | context->lastpval = 0x7fffffff; |
| 180 | 120 | context->pmin = DSS_ADJUSTMENT__PMIN; |
| r9922 | r9923 | |
| 302 | 242 | { |
| 303 | 243 | DISCRETE_DECLARE_CONTEXT(dss_input) |
| 304 | 244 | |
| 305 | assert(DSS_INPUT_STREAM__STREAM < | |
| 245 | //assert(DSS_INPUT_STREAM__STREAM < | |
| 306 | 246 | |
| 307 | 247 | context->is_stream = TRUE; |
| 308 | 248 | /* Stream out number is set during start */ |
| r9922 | r9923 | |
| 312 | 252 | context->ptr = NULL; |
| 313 | 253 | //context->data = 0; |
| 314 | 254 | |
| 315 | if (node->block | |
| 255 | if (node->block_ | |
| 316 | 256 | { |
| 317 | 257 | context->is_buffered = TRUE; |
| 318 | 258 | context->buffer_stream = stream_create(node->info->device, 0, 1, node->info->sample_rate, (void *) node, buffer_stream_update); |
| r9922 | r9923 | |
|---|---|---|
| 472 | 472 | |
| 473 | 473 | int addr; |
| 474 | 474 | |
| 475 | context->size = node->active_inputs - DST_DIODE_MIX_INP_OFFSET; | |
| 475 | context->size = node->active_inputs() - DST_DIODE_MIX_INP_OFFSET; | |
| 476 | 476 | assert(context->size <= 8); |
| 477 | 477 | |
| 478 | 478 | for (addr = 0; addr < context->size; addr++) |
| r9922 | r9923 | |
| 512 | 512 | if(DST_DIVIDE__DIV == 0) |
| 513 | 513 | { |
| 514 | 514 | node->output[0 ]= DBL_MAX; /* Max out but don't break */ |
| 515 | discrete_log(node->info, "dst_divider_step() - Divide by Zero attempted in NODE_%02d.\n", | |
| 515 | discrete_log(node->info, "dst_divider_step() - Divide by Zero attempted in NODE_%02d.\n", | |
| 516 | 516 | } |
| 517 | 517 | else |
| 518 | 518 | { |
| r9922 | r9923 | |
| 1338 | 1338 | context->c_bit_flag |= 1 << bit; |
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | context->size = node->active_inputs - 1; | |
| 1341 | context->size = node->active_inputs() - 1; | |
| 1342 | 1342 | |
| 1343 | 1343 | /* |
| 1344 | 1344 | * THERE IS NO ERROR CHECKING!!!!!!!!! |
| r9922 | r9923 | |
| 1447 | 1447 | else |
| 1448 | 1448 | { |
| 1449 | 1449 | /* Bad address. We will leave the output alone. */ |
| 1450 | discrete_log(node->info, "NODE_%02d - Address = %d. Out of bounds\n", | |
| 1450 | discrete_log(node->info, "NODE_%02d - Address = %d. Out of bounds\n", | |
| 1451 | 1451 | } |
| 1452 | 1452 | } |
| 1453 | 1453 | |
| r9922 | r9923 | |
| 1455 | 1455 | { |
| 1456 | 1456 | DISCRETE_DECLARE_CONTEXT(dst_size) |
| 1457 | 1457 | |
| 1458 | context->size = node->active_inputs - 1; | |
| 1458 | context->size = node->active_inputs() - 1; | |
| 1459 | 1459 | |
| 1460 | 1460 | DISCRETE_STEP_CALL(dst_multiplex); |
| 1461 | 1461 | } |
| r9922 | r9923 | |
| 1751 | 1751 | double number1,top; |
| 1752 | 1752 | int trans_stack_ptr = 0; |
| 1753 | 1753 | |
| 1754 | const char *fPTR = (const char *)node->custom; | |
| 1754 | const char *fPTR = (const char *)node->custom_data(); | |
| 1755 | 1755 | |
| 1756 | 1756 | top = HUGE_VAL; |
| 1757 | 1757 | |
| r9922 | r9923 | |
| 1832 | 1832 | top = (int)number1 ^ (int)top; |
| 1833 | 1833 | break; |
| 1834 | 1834 | default: |
| 1835 | discrete_log(node->info, "dst_transform_step - Invalid function type/variable passed: %s",(const char *)node->custom); | |
| 1835 | discrete_log(node->info, "dst_transform_step - Invalid function type/variable passed: %s",(const char *)node->custom_data()); | |
| 1836 | 1836 | /* that is enough to fatalerror */ |
| 1837 | fatalerror("dst_transform_step - Invalid function type/variable passed: %s", (const char *)node->custom); | |
| 1837 | fatalerror("dst_transform_step - Invalid function type/variable passed: %s", (const char *)node->custom_data()); | |
| 1838 | 1838 | break; |
| 1839 | 1839 | } |
| 1840 | 1840 | } |
| r9922 | r9923 | |
|---|---|---|
| 82 | 82 | *************************************/ |
| 83 | 83 | |
| 84 | 84 | static void init_nodes(discrete_info *info, const linked_list_entry *block_list, device_t *device); |
| 85 | static void find_input_nodes(const discrete_info *info); | |
| 86 | 85 | static node_description *discrete_find_node(const discrete_info *info, int node); |
| 87 | static DEVICE_RESET( discrete ); | |
| 88 | static STREAM_UPDATE( discrete_stream_update ); | |
| 86 | //static DEVICE_RESET( discrete ); | |
| 87 | //static STREAM_UPDATE( discrete_stream_update ); | |
| 89 | 88 | static STREAM_UPDATE( buffer_stream_update ); |
| 90 | 89 | |
| 91 | 90 | static int profiling = 0; |
| r9922 | r9923 | |
| 120 | 119 | * |
| 121 | 120 | *************************************/ |
| 122 | 121 | |
| 123 | INLINE int node_module_index(const node_description *node) | |
| 124 | { | |
| 125 | linked_list_entry *entry; | |
| 126 | int index = 0; | |
| 127 | ||
| 128 | for (entry = node->info->node_list; entry != NULL; entry = entry->next) | |
| 129 | { | |
| 130 | node_description *n = (node_description *) entry->ptr; | |
| 131 | ||
| 132 | if (n == node) | |
| 133 | return index; | |
| 134 | if (n->module->type == node->module->type) | |
| 135 | index++; | |
| 136 | } | |
| 137 | return -1; | |
| 138 | } | |
| 139 | ||
| 140 | 122 | INLINE void linked_list_tail_add(const discrete_info *info, linked_list_entry ***list_tail_ptr, const void *ptr) |
| 141 | 123 | { |
| 142 | 124 | **list_tail_ptr = auto_alloc(info->device->machine, linked_list_entry); |
| r9922 | r9923 | |
| 318 | 300 | { DSS_NULL ,"DSS_NULL" , 0 ,0 ,NULL ,NULL ,NULL ,NULL } |
| 319 | 301 | }; |
| 320 | 302 | |
| 321 | INLINE void step_nodes_in_list( | |
| 303 | INLINE void step_nodes_in_list( | |
| 322 | 304 | { |
| 323 | const linked_list_entry *entry; | |
| 324 | 305 | |
| 325 | 306 | if (EXPECTED(!profiling)) |
| 326 | 307 | { |
| 327 | for | |
| 308 | for_ | |
| 328 | 309 | { |
| 329 | node_description *node = (node_description *) entry->ptr; | |
| 330 | ||
| 331 | 310 | /* Now step the node */ |
| 332 | (*n | |
| 311 | (*entry.item()->step)(entry.item()); | |
| 333 | 312 | } |
| 334 | 313 | } |
| 335 | 314 | else |
| 336 | 315 | { |
| 337 | 316 | osd_ticks_t last = get_profile_ticks(); |
| 338 | 317 | |
| 339 | for | |
| 318 | for_ | |
| 340 | 319 | { |
| 341 | node_description *node = | |
| 320 | node_description *node = | |
| 342 | 321 | |
| 343 | 322 | node->run_time -= last; |
| 344 | 323 | (*node->step)(node); |
| r9922 | r9923 | |
| 476 | 455 | * Master discrete system start |
| 477 | 456 | * |
| 478 | 457 | *************************************/ |
| 479 | ||
| 458 | #if 0 | |
| 480 | 459 | static DEVICE_START( discrete ) |
| 481 | 460 | { |
| 482 | 461 | linked_list_entry **intf; |
| 483 | const linked_list_entry *entry; | |
| 484 | 462 | const discrete_sound_block *intf_start = (discrete_sound_block *)device->baseconfig().static_config(); |
| 485 | 463 | discrete_info *info = get_safe_token(device); |
| 486 | 464 | char name[32]; |
| r9922 | r9923 | |
| 516 | 494 | discrete_sanity_check(info); |
| 517 | 495 | |
| 518 | 496 | /* Start with empty lists */ |
| 519 | info->node_list = NULL; | |
| 520 | info->output_list = NULL; | |
| 521 | info->input_list = NULL; | |
| 497 | info->node_list.reset(); | |
| 498 | info->output_list.reset(); | |
| 499 | info->input_list.reset(); | |
| 522 | 500 | |
| 523 | 501 | /* allocate memory to hold pointers to nodes by index */ |
| 524 | 502 | info->indexed_node = auto_alloc_array_clear(device->machine, node_description *, DISCRETE_MAX_NODES); |
| r9922 | r9923 | |
| 527 | 505 | init_nodes(info, info->block_list, device); |
| 528 | 506 | |
| 529 | 507 | /* now go back and find pointers to all input nodes */ |
| 530 | find_input_nodes(info); | |
| 508 | for_each(node_description *, node, &info->node_list) | |
| 509 | { | |
| 510 | node.item()->find_input_nodes(); | |
| 511 | } | |
| 531 | 512 | |
| 532 | 513 | /* initialize the stream(s) */ |
| 533 | info->discrete_stream = stream_create(device, | |
| 514 | info->discrete_stream = stream_create(device, | |
| 534 | 515 | |
| 535 | 516 | /* allocate a queue */ |
| 536 | 517 | |
| r9922 | r9923 | |
| 538 | 519 | |
| 539 | 520 | /* Process nodes which have a start func */ |
| 540 | 521 | |
| 541 | for | |
| 522 | for_ | |
| 542 | 523 | { |
| 543 | node_description *node = (node_description *) entry->ptr; | |
| 544 | ||
| 545 | if (node->module->start) | |
| 546 | (*node->module->start)(node); | |
| 524 | if (node.item()->module->start) | |
| 525 | (*node.item()->module->start)(node.item()); | |
| 547 | 526 | } |
| 548 | 527 | |
| 549 | 528 | } |
| 529 | #endif | |
| 550 | 530 | |
| 551 | 531 | |
| 552 | ||
| 553 | 532 | /************************************* |
| 554 | 533 | * |
| 555 | 534 | * Master discrete system stop |
| 556 | 535 | * |
| 557 | 536 | *************************************/ |
| 558 | 537 | |
| 559 | static UINT64 list_run_time(const | |
| 538 | static UINT64 list_run_time(const | |
| 560 | 539 | { |
| 561 | const linked_list_entry *entry; | |
| 562 | 540 | UINT64 total = 0; |
| 563 | 541 | |
| 564 | for | |
| 542 | for_ | |
| 565 | 543 | { |
| 566 | node_description *node = (node_description *) entry->ptr; | |
| 567 | ||
| 568 | total += node->run_time; | |
| 544 | total += node.item()->run_time; | |
| 569 | 545 | } |
| 570 | 546 | return total; |
| 571 | 547 | } |
| r9922 | r9923 | |
| 576 | 552 | UINT64 total; |
| 577 | 553 | UINT64 tresh; |
| 578 | 554 | double tt; |
| 579 | linked_list_entry *entry; | |
| 580 | 555 | |
| 581 | 556 | /* calculate total time */ |
| 582 | 557 | total = list_run_time(info->node_list); |
| 583 | count = | |
| 558 | count = | |
| 584 | 559 | /* print statistics */ |
| 585 | 560 | printf("Total Samples : %16" I64FMT "d\n", info->total_samples); |
| 586 | 561 | tresh = total / count; |
| 587 | 562 | printf("Threshold (mean): %16" I64FMT "d\n", tresh / info->total_samples ); |
| 588 | for | |
| 563 | for_ | |
| 589 | 564 | { |
| 590 | node_description *node = (node_description *) entry->ptr; | |
| 591 | ||
| 592 | if (node->run_time > tresh) | |
| 593 | printf("%3d: %20s %8.2f %10.2f\n", NODE_BLOCKINDEX(node), node->module->name, (float) node->run_time / (float) total * 100.0, ((float) node->run_time) / (float) info->total_samples); | |
| 565 | if (node.item()->run_time > tresh) | |
| 566 | printf("%3d: %20s %8.2f %10.2f\n", node.item()->index(), node.item()->module->name, (float) node.item()->run_time / (float) total * 100.0, ((float) node.item()->run_time) / (float) info->total_samples); | |
| 594 | 567 | } |
| 595 | 568 | |
| 596 | 569 | /* Task information */ |
| 597 | for | |
| 570 | for_each(discre | |
| 598 | 571 | { |
| 599 | discrete_task *task = (discrete_task *) entry->ptr; | |
| 600 | tt = list_run_time(task->list); | |
| 572 | tt = list_run_time(task.item()->list); | |
| 601 | 573 | |
| 602 | printf("Task(%d): %8.2f %15.2f\n", task->task_group, tt / (double) total * 100.0, tt / (double) info->total_samples); | |
| 574 | printf("Task(%d): %8.2f %15.2f\n", task.item()->task_group, tt / (double) total * 100.0, tt / (double) info->total_samples); | |
| 603 | 575 | } |
| 604 | 576 | |
| 605 | 577 | printf("Average samples/stream_update: %8.2f\n", (double) info->total_samples / (double) info->total_stream_updates); |
| 606 | 578 | } |
| 607 | 579 | |
| 580 | #if 0 | |
| 608 | 581 | static DEVICE_STOP( discrete ) |
| 609 | 582 | { |
| 610 | 583 | discrete_info *info = get_safe_token(device); |
| 611 | const linked_list_entry *entry; | |
| 612 | 584 | |
| 613 | 585 | osd_work_queue_free(info->queue); |
| 614 | 586 | |
| r9922 | r9923 | |
| 619 | 591 | |
| 620 | 592 | /* Process nodes which have a stop func */ |
| 621 | 593 | |
| 622 | for | |
| 594 | for_ | |
| 623 | 595 | { |
| 624 | node_description *node = (node_description *) entry->ptr; | |
| 625 | ||
| 626 | if (node->module->stop) | |
| 627 | (*node->module->stop)(node); | |
| 596 | if (node.item()->module->stop) | |
| 597 | (*node.item()->module->stop)(node.item()); | |
| 628 | 598 | } |
| 629 | 599 | |
| 630 | 600 | if (DISCRETE_DEBUGLOG) |
| r9922 | r9923 | |
| 635 | 605 | info->disclogfile = NULL; |
| 636 | 606 | } |
| 637 | 607 | } |
| 608 | #endif | |
| 638 | 609 | |
| 639 | 610 | |
| 640 | ||
| 641 | 611 | /************************************* |
| 642 | 612 | * |
| 643 | 613 | * Master reset of all nodes |
| 644 | 614 | * |
| 645 | 615 | *************************************/ |
| 646 | ||
| 616 | #if 0 | |
| 647 | 617 | static DEVICE_RESET( discrete ) |
| 648 | 618 | { |
| 649 | 619 | const discrete_info *info = get_safe_token(device); |
| 650 | const linked_list_entry *entry; | |
| 651 | 620 | |
| 652 | 621 | /* loop over all nodes */ |
| 653 | for ( | |
| 622 | for_each ( | |
| 654 | 623 | { |
| 655 | node | |
| 624 | node. | |
| 656 | 625 | |
| 657 | node->output[0] = 0; | |
| 658 | ||
| 659 | 626 | /* if the node has a reset function, call it */ |
| 660 | if (node->module->reset) | |
| 661 | (*node->module->reset)(node); | |
| 627 | if (node.item()->module->reset) | |
| 628 | (*node.item()->module->reset)(node.item()); | |
| 662 | 629 | |
| 663 | 630 | /* otherwise, just step it */ |
| 664 | else if (node->step) | |
| 665 | (*node->step)(node); | |
| 631 | else if (node.item()->step) | |
| 632 | (*node.item()->step)(node.item()); | |
| 666 | 633 | } |
| 667 | 634 | } |
| 635 | #endif | |
| 668 | 636 | |
| 669 | 637 | /************************************* |
| 670 | 638 | * |
| r9922 | r9923 | |
| 674 | 642 | |
| 675 | 643 | static void *task_callback(void *param, int threadid) |
| 676 | 644 | { |
| 677 | const linked_list_entry *list = (linked_list_entry *) param; | |
| 678 | const linked_list_entry *entry; | |
| 645 | task_list_t *list = (task_list_t *) param; | |
| 679 | 646 | int samples; |
| 680 | 647 | |
| 681 | 648 | do |
| 682 | 649 | { |
| 683 | for | |
| 650 | for_ | |
| 684 | 651 | { |
| 685 | discrete_task *task = (discrete_task *) entry->ptr; | |
| 686 | INT32 prev_id; | |
| 687 | ||
| 688 | 652 | /* try to lock */ |
| 689 | prev_id = compare_exchange32(&task->threadid, -1, threadid); | |
| 690 | if (prev_id == -1 && task->threadid == threadid) | |
| 653 | if (task.item()->lock_threadid(threadid)) | |
| 691 | 654 | { |
| 692 | l | |
| 655 | sampl | |
| 693 | 656 | |
| 694 | samples = MIN(task->samples, MAX_SAMPLES_PER_TASK_SLICE); | |
| 695 | ||
| 696 | 657 | /* check dependencies */ |
| 697 | for | |
| 658 | for_each(dis | |
| 698 | 659 | { |
| 699 | discrete_source_node *sn = (discrete_source_node *) src_entry->ptr; | |
| 700 | 660 | int avail; |
| 701 | 661 | |
| 702 | avail = sn->task->ptr[sn->output_node] - sn->ptr; | |
| 662 | avail = sn.item()->task->ptr[sn.item()->output_node] - sn.item()->ptr; | |
| 703 | 663 | assert_always(avail >= 0, "task_callback: available samples are negative"); |
| 704 | 664 | if (avail < samples) |
| 705 | 665 | samples = avail; |
| 706 | 666 | } |
| 707 | 667 | |
| 708 | task->samples -= samples; | |
| 709 | assert_always(task->samples >=0, "task_callback: task_samples got negative"); | |
| 668 | task.item()->samples -= samples; | |
| 669 | assert_always(task.item()->samples >=0, "task_callback: task_samples got negative"); | |
| 710 | 670 | while (samples > 0) |
| 711 | 671 | { |
| 712 | 672 | /* step */ |
| 713 | step_nodes_in_list(task->list); | |
| 673 | step_nodes_in_list(task.item()->list); | |
| 714 | 674 | samples--; |
| 715 | 675 | } |
| 716 | if (task->samples == 0) | |
| 676 | if (task.item()->samples == 0) | |
| 717 | 677 | { |
| 678 | /* return and keep the task locked so it is not picked up by other worker threads */ | |
| 718 | 679 | return NULL; |
| 719 | 680 | } |
| 720 | task | |
| 681 | task.it | |
| 721 | 682 | } |
| 722 | 683 | } |
| 723 | 684 | } while (1); |
| r9922 | r9923 | |
| 738 | 699 | *(ptr++) = data; |
| 739 | 700 | } |
| 740 | 701 | |
| 741 | ||
| 702 | #if 0 | |
| 742 | 703 | static STREAM_UPDATE( discrete_stream_update ) |
| 743 | 704 | { |
| 744 | 705 | discrete_info *info = (discrete_info *)param; |
| 745 | const linked_list_entry *entry; | |
| 746 | 706 | int outputnum; |
| 747 | 707 | //, task_group; |
| 748 | 708 | |
| r9922 | r9923 | |
| 750 | 710 | return; |
| 751 | 711 | |
| 752 | 712 | /* Setup any output streams */ |
| 753 | for (entry = info->output_list, outputnum = 0; entry != NULL; entry = entry->next, outputnum++) | |
| 713 | outputnum = 0; | |
| 714 | for_each(node_description *, node, &info->output_list) | |
| 754 | 715 | { |
| 755 | ((node_description *) entry->ptr)->context = (void *) outputs[outputnum]; | |
| 716 | node.item()->context = (void *) outputs[outputnum]; | |
| 717 | outputnum++; | |
| 756 | 718 | } |
| 757 | 719 | |
| 758 | 720 | /* Setup any input streams */ |
| 759 | for | |
| 721 | for_ | |
| 760 | 722 | { |
| 761 | struct dss_input_context *context = (struct dss_input_context *) | |
| 723 | struct dss_input_context *context = (struct dss_input_context *) | |
| 762 | 724 | context->ptr = (stream_sample_t *) inputs[context->stream_in_number]; |
| 763 | 725 | } |
| 764 | 726 | |
| 765 | 727 | /* Setup tasks */ |
| 766 | for | |
| 728 | for_each(discre | |
| 767 | 729 | { |
| 768 | discrete_task *task = (discrete_task *) entry->ptr; | |
| 769 | linked_list_entry *src_entry; | |
| 770 | 730 | int i; |
| 771 | 731 | |
| 772 | task->samples = samples; | |
| 773 | task->threadid = -1; | |
| 732 | task.item()->samples = samples; | |
| 733 | /* unlock the thread */ | |
| 734 | task.item()->unlock(); | |
| 774 | 735 | |
| 775 | 736 | /* set up task buffers */ |
| 776 | for (i = 0; i < task->numbuffered; i++) | |
| 777 | task->ptr[i] = task->node_buf[i]; | |
| 737 | for (i = 0; i < task.item()->numbuffered; i++) | |
| 738 | task.item()->ptr[i] = task.item()->node_buf[i]; | |
| 778 | 739 | |
| 779 | 740 | /* initialize sources */ |
| 780 | for | |
| 741 | for_each(dis | |
| 781 | 742 | { |
| 782 | discrete_source_node *sn = (discrete_source_node *) src_entry->ptr; | |
| 783 | sn->ptr = sn->task->node_buf[sn->output_node]; | |
| 743 | sn.item()->ptr = sn.item()->task->node_buf[sn.item()->output_node]; | |
| 784 | 744 | } |
| 785 | 745 | } |
| 786 | 746 | |
| 787 | for | |
| 747 | for_each(discre | |
| 788 | 748 | { |
| 789 | 749 | /* Fire a work item for each task */ |
| 790 | osd_work_item_queue(info->queue, task_callback, (void *) info->task_list, WORK_ITEM_FLAG_AUTO_RELEASE); | |
| 750 | osd_work_item_queue(info->queue, task_callback, (void *) &info->task_list, WORK_ITEM_FLAG_AUTO_RELEASE); | |
| 791 | 751 | } |
| 792 | 752 | osd_work_queue_wait(info->queue, osd_ticks_per_second()*10); |
| 793 | 753 | |
| r9922 | r9923 | |
| 798 | 758 | } |
| 799 | 759 | |
| 800 | 760 | } |
| 761 | #endif | |
| 801 | 762 | |
| 802 | 763 | |
| 803 | ||
| 804 | 764 | /************************************* |
| 805 | 765 | * |
| 806 | 766 | * First pass init of nodes |
| r9922 | r9923 | |
| 811 | 771 | static void init_nodes(discrete_info *info, const linked_list_entry *block_list, device_t *device) |
| 812 | 772 | { |
| 813 | 773 | const linked_list_entry *entry; |
| 814 | linked_list_entry *task_node_list = NULL; | |
| 815 | 774 | discrete_task *task = NULL; |
| 816 | 775 | /* list tail pointers */ |
| 817 | linked_list_entry **task_node_list_ptr = NULL; | |
| 818 | linked_list_entry **node_list_ptr = &info->node_list; | |
| 819 | linked_list_entry **task_list_ptr = &info->task_list; | |
| 820 | linked_list_entry **output_list_ptr = &info->output_list; | |
| 821 | linked_list_entry **input_list_ptr = &info->input_list; | |
| 822 | 776 | int has_tasks = 0; |
| 823 | 777 | |
| 824 | 778 | /* check whether we have tasks ... */ |
| r9922 | r9923 | |
| 831 | 785 | |
| 832 | 786 | if (!has_tasks) |
| 833 | 787 | { |
| 834 | /* set up a main task */ | |
| 835 | task_node_list = NULL; | |
| 836 | task_node_list_ptr = &task_node_list; | |
| 788 | /* make sure we have one simple task | |
| 789 | * No need to create a node since there are no dependencies. | |
| 790 | */ | |
| 791 | task = auto_alloc_clear(info->device->machine, discrete_task); | |
| 792 | info->task_list.add_tail(task); | |
| 837 | 793 | } |
| 838 | 794 | |
| 839 | 795 | /* loop over all nodes */ |
| 840 | 796 | for (entry = block_list; entry != NULL; entry = entry->next) |
| 841 | 797 | { |
| 842 | 798 | const discrete_sound_block *block = (discrete_sound_block *) entry->ptr; |
| 843 | node_description *node = auto_alloc_clear(info->device->machine, node_description); | |
| 844 | 799 | int modulenum; |
| 845 | 800 | |
| 846 | 801 | /* find the requested module */ |
| r9922 | r9923 | |
| 850 | 805 | if (module_list[modulenum].type != block->type) |
| 851 | 806 | fatalerror("init_nodes() - Unable to find discrete module type %d for NODE_%02d", block->type, NODE_INDEX(block->node)); |
| 852 | 807 | |
| 853 | /* static inits */ | |
| 854 | node->context = NULL; | |
| 855 | node->info = info; | |
| 856 | node->module = &module_list[modulenum]; | |
| 857 | node->output[0] = 0.0; | |
| 858 | node->block = block; | |
| 859 | node->custom = block->custom; | |
| 860 | node->active_inputs = block->active_inputs; | |
| 861 | node->run_time = 0; | |
| 808 | node_description *node = auto_alloc_clear(info->device->machine, node_description(info, &module_list[modulenum], block)); | |
| 862 | 809 | |
| 863 | /* setup module if custom */ | |
| 864 | if (block->type == DST_CUSTOM) | |
| 865 | { | |
| 866 | const discrete_custom_info *custom = (const discrete_custom_info *)node->custom; | |
| 867 | node->module = &custom->module; | |
| 868 | node->custom = custom->custom; | |
| 869 | } | |
| 870 | ||
| 871 | /* copy initial / default step function */ | |
| 872 | node->step = node->module->step; | |
| 873 | ||
| 874 | /* allocate memory if necessary */ | |
| 875 | if (node->module->contextsize) | |
| 876 | node->context = auto_alloc_array_clear(device->machine, UINT8, node->module->contextsize); | |
| 877 | ||
| 878 | 810 | /* keep track of special nodes */ |
| 879 | 811 | if (block->node == NODE_SPECIAL) |
| 880 | 812 | { |
| r9922 | r9923 | |
| 882 | 814 | { |
| 883 | 815 | /* Output Node */ |
| 884 | 816 | case DSO_OUTPUT: |
| 885 | | |
| 817 | | |
| 886 | 818 | break; |
| 887 | 819 | |
| 888 | 820 | /* CSVlog Node for debugging */ |
| r9922 | r9923 | |
| 895 | 827 | |
| 896 | 828 | /* Task processing */ |
| 897 | 829 | case DSO_TASK_START: |
| 898 | if (task | |
| 830 | if (task | |
| 899 | 831 | fatalerror("init_nodes() - Nested DISCRETE_START_TASK."); |
| 900 | 832 | task = auto_alloc_clear(info->device->machine, discrete_task); |
| 901 | 833 | node->context = task; |
| 902 | task_node_list = NULL; | |
| 903 | task_node_list_ptr = &task_node_list; | |
| 904 | 834 | break; |
| 905 | 835 | |
| 906 | 836 | case DSO_TASK_END: |
| 907 | if (task | |
| 837 | if (task | |
| 908 | 838 | fatalerror("init_nodes() - NO DISCRETE_START_TASK."); |
| 909 | 839 | task->numbuffered = 0; |
| 910 | task->list = task_node_list; | |
| 911 | 840 | task->task_group = -1; /* will be set later */ |
| 912 | task->source_list = NULL; | |
| 913 | linked_list_tail_add(info, &task_list_ptr, task); | |
| 841 | task->source_list.reset(); | |
| 842 | info->task_list.add_tail(task); | |
| 914 | 843 | node->context = task; |
| 915 | task = NULL; | |
| 916 | task_node_list = NULL; | |
| 844 | //task = NULL; | |
| 917 | 845 | break; |
| 918 | 846 | |
| 919 | 847 | default: |
| r9922 | r9923 | |
| 932 | 860 | /* if we are an stream input node, track that */ |
| 933 | 861 | if (block->type == DSS_INPUT_STREAM) |
| 934 | 862 | { |
| 935 | | |
| 863 | | |
| 936 | 864 | } |
| 937 | 865 | else if (block->type == DSS_INPUT_BUFFER) |
| 938 | 866 | { |
| 939 | | |
| 867 | | |
| 940 | 868 | } |
| 941 | 869 | |
| 942 | 870 | /* add to node list */ |
| 943 | | |
| 871 | | |
| 944 | 872 | |
| 945 | 873 | /* our running order just follows the order specified */ |
| 946 | 874 | /* does the node step ? */ |
| 947 | 875 | if (node->step != NULL) |
| 948 | 876 | { |
| 949 | 877 | /* do we belong to a task? */ |
| 950 | if (task | |
| 878 | if (task | |
| 951 | 879 | fatalerror("init_nodes() - found node outside of task."); |
| 952 | 880 | else |
| 953 | | |
| 881 | task-> | |
| 954 | 882 | } |
| 955 | 883 | |
| 956 | 884 | if (block->type == DSO_TASK_END) |
| 957 | 885 | { |
| 958 | task | |
| 886 | task | |
| 959 | 887 | } |
| 960 | 888 | |
| 961 | 889 | /* and register save state */ |
| 962 | if (node->block->node != NODE_SPECIAL) | |
| 963 | state_save_register_device_item_array(device, node->block->node, node->output); | |
| 890 | node->save_state(device); | |
| 964 | 891 | } |
| 965 | 892 | |
| 966 | 893 | if (!has_tasks) |
| 967 | 894 | { |
| 968 | /* make sure we have one simple task | |
| 969 | * No need to create a node since there are no dependencies. | |
| 970 | */ | |
| 971 | task = auto_alloc_clear(info->device->machine, discrete_task); | |
| 972 | task->numbuffered = 0; | |
| 973 | task->list = task_node_list; | |
| 974 | task->task_group = 0; | |
| 975 | task->source_list = NULL; | |
| 976 | linked_list_tail_add(info, &task_list_ptr, task); | |
| 977 | 895 | } |
| 978 | 896 | |
| 979 | 897 | /* if no outputs, give an error */ |
| 980 | if ( | |
| 898 | if ( | |
| 981 | 899 | fatalerror("init_nodes() - Couldn't find an output node"); |
| 982 | 900 | } |
| 983 | 901 | |
| 984 | 902 | |
| 985 | 903 | /************************************* |
| 986 | 904 | * |
| 987 | * | |
| 905 | * | |
| 988 | 906 | * |
| 989 | 907 | *************************************/ |
| 990 | 908 | |
| 991 | /* attempt to group all static node parameters together. | |
| 992 | * Has a negative impact on performance - but it should | |
| 993 | * reduce memory bandwidth - this is weird. */ | |
| 909 | node_description::node_description(const discrete_info * xinfo, const discrete_module *xmodule, const discrete_sound_block *xblock) : | |
| 910 | context(NULL), | |
| 911 | module(xmodule), | |
| 912 | info(xinfo), | |
| 913 | run_time(0), | |
| 914 | m_block(xblock) | |
| 915 | { | |
| 916 | output[0] = 0.0; | |
| 917 | m_custom = m_block->custom; | |
| 918 | m_active_inputs = m_block->active_inputs; | |
| 994 | 919 | |
| 995 | #if 0 | |
| 996 | static double dbuf[10240] = { 0.0, 1.0 }; | |
| 997 | static int dbufptr = 2; | |
| 998 | ||
| 999 | static double *getDoublePtr(double val) | |
| 1000 | { | |
| 1001 | int i; | |
| 1002 | for (i=0; i < dbufptr; i += 1) | |
| 920 | /* setup module if custom */ | |
| 921 | if (m_block->type == DST_CUSTOM) | |
| 1003 | 922 | { |
| 1004 | if (dbuf[i] == val) | |
| 1005 | { | |
| 1006 | return &dbuf[i]; | |
| 1007 | } | |
| 923 | const discrete_custom_info *custom = (const discrete_custom_info *)m_custom; | |
| 924 | module = &custom->module; | |
| 925 | m_custom = custom->custom; | |
| 1008 | 926 | } |
| 1009 | dbuf[dbufptr] = val; | |
| 1010 | dbufptr+=1; | |
| 1011 | return &dbuf[dbufptr-1]; | |
| 927 | ||
| 928 | /* copy initial / default step function */ | |
| 929 | step = module->step; | |
| 930 | ||
| 931 | /* allocate memory if necessary */ | |
| 932 | if (module->contextsize) | |
| 933 | context = global_alloc_array(UINT8, module->contextsize); | |
| 1012 | 934 | } |
| 1013 | #endif | |
| 1014 | 935 | |
| 1015 | ||
| 936 | n | |
| 1016 | 937 | { |
| 1017 | const linked_list_entry *entry; | |
| 938 | if (module->contextsize) | |
| 939 | global_free(context); | |
| 940 | } | |
| 941 | ||
| 942 | int node_description::index(void) | |
| 943 | { | |
| 944 | return NODE_INDEX(m_block->node); | |
| 945 | } | |
| 946 | ||
| 947 | void node_description::save_state(device_t *device) | |
| 948 | { | |
| 949 | if (m_block->node != NODE_SPECIAL) | |
| 950 | state_save_register_device_item_array(device, m_block->node, output); | |
| 951 | } | |
| 952 | ||
| 953 | void node_description::find_input_nodes(void) | |
| 954 | { | |
| 1018 | 955 | int inputnum; |
| 1019 | 956 | |
| 1020 | /* loop over all nodes */ | |
| 1021 | for (entry = info->node_list; entry != NULL; entry = entry->next) | |
| 957 | /* loop over all active inputs */ | |
| 958 | for (inputnum = 0; inputnum < m_active_inputs; inputnum++) | |
| 1022 | 959 | { |
| 1023 | node_description *node = (node_description *) entry->ptr; | |
| 1024 | const discrete_sound_block *block = node->block; | |
| 960 | int inputnode = m_block->input_node[inputnum]; | |
| 1025 | 961 | |
| 1026 | /* loop over all active inputs */ | |
| 1027 | for (inputnum = 0; inputnum < node->active_inputs; inputnum++) | |
| 962 | /* if this input is node-based, find the node in the indexed list */ | |
| 963 | if IS_VALUE_A_NODE(inputnode) | |
| 1028 | 964 | { |
| 1029 | int inputnode = block->input_node[inputnum]; | |
| 965 | const node_description *node_ref = info->indexed_node[NODE_INDEX(inputnode)]; | |
| 966 | if (!node_ref) | |
| 967 | fatalerror("discrete_start - NODE_%02d referenced a non existent node NODE_%02d", index(), NODE_INDEX(inputnode)); | |
| 1030 | 968 | |
| 1031 | /* if this input is node-based, find the node in the indexed list */ | |
| 1032 | if IS_VALUE_A_NODE(inputnode) | |
| 969 | if ((NODE_CHILD_NODE_NUM(inputnode) >= node_ref->module->num_output) && (node_ref->module->type != DST_CUSTOM)) | |
| 970 | fatalerror("discrete_start - NODE_%02d referenced non existent output %d on node NODE_%02d", index(), NODE_CHILD_NODE_NUM(inputnode), NODE_INDEX(inputnode)); | |
| 971 | ||
| 972 | input[inputnum] = &(node_ref->output[NODE_CHILD_NODE_NUM(inputnode)]); /* Link referenced node out to input */ | |
| 973 | m_input_is_node |= 1 << inputnum; /* Bit flag if input is node */ | |
| 974 | } | |
| 975 | else | |
| 976 | { | |
| 977 | /* warn if trying to use a node for an input that can only be static */ | |
| 978 | if IS_VALUE_A_NODE(m_block->initial[inputnum]) | |
| 1033 | 979 | { |
| 1034 | const node_description *node_ref = info->indexed_node[NODE_INDEX(inputnode)]; | |
| 1035 | if (!node_ref) | |
| 1036 | fatalerror("discrete_start - NODE_%02d referenced a non existent node NODE_%02d", NODE_BLOCKINDEX(node), NODE_INDEX(inputnode)); | |
| 1037 | ||
| 1038 | if ((NODE_CHILD_NODE_NUM(inputnode) >= node_ref->module->num_output) && (node_ref->module->type != DST_CUSTOM)) | |
| 1039 | fatalerror("discrete_start - NODE_%02d referenced non existent output %d on node NODE_%02d", NODE_BLOCKINDEX(node), NODE_CHILD_NODE_NUM(inputnode), NODE_INDEX(inputnode)); | |
| 1040 | ||
| 1041 | node->input[inputnum] = &(node_ref->output[NODE_CHILD_NODE_NUM(inputnode)]); /* Link referenced node out to input */ | |
| 1042 | node->input_is_node |= 1 << inputnum; /* Bit flag if input is node */ | |
| 980 | discrete_log(info, "Warning - discrete_start - NODE_%02d trying to use a node on static input %d", index(), inputnum); | |
| 981 | /* also report it in the error log so it is not missed */ | |
| 982 | logerror("Warning - discrete_start - NODE_%02d trying to use a node on static input %d", index(), inputnum); | |
| 1043 | 983 | } |
| 1044 | 984 | else |
| 1045 | 985 | { |
| 1046 | /* warn if trying to use a node for an input that can only be static */ | |
| 1047 | if IS_VALUE_A_NODE(block->initial[inputnum]) | |
| 1048 | { | |
| 1049 | discrete_log(info, "Warning - discrete_start - NODE_%02d trying to use a node on static input %d", NODE_BLOCKINDEX(node), inputnum); | |
| 1050 | /* also report it in the error log so it is not missed */ | |
| 1051 | logerror("Warning - discrete_start - NODE_%02d trying to use a node on static input %d", NODE_BLOCKINDEX(node), inputnum); | |
| 1052 | } | |
| 1053 | else | |
| 1054 | { | |
| 1055 | node->input[inputnum] = &(node->block->initial[inputnum]); | |
| 1056 | //node->input[inputnum] = getDoublePtr(node->block->initial[inputnum]); | |
| 1057 | } | |
| 986 | input[inputnum] = &(m_block->initial[inputnum]); | |
| 987 | //node->input[inputnum] = getDoublePtr(node->block->initial[inputnum]); | |
| 1058 | 988 | } |
| 1059 | 989 | } |
| 1060 | for (inputnum = node->active_inputs; inputnum < DISCRETE_MAX_INPUTS; inputnum++) | |
| 1061 | { | |
| 1062 | /* FIXME: Check that no nodes follow ! */ | |
| 1063 | node->input[inputnum] = &(block->initial[inputnum]); | |
| 1064 | } | |
| 1065 | 990 | } |
| 991 | for (inputnum = m_active_inputs; inputnum < DISCRETE_MAX_INPUTS; inputnum++) | |
| 992 | { | |
| 993 | /* FIXME: Check that no nodes follow ! */ | |
| 994 | input[inputnum] = &(m_block->initial[inputnum]); | |
| 995 | } | |
| 1066 | 996 | } |
| 1067 | 997 | |
| 998 | int node_description::same_module_index(const node_list_t &list) | |
| 999 | { | |
| 1000 | int index = 0; | |
| 1001 | ||
| 1002 | for_each(node_description *, n, &list) | |
| 1003 | { | |
| 1004 | if (n.item() == this) | |
| 1005 | return index; | |
| 1006 | if (n.item()->module->type == this->module->type) | |
| 1007 | index++; | |
| 1008 | } | |
| 1009 | return -1; | |
| 1010 | } | |
| 1011 | ||
| 1012 | #if 0 | |
| 1068 | 1013 | /************************************************************************** |
| 1069 | 1014 | * Generic get_info |
| 1070 | 1015 | **************************************************************************/ |
| r9922 | r9923 | |
| 1092 | 1037 | |
| 1093 | 1038 | |
| 1094 | 1039 | DEFINE_LEGACY_SOUND_DEVICE(DISCRETE, discrete); |
| 1040 | #endif | |
| 1041 | ||
| 1042 | //************************************************************************** | |
| 1043 | // GLOBAL VARIABLES | |
| 1044 | //************************************************************************** | |
| 1045 | ||
| 1046 | const device_type DISCRETE = discrete_device_config::static_alloc_device_config; | |
| 1047 | ||
| 1048 | //************************************************************************** | |
| 1049 | // DEVICE CONFIGURATION | |
| 1050 | //************************************************************************** | |
| 1051 | ||
| 1052 | #if 0 | |
| 1053 | //------------------------------------------------- | |
| 1054 | // static_set_type - configuration helper to set | |
| 1055 | // the chip type | |
| 1056 | //------------------------------------------------- | |
| 1057 | ||
| 1058 | void discrete_device_config::static_set_type(device_config *device, int type) | |
| 1059 | { | |
| 1060 | discrete_device_config *asc = downcast<discrete_device_config *>(device); | |
| 1061 | asc->m_type = type; | |
| 1062 | } | |
| 1063 | ||
| 1064 | //------------------------------------------------- | |
| 1065 | // static_set_type - configuration helper to set | |
| 1066 | // the IRQ callback | |
| 1067 | //------------------------------------------------- | |
| 1068 | ||
| 1069 | ||
| 1070 | void discrete_device_config::static_set_irqf(device_config *device, void (*irqf)(device_t *device, int state)) | |
| 1071 | { | |
| 1072 | discrete_device_config *asc = downcast<discrete_device_config *>(device); | |
| 1073 | asc->m_irq_func = irqf; | |
| 1074 | } | |
| 1075 | #endif | |
| 1076 | ||
| 1077 | //------------------------------------------------- | |
| 1078 | // discrete_device_config - constructor | |
| 1079 | //------------------------------------------------- | |
| 1080 | ||
| 1081 | discrete_device_config::discrete_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) | |
| 1082 | : device_config(mconfig, static_alloc_device_config, "DISCRETE", tag, owner, clock), | |
| 1083 | device_config_sound_interface(mconfig, *this) | |
| 1084 | { | |
| 1085 | } | |
| 1086 | ||
| 1087 | ||
| 1088 | //------------------------------------------------- | |
| 1089 | // static_alloc_device_config - allocate a new | |
| 1090 | // configuration object | |
| 1091 | //------------------------------------------------- | |
| 1092 | ||
| 1093 | device_config *discrete_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock) | |
| 1094 | { | |
| 1095 | return global_alloc(discrete_device_config(mconfig, tag, owner, clock)); | |
| 1096 | } | |
| 1097 | ||
| 1098 | ||
| 1099 | //------------------------------------------------- | |
| 1100 | // alloc_device - allocate a new device object | |
| 1101 | //------------------------------------------------- | |
| 1102 | ||
| 1103 | device_t *discrete_device_config::alloc_device(running_machine &machine) const | |
| 1104 | { | |
| 1105 | return auto_alloc(&machine, discrete_device(machine, *this)); | |
| 1106 | } | |
| 1107 | ||
| 1108 | ||
| 1109 | //------------------------------------------------- | |
| 1110 | // discrete_device - constructor | |
| 1111 | //------------------------------------------------- | |
| 1112 | ||
| 1113 | discrete_device::discrete_device(running_machine &_machine, const discrete_device_config &config) | |
| 1114 | : device_t(_machine, config), | |
| 1115 | device_sound_interface(_machine, config, *this), | |
| 1116 | m_config(config) | |
| 1117 | { | |
| 1118 | //memset(&m_info, 0, sizeof(m_info)); | |
| 1119 | ||
| 1120 | } | |
| 1121 | ||
| 1122 | discrete_device::~discrete_device(void) | |
| 1123 | { | |
| 1124 | discrete_info *info = &m_info; | |
| 1125 | ||
| 1126 | osd_work_queue_free(info->queue); | |
| 1127 | ||
| 1128 | if (profiling) | |
| 1129 | { | |
| 1130 | display_profiling(info); | |
| 1131 | } | |
| 1132 | ||
| 1133 | /* Process nodes which have a stop func */ | |
| 1134 | ||
| 1135 | for_each(node_description *, node, &info->node_list) | |
| 1136 | { | |
| 1137 | if (node.item()->module->stop) | |
| 1138 | (*node.item()->module->stop)(node.item()); | |
| 1139 | } | |
| 1140 | ||
| 1141 | if (DISCRETE_DEBUGLOG) | |
| 1142 | { | |
| 1143 | /* close the debug log */ | |
| 1144 | if (info->disclogfile) | |
| 1145 | fclose(info->disclogfile); | |
| 1146 | info->disclogfile = NULL; | |
| 1147 | } | |
| 1148 | } | |
| 1149 | ||
| 1150 | //------------------------------------------------- | |
| 1151 | // device_start - device-specific startup | |
| 1152 | //------------------------------------------------- | |
| 1153 | ||
| 1154 | void discrete_device::device_start() | |
| 1155 | { | |
| 1156 | // create the stream | |
| 1157 | //m_stream = stream_create(this, 0, 2, 22257, this, static_stream_generate); | |
| 1158 | ||
| 1159 | linked_list_entry **intf; | |
| 1160 | const discrete_sound_block *intf_start = (discrete_sound_block *) baseconfig().static_config(); | |
| 1161 | discrete_info *info = &m_info; | |
| 1162 | char name[32]; | |
| 1163 | ||
| 1164 | info->device = this; | |
| 1165 | ||
| 1166 | /* If a clock is specified we will use it, otherwise run at the audio sample rate. */ | |
| 1167 | if (this->clock()) | |
| 1168 | info->sample_rate = this->clock(); | |
| 1169 | else | |
| 1170 | info->sample_rate = this->machine->sample_rate; | |
| 1171 | info->sample_time = 1.0 / info->sample_rate; | |
| 1172 | info->neg_sample_time = - info->sample_time; | |
| 1173 | ||
| 1174 | info->total_samples = 0; | |
| 1175 | info->total_stream_updates = 0; | |
| 1176 | ||
| 1177 | /* create the logfile */ | |
| 1178 | sprintf(name, "discrete%s.log", this->tag()); | |
| 1179 | if (DISCRETE_DEBUGLOG) | |
| 1180 | info->disclogfile = fopen(name, "w"); | |
| 1181 | ||
| 1182 | /* enable profiling */ | |
| 1183 | if (getenv("DISCRETE_PROFILING")) | |
| 1184 | profiling = atoi(getenv("DISCRETE_PROFILING")); | |
| 1185 | ||
| 1186 | /* Build the final block list */ | |
| 1187 | info->block_list = NULL; | |
| 1188 | intf = &info->block_list; | |
| 1189 | discrete_build_list(info, intf_start, &intf); | |
| 1190 | ||
| 1191 | /* first pass through the nodes: sanity check, fill in the indexed_nodes, and make a total count */ | |
| 1192 | discrete_sanity_check(info); | |
| 1193 | ||
| 1194 | /* Start with empty lists */ | |
| 1195 | info->node_list.reset(); | |
| 1196 | info->output_list.reset(); | |
| 1197 | info->input_list.reset(); | |
| 1198 | ||
| 1199 | /* allocate memory to hold pointers to nodes by index */ | |
| 1200 | info->indexed_node = auto_alloc_array_clear(this->machine, node_description *, DISCRETE_MAX_NODES); | |
| 1201 | ||
| 1202 | /* initialize the node data */ | |
| 1203 | init_nodes(info, info->block_list, this); | |
| 1204 | ||
| 1205 | /* now go back and find pointers to all input nodes */ | |
| 1206 | for_each(node_description *, node, &info->node_list) | |
| 1207 | { | |
| 1208 | node.item()->find_input_nodes(); | |
| 1209 | } | |
| 1210 | ||
| 1211 | /* initialize the stream(s) */ | |
| 1212 | info->discrete_stream = stream_create(this,info->input_list.count(), info->output_list.count(), info->sample_rate, this, static_stream_generate); | |
| 1213 | ||
| 1214 | /* allocate a queue */ | |
| 1215 | ||
| 1216 | info->queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_MULTI | WORK_QUEUE_FLAG_HIGH_FREQ); | |
| 1217 | ||
| 1218 | /* Process nodes which have a start func */ | |
| 1219 | ||
| 1220 | for_each(node_description *, node, &info->node_list) | |
| 1221 | { | |
| 1222 | if (node.item()->module->start) | |
| 1223 | (*node.item()->module->start)(node.item()); | |
| 1224 | } | |
| 1225 | } | |
| 1226 | ||
| 1227 | ||
| 1228 | //------------------------------------------------- | |
| 1229 | // device_reset - device-specific reset | |
| 1230 | //------------------------------------------------- | |
| 1231 | ||
| 1232 | void discrete_device::device_reset() | |
| 1233 | { | |
| 1234 | ||
| 1235 | const discrete_info *info = &m_info; | |
| 1236 | stream_update(info->discrete_stream); | |
| 1237 | ||
| 1238 | /* loop over all nodes */ | |
| 1239 | for_each (node_description *, node, &info->node_list) | |
| 1240 | { | |
| 1241 | node.item()->output[0] = 0; | |
| 1242 | ||
| 1243 | /* if the node has a reset function, call it */ | |
| 1244 | if (node.item()->module->reset) | |
| 1245 | (*node.item()->module->reset)(node.item()); | |
| 1246 | ||
| 1247 | /* otherwise, just step it */ | |
| 1248 | else if (node.item()->step) | |
| 1249 | (*node.item()->step)(node.item()); | |
| 1250 | } | |
| 1251 | } | |
| 1252 | ||
| 1253 | //------------------------------------------------- | |
| 1254 | // stream_generate - handle update requests for | |
| 1255 | // our sound stream | |
| 1256 | //------------------------------------------------- | |
| 1257 | ||
| 1258 | STREAM_UPDATE( discrete_device::static_stream_generate ) | |
| 1259 | { | |
| 1260 | reinterpret_cast<discrete_device *>(param)->stream_generate(inputs, outputs, samples); | |
| 1261 | } | |
| 1262 | ||
| 1263 | void discrete_device::stream_generate(stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1264 | { | |
| 1265 | discrete_info *info = &m_info; | |
| 1266 | int outputnum; | |
| 1267 | //, task_group; | |
| 1268 | ||
| 1269 | if (samples == 0) | |
| 1270 | return; | |
| 1271 | /* Setup any output streams */ | |
| 1272 | outputnum = 0; | |
| 1273 | for_each(node_description *, node, &info->output_list) | |
| 1274 | { | |
| 1275 | node.item()->context = (void *) outputs[outputnum]; | |
| 1276 | outputnum++; | |
| 1277 | } | |
| 1278 | ||
| 1279 | /* Setup any input streams */ | |
| 1280 | for_each(node_description *, node, &info->input_list) | |
| 1281 | { | |
| 1282 | struct dss_input_context *context = (struct dss_input_context *) node.item()->context; | |
| 1283 | context->ptr = (stream_sample_t *) inputs[context->stream_in_number]; | |
| 1284 | } | |
| 1285 | ||
| 1286 | /* Setup tasks */ | |
| 1287 | for_each(discrete_task *, task, &info->task_list) | |
| 1288 | { | |
| 1289 | int i; | |
| 1290 | ||
| 1291 | task.item()->samples = samples; | |
| 1292 | /* unlock the thread */ | |
| 1293 | task.item()->unlock(); | |
| 1294 | ||
| 1295 | /* set up task buffers */ | |
| 1296 | for (i = 0; i < task.item()->numbuffered; i++) | |
| 1297 | task.item()->ptr[i] = task.item()->node_buf[i]; | |
| 1298 | ||
| 1299 | /* initialize sources */ | |
| 1300 | for_each(discrete_source_node *, sn, &task.item()->source_list) | |
| 1301 | { | |
| 1302 | sn.item()->ptr = sn.item()->task->node_buf[sn.item()->output_node]; | |
| 1303 | } | |
| 1304 | } | |
| 1305 | ||
| 1306 | for_each(discrete_task *, task, &info->task_list) | |
| 1307 | { | |
| 1308 | /* Fire a work item for each task */ | |
| 1309 | osd_work_item_queue(info->queue, task_callback, (void *) &info->task_list, WORK_ITEM_FLAG_AUTO_RELEASE); | |
| 1310 | } | |
| 1311 | osd_work_queue_wait(info->queue, osd_ticks_per_second()*10); | |
| 1312 | ||
| 1313 | if (profiling) | |
| 1314 | { | |
| 1315 | info->total_samples += samples; | |
| 1316 | info->total_stream_updates++; | |
| 1317 | } | |
| 1318 | } | |
| 1319 | ||
| 1320 | //------------------------------------------------- | |
| 1321 | // read - read from the chip's registers and internal RAM | |
| 1322 | //------------------------------------------------- | |
| 1323 | ||
| 1324 | READ8_MEMBER( discrete_device::read ) | |
| 1325 | { | |
| 1326 | discrete_info *info = &m_info; | |
| 1327 | node_description *node = discrete_find_node(info, offset); | |
| 1328 | ||
| 1329 | UINT8 data = 0; | |
| 1330 | ||
| 1331 | /* Read the node input value if allowed */ | |
| 1332 | if (node) | |
| 1333 | { | |
| 1334 | /* Bring the system up to now */ | |
| 1335 | stream_update(info->discrete_stream); | |
| 1336 | ||
| 1337 | data = (UINT8) node->output[NODE_CHILD_NODE_NUM(offset)]; | |
| 1338 | } | |
| 1339 | else | |
| 1340 | fatalerror("discrete_sound_r read from non-existent NODE_%02d\n", offset-NODE_00); | |
| 1341 | ||
| 1342 | return data; | |
| 1343 | } | |
| 1344 | ||
| 1345 | //------------------------------------------------- | |
| 1346 | // write - write to the chip's registers and internal RAM | |
| 1347 | //------------------------------------------------- | |
| 1348 | ||
| 1349 | WRITE8_MEMBER( discrete_device::write ) | |
| 1350 | { | |
| 1351 | discrete_info *info = &m_info; | |
| 1352 | node_description *node = discrete_find_node(info, offset); | |
| 1353 | ||
| 1354 | /* Update the node input value if it's a proper input node */ | |
| 1355 | if (node) | |
| 1356 | { | |
| 1357 | struct dss_input_context *context = (struct dss_input_context *)node->context; | |
| 1358 | UINT8 new_data = 0; | |
| 1359 | ||
| 1360 | switch (node->module->type) | |
| 1361 | { | |
| 1362 | case DSS_INPUT_DATA: | |
| 1363 | case DSS_INPUT_BUFFER: | |
| 1364 | new_data = data; | |
| 1365 | break; | |
| 1366 | case DSS_INPUT_LOGIC: | |
| 1367 | case DSS_INPUT_PULSE: | |
| 1368 | new_data = data ? 1 : 0; | |
| 1369 | break; | |
| 1370 | case DSS_INPUT_NOT: | |
| 1371 | new_data = data ? 0 : 1; | |
| 1372 | break; | |
| 1373 | } | |
| 1374 | ||
| 1375 | if (context->data != new_data) | |
| 1376 | { | |
| 1377 | if (context->is_buffered) | |
| 1378 | { | |
| 1379 | /* Bring the system up to now */ | |
| 1380 | stream_update(context->buffer_stream); | |
| 1381 | ||
| 1382 | context->data = new_data; | |
| 1383 | } | |
| 1384 | else | |
| 1385 | { | |
| 1386 | /* Bring the system up to now */ | |
| 1387 | stream_update(info->discrete_stream); | |
| 1388 | ||
| 1389 | context->data = new_data; | |
| 1390 | ||
| 1391 | /* Update the node output here so we don't have to do it each step */ | |
| 1392 | node->output[0] = new_data * context->gain + context->offset; | |
| 1393 | } | |
| 1394 | } | |
| 1395 | } | |
| 1396 | else | |
| 1397 | { | |
| 1398 | discrete_log(info, "discrete_sound_w write to non-existent NODE_%02d\n", offset-NODE_00); | |
| 1399 | } | |
| 1400 | } |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | #ifndef __DISCRETE_H__ |
| 4 | 4 | #define __DISCRETE_H__ |
| 5 | 5 | |
| 6 | #include "devlegcy.h" | |
| 6 | //#include "devlegcy.h" | |
| 7 | 7 | #include "machine/rescap.h" |
| 8 | 8 | |
| 9 | 9 | /*********************************************************************** |
| r9922 | r9923 | |
| 3469 | 3469 | #include "streams.h" |
| 3470 | 3470 | #include "wavwrite.h" |
| 3471 | 3471 | |
| 3472 | ||
| 3473 | ||
| 3474 | 3472 | /************************************* |
| 3475 | 3473 | * |
| 3476 | 3474 | * macros |
| r9922 | r9923 | |
| 3516 | 3514 | #define DISCRETE_STOP_CALL(_func) DISCRETE_STOP_NAME(_func) (node) |
| 3517 | 3515 | |
| 3518 | 3516 | #define DISCRETE_DECLARE_CONTEXT(_name) struct _name##_context *context = (struct _name##_context *)node->context; |
| 3519 | #define DISCRETE_DECLARE_INFO(_name) const _name *info = (const _name *)node->custom; | |
| 3517 | #define DISCRETE_DECLARE_INFO(_name) const _name *info = (const _name *)node->custom_data(); | |
| 3520 | 3518 | |
| 3521 | 3519 | #define DISCRETE_CUSTOM_MODULE(_basename, _context_type) \ |
| 3522 | 3520 | { DST_CUSTOM, "CUSTOM", 1, sizeof(_context_type), DISCRETE_RESET_NAME(_basename), DISCRETE_STEP_NAME(_basename) } |
| r9922 | r9923 | |
| 3758 | 3756 | |
| 3759 | 3757 | /************************************* |
| 3760 | 3758 | * |
| 3759 | * Classes and structs to handle | |
| 3760 | * linked lists. | |
| 3761 | * | |
| 3762 | *************************************/ | |
| 3763 | ||
| 3764 | typedef struct _linked_list_entry linked_list_entry; | |
| 3765 | struct _linked_list_entry | |
| 3766 | { | |
| 3767 | linked_list_entry *next; | |
| 3768 | const void *ptr; | |
| 3769 | }; | |
| 3770 | ||
| 3771 | template<class T> class enumerator_t | |
| 3772 | { | |
| 3773 | public: | |
| 3774 | enumerator_t(linked_list_entry *first) : m_cur(first) { } | |
| 3775 | ~enumerator_t() { } | |
| 3776 | ||
| 3777 | inline T item(void) { return (T) m_cur->ptr; } | |
| 3778 | inline void next(void) { m_cur = m_cur->next; } | |
| 3779 | inline bool has_item(void) { return (m_cur != NULL); } | |
| 3780 | private: | |
| 3781 | linked_list_entry *m_cur; | |
| 3782 | }; | |
| 3783 | ||
| 3784 | #define for_each(_T, _e, _l) for (enumerator_t<_T> _e = (_l)->enumerator() ; _e.has_item(); _e.next()) | |
| 3785 | ||
| 3786 | template<class T> class linked_list_t | |
| 3787 | { | |
| 3788 | public: | |
| 3789 | linked_list_t() { m_first = NULL; m_last = NULL; } | |
| 3790 | ~linked_list_t() { reset(); } | |
| 3791 | ||
| 3792 | void add_tail(T object) | |
| 3793 | { | |
| 3794 | linked_list_entry *n = global_alloc(linked_list_entry); | |
| 3795 | n->ptr = (void *) object; | |
| 3796 | n->next = NULL; | |
| 3797 | if (m_last == NULL) | |
| 3798 | { | |
| 3799 | m_last = n; | |
| 3800 | m_first = n; | |
| 3801 | } | |
| 3802 | else | |
| 3803 | { | |
| 3804 | m_last->next = n; | |
| 3805 | m_last = n; | |
| 3806 | } | |
| 3807 | } | |
| 3808 | void add_head(T object) | |
| 3809 | { | |
| 3810 | linked_list_entry *n = global_alloc(linked_list_entry); | |
| 3811 | n->ptr = (void *) object; | |
| 3812 | n->next = NULL; | |
| 3813 | if (m_last == NULL) | |
| 3814 | { | |
| 3815 | m_last = n; | |
| 3816 | m_first = n; | |
| 3817 | } | |
| 3818 | else | |
| 3819 | { | |
| 3820 | n->next = m_first; | |
| 3821 | m_first = n; | |
| 3822 | } | |
| 3823 | } | |
| 3824 | void reset(void) | |
| 3825 | { | |
| 3826 | linked_list_entry *e = m_first; | |
| 3827 | while (e != NULL) | |
| 3828 | { | |
| 3829 | linked_list_entry *o = e; | |
| 3830 | e = e->next; | |
| 3831 | global_free(o); | |
| 3832 | } | |
| 3833 | m_first = NULL; m_last = NULL; | |
| 3834 | } | |
| 3835 | inline int count(void) const | |
| 3836 | { | |
| 3837 | int cnt = 0; | |
| 3838 | linked_list_entry *e = m_first; | |
| 3839 | while (e != NULL) | |
| 3840 | { | |
| 3841 | e = e->next; | |
| 3842 | cnt++; | |
| 3843 | } | |
| 3844 | return cnt; | |
| 3845 | } | |
| 3846 | inline enumerator_t<T> enumerator(void) const {enumerator_t<T> r(m_first); return r; } | |
| 3847 | private: | |
| 3848 | linked_list_entry *m_first; | |
| 3849 | linked_list_entry *m_last; | |
| 3850 | }; | |
| 3851 | ||
| 3852 | /************************************* | |
| 3853 | * | |
| 3761 | 3854 | * The discrete sound blocks as |
| 3762 | 3855 | * defined in the drivers |
| 3763 | 3856 | * |
| r9922 | r9923 | |
| 3777 | 3870 | |
| 3778 | 3871 | /************************************* |
| 3779 | 3872 | * |
| 3780 | * | |
| 3873 | * In | |
| 3781 | 3874 | * |
| 3782 | 3875 | *************************************/ |
| 3783 | 3876 | |
| 3784 | typedef struct _ | |
| 3877 | typedef struct _ | |
| 3785 | 3878 | typedef struct _discrete_info discrete_info; |
| 3786 | 3879 | |
| 3787 | typedef struct _discrete_module discrete_module; | |
| 3788 | struct _discrete_module | |
| 3789 | { | |
| 3790 | int type; | |
| 3791 | const char * name; | |
| 3792 | int num_output; /* Total number of output nodes, i.e. Master node + 1 */ | |
| 3793 | size_t contextsize; | |
| 3794 | DISCRETE_FUNC((*reset)); /* Called to reset a node after creation or system reset */ | |
| 3795 | DISCRETE_FUNC((*step)); /* Called to execute one time delta of output update */ | |
| 3796 | DISCRETE_FUNC((*start)); /* Called to execute at device start */ | |
| 3797 | DISCRETE_FUNC((*stop)); /* Called to execute at device stop */ | |
| 3798 | }; | |
| 3799 | 3880 | |
| 3881 | class node_description; | |
| 3882 | typedef linked_list_t<node_description *> node_list_t; | |
| 3800 | 3883 | |
| 3801 | /************************************* | |
| 3802 | * | |
| 3803 | * Internal structure of a node | |
| 3804 | * | |
| 3805 | *************************************/ | |
| 3806 | 3884 | |
| 3807 | ||
| 3885 | ||
| 3808 | 3886 | { |
| 3809 | /* this declaration order seems to be optimal */ | |
| 3810 | double output[DISCRETE_MAX_OUTPUTS]; /* The node's last output value */ | |
| 3887 | public: | |
| 3888 | node_description(const discrete_info * info, const discrete_module *module, const discrete_sound_block *block); | |
| 3811 | 3889 | |
| 3812 | DISCRETE_FUNC((*step)); /* Called to execute one time delta of output update */ | |
| 3813 | void * context; /* Contextual information specific to this node type */ | |
| 3890 | ~node_description(void); | |
| 3814 | 3891 | |
| 3892 | /* Return the node index, i.e. X from NODE(X) */ | |
| 3893 | int index(void); | |
| 3894 | /* Return the node number, i.e. NODE(X) */ | |
| 3895 | inline int block_node(void) { return m_block->node; } | |
| 3896 | /* Return the node type */ | |
| 3897 | inline int block_type(void) { return m_block->type; } | |
| 3898 | /* Custom function specific initialisation data */ | |
| 3899 | inline const void *custom_data(void) { return m_custom; } | |
| 3900 | ||
| 3901 | void find_input_nodes(void); | |
| 3902 | void save_state(device_t *device); | |
| 3903 | ||
| 3904 | inline int input_node(int inputnum) { return m_block->input_node[inputnum]; } | |
| 3905 | ||
| 3906 | /* FIXME: this is used by csv and wav logs - going forward, ids should be explicitly passed */ | |
| 3907 | int same_module_index(const node_list_t &list); | |
| 3908 | ||
| 3909 | /* The node's last output value */ | |
| 3910 | double output[DISCRETE_MAX_OUTPUTS]; | |
| 3911 | ||
| 3912 | /* Called to execute one time delta of output update */ | |
| 3913 | DISCRETE_FUNC((*step)); | |
| 3914 | ||
| 3915 | /* Contextual information specific to this node type */ | |
| 3916 | void * context; | |
| 3917 | ||
| 3815 | 3918 | const double * input[DISCRETE_MAX_INPUTS]; /* Addresses of Input values */ |
| 3816 | int active_inputs; /* Number of active inputs on this node type */ | |
| 3817 | int input_is_node; /* Bit Flags. 1 in bit location means input_is_node */ | |
| 3919 | /* Number of active inputs on this node type */ | |
| 3920 | inline int active_inputs(void) { return m_active_inputs; } | |
| 3921 | /* Bit Flags. 1 in bit location means input_is_node */ | |
| 3922 | inline int input_is_node(void) { return m_input_is_node; }; | |
| 3818 | 3923 | |
| 3819 | const void * custom; /* Custom function specific initialisation data */ | |
| 3820 | ||
| 3821 | 3924 | const discrete_module *module; /* Node's module info */ |
| 3822 | 3925 | const discrete_info *info; /* Points to the parent */ |
| 3823 | const discrete_sound_block *block; /* Points to the node's setup block. */ | |
| 3824 | 3926 | |
| 3825 | 3927 | osd_ticks_t run_time; |
| 3928 | protected: | |
| 3929 | private: | |
| 3930 | const discrete_sound_block *m_block; /* Points to the node's setup block. */ | |
| 3931 | int m_active_inputs; /* Number of active inputs on this node type */ | |
| 3932 | /* Custom function specific initialisation data */ | |
| 3933 | const void * m_custom; | |
| 3934 | int m_input_is_node; | |
| 3935 | ||
| 3826 | 3936 | }; |
| 3827 | 3937 | |
| 3828 | 3938 | |
| 3829 | 3939 | /************************************* |
| 3830 | 3940 | * |
| 3941 | * Discrete module definition | |
| 3942 | * | |
| 3943 | *************************************/ | |
| 3944 | ||
| 3945 | struct _discrete_module | |
| 3946 | { | |
| 3947 | int type; | |
| 3948 | const char * name; | |
| 3949 | int num_output; /* Total number of output nodes, i.e. Master node + 1 */ | |
| 3950 | size_t contextsize; | |
| 3951 | DISCRETE_FUNC((*reset)); /* Called to reset a node after creation or system reset */ | |
| 3952 | DISCRETE_FUNC((*step)); /* Called to execute one time delta of output update */ | |
| 3953 | DISCRETE_FUNC((*start)); /* Called to execute at device start */ | |
| 3954 | DISCRETE_FUNC((*stop)); /* Called to execute at device stop */ | |
| 3955 | }; | |
| 3956 | ||
| 3957 | /************************************* | |
| 3958 | * | |
| 3831 | 3959 | * Core runtime info |
| 3832 | 3960 | * |
| 3833 | 3961 | * this structure is exposed mainly |
| r9922 | r9923 | |
| 3836 | 3964 | * |
| 3837 | 3965 | *************************************/ |
| 3838 | 3966 | |
| 3839 | typedef struct _linked_list_entry linked_list_entry; | |
| 3840 | struct _linked_list_entry | |
| 3841 | { | |
| 3842 | linked_list_entry *next; | |
| 3843 | const void *ptr; | |
| 3844 | }; | |
| 3845 | 3967 | |
| 3846 | typedef struct _discrete_task discrete_task; | |
| 3847 | struct _discrete_task | |
| 3968 | typedef struct _discrete_source_node discrete_source_node; | |
| 3969 | ||
| 3970 | typedef linked_list_t<discrete_source_node *> source_node_list_t; | |
| 3971 | ||
| 3972 | class discrete_task | |
| 3848 | 3973 | { |
| 3849 | const linked_list_entry *list; | |
| 3974 | public: | |
| 3975 | discrete_task(void) | |
| 3976 | : numbuffered(0), task_group(0), m_threadid(-1) | |
| 3977 | { | |
| 3978 | source_list.reset(); | |
| 3979 | list.reset(); | |
| 3980 | } | |
| 3850 | 3981 | |
| 3851 | volatile INT32 threadid; | |
| 3982 | ~discrete_task(void) { } | |
| 3983 | ||
| 3984 | //const linked_list_entry *list; | |
| 3985 | node_list_t list; | |
| 3986 | ||
| 3852 | 3987 | volatile int samples; |
| 3853 | 3988 | |
| 3854 | 3989 | /* list of source nodes */ |
| 3855 | | |
| 3990 | source_node_list_ | |
| 3856 | 3991 | |
| 3992 | int numbuffered; | |
| 3857 | 3993 | int task_group; |
| 3858 | int numbuffered; | |
| 3859 | 3994 | double *ptr[DISCRETE_MAX_TASK_OUTPUTS]; |
| 3860 | 3995 | const double *source[DISCRETE_MAX_TASK_OUTPUTS]; |
| 3861 | 3996 | |
| 3862 | 3997 | double *node_buf[DISCRETE_MAX_TASK_OUTPUTS]; |
| 3863 | const node_description *nodes[DISCRETE_MAX_TASK_OUTPUTS]; | |
| 3998 | node_description *nodes[DISCRETE_MAX_TASK_OUTPUTS]; | |
| 3999 | ||
| 4000 | inline bool lock_threadid(INT32 threadid) | |
| 4001 | { | |
| 4002 | INT32 prev_id; | |
| 4003 | prev_id = compare_exchange32(&m_threadid, -1, threadid); | |
| 4004 | return (prev_id == -1 && m_threadid == threadid); | |
| 4005 | } | |
| 4006 | inline void unlock(void) { m_threadid = -1; } | |
| 4007 | private: | |
| 4008 | volatile INT32 m_threadid; | |
| 3864 | 4009 | }; |
| 3865 | 4010 | |
| 3866 | typedef struct _discrete_source_node discrete_source_node; | |
| 4011 | typedef linked_list_t<discrete_task *> task_list_t; | |
| 4012 | ||
| 3867 | 4013 | struct _discrete_source_node |
| 3868 | 4014 | { |
| 3869 | 4015 | const discrete_task *task; |
| r9922 | r9923 | |
| 3885 | 4031 | node_description **indexed_node; |
| 3886 | 4032 | |
| 3887 | 4033 | /* list of all nodes */ |
| 3888 | | |
| 4034 | | |
| 3889 | 4035 | |
| 3890 | 4036 | /* list of discrete blocks after prescan (IMPORT, DELETE, REPLACE) */ |
| 3891 | 4037 | linked_list_entry *block_list; /* discrete_sound_block * */ |
| 3892 | 4038 | |
| 3893 | 4039 | /* tasks */ |
| 3894 | | |
| 4040 | task | |
| 3895 | 4041 | |
| 3896 | 4042 | /* the input streams */ |
| 3897 | | |
| 4043 | | |
| 3898 | 4044 | |
| 3899 | 4045 | /* output node tracking */ |
| 3900 | | |
| 4046 | | |
| 3901 | 4047 | |
| 3902 | 4048 | /* the output stream */ |
| 3903 | 4049 | sound_stream *discrete_stream; |
| r9922 | r9923 | |
| 4254 | 4400 | #error "DISCRETE_MAX_OUTPUTS != 8" |
| 4255 | 4401 | #endif |
| 4256 | 4402 | |
| 4257 | #define NODE_BLOCKINDEX(_node) NODE_INDEX((_node)->block->node) | |
| 4403 | //#define NODE_BLOCKINDEX(_node) NODE_INDEX((_node)->block->node) | |
| 4258 | 4404 | |
| 4259 | 4405 | #define NODE_RELATIVE(_x, _y) (NODE(NODE_INDEX(_x) + (_y))) |
| 4260 | 4406 | |
| r9922 | r9923 | |
| 4424 | 4570 | |
| 4425 | 4571 | #define DISCRETE_SOUND_EXTERN(name) extern const discrete_sound_block name##_discrete_interface[] |
| 4426 | 4572 | #define DISCRETE_SOUND_START(name) const discrete_sound_block name##_discrete_interface[] = { |
| 4427 | #define DISCRETE_SOUND_END { NODE_00, DSS_NULL , 0, { NODE_NC }, { 0 } ,NULL ,"DISCRETE_SOUND_END" } }; | |
| 4428 | 4573 | |
| 4574 | #define DSC_SND_ENTRY(_nod, _dss, _num, _iact, _iinit, _custom, _name) { _nod, _dss, _num, _iact, _iinit, _custom, _name } | |
| 4575 | ||
| 4576 | ||
| 4577 | #define DISCRETE_SOUND_END DSC_SND_ENTRY( NODE_00, DSS_NULL , 0, DSE( NODE_NC ), DSE( 0 ) ,NULL ,"DISCRETE_SOUND_END" ) }; | |
| 4578 | #define DSE( ... ) { __VA_ARGS__ } | |
| 4579 | ||
| 4429 | 4580 | /* Module Name out, enum value, #in, {variable inputs}, {static inputs}, data pointer, "name" */ |
| 4430 | 4581 | |
| 4431 | 4582 | /* from disc_inp.c */ |
| 4432 | #define DISCRETE_ADJUSTMENT(NODE,MIN,MAX,LOGLIN,TAG) { NODE, DSS_ADJUSTMENT , 7, { NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { MIN,MAX,LOGLIN,0 ,0 ,100 }, TAG , "DISCRETE_ADJUSTMENT" }, | |
| 4433 | #define DISCRETE_ADJUSTMENTX(NODE,MIN,MAX,LOGLIN,TAG,PMIN,PMAX) { NODE, DSS_ADJUSTMENT , 7, { NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { MIN,MAX,LOGLIN,0 ,PMIN,PMAX }, TAG , "DISCRETE_ADJUSTMENTX" }, | |
| 4434 | #define DISCRETE_CONSTANT(NODE,CONST) { NODE, DSS_CONSTANT , 1, { NODE_NC }, { CONST } ,NULL ,"DISCRETE_CONSTANT" }, | |
| 4435 | #define DISCRETE_INPUT_DATA(NODE) { NODE, DSS_INPUT_DATA , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,0 }, NULL, "DISCRETE_INPUT_DATA" }, | |
| 4436 | #define DISCRETE_INPUTX_DATA(NODE,GAIN,OFFSET,INIT) { NODE, DSS_INPUT_DATA , 3, { NODE_NC,NODE_NC,NODE_NC }, { GAIN,OFFSET,INIT }, NULL, "DISCRETE_INPUTX_DATA" }, | |
| 4437 | #define DISCRETE_INPUT_LOGIC(NODE) { NODE, DSS_INPUT_LOGIC , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,0 }, NULL, "DISCRETE_INPUT_LOGIC" }, | |
| 4438 | #define DISCRETE_INPUTX_LOGIC(NODE,GAIN,OFFSET,INIT) { NODE, DSS_INPUT_LOGIC , 3, { NODE_NC,NODE_NC,NODE_NC }, { GAIN,OFFSET,INIT }, NULL, "DISCRETE_INPUTX_LOGIC" }, | |
| 4439 | #define DISCRETE_INPUT_NOT(NODE) { NODE, DSS_INPUT_NOT , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,0 }, NULL, "DISCRETE_INPUT_NOT" }, | |
| 4440 | #define DISCRETE_INPUTX_NOT(NODE,GAIN,OFFSET,INIT) { NODE, DSS_INPUT_NOT , 3, { NODE_NC,NODE_NC,NODE_NC }, { GAIN,OFFSET,INIT }, NULL, "DISCRETE_INPUTX_NOT" }, | |
| 4441 | #define DISCRETE_INPUT_PULSE(NODE,INIT) { NODE, DSS_INPUT_PULSE , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,INIT }, NULL, "DISCRETE_INPUT_PULSE" }, | |
| 4583 | #define DISCRETE_ADJUSTMENT(NODE,MIN,MAX,LOGLIN,TAG) DSC_SND_ENTRY( NODE, DSS_ADJUSTMENT , 7, DSE( NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( MIN,MAX,LOGLIN,0 ,0 ,100 ), TAG , "DISCRETE_ADJUSTMENT" ), | |
| 4584 | #define DISCRETE_ADJUSTMENTX(NODE,MIN,MAX,LOGLIN,TAG,PMIN,PMAX) DSC_SND_ENTRY( NODE, DSS_ADJUSTMENT , 7, DSE( NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( MIN,MAX,LOGLIN,0 ,PMIN,PMAX ), TAG , "DISCRETE_ADJUSTMENTX" ), | |
| 4585 | #define DISCRETE_CONSTANT(NODE,CONST) DSC_SND_ENTRY( NODE, DSS_CONSTANT , 1, DSE( NODE_NC ), DSE( CONST ) ,NULL ,"DISCRETE_CONSTANT" ), | |
| 4586 | #define DISCRETE_INPUT_DATA(NODE) DSC_SND_ENTRY( NODE, DSS_INPUT_DATA , 3, DSE( NODE_NC,NODE_NC,NODE_NC ), DSE( 1,0,0 ), NULL, "DISCRETE_INPUT_DATA" ), | |
| 4587 | #define DISCRETE_INPUTX_DATA(NODE,GAIN,OFFSET,INIT) DSC_SND_ENTRY( NODE, DSS_INPUT_DATA , 3, DSE( NODE_NC,NODE_NC,NODE_NC ), DSE( GAIN,OFFSET,INIT ), NULL, "DISCRETE_INPUTX_DATA" ), | |
| 4588 | #define DISCRETE_INPUT_LOGIC(NODE) DSC_SND_ENTRY( NODE, DSS_INPUT_LOGIC , 3, DSE( NODE_NC,NODE_NC,NODE_NC ), DSE( 1,0,0 ), NULL, "DISCRETE_INPUT_LOGIC" ), | |
| 4589 | #define DISCRETE_INPUTX_LOGIC(NODE,GAIN,OFFSET,INIT) DSC_SND_ENTRY( NODE, DSS_INPUT_LOGIC , 3, DSE( NODE_NC,NODE_NC,NODE_NC ), DSE( GAIN,OFFSET,INIT ), NULL, "DISCRETE_INPUTX_LOGIC" ), | |
| 4590 | #define DISCRETE_INPUT_NOT(NODE) DSC_SND_ENTRY( NODE, DSS_INPUT_NOT , 3, DSE( NODE_NC,NODE_NC,NODE_NC ), DSE( 1,0,0 ), NULL, "DISCRETE_INPUT_NOT" ), | |
| 4591 | #define DISCRETE_INPUTX_NOT(NODE,GAIN,OFFSET,INIT) DSC_SND_ENTRY( NODE, DSS_INPUT_NOT , 3, DSE( NODE_NC,NODE_NC,NODE_NC ), DSE( GAIN,OFFSET,INIT ), NULL, "DISCRETE_INPUTX_NOT" ), | |
| 4592 | #define DISCRETE_INPUT_PULSE(NODE,INIT) DSC_SND_ENTRY( NODE, DSS_INPUT_PULSE , 3, DSE( NODE_NC,NODE_NC,NODE_NC ), DSE( 1,0,INIT ), NULL, "DISCRETE_INPUT_PULSE" ), | |
| 4442 | 4593 | |
| 4443 | #define DISCRETE_INPUT_STREAM(NODE, NUM) { NODE, DSS_INPUT_STREAM, 3, { NUM,NODE_NC,NODE_NC }, { NUM,1,0 }, NULL, "DISCRETE_INPUT_STREAM" }, | |
| 4444 | #define DISCRETE_INPUTX_STREAM(NODE, NUM, GAIN,OFFSET) { NODE, DSS_INPUT_STREAM, 3, { NUM,NODE_NC,NODE_NC }, { NUM,GAIN,OFFSET }, NULL, "DISCRETE_INPUTX_STREAM" }, | |
| 4594 | #define DISCRETE_INPUT_STREAM(NODE, NUM) DSC_SND_ENTRY( NODE, DSS_INPUT_STREAM, 3, DSE( NUM,NODE_NC,NODE_NC ), DSE( NUM,1,0 ), NULL, "DISCRETE_INPUT_STREAM" ), | |
| 4595 | #define DISCRETE_INPUTX_STREAM(NODE, NUM, GAIN,OFFSET) DSC_SND_ENTRY( NODE, DSS_INPUT_STREAM, 3, DSE( NUM,NODE_NC,NODE_NC ), DSE( NUM,GAIN,OFFSET ), NULL, "DISCRETE_INPUTX_STREAM" ), | |
| 4445 | 4596 | |
| 4446 | #define DISCRETE_INPUT_BUFFER(NODE, NUM) | |
| 4597 | #define DISCRETE_INPUT_BUFFER(NODE, NUM) DSC_SND_ENTRY( NODE, DSS_INPUT_BUFFER, 3, DSE( NUM,NODE_NC,NODE_NC ), DSE( NUM,1,0 ), NULL, "DISCRETE_INPUT_BUFFER" ), | |
| 4447 | 4598 | |
| 4448 | 4599 | /* from disc_wav.c */ |
| 4449 | 4600 | /* generic modules */ |
| 4450 | #define DISCRETE_COUNTER(NODE,ENAB,RESET,CLK,MIN,MAX,DIR,INIT0,CLKTYPE) { NODE, DSS_COUNTER , 8, { ENAB,RESET,CLK,NODE_NC,NODE_NC,DIR,INIT0,NODE_NC }, { ENAB,RESET,CLK,MIN,MAX,DIR,INIT0,CLKTYPE }, NULL, "DISCRETE_COUNTER" }, | |
| 4451 | #define DISCRETE_COUNTER_7492(NODE,ENAB,RESET,CLK,CLKTYPE) { NODE, DSS_COUNTER , 8, { ENAB,RESET,CLK,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,RESET,CLK,CLKTYPE,0,1,0,DISC_COUNTER_IS_7492 }, NULL, "DISCRETE_COUNTER_7492" }, | |
| 4452 | #define DISCRETE_LFSR_NOISE(NODE,ENAB,RESET,CLK,AMPL,FEED,BIAS,LFSRTB) { NODE, DSS_LFSR_NOISE , 6, { ENAB,RESET,CLK,AMPL,FEED,BIAS }, { ENAB,RESET,CLK,AMPL,FEED,BIAS }, LFSRTB, "DISCRETE_LFSR_NOISE" }, | |
| 4453 | #define DISCRETE_NOISE(NODE,ENAB,FREQ,AMPL,BIAS) { NODE, DSS_NOISE , 4, { ENAB,FREQ,AMPL,BIAS }, { ENAB,FREQ,AMPL,BIAS }, NULL, "DISCRETE_NOISE" }, | |
| 4454 | #define DISCRETE_NOTE(NODE,ENAB,CLK,DATA,MAX1,MAX2,CLKTYPE) { NODE, DSS_NOTE , 6, { ENAB,CLK,DATA,NODE_NC,NODE_NC,NODE_NC }, { ENAB,CLK,DATA,MAX1,MAX2,CLKTYPE }, NULL, "DISCRETE_NOTE" }, | |
| 4455 | #define DISCRETE_SAWTOOTHWAVE(NODE,ENAB,FREQ,AMPL,BIAS,GRAD,PHASE) { NODE, DSS_SAWTOOTHWAVE, 6, { ENAB,FREQ,AMPL,BIAS,NODE_NC,NODE_NC }, { ENAB,FREQ,AMPL,BIAS,GRAD,PHASE }, NULL, "DISCRETE_SAWTOOTHWAVE" }, | |
| 4456 | #define DISCRETE_SINEWAVE(NODE,ENAB,FREQ,AMPL,BIAS,PHASE) { NODE, DSS_SINEWAVE , 5, { ENAB,FREQ,AMPL,BIAS,NODE_NC }, { ENAB,FREQ,AMPL,BIAS,PHASE }, NULL, "DISCRETE_SINEWAVE" }, | |
| 4457 | #define DISCRETE_SQUAREWAVE(NODE,ENAB,FREQ,AMPL,DUTY,BIAS,PHASE) { NODE, DSS_SQUAREWAVE , 6, { ENAB,FREQ,AMPL,DUTY,BIAS,NODE_NC }, { ENAB,FREQ,AMPL,DUTY,BIAS,PHASE }, NULL, "DISCRETE_SQUAREWAVE" }, | |
| 4458 | #define DISCRETE_SQUAREWFIX(NODE,ENAB,FREQ,AMPL,DUTY,BIAS,PHASE) { NODE, DSS_SQUAREWFIX , 6, { ENAB,FREQ,AMPL,DUTY,BIAS,NODE_NC }, { ENAB,FREQ,AMPL,DUTY,BIAS,PHASE }, NULL, "DISCRETE_SQUAREWFIX" }, | |
| 4459 | #define DISCRETE_SQUAREWAVE2(NODE,ENAB,AMPL,T_OFF,T_ON,BIAS,TSHIFT) { NODE, DSS_SQUAREWAVE2 , 6, { ENAB,AMPL,T_OFF,T_ON,BIAS,NODE_NC }, { ENAB,AMPL,T_OFF,T_ON,BIAS,TSHIFT }, NULL, "DISCRETE_SQUAREWAVE2" }, | |
| 4460 | #define DISCRETE_TRIANGLEWAVE(NODE,ENAB,FREQ,AMPL,BIAS,PHASE) { NODE, DSS_TRIANGLEWAVE, 5, { ENAB,FREQ,AMPL,BIAS,NODE_NC }, { ENAB,FREQ,AMPL,BIAS,PHASE }, NULL, "DISCRETE_TRIANGLEWAVE" }, | |
| 4601 | #define DISCRETE_COUNTER(NODE,ENAB,RESET,CLK,MIN,MAX,DIR,INIT0,CLKTYPE) DSC_SND_ENTRY( NODE, DSS_COUNTER , 8, DSE( ENAB,RESET,CLK,NODE_NC,NODE_NC,DIR,INIT0,NODE_NC ), DSE( ENAB,RESET,CLK,MIN,MAX,DIR,INIT0,CLKTYPE ), NULL, "DISCRETE_COUNTER" ), | |
| 4602 | #define DISCRETE_COUNTER_7492(NODE,ENAB,RESET,CLK,CLKTYPE) DSC_SND_ENTRY( NODE, DSS_COUNTER , 8, DSE( ENAB,RESET,CLK,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,RESET,CLK,CLKTYPE,0,1,0,DISC_COUNTER_IS_7492 ), NULL, "DISCRETE_COUNTER_7492" ), | |
| 4603 | #define DISCRETE_LFSR_NOISE(NODE,ENAB,RESET,CLK,AMPL,FEED,BIAS,LFSRTB) DSC_SND_ENTRY( NODE, DSS_LFSR_NOISE , 6, DSE( ENAB,RESET,CLK,AMPL,FEED,BIAS ), DSE( ENAB,RESET,CLK,AMPL,FEED,BIAS ), LFSRTB, "DISCRETE_LFSR_NOISE" ), | |
| 4604 | #define DISCRETE_NOISE(NODE,ENAB,FREQ,AMPL,BIAS) DSC_SND_ENTRY( NODE, DSS_NOISE , 4, DSE( ENAB,FREQ,AMPL,BIAS ), DSE( ENAB,FREQ,AMPL,BIAS ), NULL, "DISCRETE_NOISE" ), | |
| 4605 | #define DISCRETE_NOTE(NODE,ENAB,CLK,DATA,MAX1,MAX2,CLKTYPE) DSC_SND_ENTRY( NODE, DSS_NOTE , 6, DSE( ENAB,CLK,DATA,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,CLK,DATA,MAX1,MAX2,CLKTYPE ), NULL, "DISCRETE_NOTE" ), | |
| 4606 | #define DISCRETE_SAWTOOTHWAVE(NODE,ENAB,FREQ,AMPL,BIAS,GRAD,PHASE) DSC_SND_ENTRY( NODE, DSS_SAWTOOTHWAVE, 6, DSE( ENAB,FREQ,AMPL,BIAS,NODE_NC,NODE_NC ), DSE( ENAB,FREQ,AMPL,BIAS,GRAD,PHASE ), NULL, "DISCRETE_SAWTOOTHWAVE" ), | |
| 4607 | #define DISCRETE_SINEWAVE(NODE,ENAB,FREQ,AMPL,BIAS,PHASE) DSC_SND_ENTRY( NODE, DSS_SINEWAVE , 5, DSE( ENAB,FREQ,AMPL,BIAS,NODE_NC ), DSE( ENAB,FREQ,AMPL,BIAS,PHASE ), NULL, "DISCRETE_SINEWAVE" ), | |
| 4608 | #define DISCRETE_SQUAREWAVE(NODE,ENAB,FREQ,AMPL,DUTY,BIAS,PHASE) DSC_SND_ENTRY( NODE, DSS_SQUAREWAVE , 6, DSE( ENAB,FREQ,AMPL,DUTY,BIAS,NODE_NC ), DSE( ENAB,FREQ,AMPL,DUTY,BIAS,PHASE ), NULL, "DISCRETE_SQUAREWAVE" ), | |
| 4609 | #define DISCRETE_SQUAREWFIX(NODE,ENAB,FREQ,AMPL,DUTY,BIAS,PHASE) DSC_SND_ENTRY( NODE, DSS_SQUAREWFIX , 6, DSE( ENAB,FREQ,AMPL,DUTY,BIAS,NODE_NC ), DSE( ENAB,FREQ,AMPL,DUTY,BIAS,PHASE ), NULL, "DISCRETE_SQUAREWFIX" ), | |
| 4610 | #define DISCRETE_SQUAREWAVE2(NODE,ENAB,AMPL,T_OFF,T_ON,BIAS,TSHIFT) DSC_SND_ENTRY( NODE, DSS_SQUAREWAVE2 , 6, DSE( ENAB,AMPL,T_OFF,T_ON,BIAS,NODE_NC ), DSE( ENAB,AMPL,T_OFF,T_ON,BIAS,TSHIFT ), NULL, "DISCRETE_SQUAREWAVE2" ), | |
| 4611 | #define DISCRETE_TRIANGLEWAVE(NODE,ENAB,FREQ,AMPL,BIAS,PHASE) DSC_SND_ENTRY( NODE, DSS_TRIANGLEWAVE, 5, DSE( ENAB,FREQ,AMPL,BIAS,NODE_NC ), DSE( ENAB,FREQ,AMPL,BIAS,PHASE ), NULL, "DISCRETE_TRIANGLEWAVE" ), | |
| 4461 | 4612 | /* Component specific */ |
| 4462 | #define DISCRETE_INVERTER_OSC(NODE,ENAB,MOD,RCHARGE,RP,C,R2,INFO) { NODE, DSS_INVERTER_OSC, 6, { ENAB,MOD,NODE_NC,NODE_NC,NODE_NC }, { ENAB,MOD,RCHARGE,RP,C,R2 }, INFO, "DISCRETE_INVERTER_OSC" }, | |
| 4463 | #define DISCRETE_OP_AMP_OSCILLATOR(NODE,ENAB,INFO) { NODE, DSS_OP_AMP_OSC , 1, { ENAB }, { ENAB }, INFO, "DISCRETE_OP_AMP_OSCILLATOR" }, | |
| 4464 | #define DISCRETE_OP_AMP_VCO1(NODE,ENAB,VMOD1,INFO) { NODE, DSS_OP_AMP_OSC , 2, { ENAB,VMOD1 }, { ENAB,VMOD1 }, INFO, "DISCRETE_OP_AMP_VCO1" }, | |
| 4465 | #define DISCRETE_OP_AMP_VCO2(NODE,ENAB,VMOD1,VMOD2,INFO) { NODE, DSS_OP_AMP_OSC , 3, { ENAB,VMOD1,VMOD2 }, { ENAB,VMOD1,VMOD2 }, INFO, "DISCRETE_OP_AMP_VCO2" }, | |
| 4466 | #define DISCRETE_SCHMITT_OSCILLATOR(NODE,ENAB,INP0,AMPL,TABLE) { NODE, DSS_SCHMITT_OSC , 3, { ENAB,INP0,AMPL }, { ENAB,INP0,AMPL }, TABLE, "DISCRETE_SCHMITT_OSCILLATOR" }, | |
| 4613 | #define DISCRETE_INVERTER_OSC(NODE,ENAB,MOD,RCHARGE,RP,C,R2,INFO) DSC_SND_ENTRY( NODE, DSS_INVERTER_OSC, 6, DSE( ENAB,MOD,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,MOD,RCHARGE,RP,C,R2 ), INFO, "DISCRETE_INVERTER_OSC" ), | |
| 4614 | #define DISCRETE_OP_AMP_OSCILLATOR(NODE,ENAB,INFO) DSC_SND_ENTRY( NODE, DSS_OP_AMP_OSC , 1, DSE( ENAB ), DSE( ENAB ), INFO, "DISCRETE_OP_AMP_OSCILLATOR" ), | |
| 4615 | #define DISCRETE_OP_AMP_VCO1(NODE,ENAB,VMOD1,INFO) DSC_SND_ENTRY( NODE, DSS_OP_AMP_OSC , 2, DSE( ENAB,VMOD1 ), DSE( ENAB,VMOD1 ), INFO, "DISCRETE_OP_AMP_VCO1" ), | |
| 4616 | #define DISCRETE_OP_AMP_VCO2(NODE,ENAB,VMOD1,VMOD2,INFO) DSC_SND_ENTRY( NODE, DSS_OP_AMP_OSC , 3, DSE( ENAB,VMOD1,VMOD2 ), DSE( ENAB,VMOD1,VMOD2 ), INFO, "DISCRETE_OP_AMP_VCO2" ), | |
| 4617 | #define DISCRETE_SCHMITT_OSCILLATOR(NODE,ENAB,INP0,AMPL,TABLE) DSC_SND_ENTRY( NODE, DSS_SCHMITT_OSC , 3, DSE( ENAB,INP0,AMPL ), DSE( ENAB,INP0,AMPL ), TABLE, "DISCRETE_SCHMITT_OSCILLATOR" ), | |
| 4467 | 4618 | /* Not yet implemented */ |
| 4468 | #define DISCRETE_ADSR_ENV(NODE,ENAB,TRIGGER,GAIN,ADSRTB) | |
| 4619 | #define DISCRETE_ADSR_ENV(NODE,ENAB,TRIGGER,GAIN,ADSRTB) DSC_SND_ENTRY( NODE, DSS_ADSR , 3, DSE( ENAB,TRIGGER,GAIN ), DSE( ENAB,TRIGGER,GAIN ), ADSRTB, "DISCRETE_ADSR_ENV" ), | |
| 4469 | 4620 | |
| 4470 | 4621 | /* from disc_mth.c */ |
| 4471 | 4622 | /* generic modules */ |
| 4472 | #define DISCRETE_ADDER2(NODE,ENAB,INP0,INP1) { NODE, DST_ADDER , 3, { ENAB,INP0,INP1 }, { ENAB,INP0,INP1 }, NULL, "DISCRETE_ADDER2" }, | |
| 4473 | #define DISCRETE_ADDER3(NODE,ENAB,INP0,INP1,INP2) { NODE, DST_ADDER , 4, { ENAB,INP0,INP1,INP2 }, { ENAB,INP0,INP1,INP2 }, NULL, "DISCRETE_ADDER3" }, | |
| 4474 | #define DISCRETE_ADDER4(NODE,ENAB,INP0,INP1,INP2,INP3) { NODE, DST_ADDER , 5, { ENAB,INP0,INP1,INP2,INP3 }, { ENAB,INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_ADDER4" }, | |
| 4475 | #define DISCRETE_CLAMP(NODE,INP0,MIN,MAX) { NODE, DST_CLAMP , 3, { INP0,MIN,MAX }, { INP0,MIN,MAX }, NULL, "DISCRETE_CLAMP" }, | |
| 4476 | #define DISCRETE_DIVIDE(NODE,ENAB,INP0,INP1) { NODE, DST_DIVIDE , 3, { ENAB,INP0,INP1 }, { ENAB,INP0,INP1 }, NULL, "DISCRETE_DIVIDE" }, | |
| 4477 | #define DISCRETE_GAIN(NODE,INP0,GAIN) { NODE, DST_GAIN , 3, { INP0,NODE_NC,NODE_NC }, { INP0,GAIN,0 }, NULL, "DISCRETE_GAIN" }, | |
| 4478 | #define DISCRETE_INVERT(NODE,INP0) { NODE, DST_GAIN , 3, { INP0,NODE_NC,NODE_NC }, { INP0,-1,0 }, NULL, "DISCRETE_INVERT" }, | |
| 4479 | #define DISCRETE_LOGIC_INVERT(NODE,INP0) { NODE, DST_LOGIC_INV , 1, { INP0 }, { INP0 }, NULL, "DISCRETE_LOGIC_INVERT" }, | |
| 4623 | #define DISCRETE_ADDER2(NODE,ENAB,INP0,INP1) DSC_SND_ENTRY( NODE, DST_ADDER , 3, DSE( ENAB,INP0,INP1 ), DSE( ENAB,INP0,INP1 ), NULL, "DISCRETE_ADDER2" ), | |
| 4624 | #define DISCRETE_ADDER3(NODE,ENAB,INP0,INP1,INP2) DSC_SND_ENTRY( NODE, DST_ADDER , 4, DSE( ENAB,INP0,INP1,INP2 ), DSE( ENAB,INP0,INP1,INP2 ), NULL, "DISCRETE_ADDER3" ), | |
| 4625 | #define DISCRETE_ADDER4(NODE,ENAB,INP0,INP1,INP2,INP3) DSC_SND_ENTRY( NODE, DST_ADDER , 5, DSE( ENAB,INP0,INP1,INP2,INP3 ), DSE( ENAB,INP0,INP1,INP2,INP3 ), NULL, "DISCRETE_ADDER4" ), | |
| 4626 | #define DISCRETE_CLAMP(NODE,INP0,MIN,MAX) DSC_SND_ENTRY( NODE, DST_CLAMP , 3, DSE( INP0,MIN,MAX ), DSE( INP0,MIN,MAX ), NULL, "DISCRETE_CLAMP" ), | |
| 4627 | #define DISCRETE_DIVIDE(NODE,ENAB,INP0,INP1) DSC_SND_ENTRY( NODE, DST_DIVIDE , 3, DSE( ENAB,INP0,INP1 ), DSE( ENAB,INP0,INP1 ), NULL, "DISCRETE_DIVIDE" ), | |
| 4628 | #define DISCRETE_GAIN(NODE,INP0,GAIN) DSC_SND_ENTRY( NODE, DST_GAIN , 3, DSE( INP0,NODE_NC,NODE_NC ), DSE( INP0,GAIN,0 ), NULL, "DISCRETE_GAIN" ), | |
| 4629 | #define DISCRETE_INVERT(NODE,INP0) DSC_SND_ENTRY( NODE, DST_GAIN , 3, DSE( INP0,NODE_NC,NODE_NC ), DSE( INP0,-1,0 ), NULL, "DISCRETE_INVERT" ), | |
| 4630 | #define DISCRETE_LOGIC_INVERT(NODE,INP0) DSC_SND_ENTRY( NODE, DST_LOGIC_INV , 1, DSE( INP0 ), DSE( INP0 ), NULL, "DISCRETE_LOGIC_INVERT" ), | |
| 4480 | 4631 | |
| 4481 | #define DISCRETE_BIT_DECODE(NODE, INP, BIT_N, VOUT) { NODE, DST_BITS_DECODE , 4, { INP,NODE_NC,NODE_NC,NODE_NC }, { INP,BIT_N,BIT_N,VOUT }, NULL, "DISCRETE_BIT_DECODE" }, | |
| 4482 | #define DISCRETE_BITS_DECODE(NODE, INP, BIT_FROM, BIT_TO, VOUT) { NODE, DST_BITS_DECODE , 4, { INP,NODE_NC,NODE_NC,NODE_NC }, { INP,BIT_FROM,BIT_TO,VOUT }, NULL, "DISCRETE_BITS_DECODE" }, | |
| 4632 | #define DISCRETE_BIT_DECODE(NODE, INP, BIT_N, VOUT) DSC_SND_ENTRY( NODE, DST_BITS_DECODE , 4, DSE( INP,NODE_NC,NODE_NC,NODE_NC ), DSE( INP,BIT_N,BIT_N,VOUT ), NULL, "DISCRETE_BIT_DECODE" ), | |
| 4633 | #define DISCRETE_BITS_DECODE(NODE, INP, BIT_FROM, BIT_TO, VOUT) DSC_SND_ENTRY( NODE, DST_BITS_DECODE , 4, DSE( INP,NODE_NC,NODE_NC,NODE_NC ), DSE( INP,BIT_FROM,BIT_TO,VOUT ), NULL, "DISCRETE_BITS_DECODE" ), | |
| 4483 | 4634 | |
| 4484 | #define DISCRETE_LOGIC_AND(NODE,INP0,INP1) { NODE, DST_LOGIC_AND , 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,1.0,1.0 }, NULL, "DISCRETE_LOGIC_AND" }, | |
| 4485 | #define DISCRETE_LOGIC_AND3(NODE,INP0,INP1,INP2) { NODE, DST_LOGIC_AND , 4, { INP0,INP1,INP2,NODE_NC }, { INP0,INP1,INP2,1.0 }, NULL, "DISCRETE_LOGIC_AND3" }, | |
| 4486 | #define DISCRETE_LOGIC_AND4(NODE,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_AND , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 } ,NULL, "DISCRETE_LOGIC_AND4" }, | |
| 4487 | #define DISCRETE_LOGIC_NAND(NODE,INP0,INP1) { NODE, DST_LOGIC_NAND , 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,1.0,1.0 }, NULL, "DISCRETE_LOGIC_NAND" }, | |
| 4488 | #define DISCRETE_LOGIC_NAND3(NODE,INP0,INP1,INP2) { NODE, DST_LOGIC_NAND , 4, { INP0,INP1,INP2,NODE_NC }, { INP0,INP1,INP2,1.0 }, NULL, "DISCRETE_LOGIC_NAND3" }, | |
| 4489 | #define DISCRETE_LOGIC_NAND4(NODE,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_NAND , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 }, NULL, ")DISCRETE_LOGIC_NAND4" }, | |
| 4490 | #define DISCRETE_LOGIC_OR(NODE,INP0,INP1) { NODE, DST_LOGIC_OR , 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,0.0,0.0 }, NULL, "DISCRETE_LOGIC_OR" }, | |
| 4491 | #define DISCRETE_LOGIC_OR3(NODE,INP0,INP1,INP2) { NODE, DST_LOGIC_OR , 4, { INP0,INP1,INP2,NODE_NC }, { INP0,INP1,INP2,0.0 }, NULL, "DISCRETE_LOGIC_OR3" }, | |
| 4492 | #define DISCRETE_LOGIC_OR4(NODE,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_OR , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_LOGIC_OR4" }, | |
| 4493 | #define DISCRETE_LOGIC_NOR(NODE,INP0,INP1) { NODE, DST_LOGIC_NOR , 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,0.0,0.0 }, NULL, "DISCRETE_LOGIC_NOR" }, | |
| 4494 | #define DISCRETE_LOGIC_NOR3(NODE,INP0,INP1,INP2) { NODE, DST_LOGIC_NOR , 4, { INP0,INP1,INP2,NODE_NC }, { INP0,INP1,INP2,0.0 }, NULL, "DISCRETE_LOGIC_NOR3" }, | |
| 4495 | #define DISCRETE_LOGIC_NOR4(NODE,INP0,INP1,INP2,INP3) { NODE, DST_LOGIC_NOR , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_LOGIC_NOR4" }, | |
| 4496 | #define DISCRETE_LOGIC_XOR(NODE,INP0,INP1) { NODE, DST_LOGIC_XOR , 2, { INP0,INP1 }, { INP0,INP1 }, NULL, "DISCRETE_LOGIC_XOR" }, | |
| 4497 | #define DISCRETE_LOGIC_XNOR(NODE,INP0,INP1) { NODE, DST_LOGIC_NXOR , 2, { INP0,INP1 }, { INP0,INP1 }, NULL, "DISCRETE_LOGIC_XNOR" }, | |
| 4498 | #define DISCRETE_LOGIC_DFLIPFLOP(NODE,RESET,SET,CLK,INP) { NODE, DST_LOGIC_DFF , 4, { RESET,SET,CLK,INP }, { RESET,SET,CLK,INP }, NULL, "DISCRETE_LOGIC_DFLIPFLOP" }, | |
| 4499 | #define DISCRETE_LOGIC_JKFLIPFLOP(NODE,RESET,SET,CLK,J,K) { NODE, DST_LOGIC_JKFF , 5, { RESET,SET,CLK,J,K }, { RESET,SET,CLK,J,K }, NULL, "DISCRETE_LOGIC_JKFLIPFLOP" }, | |
| 4500 | #define DISCRETE_LOGIC_SHIFT(NODE,INP0,RESET,CLK,SIZE,OPTIONS) { NODE, DST_LOGIC_SHIFT , 5, { INP0,RESET,CLK,NODE_NC,NODE_NC }, { INP0,RESET,CLK,SIZE,OPTIONS }, NULL, "DISCRETE_LOGIC_SHIFT" }, | |
| 4501 | #define DISCRETE_LOOKUP_TABLE(NODE,ADDR,SIZE,TABLE) { NODE, DST_LOOKUP_TABLE, 2, { ADDR,NODE_NC }, { ADDR,SIZE }, TABLE, "DISCRETE_LOOKUP_TABLE" }, | |
| 4502 | #define DISCRETE_MULTIPLEX2(NODE,ADDR,INP0,INP1) { NODE, DST_MULTIPLEX , 3, { ADDR,INP0,INP1 }, { ADDR,INP0,INP1 }, NULL, "DISCRETE_MULTIPLEX2" }, | |
| 4503 | #define DISCRETE_MULTIPLEX4(NODE,ADDR,INP0,INP1,INP2,INP3) { NODE, DST_MULTIPLEX , 5, { ADDR,INP0,INP1,INP2,INP3 }, { ADDR,INP0,INP1,INP2,INP3 }, NULL, "DISCRETE_MULTIPLEX4" }, | |
| 4504 | #define DISCRETE_MULTIPLEX8(NODE,ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7) { NODE, DST_MULTIPLEX, 9, { ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7 }, { ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7 }, NULL, "DISCRETE_MULTIPLEX8" }, | |
| 4505 | #define DISCRETE_MULTIPLY(NODE,INP0,INP1) { NODE, DST_GAIN , 3, { INP0,INP1,NODE_NC }, { INP0,INP1,0 }, NULL, "DISCRETE_MULTIPLY" }, | |
| 4506 | #define DISCRETE_MULTADD(NODE,INP0,INP1,INP2) { NODE, DST_GAIN , 3, { INP0,INP1,INP2 }, { INP0,INP1,INP2 }, NULL, "DISCRETE_MULTADD" }, | |
| 4507 | #define DISCRETE_ONESHOT(NODE,TRIG,AMPL,WIDTH,TYPE) { NODE, DST_ONESHOT , 5, { 0,TRIG,AMPL,WIDTH,NODE_NC }, { 0,TRIG,AMPL,WIDTH,TYPE }, NULL, "DISCRETE_ONESHOT" }, | |
| 4508 | #define DISCRETE_ONESHOTR(NODE,RESET,TRIG,AMPL,WIDTH,TYPE) { NODE, DST_ONESHOT , 5, { RESET,TRIG,AMPL,WIDTH,NODE_NC }, { RESET,TRIG,AMPL,WIDTH,TYPE }, NULL, "One Shot Resetable" }, | |
| 4509 | #define DISCRETE_ONOFF(NODE,ENAB,INP0) { NODE, DST_GAIN , 3, { ENAB,INP0,NODE_NC }, { 0,1,0 }, NULL, "DISCRETE_ONOFF" }, | |
| 4510 | #define DISCRETE_RAMP(NODE,ENAB,RAMP,GRAD,START,END,CLAMP) { NODE, DST_RAMP , 6, { ENAB,RAMP,GRAD,START,END,CLAMP }, { ENAB,RAMP,GRAD,START,END,CLAMP }, NULL, "DISCRETE_RAMP" }, | |
| 4511 | #define DISCRETE_SAMPLHOLD(NODE,INP0,CLOCK,CLKTYPE) { NODE, DST_SAMPHOLD , 3, { INP0,CLOCK,NODE_NC }, { INP0,CLOCK,CLKTYPE }, NULL, "DISCRETE_SAMPLHOLD" }, | |
| 4512 | #define DISCRETE_SWITCH(NODE,ENAB,SWITCH,INP0,INP1) { NODE, DST_SWITCH , 4, { ENAB,SWITCH,INP0,INP1 }, { ENAB,SWITCH,INP0,INP1 }, NULL, "DISCRETE_SWITCH" }, | |
| 4513 | #define DISCRETE_ASWITCH(NODE,CTRL,INP,THRESHOLD) { NODE, DST_ASWITCH , 3, { CTRL,INP,THRESHOLD }, { CTRL,INP, THRESHOLD}, NULL, "Analog Switch" }, | |
| 4514 | #define DISCRETE_TRANSFORM2(NODE,INP0,INP1,FUNCT) { NODE, DST_TRANSFORM , 2, { INP0,INP1 }, { INP0,INP1 }, FUNCT, "DISCRETE_TRANSFORM2" }, | |
| 4515 | #define DISCRETE_TRANSFORM3(NODE,INP0,INP1,INP2,FUNCT) { NODE, DST_TRANSFORM , 3, { INP0,INP1,INP2 }, { INP0,INP1,INP2 }, FUNCT, "DISCRETE_TRANSFORM3" }, | |
| 4516 | #define DISCRETE_TRANSFORM4(NODE,INP0,INP1,INP2,INP3,FUNCT) { NODE, DST_TRANSFORM , 4, { INP0,INP1,INP2,INP3 }, { INP0,INP1,INP2,INP3 }, FUNCT, "DISCRETE_TRANSFORM4" }, | |
| 4517 | #define DISCRETE_TRANSFORM5(NODE,INP0,INP1,INP2,INP3,INP4,FUNCT) { NODE, DST_TRANSFORM , 5, { INP0,INP1,INP2,INP3,INP4 }, { INP0,INP1,INP2,INP3,INP4 }, FUNCT, "DISCRETE_TRANSFORM5" }, | |
| 4635 | #define DISCRETE_LOGIC_AND(NODE,INP0,INP1) DSC_SND_ENTRY( NODE, DST_LOGIC_AND , 4, DSE( INP0,INP1,NODE_NC,NODE_NC ), DSE( INP0,INP1,1.0,1.0 ), NULL, "DISCRETE_LOGIC_AND" ), | |
| 4636 | #define DISCRETE_LOGIC_AND3(NODE,INP0,INP1,INP2) DSC_SND_ENTRY( NODE, DST_LOGIC_AND , 4, DSE( INP0,INP1,INP2,NODE_NC ), DSE( INP0,INP1,INP2,1.0 ), NULL, "DISCRETE_LOGIC_AND3" ), | |
| 4637 | #define DISCRETE_LOGIC_AND4(NODE,INP0,INP1,INP2,INP3) DSC_SND_ENTRY( NODE, DST_LOGIC_AND , 4, DSE( INP0,INP1,INP2,INP3 ), DSE( INP0,INP1,INP2,INP3 ) ,NULL, "DISCRETE_LOGIC_AND4" ), | |
| 4638 | #define DISCRETE_LOGIC_NAND(NODE,INP0,INP1) DSC_SND_ENTRY( NODE, DST_LOGIC_NAND , 4, DSE( INP0,INP1,NODE_NC,NODE_NC ), DSE( INP0,INP1,1.0,1.0 ), NULL, "DISCRETE_LOGIC_NAND" ), | |
| 4639 | #define DISCRETE_LOGIC_NAND3(NODE,INP0,INP1,INP2) DSC_SND_ENTRY( NODE, DST_LOGIC_NAND , 4, DSE( INP0,INP1,INP2,NODE_NC ), DSE( INP0,INP1,INP2,1.0 ), NULL, "DISCRETE_LOGIC_NAND3" ), | |
| 4640 | #define DISCRETE_LOGIC_NAND4(NODE,INP0,INP1,INP2,INP3) DSC_SND_ENTRY( NODE, DST_LOGIC_NAND , 4, DSE( INP0,INP1,INP2,INP3 ), DSE( INP0,INP1,INP2,INP3 ), NULL, ")DISCRETE_LOGIC_NAND4" ), | |
| 4641 | #define DISCRETE_LOGIC_OR(NODE,INP0,INP1) DSC_SND_ENTRY( NODE, DST_LOGIC_OR , 4, DSE( INP0,INP1,NODE_NC,NODE_NC ), DSE( INP0,INP1,0.0,0.0 ), NULL, "DISCRETE_LOGIC_OR" ), | |
| 4642 | #define DISCRETE_LOGIC_OR3(NODE,INP0,INP1,INP2) DSC_SND_ENTRY( NODE, DST_LOGIC_OR , 4, DSE( INP0,INP1,INP2,NODE_NC ), DSE( INP0,INP1,INP2,0.0 ), NULL, "DISCRETE_LOGIC_OR3" ), | |
| 4643 | #define DISCRETE_LOGIC_OR4(NODE,INP0,INP1,INP2,INP3) DSC_SND_ENTRY( NODE, DST_LOGIC_OR , 4, DSE( INP0,INP1,INP2,INP3 ), DSE( INP0,INP1,INP2,INP3 ), NULL, "DISCRETE_LOGIC_OR4" ), | |
| 4644 | #define DISCRETE_LOGIC_NOR(NODE,INP0,INP1) DSC_SND_ENTRY( NODE, DST_LOGIC_NOR , 4, DSE( INP0,INP1,NODE_NC,NODE_NC ), DSE( INP0,INP1,0.0,0.0 ), NULL, "DISCRETE_LOGIC_NOR" ), | |
| 4645 | #define DISCRETE_LOGIC_NOR3(NODE,INP0,INP1,INP2) DSC_SND_ENTRY( NODE, DST_LOGIC_NOR , 4, DSE( INP0,INP1,INP2,NODE_NC ), DSE( INP0,INP1,INP2,0.0 ), NULL, "DISCRETE_LOGIC_NOR3" ), | |
| 4646 | #define DISCRETE_LOGIC_NOR4(NODE,INP0,INP1,INP2,INP3) DSC_SND_ENTRY( NODE, DST_LOGIC_NOR , 4, DSE( INP0,INP1,INP2,INP3 ), DSE( INP0,INP1,INP2,INP3 ), NULL, "DISCRETE_LOGIC_NOR4" ), | |
| 4647 | #define DISCRETE_LOGIC_XOR(NODE,INP0,INP1) DSC_SND_ENTRY( NODE, DST_LOGIC_XOR , 2, DSE( INP0,INP1 ), DSE( INP0,INP1 ), NULL, "DISCRETE_LOGIC_XOR" ), | |
| 4648 | #define DISCRETE_LOGIC_XNOR(NODE,INP0,INP1) DSC_SND_ENTRY( NODE, DST_LOGIC_NXOR , 2, DSE( INP0,INP1 ), DSE( INP0,INP1 ), NULL, "DISCRETE_LOGIC_XNOR" ), | |
| 4649 | #define DISCRETE_LOGIC_DFLIPFLOP(NODE,RESET,SET,CLK,INP) DSC_SND_ENTRY( NODE, DST_LOGIC_DFF , 4, DSE( RESET,SET,CLK,INP ), DSE( RESET,SET,CLK,INP ), NULL, "DISCRETE_LOGIC_DFLIPFLOP" ), | |
| 4650 | #define DISCRETE_LOGIC_JKFLIPFLOP(NODE,RESET,SET,CLK,J,K) DSC_SND_ENTRY( NODE, DST_LOGIC_JKFF , 5, DSE( RESET,SET,CLK,J,K ), DSE( RESET,SET,CLK,J,K ), NULL, "DISCRETE_LOGIC_JKFLIPFLOP" ), | |
| 4651 | #define DISCRETE_LOGIC_SHIFT(NODE,INP0,RESET,CLK,SIZE,OPTIONS) DSC_SND_ENTRY( NODE, DST_LOGIC_SHIFT , 5, DSE( INP0,RESET,CLK,NODE_NC,NODE_NC ), DSE( INP0,RESET,CLK,SIZE,OPTIONS ), NULL, "DISCRETE_LOGIC_SHIFT" ), | |
| 4652 | #define DISCRETE_LOOKUP_TABLE(NODE,ADDR,SIZE,TABLE) DSC_SND_ENTRY( NODE, DST_LOOKUP_TABLE, 2, DSE( ADDR,NODE_NC ), DSE( ADDR,SIZE ), TABLE, "DISCRETE_LOOKUP_TABLE" ), | |
| 4653 | #define DISCRETE_MULTIPLEX2(NODE,ADDR,INP0,INP1) DSC_SND_ENTRY( NODE, DST_MULTIPLEX , 3, DSE( ADDR,INP0,INP1 ), DSE( ADDR,INP0,INP1 ), NULL, "DISCRETE_MULTIPLEX2" ), | |
| 4654 | #define DISCRETE_MULTIPLEX4(NODE,ADDR,INP0,INP1,INP2,INP3) DSC_SND_ENTRY( NODE, DST_MULTIPLEX , 5, DSE( ADDR,INP0,INP1,INP2,INP3 ), DSE( ADDR,INP0,INP1,INP2,INP3 ), NULL, "DISCRETE_MULTIPLEX4" ), | |
| 4655 | #define DISCRETE_MULTIPLEX8(NODE,ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7) DSC_SND_ENTRY( NODE, DST_MULTIPLEX, 9, DSE( ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7 ), DSE( ADDR,INP0,INP1,INP2,INP3,INP4,INP5,INP6,INP7 ), NULL, "DISCRETE_MULTIPLEX8" ), | |
| 4656 | #define DISCRETE_MULTIPLY(NODE,INP0,INP1) DSC_SND_ENTRY( NODE, DST_GAIN , 3, DSE( INP0,INP1,NODE_NC ), DSE( INP0,INP1,0 ), NULL, "DISCRETE_MULTIPLY" ), | |
| 4657 | #define DISCRETE_MULTADD(NODE,INP0,INP1,INP2) DSC_SND_ENTRY( NODE, DST_GAIN , 3, DSE( INP0,INP1,INP2 ), DSE( INP0,INP1,INP2 ), NULL, "DISCRETE_MULTADD" ), | |
| 4658 | #define DISCRETE_ONESHOT(NODE,TRIG,AMPL,WIDTH,TYPE) DSC_SND_ENTRY( NODE, DST_ONESHOT , 5, DSE( 0,TRIG,AMPL,WIDTH,NODE_NC ), DSE( 0,TRIG,AMPL,WIDTH,TYPE ), NULL, "DISCRETE_ONESHOT" ), | |
| 4659 | #define DISCRETE_ONESHOTR(NODE,RESET,TRIG,AMPL,WIDTH,TYPE) DSC_SND_ENTRY( NODE, DST_ONESHOT , 5, DSE( RESET,TRIG,AMPL,WIDTH,NODE_NC ), DSE( RESET,TRIG,AMPL,WIDTH,TYPE ), NULL, "One Shot Resetable" ), | |
| 4660 | #define DISCRETE_ONOFF(NODE,ENAB,INP0) DSC_SND_ENTRY( NODE, DST_GAIN , 3, DSE( ENAB,INP0,NODE_NC ), DSE( 0,1,0 ), NULL, "DISCRETE_ONOFF" ), | |
| 4661 | #define DISCRETE_RAMP(NODE,ENAB,RAMP,GRAD,START,END,CLAMP) DSC_SND_ENTRY( NODE, DST_RAMP , 6, DSE( ENAB,RAMP,GRAD,START,END,CLAMP ), DSE( ENAB,RAMP,GRAD,START,END,CLAMP ), NULL, "DISCRETE_RAMP" ), | |
| 4662 | #define DISCRETE_SAMPLHOLD(NODE,INP0,CLOCK,CLKTYPE) DSC_SND_ENTRY( NODE, DST_SAMPHOLD , 3, DSE( INP0,CLOCK,NODE_NC ), DSE( INP0,CLOCK,CLKTYPE ), NULL, "DISCRETE_SAMPLHOLD" ), | |
| 4663 | #define DISCRETE_SWITCH(NODE,ENAB,SWITCH,INP0,INP1) DSC_SND_ENTRY( NODE, DST_SWITCH , 4, DSE( ENAB,SWITCH,INP0,INP1 ), DSE( ENAB,SWITCH,INP0,INP1 ), NULL, "DISCRETE_SWITCH" ), | |
| 4664 | #define DISCRETE_ASWITCH(NODE,CTRL,INP,THRESHOLD) DSC_SND_ENTRY( NODE, DST_ASWITCH , 3, DSE( CTRL,INP,THRESHOLD ), DSE( CTRL,INP, THRESHOLD), NULL, "Analog Switch" ), | |
| 4665 | #define DISCRETE_TRANSFORM2(NODE,INP0,INP1,FUNCT) DSC_SND_ENTRY( NODE, DST_TRANSFORM , 2, DSE( INP0,INP1 ), DSE( INP0,INP1 ), FUNCT, "DISCRETE_TRANSFORM2" ), | |
| 4666 | #define DISCRETE_TRANSFORM3(NODE,INP0,INP1,INP2,FUNCT) DSC_SND_ENTRY( NODE, DST_TRANSFORM , 3, DSE( INP0,INP1,INP2 ), DSE( INP0,INP1,INP2 ), FUNCT, "DISCRETE_TRANSFORM3" ), | |
| 4667 | #define DISCRETE_TRANSFORM4(NODE,INP0,INP1,INP2,INP3,FUNCT) DSC_SND_ENTRY( NODE, DST_TRANSFORM , 4, DSE( INP0,INP1,INP2,INP3 ), DSE( INP0,INP1,INP2,INP3 ), FUNCT, "DISCRETE_TRANSFORM4" ), | |
| 4668 | #define DISCRETE_TRANSFORM5(NODE,INP0,INP1,INP2,INP3,INP4,FUNCT) DSC_SND_ENTRY( NODE, DST_TRANSFORM , 5, DSE( INP0,INP1,INP2,INP3,INP4 ), DSE( INP0,INP1,INP2,INP3,INP4 ), FUNCT, "DISCRETE_TRANSFORM5" ), | |
| 4518 | 4669 | /* Component specific */ |
| 4519 | #define DISCRETE_COMP_ADDER(NODE,DATA,TABLE) { NODE, DST_COMP_ADDER , 1, { DATA }, { DATA }, TABLE, "DISCRETE_COMP_ADDER" }, | |
| 4520 | #define DISCRETE_DAC_R1(NODE,DATA,VDATA,LADDER) { NODE, DST_DAC_R1 , 2, { DATA,NODE_NC }, { DATA,VDATA }, LADDER, "DISCRETE_DAC_R1" }, | |
| 4521 | #define DISCRETE_DIODE_MIXER2(NODE,IN0,IN1,TABLE) { NODE, DST_DIODE_MIX , 3, { IN0,IN1 }, { IN0,IN1 }, TABLE, "DISCRETE_DIODE_MIXER2" }, | |
| 4522 | #define DISCRETE_DIODE_MIXER3(NODE,IN0,IN1,IN2,TABLE) { NODE, DST_DIODE_MIX , 4, { IN0,IN1,IN2 }, { IN0,IN1,IN2 }, TABLE, "DISCRETE_DIODE_MIXER3" }, | |
| 4523 | #define DISCRETE_DIODE_MIXER4(NODE,IN0,IN1,IN2,IN3,TABLE) { NODE, DST_DIODE_MIX , 5, { IN0,IN1,IN2,IN3 }, { IN0,IN1,IN2,IN3 }, TABLE, "DISCRETE_DIODE_MIXER4" }, | |
| 4524 | #define DISCRETE_INTEGRATE(NODE,TRG0,TRG1,INFO) { NODE, DST_INTEGRATE , 2, { TRG0,TRG1 }, { TRG0,TRG1 }, INFO, "DISCRETE_INTEGRATE" }, | |
| 4525 | #define DISCRETE_MIXER2(NODE,ENAB,IN0,IN1,INFO) { NODE, DST_MIXER , 3, { ENAB,IN0,IN1 }, { ENAB,IN0,IN1 }, INFO, "DISCRETE_MIXER2" }, | |
| 4526 | #define DISCRETE_MIXER3(NODE,ENAB,IN0,IN1,IN2,INFO) { NODE, DST_MIXER , 4, { ENAB,IN0,IN1,IN2 }, { ENAB,IN0,IN1,IN2 }, INFO, "DISCRETE_MIXER3" }, | |
| 4527 | #define DISCRETE_MIXER4(NODE,ENAB,IN0,IN1,IN2,IN3,INFO) { NODE, DST_MIXER , 5, { ENAB,IN0,IN1,IN2,IN3 }, { ENAB,IN0,IN1,IN2,IN3 }, INFO, "DISCRETE_MIXER4" }, | |
| 4528 | #define DISCRETE_MIXER5(NODE,ENAB,IN0,IN1,IN2,IN3,IN4,INFO) { NODE, DST_MIXER , 6, { ENAB,IN0,IN1,IN2,IN3,IN4 }, { ENAB,IN0,IN1,IN2,IN3,IN4 }, INFO, "DISCRETE_MIXER5" }, | |
| 4529 | #define DISCRETE_MIXER6(NODE,ENAB,IN0,IN1,IN2,IN3,IN4,IN5,INFO) { NODE, DST_MIXER , 7, { ENAB,IN0,IN1,IN2,IN3,IN4,IN5 }, { ENAB,IN0,IN1,IN2,IN3,IN4,IN5 }, INFO, "DISCRETE_MIXER6" }, | |
| 4530 | #define DISCRETE_MIXER7(NODE,ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6,INFO) { NODE, DST_MIXER , 8, { ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6 }, { ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6 }, INFO, "DISCRETE_MIXER7" }, | |
| 4531 | #define DISCRETE_MIXER8(NODE,ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,INFO) { NODE, DST_MIXER , 9, { ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7 }, { ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7 }, INFO, "DISCRETE_MIXER8" }, | |
| 4532 | #define DISCRETE_OP_AMP(NODE,ENAB,IN0,IN1,INFO) { NODE, DST_OP_AMP , 3, { ENAB,IN0,IN1 }, { ENAB,IN0,IN1 }, INFO, "DISCRETE_OP_AMP" }, | |
| 4533 | #define DISCRETE_OP_AMP_ONESHOT(NODE,TRIG,INFO) { NODE, DST_OP_AMP_1SHT , 1, { TRIG }, { TRIG }, INFO, "DISCRETE_OP_AMP_ONESHOT" }, | |
| 4534 | #define DISCRETE_OP_AMP_TRIG_VCA(NODE,TRG0,TRG1,TRG2,IN0,IN1,INFO) { NODE, DST_TVCA_OP_AMP , 5, { TRG0,TRG1,TRG2,IN0,IN1 }, { TRG0,TRG1,TRG2,IN0,IN1 }, INFO, "DISCRETE_OP_AMP_TRIG_VCA" }, | |
| 4535 | #define DISCRETE_VCA(NODE,ENAB,IN0,CTRL,TYPE) { NODE, DST_VCA , 4, { ENAB,IN0,CTRL,NODE_NC }, { ENAB,IN0,CTRL,TYPE }, NULL, "DISCRETE_VCA" }, | |
| 4536 | #define DISCRETE_XTIME_BUFFER(NODE,IN0,LOW,HIGH) { NODE, DST_XTIME_BUFFER, 4, { IN0,LOW,HIGH,NODE_NC }, { IN0,LOW,HIGH,0 }, NULL, "DISCRETE_XTIME_BUFFER" }, | |
| 4537 | #define DISCRETE_XTIME_INVERTER(NODE,IN0,LOW,HIGH) { NODE, DST_XTIME_BUFFER, 4, { IN0,LOW,HIGH,NODE_NC }, { IN0,LOW,HIGH,1 }, NULL, "DISCRETE_XTIME_INVERTER" }, | |
| 4538 | #define DISCRETE_XTIME_AND(NODE,IN0,IN1,LOW,HIGH) { NODE, DST_XTIME_AND, 5, { IN0,IN1,LOW,HIGH,NODE_NC }, { IN0,IN1,LOW,HIGH,0 }, NULL, "DISCRETE_XTIME_AND" }, | |
| 4539 | #define DISCRETE_XTIME_NAND(NODE,IN0,IN1,LOW,HIGH) { NODE, DST_XTIME_AND, 5, { IN0,IN1,LOW,HIGH,NODE_NC }, { IN0,IN1,LOW,HIGH,1 }, NULL, "DISCRETE_XTIME_NAND" }, | |
| 4540 | #define DISCRETE_XTIME_OR(NODE,IN0,IN1,LOW,HIGH) { NODE, DST_XTIME_OR, 5, { IN0,IN1,LOW,HIGH,NODE_NC }, { IN0,IN1,LOW,HIGH,0 }, NULL, "DISCRETE_XTIME_OR" }, | |
| 4541 | #define DISCRETE_XTIME_NOR(NODE,IN0,IN1,LOW,HIGH) { NODE, DST_XTIME_OR, 5, { IN0,IN1,LOW,HIGH,NODE_NC }, { IN0,IN1,LOW,HIGH,1 }, NULL, "DISCRETE_XTIME_NOR" }, | |
| 4542 | #define DISCRETE_XTIME_XOR(NODE,IN0,IN1,LOW,HIGH) { NODE, DST_XTIME_XOR, 5, { IN0,IN1,LOW,HIGH,NODE_NC }, { IN0,IN1,LOW,HIGH,0 }, NULL, "DISCRETE_XTIME_XOR" }, | |
| 4543 | #define DISCRETE_XTIME_XNOR(NODE,IN0,IN1,LOW,HIGH) { NODE, DST_XTIME_XNOR, 5, { IN0,IN1,LOW,HIGH,NODE_NC }, { IN0,IN1,LOW,HIGH,1 }, NULL, "DISCRETE_XTIME_XNOR" }, | |
| 4670 | #define DISCRETE_COMP_ADDER(NODE,DATA,TABLE) DSC_SND_ENTRY( NODE, DST_COMP_ADDER , 1, DSE( DATA ), DSE( DATA ), TABLE, "DISCRETE_COMP_ADDER" ), | |
| 4671 | #define DISCRETE_DAC_R1(NODE,DATA,VDATA,LADDER) DSC_SND_ENTRY( NODE, DST_DAC_R1 , 2, DSE( DATA,NODE_NC ), DSE( DATA,VDATA ), LADDER, "DISCRETE_DAC_R1" ), | |
| 4672 | #define DISCRETE_DIODE_MIXER2(NODE,IN0,IN1,TABLE) DSC_SND_ENTRY( NODE, DST_DIODE_MIX , 3, DSE( IN0,IN1 ), DSE( IN0,IN1 ), TABLE, "DISCRETE_DIODE_MIXER2" ), | |
| 4673 | #define DISCRETE_DIODE_MIXER3(NODE,IN0,IN1,IN2,TABLE) DSC_SND_ENTRY( NODE, DST_DIODE_MIX , 4, DSE( IN0,IN1,IN2 ), DSE( IN0,IN1,IN2 ), TABLE, "DISCRETE_DIODE_MIXER3" ), | |
| 4674 | #define DISCRETE_DIODE_MIXER4(NODE,IN0,IN1,IN2,IN3,TABLE) DSC_SND_ENTRY( NODE, DST_DIODE_MIX , 5, DSE( IN0,IN1,IN2,IN3 ), DSE( IN0,IN1,IN2,IN3 ), TABLE, "DISCRETE_DIODE_MIXER4" ), | |
| 4675 | #define DISCRETE_INTEGRATE(NODE,TRG0,TRG1,INFO) DSC_SND_ENTRY( NODE, DST_INTEGRATE , 2, DSE( TRG0,TRG1 ), DSE( TRG0,TRG1 ), INFO, "DISCRETE_INTEGRATE" ), | |
| 4676 | #define DISCRETE_MIXER2(NODE,ENAB,IN0,IN1,INFO) DSC_SND_ENTRY( NODE, DST_MIXER , 3, DSE( ENAB,IN0,IN1 ), DSE( ENAB,IN0,IN1 ), INFO, "DISCRETE_MIXER2" ), | |
| 4677 | #define DISCRETE_MIXER3(NODE,ENAB,IN0,IN1,IN2,INFO) DSC_SND_ENTRY( NODE, DST_MIXER , 4, DSE( ENAB,IN0,IN1,IN2 ), DSE( ENAB,IN0,IN1,IN2 ), INFO, "DISCRETE_MIXER3" ), | |
| 4678 | #define DISCRETE_MIXER4(NODE,ENAB,IN0,IN1,IN2,IN3,INFO) DSC_SND_ENTRY( NODE, DST_MIXER , 5, DSE( ENAB,IN0,IN1,IN2,IN3 ), DSE( ENAB,IN0,IN1,IN2,IN3 ), INFO, "DISCRETE_MIXER4" ), | |
| 4679 | #define DISCRETE_MIXER5(NODE,ENAB,IN0,IN1,IN2,IN3,IN4,INFO) DSC_SND_ENTRY( NODE, DST_MIXER , 6, DSE( ENAB,IN0,IN1,IN2,IN3,IN4 ), DSE( ENAB,IN0,IN1,IN2,IN3,IN4 ), INFO, "DISCRETE_MIXER5" ), | |
| 4680 | #define DISCRETE_MIXER6(NODE,ENAB,IN0,IN1,IN2,IN3,IN4,IN5,INFO) DSC_SND_ENTRY( NODE, DST_MIXER , 7, DSE( ENAB,IN0,IN1,IN2,IN3,IN4,IN5 ), DSE( ENAB,IN0,IN1,IN2,IN3,IN4,IN5 ), INFO, "DISCRETE_MIXER6" ), | |
| 4681 | #define DISCRETE_MIXER7(NODE,ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6,INFO) DSC_SND_ENTRY( NODE, DST_MIXER , 8, DSE( ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6 ), DSE( ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6 ), INFO, "DISCRETE_MIXER7" ), | |
| 4682 | #define DISCRETE_MIXER8(NODE,ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,INFO) DSC_SND_ENTRY( NODE, DST_MIXER , 9, DSE( ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7 ), DSE( ENAB,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7 ), INFO, "DISCRETE_MIXER8" ), | |
| 4683 | #define DISCRETE_OP_AMP(NODE,ENAB,IN0,IN1,INFO) DSC_SND_ENTRY( NODE, DST_OP_AMP , 3, DSE( ENAB,IN0,IN1 ), DSE( ENAB,IN0,IN1 ), INFO, "DISCRETE_OP_AMP" ), | |
| 4684 | #define DISCRETE_OP_AMP_ONESHOT(NODE,TRIG,INFO) DSC_SND_ENTRY( NODE, DST_OP_AMP_1SHT , 1, DSE( TRIG ), DSE( TRIG ), INFO, "DISCRETE_OP_AMP_ONESHOT" ), | |
| 4685 | #define DISCRETE_OP_AMP_TRIG_VCA(NODE,TRG0,TRG1,TRG2,IN0,IN1,INFO) DSC_SND_ENTRY( NODE, DST_TVCA_OP_AMP , 5, DSE( TRG0,TRG1,TRG2,IN0,IN1 ), DSE( TRG0,TRG1,TRG2,IN0,IN1 ), INFO, "DISCRETE_OP_AMP_TRIG_VCA" ), | |
| 4686 | #define DISCRETE_VCA(NODE,ENAB,IN0,CTRL,TYPE) DSC_SND_ENTRY( NODE, DST_VCA , 4, DSE( ENAB,IN0,CTRL,NODE_NC ), DSE( ENAB,IN0,CTRL,TYPE ), NULL, "DISCRETE_VCA" ), | |
| 4687 | #define DISCRETE_XTIME_BUFFER(NODE,IN0,LOW,HIGH) DSC_SND_ENTRY( NODE, DST_XTIME_BUFFER, 4, DSE( IN0,LOW,HIGH,NODE_NC ), DSE( IN0,LOW,HIGH,0 ), NULL, "DISCRETE_XTIME_BUFFER" ), | |
| 4688 | #define DISCRETE_XTIME_INVERTER(NODE,IN0,LOW,HIGH) DSC_SND_ENTRY( NODE, DST_XTIME_BUFFER, 4, DSE( IN0,LOW,HIGH,NODE_NC ), DSE( IN0,LOW,HIGH,1 ), NULL, "DISCRETE_XTIME_INVERTER" ), | |
| 4689 | #define DISCRETE_XTIME_AND(NODE,IN0,IN1,LOW,HIGH) DSC_SND_ENTRY( NODE, DST_XTIME_AND, 5, DSE( IN0,IN1,LOW,HIGH,NODE_NC ), DSE( IN0,IN1,LOW,HIGH,0 ), NULL, "DISCRETE_XTIME_AND" ), | |
| 4690 | #define DISCRETE_XTIME_NAND(NODE,IN0,IN1,LOW,HIGH) DSC_SND_ENTRY( NODE, DST_XTIME_AND, 5, DSE( IN0,IN1,LOW,HIGH,NODE_NC ), DSE( IN0,IN1,LOW,HIGH,1 ), NULL, "DISCRETE_XTIME_NAND" ), | |
| 4691 | #define DISCRETE_XTIME_OR(NODE,IN0,IN1,LOW,HIGH) DSC_SND_ENTRY( NODE, DST_XTIME_OR, 5, DSE( IN0,IN1,LOW,HIGH,NODE_NC ), DSE( IN0,IN1,LOW,HIGH,0 ), NULL, "DISCRETE_XTIME_OR" ), | |
| 4692 | #define DISCRETE_XTIME_NOR(NODE,IN0,IN1,LOW,HIGH) DSC_SND_ENTRY( NODE, DST_XTIME_OR, 5, DSE( IN0,IN1,LOW,HIGH,NODE_NC ), DSE( IN0,IN1,LOW,HIGH,1 ), NULL, "DISCRETE_XTIME_NOR" ), | |
| 4693 | #define DISCRETE_XTIME_XOR(NODE,IN0,IN1,LOW,HIGH) DSC_SND_ENTRY( NODE, DST_XTIME_XOR, 5, DSE( IN0,IN1,LOW,HIGH,NODE_NC ), DSE( IN0,IN1,LOW,HIGH,0 ), NULL, "DISCRETE_XTIME_XOR" ), | |
| 4694 | #define DISCRETE_XTIME_XNOR(NODE,IN0,IN1,LOW,HIGH) DSC_SND_ENTRY( NODE, DST_XTIME_XNOR, 5, DSE( IN0,IN1,LOW,HIGH,NODE_NC ), DSE( IN0,IN1,LOW,HIGH,1 ), NULL, "DISCRETE_XTIME_XNOR" ), | |
| 4544 | 4695 | |
| 4545 | 4696 | /* from disc_flt.c */ |
| 4546 | 4697 | /* generic modules */ |
| 4547 | #define DISCRETE_FILTER1(NODE,ENAB,INP0,FREQ,TYPE) { NODE, DST_FILTER1 , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,FREQ,TYPE }, NULL, "DISCRETE_FILTER1" }, | |
| 4548 | #define DISCRETE_FILTER2(NODE,ENAB,INP0,FREQ,DAMP,TYPE) { NODE, DST_FILTER2 , 5, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,FREQ,DAMP,TYPE }, NULL, "DISCRETE_FILTER2" }, | |
| 4698 | #define DISCRETE_FILTER1(NODE,ENAB,INP0,FREQ,TYPE) DSC_SND_ENTRY( NODE, DST_FILTER1 , 4, DSE( ENAB,INP0,NODE_NC,NODE_NC ), DSE( ENAB,INP0,FREQ,TYPE ), NULL, "DISCRETE_FILTER1" ), | |
| 4699 | #define DISCRETE_FILTER2(NODE,ENAB,INP0,FREQ,DAMP,TYPE) DSC_SND_ENTRY( NODE, DST_FILTER2 , 5, DSE( ENAB,INP0,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,INP0,FREQ,DAMP,TYPE ), NULL, "DISCRETE_FILTER2" ), | |
| 4549 | 4700 | /* Component specific */ |
| 4550 | #define DISCRETE_SALLEN_KEY_FILTER(NODE,ENAB,INP0,TYPE,INFO) { NODE, DST_SALLEN_KEY , 3, { ENAB,INP0,NODE_NC }, { ENAB,INP0,TYPE }, INFO, "DISCRETE_SALLEN_KEY_FILTER" }, | |
| 4551 | #define DISCRETE_CRFILTER(NODE,INP0,RVAL,CVAL) { NODE, DST_CRFILTER , 4, { INP0,RVAL,CVAL }, { INP0,RVAL,CVAL }, NULL, "DISCRETE_CRFILTER" }, | |
| 4552 | #define DISCRETE_CRFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF) { NODE, DST_CRFILTER , 5, { INP0,RVAL,CVAL,VREF }, { INP0,RVAL,CVAL,VREF }, NULL, "DISCRETE_CRFILTER_VREF" }, | |
| 4553 | #define DISCRETE_OP_AMP_FILTER(NODE,ENAB,INP0,INP1,TYPE,INFO) { NODE, DST_OP_AMP_FILT , 4, { ENAB,INP0,INP1,NODE_NC }, { ENAB,INP0,INP1,TYPE }, INFO, "DISCRETE_OP_AMP_FILTER" }, | |
| 4554 | #define DISCRETE_RC_CIRCUIT_1(NODE,INP0,INP1,RVAL,CVAL) { NODE, DST_RC_CIRCUIT_1, 4, { INP0,INP1,NODE_NC,NODE_NC }, { INP0,INP1,RVAL,CVAL }, NULL, "DISCRETE_RC_CIRCUIT_1" }, | |
| 4555 | #define DISCRETE_RCDISC(NODE,ENAB,INP0,RVAL,CVAL) { NODE, DST_RCDISC , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_RCDISC" }, | |
| 4556 | #define DISCRETE_RCDISC2(NODE,SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL) { NODE, DST_RCDISC2 , 6, { SWITCH,INP0,NODE_NC,INP1,NODE_NC,NODE_NC }, { SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL }, NULL, "DISCRETE_RCDISC2" }, | |
| 4557 | #define DISCRETE_RCDISC3(NODE,ENAB,INP0,RVAL0,RVAL1,CVAL,DJV) { NODE, DST_RCDISC3 , 6, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL0,RVAL1,CVAL,DJV }, NULL, "DISCRETE_RCDISC3" }, | |
| 4558 | #define DISCRETE_RCDISC4(NODE,ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,VP,TYPE) { NODE, DST_RCDISC4 , 8, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,VP,TYPE }, NULL, "DISCRETE_RCDISC4" }, | |
| 4559 | #define DISCRETE_RCDISC5(NODE,ENAB,INP0,RVAL,CVAL) { NODE, DST_RCDISC5 , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_RCDISC5" }, | |
| 4560 | #define DISCRETE_RCDISC_MODULATED(NODE,INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP) { NODE, DST_RCDISC_MOD, 8, { INP0,INP1,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP }, NULL, "DISCRETE_RCDISC_MODULATED" }, | |
| 4561 | #define DISCRETE_RCFILTER(NODE,INP0,RVAL,CVAL) { NODE, DST_RCFILTER , 3, { INP0,RVAL,CVAL }, { INP0,RVAL,CVAL }, NULL, "DISCRETE_RCFILTER" }, | |
| 4562 | #define DISCRETE_RCFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF) { NODE, DST_RCFILTER , 4, { INP0,RVAL,CVAL,VREF }, { INP0,RVAL,CVAL,VREF }, NULL, "DISCRETE_RCFILTER_VREF" }, | |
| 4563 | #define DISCRETE_RCFILTER_SW(NODE,ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4) { NODE, DST_RCFILTER_SW, 8, { ENAB,INP0,SW,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4 }, NULL, "DISCRETE_RCFILTER_SW" }, | |
| 4564 | #define DISCRETE_RCINTEGRATE(NODE,INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE) { NODE, DST_RCINTEGRATE , 7, { INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE }, NULL, "DISCRETE_RCINTEGRATE" }, | |
| 4701 | #define DISCRETE_SALLEN_KEY_FILTER(NODE,ENAB,INP0,TYPE,INFO) DSC_SND_ENTRY( NODE, DST_SALLEN_KEY , 3, DSE( ENAB,INP0,NODE_NC ), DSE( ENAB,INP0,TYPE ), INFO, "DISCRETE_SALLEN_KEY_FILTER" ), | |
| 4702 | #define DISCRETE_CRFILTER(NODE,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, DST_CRFILTER , 4, DSE( INP0,RVAL,CVAL ), DSE( INP0,RVAL,CVAL ), NULL, "DISCRETE_CRFILTER" ), | |
| 4703 | #define DISCRETE_CRFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF) DSC_SND_ENTRY( NODE, DST_CRFILTER , 5, DSE( INP0,RVAL,CVAL,VREF ), DSE( INP0,RVAL,CVAL,VREF ), NULL, "DISCRETE_CRFILTER_VREF" ), | |
| 4704 | #define DISCRETE_OP_AMP_FILTER(NODE,ENAB,INP0,INP1,TYPE,INFO) DSC_SND_ENTRY( NODE, DST_OP_AMP_FILT , 4, DSE( ENAB,INP0,INP1,NODE_NC ), DSE( ENAB,INP0,INP1,TYPE ), INFO, "DISCRETE_OP_AMP_FILTER" ), | |
| 4705 | #define DISCRETE_RC_CIRCUIT_1(NODE,INP0,INP1,RVAL,CVAL) DSC_SND_ENTRY( NODE, DST_RC_CIRCUIT_1, 4, DSE( INP0,INP1,NODE_NC,NODE_NC ), DSE( INP0,INP1,RVAL,CVAL ), NULL, "DISCRETE_RC_CIRCUIT_1" ), | |
| 4706 | #define DISCRETE_RCDISC(NODE,ENAB,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, DST_RCDISC , 4, DSE( ENAB,INP0,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL,CVAL ), NULL, "DISCRETE_RCDISC" ), | |
| 4707 | #define DISCRETE_RCDISC2(NODE,SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL) DSC_SND_ENTRY( NODE, DST_RCDISC2 , 6, DSE( SWITCH,INP0,NODE_NC,INP1,NODE_NC,NODE_NC ), DSE( SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL ), NULL, "DISCRETE_RCDISC2" ), | |
| 4708 | #define DISCRETE_RCDISC3(NODE,ENAB,INP0,RVAL0,RVAL1,CVAL,DJV) DSC_SND_ENTRY( NODE, DST_RCDISC3 , 6, DSE( ENAB,INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL0,RVAL1,CVAL,DJV ), NULL, "DISCRETE_RCDISC3" ), | |
| 4709 | #define DISCRETE_RCDISC4(NODE,ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,VP,TYPE) DSC_SND_ENTRY( NODE, DST_RCDISC4 , 8, DSE( ENAB,INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,VP,TYPE ), NULL, "DISCRETE_RCDISC4" ), | |
| 4710 | #define DISCRETE_RCDISC5(NODE,ENAB,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, DST_RCDISC5 , 4, DSE( ENAB,INP0,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL,CVAL ), NULL, "DISCRETE_RCDISC5" ), | |
| 4711 | #define DISCRETE_RCDISC_MODULATED(NODE,INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP) DSC_SND_ENTRY( NODE, DST_RCDISC_MOD, 8, DSE( INP0,INP1,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP ), NULL, "DISCRETE_RCDISC_MODULATED" ), | |
| 4712 | #define DISCRETE_RCFILTER(NODE,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, DST_RCFILTER , 3, DSE( INP0,RVAL,CVAL ), DSE( INP0,RVAL,CVAL ), NULL, "DISCRETE_RCFILTER" ), | |
| 4713 | #define DISCRETE_RCFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF) DSC_SND_ENTRY( NODE, DST_RCFILTER , 4, DSE( INP0,RVAL,CVAL,VREF ), DSE( INP0,RVAL,CVAL,VREF ), NULL, "DISCRETE_RCFILTER_VREF" ), | |
| 4714 | #define DISCRETE_RCFILTER_SW(NODE,ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4) DSC_SND_ENTRY( NODE, DST_RCFILTER_SW, 8, DSE( ENAB,INP0,SW,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4 ), NULL, "DISCRETE_RCFILTER_SW" ), | |
| 4715 | #define DISCRETE_RCINTEGRATE(NODE,INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE) DSC_SND_ENTRY( NODE, DST_RCINTEGRATE , 7, DSE( INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE ), NULL, "DISCRETE_RCINTEGRATE" ), | |
| 4565 | 4716 | /* For testing - seem to be buggered. Use versions not ending in N. */ |
| 4566 | #define DISCRETE_RCDISCN(NODE,ENAB,INP0,RVAL,CVAL) { NODE, DST_RCDISCN , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_RCDISCN" }, | |
| 4567 | #define DISCRETE_RCDISC2N(NODE,SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL) { NODE, DST_RCDISC2N , 6, { SWITCH,INP0,NODE_NC,INP1,NODE_NC,NODE_NC }, { SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL }, NULL, "DISCRETE_RCDISC2N" }, | |
| 4568 | #define DISCRETE_RCFILTERN(NODE,ENAB,INP0,RVAL,CVAL) { NODE, DST_RCFILTERN , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_RCFILTERN" }, | |
| 4717 | #define DISCRETE_RCDISCN(NODE,ENAB,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, DST_RCDISCN , 4, DSE( ENAB,INP0,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL,CVAL ), NULL, "DISCRETE_RCDISCN" ), | |
| 4718 | #define DISCRETE_RCDISC2N(NODE,SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL) DSC_SND_ENTRY( NODE, DST_RCDISC2N , 6, DSE( SWITCH,INP0,NODE_NC,INP1,NODE_NC,NODE_NC ), DSE( SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL ), NULL, "DISCRETE_RCDISC2N" ), | |
| 4719 | #define DISCRETE_RCFILTERN(NODE,ENAB,INP0,RVAL,CVAL) DSC_SND_ENTRY( NODE, DST_RCFILTERN , 4, DSE( ENAB,INP0,NODE_NC,NODE_NC ), DSE( ENAB,INP0,RVAL,CVAL ), NULL, "DISCRETE_RCFILTERN" ), | |
| 4569 | 4720 | |
| 4570 | 4721 | /* from disc_dev.c */ |
| 4571 | 4722 | /* generic modules */ |
| 4572 | #define DISCRETE_CUSTOM1(NODE,IN0,INFO) { NODE, DST_CUSTOM , 1, { IN0 }, { IN0 }, INFO, "DISCRETE_CUSTOM1" }, | |
| 4573 | #define DISCRETE_CUSTOM2(NODE,IN0,IN1,INFO) { NODE, DST_CUSTOM , 2, { IN0,IN1 }, { IN0,IN1 }, INFO, "DISCRETE_CUSTOM2" }, | |
| 4574 | #define DISCRETE_CUSTOM3(NODE,IN0,IN1,IN2,INFO) { NODE, DST_CUSTOM , 3, { IN0,IN1,IN2 }, { IN0,IN1,IN2 }, INFO, "DISCRETE_CUSTOM3" }, | |
| 4575 | #define DISCRETE_CUSTOM4(NODE,IN0,IN1,IN2,IN3,INFO) { NODE, DST_CUSTOM , 4, { IN0,IN1,IN2,IN3 }, { IN0,IN1,IN2,IN3 }, INFO, "DISCRETE_CUSTOM4" }, | |
| 4576 | #define DISCRETE_CUSTOM5(NODE,IN0,IN1,IN2,IN3,IN4,INFO) { NODE, DST_CUSTOM , 5, { IN0,IN1,IN2,IN3,IN4 }, { IN0,IN1,IN2,IN3,IN4 }, INFO, "DISCRETE_CUSTOM5" }, | |
| 4577 | #define DISCRETE_CUSTOM6(NODE,IN0,IN1,IN2,IN3,IN4,IN5,INFO) { NODE, DST_CUSTOM , 6, { IN0,IN1,IN2,IN3,IN4,IN5 }, { IN0,IN1,IN2,IN3,IN4,IN5 }, INFO, "DISCRETE_CUSTOM6" }, | |
| 4578 | #define DISCRETE_CUSTOM7(NODE,IN0,IN1,IN2,IN3,IN4,IN5,IN6,INFO) { NODE, DST_CUSTOM , 7, { IN0,IN1,IN2,IN3,IN4,IN5,IN6 }, { IN0,IN1,IN2,IN3,IN4,IN5,IN6 }, INFO, "DISCRETE_CUSTOM7" }, | |
| 4579 | #define DISCRETE_CUSTOM8(NODE,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,INFO) { NODE, DST_CUSTOM , 8, { IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7 }, { IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7 }, INFO, "DISCRETE_CUSTOM8" }, | |
| 4580 | #define DISCRETE_CUSTOM9(NODE,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,IN8,INFO) { NODE, DST_CUSTOM , 9, { IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,IN8 }, { IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,IN8 }, INFO, "DISCRETE_CUSTOM9" }, | |
| 4723 | #define DISCRETE_CUSTOM1(NODE,IN0,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 1, DSE( IN0 ), DSE( IN0 ), INFO, "DISCRETE_CUSTOM1" ), | |
| 4724 | #define DISCRETE_CUSTOM2(NODE,IN0,IN1,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 2, DSE( IN0,IN1 ), DSE( IN0,IN1 ), INFO, "DISCRETE_CUSTOM2" ), | |
| 4725 | #define DISCRETE_CUSTOM3(NODE,IN0,IN1,IN2,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 3, DSE( IN0,IN1,IN2 ), DSE( IN0,IN1,IN2 ), INFO, "DISCRETE_CUSTOM3" ), | |
| 4726 | #define DISCRETE_CUSTOM4(NODE,IN0,IN1,IN2,IN3,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 4, DSE( IN0,IN1,IN2,IN3 ), DSE( IN0,IN1,IN2,IN3 ), INFO, "DISCRETE_CUSTOM4" ), | |
| 4727 | #define DISCRETE_CUSTOM5(NODE,IN0,IN1,IN2,IN3,IN4,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 5, DSE( IN0,IN1,IN2,IN3,IN4 ), DSE( IN0,IN1,IN2,IN3,IN4 ), INFO, "DISCRETE_CUSTOM5" ), | |
| 4728 | #define DISCRETE_CUSTOM6(NODE,IN0,IN1,IN2,IN3,IN4,IN5,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 6, DSE( IN0,IN1,IN2,IN3,IN4,IN5 ), DSE( IN0,IN1,IN2,IN3,IN4,IN5 ), INFO, "DISCRETE_CUSTOM6" ), | |
| 4729 | #define DISCRETE_CUSTOM7(NODE,IN0,IN1,IN2,IN3,IN4,IN5,IN6,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 7, DSE( IN0,IN1,IN2,IN3,IN4,IN5,IN6 ), DSE( IN0,IN1,IN2,IN3,IN4,IN5,IN6 ), INFO, "DISCRETE_CUSTOM7" ), | |
| 4730 | #define DISCRETE_CUSTOM8(NODE,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 8, DSE( IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7 ), DSE( IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7 ), INFO, "DISCRETE_CUSTOM8" ), | |
| 4731 | #define DISCRETE_CUSTOM9(NODE,IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,IN8,INFO) DSC_SND_ENTRY( NODE, DST_CUSTOM , 9, DSE( IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,IN8 ), DSE( IN0,IN1,IN2,IN3,IN4,IN5,IN6,IN7,IN8 ), INFO, "DISCRETE_CUSTOM9" ), | |
| 4581 | 4732 | /* Component specific */ |
| 4582 | #define DISCRETE_555_ASTABLE(NODE,RESET,R1,R2,C,OPTIONS) { NODE, DSD_555_ASTBL , 5, { RESET,R1,R2,C,NODE_NC }, { RESET,R1,R2,C,-1 }, OPTIONS, "DISCRETE_555_ASTABLE" }, | |
| 4583 | #define DISCRETE_555_ASTABLE_CV(NODE,RESET,R1,R2,C,CTRLV,OPTIONS) { NODE, DSD_555_ASTBL , 5, { RESET,R1,R2,C,CTRLV }, { RESET,R1,R2,C,CTRLV }, OPTIONS, "DISCRETE_555_ASTABLE_CV" }, | |
| 4584 | #define DISCRETE_555_MSTABLE(NODE,RESET,TRIG,R,C,OPTIONS) { NODE, DSD_555_MSTBL , 4, { RESET,TRIG,R,C }, { RESET,TRIG,R,C }, OPTIONS, "DISCRETE_555_MSTABLE" }, | |
| 4585 | #define DISCRETE_555_CC(NODE,RESET,VIN,R,C,RBIAS,RGND,RDIS,OPTIONS) { NODE, DSD_555_CC , 7, { RESET,VIN,R,C,RBIAS,RGND,RDIS }, { RESET,VIN,R,C,RBIAS,RGND,RDIS }, OPTIONS, "DISCRETE_555_CC" }, | |
| 4586 | #define DISCRETE_555_VCO1(NODE,RESET,VIN,OPTIONS) { NODE, DSD_555_VCO1 , 3, { RESET,VIN,NODE_NC }, { RESET,VIN,-1 }, OPTIONS, "DISCRETE_555_VCO1" }, | |
| 4587 | #define DISCRETE_555_VCO1_CV(NODE,RESET,VIN,CTRLV,OPTIONS) { NODE, DSD_555_VCO1 , 3, { RESET,VIN,CTRLV }, { RESET,VIN,CTRLV }, OPTIONS, "DISCRETE_555_VCO1_CV" }, | |
| 4588 | #define DISCRETE_566(NODE,VMOD,R,C,VPOS,VNEG,VCHARGE,OPTIONS) { NODE, DSD_566 , 7, { VMOD,R,C,NODE_NC,NODE_NC,VCHARGE,NODE_NC }, { VMOD,R,C,VPOS,VNEG,VCHARGE,OPTIONS }, NULL, "DISCRETE_566" }, | |
| 4589 | #define DISCRETE_74LS624(NODE,ENAB,VMOD,VRNG,C,R_FREQ_IN,C_FREQ_IN,R_RNG_IN,OUTTYPE) { NODE, DSD_LS624 , 8, { ENAB,VMOD,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,VMOD,VRNG,C,R_FREQ_IN,C_FREQ_IN,R_RNG_IN,OUTTYPE }, NULL, "DISCRETE_74LS624" }, | |
| 4733 | #define DISCRETE_555_ASTABLE(NODE,RESET,R1,R2,C,OPTIONS) DSC_SND_ENTRY( NODE, DSD_555_ASTBL , 5, DSE( RESET,R1,R2,C,NODE_NC ), DSE( RESET,R1,R2,C,-1 ), OPTIONS, "DISCRETE_555_ASTABLE" ), | |
| 4734 | #define DISCRETE_555_ASTABLE_CV(NODE,RESET,R1,R2,C,CTRLV,OPTIONS) DSC_SND_ENTRY( NODE, DSD_555_ASTBL , 5, DSE( RESET,R1,R2,C,CTRLV ), DSE( RESET,R1,R2,C,CTRLV ), OPTIONS, "DISCRETE_555_ASTABLE_CV" ), | |
| 4735 | #define DISCRETE_555_MSTABLE(NODE,RESET,TRIG,R,C,OPTIONS) DSC_SND_ENTRY( NODE, DSD_555_MSTBL , 4, DSE( RESET,TRIG,R,C ), DSE( RESET,TRIG,R,C ), OPTIONS, "DISCRETE_555_MSTABLE" ), | |
| 4736 | #define DISCRETE_555_CC(NODE,RESET,VIN,R,C,RBIAS,RGND,RDIS,OPTIONS) DSC_SND_ENTRY( NODE, DSD_555_CC , 7, DSE( RESET,VIN,R,C,RBIAS,RGND,RDIS ), DSE( RESET,VIN,R,C,RBIAS,RGND,RDIS ), OPTIONS, "DISCRETE_555_CC" ), | |
| 4737 | #define DISCRETE_555_VCO1(NODE,RESET,VIN,OPTIONS) DSC_SND_ENTRY( NODE, DSD_555_VCO1 , 3, DSE( RESET,VIN,NODE_NC ), DSE( RESET,VIN,-1 ), OPTIONS, "DISCRETE_555_VCO1" ), | |
| 4738 | #define DISCRETE_555_VCO1_CV(NODE,RESET,VIN,CTRLV,OPTIONS) DSC_SND_ENTRY( NODE, DSD_555_VCO1 , 3, DSE( RESET,VIN,CTRLV ), DSE( RESET,VIN,CTRLV ), OPTIONS, "DISCRETE_555_VCO1_CV" ), | |
| 4739 | #define DISCRETE_566(NODE,VMOD,R,C,VPOS,VNEG,VCHARGE,OPTIONS) DSC_SND_ENTRY( NODE, DSD_566 , 7, DSE( VMOD,R,C,NODE_NC,NODE_NC,VCHARGE,NODE_NC ), DSE( VMOD,R,C,VPOS,VNEG,VCHARGE,OPTIONS ), NULL, "DISCRETE_566" ), | |
| 4740 | #define DISCRETE_74LS624(NODE,ENAB,VMOD,VRNG,C,R_FREQ_IN,C_FREQ_IN,R_RNG_IN,OUTTYPE) DSC_SND_ENTRY( NODE, DSD_LS624 , 8, DSE( ENAB,VMOD,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC ), DSE( ENAB,VMOD,VRNG,C,R_FREQ_IN,C_FREQ_IN,R_RNG_IN,OUTTYPE ), NULL, "DISCRETE_74LS624" ), | |
| 4590 | 4741 | |
| 4591 | 4742 | /* NOP */ |
| 4592 | #define DISCRETE_NOP(NODE) | |
| 4743 | #define DISCRETE_NOP(NODE) DSC_SND_ENTRY( NODE, DSS_NOP , 0, DSE( 0 ), DSE( 0 ), NULL, "DISCRETE_NOP" ), | |
| 4593 | 4744 | |
| 4594 | 4745 | /* logging */ |
| 4595 | #define DISCRETE_CSVLOG1(NODE1) { NODE_SPECIAL, DSO_CSVLOG , 1, { NODE1 }, { NODE1 }, NULL, "DISCRETE_CSVLOG1" }, | |
| 4596 | #define DISCRETE_CSVLOG2(NODE1,NODE2) { NODE_SPECIAL, DSO_CSVLOG , 2, { NODE1,NODE2 }, { NODE1,NODE2 }, NULL, "DISCRETE_CSVLOG2" }, | |
| 4597 | #define DISCRETE_CSVLOG3(NODE1,NODE2,NODE3) { NODE_SPECIAL, DSO_CSVLOG , 3, { NODE1,NODE2,NODE3 }, { NODE1,NODE2,NODE3 }, NULL, "DISCRETE_CSVLOG3" }, | |
| 4598 | #define DISCRETE_CSVLOG4(NODE1,NODE2,NODE3,NODE4) { NODE_SPECIAL, DSO_CSVLOG , 4, { NODE1,NODE2,NODE3,NODE4 }, { NODE1,NODE2,NODE3,NODE4 }, NULL, "DISCRETE_CSVLOG4" }, | |
| 4599 | #define DISCRETE_CSVLOG5(NODE1,NODE2,NODE3,NODE4,NODE5) { NODE_SPECIAL, DSO_CSVLOG , 5, { NODE1,NODE2,NODE3,NODE4,NODE5 }, { NODE1,NODE2,NODE3,NODE4,NODE5 }, NULL, "DISCRETE_CSVLOG5" }, | |
| 4600 | #define DISCRETE_WAVLOG1(NODE1,GAIN1) { NODE_SPECIAL, DSO_WAVELOG , 2, { NODE1,NODE_NC }, { NODE1,GAIN1 }, NULL, "DISCRETE_WAVLOG1" }, | |
| 4601 | #define DISCRETE_WAVLOG2(NODE1,GAIN1,NODE2,GAIN2) { NODE_SPECIAL, DSO_WAVELOG , 4, { NODE1,NODE_NC,NODE2,NODE_NC }, { NODE1,GAIN1,NODE2,GAIN2 }, NULL, "DISCRETE_WAVLOG2" }, | |
| 4746 | #define DISCRETE_CSVLOG1(NODE1) DSC_SND_ENTRY( NODE_SPECIAL, DSO_CSVLOG , 1, DSE( NODE1 ), DSE( NODE1 ), NULL, "DISCRETE_CSVLOG1" ), | |
| 4747 | #define DISCRETE_CSVLOG2(NODE1,NODE2) DSC_SND_ENTRY( NODE_SPECIAL, DSO_CSVLOG , 2, DSE( NODE1,NODE2 ), DSE( NODE1,NODE2 ), NULL, "DISCRETE_CSVLOG2" ), | |
| 4748 | #define DISCRETE_CSVLOG3(NODE1,NODE2,NODE3) DSC_SND_ENTRY( NODE_SPECIAL, DSO_CSVLOG , 3, DSE( NODE1,NODE2,NODE3 ), DSE( NODE1,NODE2,NODE3 ), NULL, "DISCRETE_CSVLOG3" ), | |
| 4749 | #define DISCRETE_CSVLOG4(NODE1,NODE2,NODE3,NODE4) DSC_SND_ENTRY( NODE_SPECIAL, DSO_CSVLOG , 4, DSE( NODE1,NODE2,NODE3,NODE4 ), DSE( NODE1,NODE2,NODE3,NODE4 ), NULL, "DISCRETE_CSVLOG4" ), | |
| 4750 | #define DISCRETE_CSVLOG5(NODE1,NODE2,NODE3,NODE4,NODE5) DSC_SND_ENTRY( NODE_SPECIAL, DSO_CSVLOG , 5, DSE( NODE1,NODE2,NODE3,NODE4,NODE5 ), DSE( NODE1,NODE2,NODE3,NODE4,NODE5 ), NULL, "DISCRETE_CSVLOG5" ), | |
| 4751 | #define DISCRETE_WAVLOG1(NODE1,GAIN1) DSC_SND_ENTRY( NODE_SPECIAL, DSO_WAVELOG , 2, DSE( NODE1,NODE_NC ), DSE( NODE1,GAIN1 ), NULL, "DISCRETE_WAVLOG1" ), | |
| 4752 | #define DISCRETE_WAVLOG2(NODE1,GAIN1,NODE2,GAIN2) DSC_SND_ENTRY( NODE_SPECIAL, DSO_WAVELOG , 4, DSE( NODE1,NODE_NC,NODE2,NODE_NC ), DSE( NODE1,GAIN1,NODE2,GAIN2 ), NULL, "DISCRETE_WAVLOG2" ), | |
| 4602 | 4753 | |
| 4603 | 4754 | /* import */ |
| 4604 | #define DISCRETE_IMPORT(INFO) { NODE_SPECIAL, DSO_IMPORT , 0, { 0 }, { 0 }, &(INFO##_discrete_interface), "DISCRETE_IMPORT" }, | |
| 4605 | #define DISCRETE_DELETE(NODE_FROM, NODE_TO) { NODE_SPECIAL, DSO_DELETE , 2, { NODE_FROM, NODE_TO }, { NODE_FROM, NODE_TO }, NULL, "DISCRETE_DELETE" }, | |
| 4606 | #define DISCRETE_REPLACE { NODE_SPECIAL, DSO_REPLACE , 0, { 0 }, { 0 }, NULL, "DISCRETE_REPLACE" }, | |
| 4755 | #define DISCRETE_IMPORT(INFO) DSC_SND_ENTRY( NODE_SPECIAL, DSO_IMPORT , 0, DSE( 0 ), DSE( 0 ), &(INFO##_discrete_interface), "DISCRETE_IMPORT" ), | |
| 4756 | #define DISCRETE_DELETE(NODE_FROM, NODE_TO) DSC_SND_ENTRY( NODE_SPECIAL, DSO_DELETE , 2, DSE( NODE_FROM, NODE_TO ), DSE( NODE_FROM, NODE_TO ), NULL, "DISCRETE_DELETE" ), | |
| 4757 | #define DISCRETE_REPLACE DSC_SND_ENTRY( NODE_SPECIAL, DSO_REPLACE , 0, DSE( 0 ), DSE( 0 ), NULL, "DISCRETE_REPLACE" ), | |
| 4607 | 4758 | |
| 4608 | 4759 | /* parallel tasks */ |
| 4609 | 4760 | |
| 4610 | #define DISCRETE_TASK_START(TASK_GROUP) { NODE_SPECIAL, DSO_TASK_START,1, { NODE_NC, NODE_NC }, { TASK_GROUP, 0 }, NULL, "DISCRETE_TASK_START" }, | |
| 4611 | #define DISCRETE_TASK_END() { NODE_SPECIAL, DSO_TASK_END , 1, { 0 }, { 0 }, NULL, "DISCRETE_TASK_END" }, | |
| 4612 | //#define DISCRETE_TASK_SYNC() { NODE_SPECIAL, DSO_TASK_SYNC, 0, { 0 }, { 0 }, NULL, "DISCRETE_TASK_SYNC" }, | |
| 4761 | #define DISCRETE_TASK_START(TASK_GROUP) DSC_SND_ENTRY( NODE_SPECIAL, DSO_TASK_START,1, DSE( NODE_NC, NODE_NC ), DSE( TASK_GROUP, 0 ), NULL, "DISCRETE_TASK_START" ), | |
| 4762 | #define DISCRETE_TASK_END() DSC_SND_ENTRY( NODE_SPECIAL, DSO_TASK_END , 1, DSE( 0 ), DSE( 0 ), NULL, "DISCRETE_TASK_END" ), | |
| 4763 | //#define DISCRETE_TASK_SYNC() DSC_SND_ENTRY( NODE_SPECIAL, DSO_TASK_SYNC, 0, DSE( 0 ), DSE( 0 ), NULL, "DISCRETE_TASK_SYNC" ), | |
| 4613 | 4764 | |
| 4614 | 4765 | /* output */ |
| 4615 | #define DISCRETE_OUTPUT(OPNODE,GAIN) | |
| 4766 | #define DISCRETE_OUTPUT(OPNODE,GAIN) DSC_SND_ENTRY( NODE_SPECIAL, DSO_OUTPUT , 2, DSE( OPNODE,NODE_NC ), DSE( 0,GAIN ), NULL, "DISCRETE_OUTPUT" ), | |
| 4616 | 4767 | |
| 4617 | 4768 | |
| 4618 | 4769 | /************************************* |
| r9922 | r9923 | |
| 4624 | 4775 | WRITE8_DEVICE_HANDLER( discrete_sound_w ); |
| 4625 | 4776 | READ8_DEVICE_HANDLER( discrete_sound_r ); |
| 4626 | 4777 | |
| 4627 | DECLARE_LEGACY_SOUND_DEVICE(DISCRETE, discrete); | |
| 4778 | //************************************************************************** | |
| 4779 | // INTERFACE CONFIGURATION MACROS | |
| 4780 | //************************************************************************** | |
| 4781 | //FIXME: Later | |
| 4782 | #if 0 | |
| 4783 | #define MCFG_DISCRETE_ADD(_tag, _clock, _type, _irqf) \ | |
| 4784 | MCFG_DEVICE_ADD(_tag, ASC, _clock) \ | |
| 4785 | MCFG_DISCRETE_TYPE(_type) \ | |
| 4786 | MCFG_IRQ_FUNC(_irqf) | |
| 4628 | 4787 | |
| 4788 | #define MCFG_DISCRETE_REPLACE(_tag, _clock, _type, _irqf) \ | |
| 4789 | MCFG_DEVICE_REPLACE(_tag, ASC, _clock) \ | |
| 4790 | MCFG_DISCRETE_TYPE(_type) \ | |
| 4791 | MCFG_IRQ_FUNC(_irqf) | |
| 4792 | ||
| 4793 | #define MCFG_DISCRETE_TYPE(_type) \ | |
| 4794 | DISCRETE_device_config::static_set_type(device, _type); \ | |
| 4795 | ||
| 4796 | #define MCFG_IRQ_FUNC(_irqf) \ | |
| 4797 | DISCRETE_device_config::static_set_irqf(device, _irqf); \ | |
| 4798 | ||
| 4799 | #endif | |
| 4800 | ||
| 4801 | //************************************************************************** | |
| 4802 | // TYPE DEFINITIONS | |
| 4803 | //************************************************************************** | |
| 4804 | ||
| 4805 | // ======================> discrete_device_config | |
| 4806 | ||
| 4807 | class discrete_device_config : public device_config, public device_config_sound_interface | |
| 4808 | { | |
| 4809 | friend class discrete_device; | |
| 4810 | ||
| 4811 | // construction/destruction | |
| 4812 | discrete_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); | |
| 4813 | ||
| 4814 | public: | |
| 4815 | // allocators | |
| 4816 | static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); | |
| 4817 | virtual device_t *alloc_device(running_machine &machine) const; | |
| 4818 | ||
| 4819 | // inline configuration helpers | |
| 4820 | //static void static_set_type(device_config *device, int type); | |
| 4821 | //static void static_set_irqf(device_config *device, void (*irqf)(device_t *device, int state)); | |
| 4822 | ||
| 4823 | protected: | |
| 4824 | // inline data | |
| 4825 | }; | |
| 4826 | ||
| 4827 | ||
| 4828 | ||
| 4829 | // ======================> discrete_device | |
| 4830 | ||
| 4831 | class discrete_device : public device_t, public device_sound_interface | |
| 4832 | { | |
| 4833 | friend class discrete_device_config; | |
| 4834 | ||
| 4835 | // construction/destruction | |
| 4836 | discrete_device(running_machine &_machine, const discrete_device_config &config); | |
| 4837 | ||
| 4838 | public: | |
| 4839 | DECLARE_READ8_MEMBER(read); | |
| 4840 | DECLARE_WRITE8_MEMBER(write); | |
| 4841 | //sound_stream *m_stream; | |
| 4842 | virtual ~discrete_device(void); | |
| 4843 | ||
| 4844 | protected: | |
| 4845 | ||
| 4846 | // device-level overrides | |
| 4847 | virtual void device_start(); | |
| 4848 | virtual void device_reset(); | |
| 4849 | ||
| 4850 | // internal callbacks | |
| 4851 | static STREAM_UPDATE( static_stream_generate ); | |
| 4852 | virtual void stream_generate(stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 4853 | ||
| 4854 | // internal state | |
| 4855 | const discrete_device_config &m_config; | |
| 4856 | ||
| 4857 | /* all for now */ | |
| 4858 | discrete_info m_info; | |
| 4859 | ||
| 4860 | private: | |
| 4861 | ||
| 4862 | ||
| 4863 | }; | |
| 4864 | ||
| 4865 | ||
| 4866 | // device type definition | |
| 4867 | extern const device_type DISCRETE; | |
| 4868 | ||
| 4869 | ||
| 4870 | //DECLARE_LEGACY_SOUND_DEVICE(DISCRETE, discrete); | |
| 4871 | ||
| 4629 | 4872 | #endif /* __DISCRETE_H__ */ |
| r9922 | r9923 | |
|---|---|---|
| 398 | 398 | |
| 399 | 399 | node_description *v_charge_node; |
| 400 | 400 | |
| 401 | context->use_ctrlv = (node->input_is_node >> 4) & 1; | |
| 401 | context->use_ctrlv = (node->input_is_node() >> 4) & 1; | |
| 402 | 402 | context->output_type = info->options & DISC_555_OUT_MASK; |
| 403 | 403 | |
| 404 | 404 | /* Use the defaults or supplied values. */ |
| r9922 | r9923 | |
| 431 | 431 | |
| 432 | 432 | /* optimization if none of the values are nodes */ |
| 433 | 433 | context->has_rc_nodes = 0; |
| 434 | if (node->input_is_node & DSD_555_ASTBL_RC_MASK) | |
| 434 | if (node->input_is_node() & DSD_555_ASTBL_RC_MASK) | |
| 435 | 435 | context->has_rc_nodes = 1; |
| 436 | 436 | else |
| 437 | 437 | { |
| r9922 | r9923 | |
| 618 | 618 | context->output_type = info->options & DISC_555_OUT_MASK; |
| 619 | 619 | if ((context->output_type == DISC_555_OUT_COUNT_F) || (context->output_type == DISC_555_OUT_COUNT_R)) |
| 620 | 620 | { |
| 621 | discrete_log(node->info, "Invalid Output type in NODE_%d.\n", | |
| 621 | discrete_log(node->info, "Invalid Output type in NODE_%d.\n", | |
| 622 | 622 | context->output_type = DISC_555_OUT_SQW; |
| 623 | 623 | } |
| 624 | 624 | |
| r9922 | r9923 | |
| 649 | 649 | |
| 650 | 650 | /* optimization if none of the values are nodes */ |
| 651 | 651 | context->has_rc_nodes = 0; |
| 652 | if (node->input_is_node & DSD_555_MSTBL_RC_MASK) | |
| 652 | if (node->input_is_node() & DSD_555_MSTBL_RC_MASK) | |
| 653 | 653 | context->has_rc_nodes = 1; |
| 654 | 654 | else |
| 655 | 655 | context->exp_charge = RC_CHARGE_EXP(DSD_555_MSTBL__R * DSD_555_MSTBL__C); |
| r9922 | r9923 | |
| 1047 | 1047 | |
| 1048 | 1048 | /* optimization if none of the values are nodes */ |
| 1049 | 1049 | context->has_rc_nodes = 0; |
| 1050 | if (node->input_is_node & DSD_555_CC_RC_MASK) | |
| 1050 | if (node->input_is_node() & DSD_555_CC_RC_MASK) | |
| 1051 | 1051 | context->has_rc_nodes = 1; |
| 1052 | 1052 | else |
| 1053 | 1053 | { |
| r9922 | r9923 | |
| 1433 | 1433 | |
| 1434 | 1434 | /* There is no charge on the cap so the 555 goes high at init. */ |
| 1435 | 1435 | context->flip_flop = 1; |
| 1436 | context->ctrlv_is_node = (node->input_is_node >> 2) & 1; | |
| 1436 | context->ctrlv_is_node = (node->input_is_node() >> 2) & 1; | |
| 1437 | 1437 | context->v_out_high = (info->v_out_high == DEFAULT_555_HIGH) ? info->v_pos - 1.2 : info->v_out_high; |
| 1438 | 1438 | |
| 1439 | 1439 | /* Calculate 555 thresholds. |
| r9922 | r9923 | |
| 1668 | 1668 | context->fake_ac = (int)DSD_566__OPTIONS & DISC_566_OUT_AC; |
| 1669 | 1669 | |
| 1670 | 1670 | if (DSD_566__VNEG >= DSD_566__VPOS) |
| 1671 | fatalerror("[v_neg >= v_pos] in NODE_%d!\n", | |
| 1671 | fatalerror("[v_neg >= v_pos] in NODE_%d!\n", | |
| 1672 | 1672 | |
| 1673 | 1673 | v_float = DSD_566__VPOS - DSD_566__VNEG; |
| 1674 | 1674 | v_int = (int)v_float; |
| 1675 | 1675 | if ( v_float < 10 || v_float > 15 ) |
| 1676 | fatalerror("v_neg and/or v_pos out of range in NODE_%d\n", | |
| 1676 | fatalerror("v_neg and/or v_pos out of range in NODE_%d\n", | |
| 1677 | 1677 | if ( v_float != v_int ) |
| 1678 | 1678 | /* fatal for now. */ |
| 1679 | fatalerror("Power should be integer in NODE_%d\n", | |
| 1679 | fatalerror("Power should be integer in NODE_%d\n", | |
| 1680 | 1680 | |
| 1681 | 1681 | context->flip_flop = 0; |
| 1682 | 1682 | context->cap_voltage = 0; |
| r9922 | r9923 | |
|---|---|---|
| 322 | 322 | |
| 323 | 323 | |
| 324 | 324 | if (!context->is_7492 && (DSS_COUNTER__MAX < DSS_COUNTER__MIN)) |
| 325 | fatalerror("MAX < MIN in NODE_%02d", | |
| 325 | fatalerror("MAX < MIN in NODE_%02d", | |
| 326 | 326 | |
| 327 | 327 | context->out_type = context->clock_type & DISC_OUT_MASK; |
| 328 | 328 | context->clock_type &= DISC_CLK_MASK; |
| r9922 | r9923 | |
| 532 | 532 | context->out_lfsr_reg = (info->flags & DISC_LFSR_FLAG_OUTPUT_SR_SN1) ? 1 : 0; |
| 533 | 533 | |
| 534 | 534 | if ((info->clock_type < DISC_CLK_ON_F_EDGE) || (info->clock_type > DISC_CLK_IS_FREQ)) |
| 535 | discrete_log(node->info, "Invalid clock type passed in NODE_%d\n", | |
| 535 | discrete_log(node->info, "Invalid clock type passed in NODE_%d\n", | |
| 536 | 536 | |
| 537 | 537 | context->last = (DSS_COUNTER__CLOCK != 0); |
| 538 | 538 | if (info->clock_type == DISC_CLK_IS_FREQ) context->t_clock = 1.0 / DSS_LFSR_NOISE__CLOCK; |
| r9922 | r9923 | |
| 1698 | 1698 | #define DSS_INVERTER_OSC__C DISCRETE_INPUT(4) |
| 1699 | 1699 | #define DSS_INVERTER_OSC__R2 DISCRETE_INPUT(5) |
| 1700 | 1700 | |
| 1701 | INLINE double dss_inverter_tftab( | |
| 1701 | INLINE double dss_inverter_tftab( | |
| 1702 | 1702 | { |
| 1703 | 1703 | DISCRETE_DECLARE_CONTEXT(dss_inverter_osc) |
| 1704 | 1704 | DISCRETE_DECLARE_INFO(discrete_inverter_osc_desc) |
| r9922 | r9923 | |
| 1710 | 1710 | return info->vB; |
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | INLINE double dss_inverter_tf( | |
| 1713 | INLINE double dss_inverter_tf( | |
| 1714 | 1714 | { |
| 1715 | 1715 | DISCRETE_DECLARE_CONTEXT(dss_inverter_osc) |
| 1716 | 1716 | DISCRETE_DECLARE_INFO(discrete_inverter_osc_desc) |
| r9922 | r9923 | |
| 1760 | 1760 | vG2 = dss_inverter_tf(node,vG3); |
| 1761 | 1761 | break; |
| 1762 | 1762 | default: |
| 1763 | fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", | |
| 1763 | fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", | |
| 1764 | 1764 | } |
| 1765 | 1765 | |
| 1766 | 1766 | clamped = 0; |
| r9922 | r9923 | |
| 1826 | 1826 | diff = diff - diff * exp(-node->info->sample_time/(context->c * rMix)); |
| 1827 | 1827 | break; |
| 1828 | 1828 | default: |
| 1829 | fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", | |
| 1829 | fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", | |
| 1830 | 1830 | } |
| 1831 | 1831 | context->v_cap += diff; |
| 1832 | 1832 | context->v_g2_old = vG2; |
| r9922 | r9923 | |
|---|---|---|
| 179 | 179 | { |
| 180 | 180 | DISCRETE_DECLARE_CONTEXT(dst_rcfilter) |
| 181 | 181 | |
| 182 | context->has_rc_nodes = node->input_is_node & 0x6; | |
| 182 | context->has_rc_nodes = node->input_is_node() & 0x6; | |
| 183 | 183 | context->rc = DST_CRFILTER__R * DST_CRFILTER__C; |
| 184 | 184 | context->exponent = RC_CHARGE_EXP(context->rc); |
| 185 | 185 | context->vCap = 0; |
| r9922 | r9923 | |
| 872 | 872 | /* some error checking. */ |
| 873 | 873 | if (DST_RCDISC4__R1 <= 0 || DST_RCDISC4__R2 <= 0 || DST_RCDISC4__C1 <= 0 || (DST_RCDISC4__R3 <= 0 && context->type == 1)) |
| 874 | 874 | { |
| 875 | discrete_log(node->info, "Invalid component values in NODE_%d.\n", | |
| 875 | discrete_log(node->info, "Invalid component values in NODE_%d.\n", | |
| 876 | 876 | return; |
| 877 | 877 | } |
| 878 | 878 | if (DST_RCDISC4__VP < 3) |
| 879 | 879 | { |
| 880 | discrete_log(node->info, "vP must be >= 3V in NODE_%d.\n", | |
| 880 | discrete_log(node->info, "vP must be >= 3V in NODE_%d.\n", | |
| 881 | 881 | return; |
| 882 | 882 | } |
| 883 | 883 | if (DST_RCDISC4__TYPE < 1 || DST_RCDISC4__TYPE > 3) |
| 884 | 884 | { |
| 885 | discrete_log(node->info, "Invalid circuit type in NODE_%d.\n", | |
| 885 | discrete_log(node->info, "Invalid circuit type in NODE_%d.\n", | |
| 886 | 886 | return; |
| 887 | 887 | } |
| 888 | 888 | |
| r9922 | r9923 | |
| 1138 | 1138 | { |
| 1139 | 1139 | DISCRETE_DECLARE_CONTEXT(dst_rcfilter) |
| 1140 | 1140 | |
| 1141 | context->has_rc_nodes = node->input_is_node & 0x6; | |
| 1141 | context->has_rc_nodes = node->input_is_node() & 0x6; | |
| 1142 | 1142 | context->rc = DST_RCFILTER__R * DST_RCFILTER__C; |
| 1143 | 1143 | context->exponent = RC_CHARGE_EXP(context->rc); |
| 1144 | 1144 | context->vCap = 0; |
| r9922 | r9923 | |
|---|---|---|
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | #include "emu.h" |
| 13 | #include "machine/ram.h" | |
| 13 | 14 | #include "sound/samples.h" |
| 14 | 15 | #include "info.h" |
| 15 | 16 | #include "xmlfile.h" |
| r9922 | r9923 | |
| 990 | 991 | } |
| 991 | 992 | } |
| 992 | 993 | |
| 994 | /* device iteration helpers */ | |
| 995 | #define ram_first(config) (config).m_devicelist.first(RAM) | |
| 996 | #define ram_next(previous) ((previous)->typenext()) | |
| 997 | ||
| 993 | 998 | /*------------------------------------------------- |
| 999 | print_game_ramoptions - prints out all RAM | |
| 1000 | options for this system | |
| 1001 | -------------------------------------------------*/ | |
| 1002 | static void print_game_ramoptions(FILE *out, const game_driver *game, const machine_config &config) | |
| 1003 | { | |
| 1004 | const device_config *device; | |
| 1005 | ||
| 1006 | for (device = ram_first(config); device != NULL; device = ram_next(device)) | |
| 1007 | { | |
| 1008 | ram_config *ram = (ram_config *)downcast<const legacy_device_config_base *>(device)->inline_config(); | |
| 1009 | fprintf(out, "\t\t<ramoption default=\"1\">%u</ramoption>\n", ram_parse_string(ram->default_size)); | |
| 1010 | if (ram->extra_options != NULL) | |
| 1011 | { | |
| 1012 | int j; | |
| 1013 | int size = strlen(ram->extra_options); | |
| 1014 | char * const s = mame_strdup(ram->extra_options); | |
| 1015 | char * const e = s + size; | |
| 1016 | char *p = s; | |
| 1017 | for (j=0;j<size;j++) { | |
| 1018 | if (p[j]==',') p[j]=0; | |
| 1019 | } | |
| 1020 | /* try to parse each option */ | |
| 1021 | while(p <= e) | |
| 1022 | { | |
| 1023 | fprintf(out, "\t\t<ramoption>%u</ramoption>\n", ram_parse_string(p)); | |
| 1024 | p += strlen(p); | |
| 1025 | if (p == e) | |
| 1026 | break; | |
| 1027 | p += 1; | |
| 1028 | } | |
| 1029 | ||
| 1030 | osd_free(s); | |
| 1031 | } | |
| 1032 | } | |
| 1033 | } | |
| 1034 | ||
| 1035 | /*------------------------------------------------- | |
| 994 | 1036 | print_game_info - print the XML information |
| 995 | 1037 | for one particular game driver |
| 996 | 1038 | -------------------------------------------------*/ |
| r9922 | r9923 | |
| 1026 | 1068 | fprintf(out, " isbios=\"yes\""); |
| 1027 | 1069 | if (game->flags & GAME_NO_STANDALONE) |
| 1028 | 1070 | fprintf(out, " runnable=\"no\""); |
| 1071 | if (game->flags & GAME_MECHANICAL) | |
| 1072 | fprintf(out, " ismechanical=\"yes\""); | |
| 1029 | 1073 | |
| 1030 | 1074 | /* display clone information */ |
| 1031 | 1075 | clone_of = driver_get_clone(game); |
| r9922 | r9923 | |
| 1064 | 1108 | print_game_adjusters(out, game, portlist); |
| 1065 | 1109 | print_game_driver(out, game, config); |
| 1066 | 1110 | print_game_images( out, game, config ); |
| 1067 | print_game_software_list( out, game, config ); | |
| 1068 | #ifdef MESS | |
| 1069 | print_mess_game_xml(out, game, config); | |
| 1070 | #endif /* MESS */ | |
| 1071 | ||
| 1111 | print_game_software_list( out, game, config ); | |
| 1112 | print_game_ramoptions( out, game, config ); | |
| 1072 | 1113 | /* close the topmost tag */ |
| 1073 | 1114 | fprintf(out, "\t</" XML_TOP ">\n"); |
| 1074 | 1115 | } |
| r9922 | r9923 | |
| 1090 | 1131 | "\t<!ATTLIST " XML_ROOT " build CDATA #IMPLIED>\n" |
| 1091 | 1132 | "\t<!ATTLIST " XML_ROOT " debug (yes|no) \"no\">\n" |
| 1092 | 1133 | "\t<!ATTLIST " XML_ROOT " mameconfig CDATA #REQUIRED>\n" |
| 1093 | #ifdef MESS | |
| 1094 | 1134 | "\t<!ELEMENT " XML_TOP " (description, year?, manufacturer, biosset*, rom*, disk*, sample*, chip*, display*, sound?, input?, dipswitch*, configuration*, category*, adjuster*, driver?, device*, ramoption*, softwarelist*)>\n" |
| 1095 | #else | |
| 1096 | "\t<!ELEMENT " XML_TOP " (description, year?, manufacturer, biosset*, rom*, disk*, sample*, chip*, display*, sound?, input?, dipswitch*, configuration*, category*, adjuster*, driver?, device*, softwarelist*)>\n" | |
| 1097 | #endif | |
| 1098 | 1135 | "\t\t<!ATTLIST " XML_TOP " name CDATA #REQUIRED>\n" |
| 1099 | 1136 | "\t\t<!ATTLIST " XML_TOP " sourcefile CDATA #IMPLIED>\n" |
| 1100 | 1137 | "\t\t<!ATTLIST " XML_TOP " isbios (yes|no) \"no\">\n" |
| 1138 | "\t\t<!ATTLIST " XML_TOP " ismechanical (yes|no) \"no\">\n" | |
| 1101 | 1139 | "\t\t<!ATTLIST " XML_TOP " runnable (yes|no) \"yes\">\n" |
| 1102 | 1140 | "\t\t<!ATTLIST " XML_TOP " cloneof CDATA #IMPLIED>\n" |
| 1103 | 1141 | "\t\t<!ATTLIST " XML_TOP " romof CDATA #IMPLIED>\n" |
| r9922 | r9923 | |
| 1213 | 1251 | "\t\t<!ELEMENT softwarelist EMPTY>\n" |
| 1214 | 1252 | "\t\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n" |
| 1215 | 1253 | "\t\t\t<!ATTLIST softwarelist status (original|compatible) #REQUIRED>\n" |
| 1216 | #ifdef MESS | |
| 1217 | 1254 | "\t\t<!ELEMENT ramoption (#PCDATA)>\n" |
| 1218 | 1255 | "\t\t\t<!ATTLIST ramoption default CDATA #IMPLIED>\n" |
| 1219 | #endif | |
| 1220 | 1256 | "]>\n\n" |
| 1221 | 1257 | "<" XML_ROOT " build=\"%s\" debug=\"" |
| 1222 | 1258 | #ifdef MAME_DEBUG |
| r9922 | r9923 | |
|---|---|---|
| 188 | 188 | $(EMUMACHINE)/pic8259.o \ |
| 189 | 189 | $(EMUMACHINE)/pit8253.o \ |
| 190 | 190 | $(EMUMACHINE)/pd4990a.o \ |
| 191 | $(EMUMACHINE)/ram.o \ | |
| 191 | 192 | $(EMUMACHINE)/roc10937.o \ |
| 192 | 193 | $(EMUMACHINE)/rp5h01.o \ |
| 193 | 194 | $(EMUMACHINE)/rtc65271.o \ |
| r0 | r9923 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | RAM device | |
| 4 | ||
| 5 | Provides a configurable amount of RAM to drivers | |
| 6 | ||
| 7 | **************************************************************************/ | |
| 8 | ||
| 9 | #include <stdio.h> | |
| 10 | #include <ctype.h> | |
| 11 | ||
| 12 | #include "emu.h" | |
| 13 | #include "emuopts.h" | |
| 14 | #include "ram.h" | |
| 15 | ||
| 16 | ||
| 17 | /*************************************************************************** | |
| 18 | CONSTANTS | |
| 19 | ***************************************************************************/ | |
| 20 | ||
| 21 | #define RAM_STRING_BUFLEN 16 | |
| 22 | #define MAX_RAM_OPTIONS 16 | |
| 23 | ||
| 24 | ||
| 25 | /*************************************************************************** | |
| 26 | TYPE DEFINITIONS | |
| 27 | ***************************************************************************/ | |
| 28 | ||
| 29 | typedef struct _ram_state ram_state; | |
| 30 | struct _ram_state | |
| 31 | { | |
| 32 | UINT32 size; /* total amount of ram configured */ | |
| 33 | UINT8 *ram; /* pointer to the start of ram */ | |
| 34 | }; | |
| 35 | ||
| 36 | ||
| 37 | /***************************************************************************** | |
| 38 | INLINE FUNCTIONS | |
| 39 | *****************************************************************************/ | |
| 40 | ||
| 41 | INLINE ram_state *get_safe_token(device_t *device) | |
| 42 | { | |
| 43 | assert(device != NULL); | |
| 44 | assert(device->type() == RAM); | |
| 45 | ||
| 46 | return (ram_state *)downcast<legacy_device_base *>(device)->token(); | |
| 47 | } | |
| 48 | ||
| 49 | ||
| 50 | /***************************************************************************** | |
| 51 | HELPER FUNCTIONS | |
| 52 | *****************************************************************************/ | |
| 53 | ||
| 54 | /*------------------------------------------------- | |
| 55 | ram_parse_string - convert a ram string to an | |
| 56 | integer value | |
| 57 | -------------------------------------------------*/ | |
| 58 | ||
| 59 | UINT32 ram_parse_string(const char *s) | |
| 60 | { | |
| 61 | UINT32 ram; | |
| 62 | char suffix = '\0'; | |
| 63 | ||
| 64 | s += sscanf(s, "%u%c", &ram, &suffix); | |
| 65 | ||
| 66 | switch(tolower(suffix)) | |
| 67 | { | |
| 68 | case 'k': | |
| 69 | /* kilobytes */ | |
| 70 | ram *= 1024; | |
| 71 | break; | |
| 72 | ||
| 73 | case 'm': | |
| 74 | /* megabytes */ | |
| 75 | ram *= 1024*1024; | |
| 76 | break; | |
| 77 | ||
| 78 | case '\0': | |
| 79 | /* no suffix */ | |
| 80 | break; | |
| 81 | ||
| 82 | default: | |
| 83 | /* parse failure */ | |
| 84 | ram = 0; | |
| 85 | break; | |
| 86 | } | |
| 87 | ||
| 88 | return ram; | |
| 89 | } | |
| 90 | ||
| 91 | /***************************************************************************** | |
| 92 | DEVICE INTERFACE | |
| 93 | *****************************************************************************/ | |
| 94 | ||
| 95 | static DEVICE_START( ram ) | |
| 96 | { | |
| 97 | ram_state *ram = get_safe_token(device); | |
| 98 | ram_config *config = (ram_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config(); | |
| 99 | ||
| 100 | /* the device named 'ram' can get ram options from command line */ | |
| 101 | if (strcmp(device->tag(), RAM_TAG) == 0) | |
| 102 | { | |
| 103 | const char *ramsize_string = options_get_string(mame_options(), OPTION_RAMSIZE); | |
| 104 | ||
| 105 | if ((ramsize_string != NULL) && (ramsize_string[0] != '\0')) | |
| 106 | ram->size = ram_parse_string(ramsize_string); | |
| 107 | } | |
| 108 | ||
| 109 | /* if we didn't get a size yet, use the default */ | |
| 110 | if (ram->size == 0) | |
| 111 | ram->size = ram_parse_string(config->default_size); | |
| 112 | ||
| 113 | /* allocate space for the ram */ | |
| 114 | ram->ram = auto_alloc_array(device->machine, UINT8, ram->size); | |
| 115 | ||
| 116 | /* reset ram to the default value */ | |
| 117 | memset(ram->ram, config->default_value, ram->size); | |
| 118 | ||
| 119 | /* register for state saving */ | |
| 120 | state_save_register_device_item(device, 0, ram->size); | |
| 121 | state_save_register_device_item_pointer(device, 0, ram->ram, ram->size); | |
| 122 | } | |
| 123 | ||
| 124 | static DEVICE_VALIDITY_CHECK( ram ) | |
| 125 | { | |
| 126 | ram_config *config = (ram_config *)downcast<const legacy_device_config_base *>(device)->inline_config(); | |
| 127 | const char *ramsize_string = NULL; | |
| 128 | int is_valid = FALSE; | |
| 129 | UINT32 specified_ram = 0; | |
| 130 | int error = FALSE; | |
| 131 | const char *gamename_option = NULL; | |
| 132 | ||
| 133 | /* verify default ram value */ | |
| 134 | if (config!=NULL && ram_parse_string(config->default_size) == 0) | |
| 135 | { | |
| 136 | mame_printf_error("%s: '%s' has an invalid default RAM option: %s\n", driver->source_file, driver->name, config->default_size); | |
| 137 | error = TRUE; | |
| 138 | } | |
| 139 | ||
| 140 | /* command line options are only parsed for the device named RAM_TAG */ | |
| 141 | if (device->tag()!=NULL && strcmp(device->tag(), RAM_TAG) == 0) | |
| 142 | { | |
| 143 | if (mame_options()==NULL) return FALSE; | |
| 144 | /* verify command line ram option */ | |
| 145 | ramsize_string = options_get_string(mame_options(), OPTION_RAMSIZE); | |
| 146 | gamename_option = options_get_string(mame_options(), OPTION_GAMENAME); | |
| 147 | ||
| 148 | if ((ramsize_string != NULL) && (ramsize_string[0] != '\0')) | |
| 149 | { | |
| 150 | specified_ram = ram_parse_string(ramsize_string); | |
| 151 | ||
| 152 | if (specified_ram == 0) | |
| 153 | { | |
| 154 | mame_printf_error("%s: '%s' cannot recognize the RAM option %s\n", driver->source_file, driver->name, ramsize_string); | |
| 155 | error = TRUE; | |
| 156 | } | |
| 157 | if (gamename_option != NULL && *gamename_option != 0 && strcmp(gamename_option, driver->name) == 0) | |
| 158 | { | |
| 159 | /* compare command line option to default value */ | |
| 160 | if (ram_parse_string(config->default_size) == specified_ram) | |
| 161 | is_valid = TRUE; | |
| 162 | ||
| 163 | /* verify extra ram options */ | |
| 164 | if (config->extra_options != NULL) | |
| 165 | { | |
| 166 | int j; | |
| 167 | int size = strlen(config->extra_options); | |
| 168 | char * const s = mame_strdup(config->extra_options); | |
| 169 | char * const e = s + size; | |
| 170 | char *p = s; | |
| 171 | for (j=0;j<size;j++) { | |
| 172 | if (p[j]==',') p[j]=0; | |
| 173 | } | |
| 174 | ||
| 175 | /* try to parse each option */ | |
| 176 | while(p <= e) | |
| 177 | { | |
| 178 | UINT32 option_ram_size = ram_parse_string(p); | |
| 179 | ||
| 180 | if (option_ram_size == 0) | |
| 181 | { | |
| 182 | mame_printf_error("%s: '%s' has an invalid RAM option: %s\n", driver->source_file, driver->name, p); | |
| 183 | error = TRUE; | |
| 184 | } | |
| 185 | ||
| 186 | if (option_ram_size == specified_ram) | |
| 187 | is_valid = TRUE; | |
| 188 | ||
| 189 | p += strlen(p); | |
| 190 | if (p == e) | |
| 191 | break; | |
| 192 | p += 1; | |
| 193 | } | |
| 194 | ||
| 195 | osd_free(s); | |
| 196 | } | |
| 197 | ||
| 198 | } else { | |
| 199 | /* if not for this driver then return ok */ | |
| 200 | is_valid = TRUE; | |
| 201 | } | |
| 202 | } | |
| 203 | else | |
| 204 | { | |
| 205 | /* not specifying the ramsize on the command line is valid as well */ | |
| 206 | is_valid = TRUE; | |
| 207 | } | |
| 208 | } | |
| 209 | else | |
| 210 | is_valid = TRUE; | |
| 211 | ||
| 212 | if (!is_valid) | |
| 213 | { | |
| 214 | mame_printf_error("%s: '%s' cannot recognize the RAM option %s", driver->source_file, driver->name, ramsize_string); | |
| 215 | mame_printf_error(" (valid options are %s", config->default_size); | |
| 216 | ||
| 217 | if (config->extra_options != NULL) | |
| 218 | mame_printf_error(",%s).\n", config->extra_options); | |
| 219 | else | |
| 220 | mame_printf_error(").\n"); | |
| 221 | ||
| 222 | error = TRUE; | |
| 223 | } | |
| 224 | ||
| 225 | return error; | |
| 226 | ||
| 227 | } | |
| 228 | ||
| 229 | ||
| 230 | DEVICE_GET_INFO( ram ) | |
| 231 | { | |
| 232 | switch (state) | |
| 233 | { | |
| 234 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 235 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(ram_state); break; | |
| 236 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(ram_config); break; | |
| 237 | ||
| 238 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 239 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(ram); break; | |
| 240 | case DEVINFO_FCT_STOP: /* Nothing */ break; | |
| 241 | case DEVINFO_FCT_RESET: /* Nothing */ break; | |
| 242 | case DEVINFO_FCT_VALIDITY_CHECK: info->p = (void*)DEVICE_VALIDITY_CHECK_NAME(ram); break; | |
| 243 | ||
| 244 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 245 | case DEVINFO_STR_NAME: strcpy(info->s, "RAM"); break; | |
| 246 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RAM"); break; | |
| 247 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 248 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 249 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 250 | } | |
| 251 | } | |
| 252 | ||
| 253 | /*************************************************************************** | |
| 254 | IMPLEMENTATION | |
| 255 | ***************************************************************************/ | |
| 256 | ||
| 257 | UINT32 ram_get_size(device_t *device) | |
| 258 | { | |
| 259 | ram_state *ram = get_safe_token(device); | |
| 260 | return ram->size; | |
| 261 | } | |
| 262 | ||
| 263 | UINT8 *ram_get_ptr(device_t *device) | |
| 264 | { | |
| 265 | ram_state *ram = get_safe_token(device); | |
| 266 | return ram->ram; | |
| 267 | } | |
| 268 | ||
| 269 | DEFINE_LEGACY_DEVICE(RAM, ram); |
| r0 | r9923 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | RAM device | |
| 4 | ||
| 5 | Provides a configurable amount of RAM to drivers | |
| 6 | ||
| 7 | **************************************************************************/ | |
| 8 | ||
| 9 | #ifndef __RAM_H__ | |
| 10 | #define __RAM_H__ | |
| 11 | ||
| 12 | ||
| 13 | /*************************************************************************** | |
| 14 | CONSTANTS | |
| 15 | ***************************************************************************/ | |
| 16 | ||
| 17 | #define RAM_DEFAULT_VALUE 0xcd | |
| 18 | #define RAM_TAG "ram" | |
| 19 | ||
| 20 | /*************************************************************************** | |
| 21 | TYPE DEFINITIONS | |
| 22 | ***************************************************************************/ | |
| 23 | ||
| 24 | typedef struct _ram_config ram_config; | |
| 25 | struct _ram_config | |
| 26 | { | |
| 27 | const char *default_size; | |
| 28 | const char *extra_options; | |
| 29 | UINT8 default_value; | |
| 30 | }; | |
| 31 | ||
| 32 | ||
| 33 | /*************************************************************************** | |
| 34 | DEVICE CONFIGURATION MACROS | |
| 35 | ***************************************************************************/ | |
| 36 | ||
| 37 | DECLARE_LEGACY_DEVICE(RAM, ram); | |
| 38 | ||
| 39 | #define MCFG_RAM_ADD(_tag) \ | |
| 40 | MCFG_DEVICE_ADD(_tag, RAM, 0) \ | |
| 41 | MCFG_DEVICE_CONFIG_DATA32(ram_config, default_value, RAM_DEFAULT_VALUE) | |
| 42 | ||
| 43 | #define MCFG_RAM_REMOVE(_tag) \ | |
| 44 | MCFG_DEVICE_REMOVE(_tag) | |
| 45 | ||
| 46 | #define MCFG_RAM_MODIFY(_tag) \ | |
| 47 | MCFG_DEVICE_MODIFY(_tag) \ | |
| 48 | MCFG_DEVICE_CONFIG_DATAPTR(ram_config, extra_options, NULL) | |
| 49 | ||
| 50 | #define MCFG_RAM_DEFAULT_SIZE(_default_size) \ | |
| 51 | MCFG_DEVICE_CONFIG_DATAPTR(ram_config, default_size, _default_size) | |
| 52 | ||
| 53 | #define MCFG_RAM_EXTRA_OPTIONS(_extra_options) \ | |
| 54 | MCFG_DEVICE_CONFIG_DATAPTR(ram_config, extra_options, _extra_options) | |
| 55 | ||
| 56 | #define MCFG_RAM_DEFAULT_VALUE(_default_value) \ | |
| 57 | MCFG_DEVICE_CONFIG_DATA32(ram_config, default_value, _default_value) | |
| 58 | ||
| 59 | ||
| 60 | /*************************************************************************** | |
| 61 | FUNCTION PROTOTYPES | |
| 62 | ***************************************************************************/ | |
| 63 | ||
| 64 | UINT32 ram_get_size(device_t *device); | |
| 65 | UINT8 *ram_get_ptr(device_t *device); | |
| 66 | UINT32 ram_parse_string(const char *s); | |
| 67 | ||
| 68 | #endif /* __RAM_H__ */ |
| r9922 | r9923 | |
|---|---|---|
| 115 | 115 | &LAYOUT[0] \ |
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | #define CONS(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,INIT,COMPANY,FULLNAME,FLAGS) \ | |
| 119 | extern const game_driver GAME_NAME(NAME) = \ | |
| 120 | { \ | |
| 121 | __FILE__, \ | |
| 122 | #PARENT, \ | |
| 123 | #NAME, \ | |
| 124 | FULLNAME, \ | |
| 125 | #YEAR, \ | |
| 126 | COMPANY, \ | |
| 127 | MACHINE_CONFIG_NAME(MACHINE), \ | |
| 128 | INPUT_PORTS_NAME(INPUT), \ | |
| 129 | DRIVER_INIT_NAME(INIT), \ | |
| 130 | ROM_NAME(NAME), \ | |
| 131 | #COMPAT, \ | |
| 132 | ROT0|(FLAGS), \ | |
| 133 | NULL \ | |
| 134 | }; | |
| 118 | 135 | |
| 136 | #define COMP(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,INIT,COMPANY,FULLNAME,FLAGS) \ | |
| 137 | extern const game_driver GAME_NAME(NAME) = \ | |
| 138 | { \ | |
| 139 | __FILE__, \ | |
| 140 | #PARENT, \ | |
| 141 | #NAME, \ | |
| 142 | FULLNAME, \ | |
| 143 | #YEAR, \ | |
| 144 | COMPANY, \ | |
| 145 | MACHINE_CONFIG_NAME(MACHINE), \ | |
| 146 | INPUT_PORTS_NAME(INPUT), \ | |
| 147 | DRIVER_INIT_NAME(INIT), \ | |
| 148 | ROM_NAME(NAME), \ | |
| 149 | #COMPAT, \ | |
| 150 | ROT0|(FLAGS), \ | |
| 151 | NULL \ | |
| 152 | }; | |
| 119 | 153 | |
| 120 | 154 | /*************************************************************************** |
| 121 | 155 | GLOBAL VARIABLES |
| r9922 | r9923 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | MESS RAM device | |
| 4 | ||
| 5 | Provides a configurable amount of RAM to drivers | |
| 6 | ||
| 7 | **************************************************************************/ | |
| 8 | ||
| 9 | #include <stdio.h> | |
| 10 | #include <ctype.h> | |
| 11 | ||
| 12 | #include "emu.h" | |
| 13 | #include "emuopts.h" | |
| 14 | #include "messram.h" | |
| 15 | ||
| 16 | ||
| 17 | /*************************************************************************** | |
| 18 | CONSTANTS | |
| 19 | ***************************************************************************/ | |
| 20 | ||
| 21 | #define RAM_STRING_BUFLEN 16 | |
| 22 | #define MAX_RAM_OPTIONS 16 | |
| 23 | ||
| 24 | ||
| 25 | /*************************************************************************** | |
| 26 | TYPE DEFINITIONS | |
| 27 | ***************************************************************************/ | |
| 28 | ||
| 29 | typedef struct _messram_state messram_state; | |
| 30 | struct _messram_state | |
| 31 | { | |
| 32 | UINT32 size; /* total amount of ram configured */ | |
| 33 | UINT8 *ram; /* pointer to the start of ram */ | |
| 34 | }; | |
| 35 | ||
| 36 | ||
| 37 | /***************************************************************************** | |
| 38 | INLINE FUNCTIONS | |
| 39 | *****************************************************************************/ | |
| 40 | ||
| 41 | INLINE messram_state *get_safe_token(device_t *device) | |
| 42 | { | |
| 43 | assert(device != NULL); | |
| 44 | assert(device->type() == MESSRAM); | |
| 45 | ||
| 46 | return (messram_state *)downcast<legacy_device_base *>(device)->token(); | |
| 47 | } | |
| 48 | ||
| 49 | ||
| 50 | /***************************************************************************** | |
| 51 | HELPER FUNCTIONS | |
| 52 | *****************************************************************************/ | |
| 53 | ||
| 54 | /*------------------------------------------------- | |
| 55 | messram_parse_string - convert a ram string to an | |
| 56 | integer value | |
| 57 | -------------------------------------------------*/ | |
| 58 | ||
| 59 | UINT32 messram_parse_string(const char *s) | |
| 60 | { | |
| 61 | UINT32 ram; | |
| 62 | char suffix = '\0'; | |
| 63 | ||
| 64 | s += sscanf(s, "%u%c", &ram, &suffix); | |
| 65 | ||
| 66 | switch(tolower(suffix)) | |
| 67 | { | |
| 68 | case 'k': | |
| 69 | /* kilobytes */ | |
| 70 | ram *= 1024; | |
| 71 | break; | |
| 72 | ||
| 73 | case 'm': | |
| 74 | /* megabytes */ | |
| 75 | ram *= 1024*1024; | |
| 76 | break; | |
| 77 | ||
| 78 | case '\0': | |
| 79 | /* no suffix */ | |
| 80 | break; | |
| 81 | ||
| 82 | default: | |
| 83 | /* parse failure */ | |
| 84 | ram = 0; | |
| 85 | break; | |
| 86 | } | |
| 87 | ||
| 88 | return ram; | |
| 89 | } | |
| 90 | ||
| 91 | #ifdef UNUSED_FUNCTION | |
| 92 | const char *messram_string(char *buffer, UINT32 ram) | |
| 93 | { | |
| 94 | const char *suffix; | |
| 95 | ||
| 96 | if ((ram % (1024*1024)) == 0) | |
| 97 | { | |
| 98 | ram /= 1024*1024; | |
| 99 | suffix = "m"; | |
| 100 | } | |
| 101 | else if ((ram % 1024) == 0) | |
| 102 | { | |
| 103 | ram /= 1024; | |
| 104 | suffix = "k"; | |
| 105 | } | |
| 106 | else | |
| 107 | { | |
| 108 | suffix = ""; | |
| 109 | } | |
| 110 | sprintf(buffer, "%u%s", ram, suffix); | |
| 111 | return buffer; | |
| 112 | } | |
| 113 | #endif | |
| 114 | ||
| 115 | ||
| 116 | /***************************************************************************** | |
| 117 | DEVICE INTERFACE | |
| 118 | *****************************************************************************/ | |
| 119 | ||
| 120 | static DEVICE_START( messram ) | |
| 121 | { | |
| 122 | messram_state *messram = get_safe_token(device); | |
| 123 | ram_config *config = (ram_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config(); | |
| 124 | ||
| 125 | /* the device named 'messram' can get ram options from command line */ | |
| 126 | if (strcmp(device->tag(), "messram") == 0) | |
| 127 | { | |
| 128 | const char *ramsize_string = options_get_string(mame_options(), OPTION_RAMSIZE); | |
| 129 | ||
| 130 | if ((ramsize_string != NULL) && (ramsize_string[0] != '\0')) | |
| 131 | messram->size = messram_parse_string(ramsize_string); | |
| 132 | } | |
| 133 | ||
| 134 | /* if we didn't get a size yet, use the default */ | |
| 135 | if (messram->size == 0) | |
| 136 | messram->size = messram_parse_string(config->default_size); | |
| 137 | ||
| 138 | /* allocate space for the ram */ | |
| 139 | messram->ram = auto_alloc_array(device->machine, UINT8, messram->size); | |
| 140 | ||
| 141 | /* reset ram to the default value */ | |
| 142 | memset(messram->ram, config->default_value, messram->size); | |
| 143 | ||
| 144 | /* register for state saving */ | |
| 145 | state_save_register_device_item(device, 0, messram->size); | |
| 146 | state_save_register_device_item_pointer(device, 0, messram->ram, messram->size); | |
| 147 | } | |
| 148 | ||
| 149 | static DEVICE_VALIDITY_CHECK( messram ) | |
| 150 | { | |
| 151 | ram_config *config = (ram_config *)downcast<const legacy_device_config_base *>(device)->inline_config(); | |
| 152 | const char *ramsize_string = NULL; | |
| 153 | int is_valid = FALSE; | |
| 154 | UINT32 specified_ram = 0; | |
| 155 | int error = FALSE; | |
| 156 | const char *gamename_option = NULL; | |
| 157 | ||
| 158 | /* verify default ram value */ | |
| 159 | if (config!=NULL && messram_parse_string(config->default_size) == 0) | |
| 160 | { | |
| 161 | mame_printf_error("%s: '%s' has an invalid default RAM option: %s\n", driver->source_file, driver->name, config->default_size); | |
| 162 | error = TRUE; | |
| 163 | } | |
| 164 | ||
| 165 | /* command line options are only parsed for the device named "messram" */ | |
| 166 | if (device->tag()!=NULL && strcmp(device->tag(), "messram") == 0) | |
| 167 | { | |
| 168 | if (mame_options()==NULL) return FALSE; | |
| 169 | /* verify command line ram option */ | |
| 170 | ramsize_string = options_get_string(mame_options(), OPTION_RAMSIZE); | |
| 171 | gamename_option = options_get_string(mame_options(), OPTION_GAMENAME); | |
| 172 | ||
| 173 | if ((ramsize_string != NULL) && (ramsize_string[0] != '\0')) | |
| 174 | { | |
| 175 | specified_ram = messram_parse_string(ramsize_string); | |
| 176 | ||
| 177 | if (specified_ram == 0) | |
| 178 | { | |
| 179 | mame_printf_error("%s: '%s' cannot recognize the RAM option %s\n", driver->source_file, driver->name, ramsize_string); | |
| 180 | error = TRUE; | |
| 181 | } | |
| 182 | if (gamename_option != NULL && *gamename_option != 0 && strcmp(gamename_option, driver->name) == 0) | |
| 183 | { | |
| 184 | /* compare command line option to default value */ | |
| 185 | if (messram_parse_string(config->default_size) == specified_ram) | |
| 186 | is_valid = TRUE; | |
| 187 | ||
| 188 | /* verify extra ram options */ | |
| 189 | if (config->extra_options != NULL) | |
| 190 | { | |
| 191 | int j; | |
| 192 | int size = strlen(config->extra_options); | |
| 193 | char * const s = mame_strdup(config->extra_options); | |
| 194 | char * const e = s + size; | |
| 195 | char *p = s; | |
| 196 | for (j=0;j<size;j++) { | |
| 197 | if (p[j]==',') p[j]=0; | |
| 198 | } | |
| 199 | ||
| 200 | /* try to parse each option */ | |
| 201 | while(p <= e) | |
| 202 | { | |
| 203 | UINT32 option_ram_size = messram_parse_string(p); | |
| 204 | ||
| 205 | if (option_ram_size == 0) | |
| 206 | { | |
| 207 | mame_printf_error("%s: '%s' has an invalid RAM option: %s\n", driver->source_file, driver->name, p); | |
| 208 | error = TRUE; | |
| 209 | } | |
| 210 | ||
| 211 | if (option_ram_size == specified_ram) | |
| 212 | is_valid = TRUE; | |
| 213 | ||
| 214 | p += strlen(p); | |
| 215 | if (p == e) | |
| 216 | break; | |
| 217 | p += 1; | |
| 218 | } | |
| 219 | ||
| 220 | osd_free(s); | |
| 221 | } | |
| 222 | ||
| 223 | } else { | |
| 224 | /* if not for this driver then return ok */ | |
| 225 | is_valid = TRUE; | |
| 226 | } | |
| 227 | } | |
| 228 | else | |
| 229 | { | |
| 230 | /* not specifying the ramsize on the command line is valid as well */ | |
| 231 | is_valid = TRUE; | |
| 232 | } | |
| 233 | } | |
| 234 | else | |
| 235 | is_valid = TRUE; | |
| 236 | ||
| 237 | if (!is_valid) | |
| 238 | { | |
| 239 | mame_printf_error("%s: '%s' cannot recognize the RAM option %s", driver->source_file, driver->name, ramsize_string); | |
| 240 | mame_printf_error(" (valid options are %s", config->default_size); | |
| 241 | ||
| 242 | if (config->extra_options != NULL) | |
| 243 | mame_printf_error(",%s).\n", config->extra_options); | |
| 244 | else | |
| 245 | mame_printf_error(").\n"); | |
| 246 | ||
| 247 | error = TRUE; | |
| 248 | } | |
| 249 | ||
| 250 | return error; | |
| 251 | ||
| 252 | } | |
| 253 | ||
| 254 | ||
| 255 | DEVICE_GET_INFO( messram ) | |
| 256 | { | |
| 257 | switch (state) | |
| 258 | { | |
| 259 | /* --- the following bits of info are returned as 64-bit signed integers --- */ | |
| 260 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(messram_state); break; | |
| 261 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(ram_config); break; | |
| 262 | ||
| 263 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 264 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(messram); break; | |
| 265 | case DEVINFO_FCT_STOP: /* Nothing */ break; | |
| 266 | case DEVINFO_FCT_RESET: /* Nothing */ break; | |
| 267 | case DEVINFO_FCT_VALIDITY_CHECK: info->p = (void*)DEVICE_VALIDITY_CHECK_NAME(messram); break; | |
| 268 | ||
| 269 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 270 | case DEVINFO_STR_NAME: strcpy(info->s, "MESS RAM"); break; | |
| 271 | case DEVINFO_STR_FAMILY: strcpy(info->s, "RAM"); break; | |
| 272 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.00"); break; | |
| 273 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 274 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; | |
| 275 | } | |
| 276 | } | |
| 277 | ||
| 278 | ||
| 279 | /*************************************************************************** | |
| 280 | IMPLEMENTATION | |
| 281 | ***************************************************************************/ | |
| 282 | ||
| 283 | UINT32 messram_get_size(device_t *device) | |
| 284 | { | |
| 285 | messram_state *messram = get_safe_token(device); | |
| 286 | return messram->size; | |
| 287 | } | |
| 288 | ||
| 289 | ||
| 290 | UINT8 *messram_get_ptr(device_t *device) | |
| 291 | { | |
| 292 | messram_state *messram = get_safe_token(device); | |
| 293 | return messram->ram; | |
| 294 | } | |
| 295 | ||
| 296 | ||
| 297 | #ifdef UNUSED_FUNCTION | |
| 298 | void messram_dump(device_t *device, const char *filename) | |
| 299 | { | |
| 300 | messram_state *messram = get_safe_token(device); | |
| 301 | file_error filerr; | |
| 302 | mame_file *file; | |
| 303 | ||
| 304 | /* use a default filename */ | |
| 305 | if (!filename) | |
| 306 | filename = "ram.bin"; | |
| 307 | ||
| 308 | /* open the file */ | |
| 309 | filerr = mame_fopen(NULL, filename, OPEN_FLAG_WRITE, &file); | |
| 310 | if (filerr == FILERR_NONE) | |
| 311 | { | |
| 312 | /* write the data */ | |
| 313 | mame_fwrite(file, messram->ram, messram->size); | |
| 314 | ||
| 315 | /* close file */ | |
| 316 | mame_fclose(file); | |
| 317 | } | |
| 318 | } | |
| 319 | #endif | |
| 320 | ||
| 321 | DEFINE_LEGACY_DEVICE(MESSRAM, messram); |
| r9922 | r9923 | |
|---|---|---|
| 1 | /************************************************************************* | |
| 2 | ||
| 3 | MESS RAM device | |
| 4 | ||
| 5 | Provides a configurable amount of RAM to drivers | |
| 6 | ||
| 7 | **************************************************************************/ | |
| 8 | ||
| 9 | #ifndef __MESSRAM_H__ | |
| 10 | #define __MESSRAM_H__ | |
| 11 | ||
| 12 | ||
| 13 | /*************************************************************************** | |
| 14 | CONSTANTS | |
| 15 | ***************************************************************************/ | |
| 16 | ||
| 17 | #define RAM_DEFAULT_VALUE 0xcd | |
| 18 | ||
| 19 | ||
| 20 | /*************************************************************************** | |
| 21 | TYPE DEFINITIONS | |
| 22 | ***************************************************************************/ | |
| 23 | ||
| 24 | typedef struct _ram_config ram_config; | |
| 25 | struct _ram_config | |
| 26 | { | |
| 27 | const char *default_size; | |
| 28 | const char *extra_options; | |
| 29 | UINT8 default_value; | |
| 30 | }; | |
| 31 | ||
| 32 | ||
| 33 | /*************************************************************************** | |
| 34 | DEVICE CONFIGURATION MACROS | |
| 35 | ***************************************************************************/ | |
| 36 | ||
| 37 | DECLARE_LEGACY_DEVICE(MESSRAM, messram); | |
| 38 | ||
| 39 | #define MCFG_RAM_ADD(_tag) \ | |
| 40 | MCFG_DEVICE_ADD(_tag, MESSRAM, 0) \ | |
| 41 | MCFG_DEVICE_CONFIG_DATA32(ram_config, default_value, RAM_DEFAULT_VALUE) | |
| 42 | ||
| 43 | #define MCFG_RAM_REMOVE(_tag) \ | |
| 44 | MCFG_DEVICE_REMOVE(_tag) | |
| 45 | ||
| 46 | #define MCFG_RAM_MODIFY(_tag) \ | |
| 47 | MCFG_DEVICE_MODIFY(_tag) \ | |
| 48 | MCFG_DEVICE_CONFIG_DATAPTR(ram_config, extra_options, NULL) | |
| 49 | ||
| 50 | #define MCFG_RAM_DEFAULT_SIZE(_default_size) \ | |
| 51 | MCFG_DEVICE_CONFIG_DATAPTR(ram_config, default_size, _default_size) | |
| 52 | ||
| 53 | #define MCFG_RAM_EXTRA_OPTIONS(_extra_options) \ | |
| 54 | MCFG_DEVICE_CONFIG_DATAPTR(ram_config, extra_options, _extra_options) | |
| 55 | ||
| 56 | #define MCFG_RAM_DEFAULT_VALUE(_default_value) \ | |
| 57 | MCFG_DEVICE_CONFIG_DATA32(ram_config, default_value, _default_value) | |
| 58 | ||
| 59 | ||
| 60 | /*************************************************************************** | |
| 61 | FUNCTION PROTOTYPES | |
| 62 | ***************************************************************************/ | |
| 63 | ||
| 64 | UINT32 messram_get_size(device_t *device); | |
| 65 | UINT8 *messram_get_ptr(device_t *device); | |
| 66 | #ifdef UNUSED_FUNCTION | |
| 67 | void messram_dump(device_t *device, const char *filename); | |
| 68 | const char *messram_string(char *buffer, UINT32 ram); | |
| 69 | #endif | |
| 70 | UINT32 messram_parse_string(const char *s); | |
| 71 | ||
| 72 | #endif /* __MESSRAM_H__ */ |
| r9922 | r9923 | |
|---|---|---|
| 39 | 39 | #include "emu.h" |
| 40 | 40 | #include "coco_vhd.h" |
| 41 | 41 | #include "includes/coco.h" |
| 42 | #include " | |
| 42 | #include "ma | |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | /*************************************************************************** |
| r9922 | r9923 | |
| 164 | 164 | switch(data) |
| 165 | 165 | { |
| 166 | 166 | case VHDCMD_READ: /* Read sector */ |
| 167 | memset(& | |
| 167 | memset(& | |
| 168 | 168 | if (total_size > seek_position) |
| 169 | 169 | { |
| 170 | 170 | bytes_to_read = (UINT32) MIN((UINT64) 256, total_size - seek_position); |
| 171 | result = image->fread(& | |
| 171 | result = image->fread(& | |
| 172 | 172 | if (result != bytes_to_read) |
| 173 | 173 | { |
| 174 | 174 | vhd->status = VHDSTATUS_ACCESS_DENIED; |
| r9922 | r9923 | |
| 180 | 180 | break; |
| 181 | 181 | |
| 182 | 182 | case VHDCMD_WRITE: /* Write Sector */ |
| 183 | result = image->fwrite(&( | |
| 183 | result = image->fwrite(&( | |
| 184 | 184 | |
| 185 | 185 | if (result != 256) |
| 186 | 186 | { |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "xmlfile.h" |
| 14 | 14 | #include "emu.h" |
| 15 | 15 | #include "hash.h" |
| 16 | #include "me | |
| 16 | #include "machine/ | |
| 17 | 17 | |
| 18 | 18 | /*************************************************************************** |
| 19 | 19 | TYPE DEFINITIONS |
| r9922 | r9923 | |
| 227 | 227 | return MCERR_MISSING_RAM_LENGTH; |
| 228 | 228 | |
| 229 | 229 | /* ...and parse it */ |
| 230 | resource->length = | |
| 230 | resource->length = | |
| 231 | 231 | if (resource->length <= 0) |
| 232 | 232 | return MCERR_INVALID_RAM_SPEC; |
| 233 | 233 |
| r9922 | r9923 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | void MessSetupGameOptions(core_options *opts, int driver_index) |
| 48 | 48 | { |
| 49 | BOOL is_global = (driver_index == OPTIONS_TYPE_GLOBAL); | |
| 50 | AddOptions(opts, mess_core_options, is_global); | |
| 51 | ||
| 52 | 49 | if (driver_index >= 0) |
| 53 | 50 | { |
| 54 | 51 | image_add_device_options(opts, drivers[driver_index]); |
| r9922 | r9923 | |
|---|---|---|
| 15 | 15 | #include <tchar.h> |
| 16 | 16 | |
| 17 | 17 | #include "emu.h" |
| 18 | #include "emuopts.h" | |
| 18 | 19 | #include "image.h" |
| 19 | 20 | #include "screenshot.h" |
| 20 | 21 | #include "datamap.h" |
| r9922 | r9923 | |
| 24 | 25 | #include "mui_util.h" |
| 25 | 26 | #include "mui_opts.h" |
| 26 | 27 | #include "resourcems.h" |
| 27 | #include "mess.h" | |
| 28 | 28 | #include "propertiesms.h" |
| 29 | 29 | #include "optionsms.h" |
| 30 | 30 | #include "msuiutil.h" |
| 31 | 31 | #include "strconv.h" |
| 32 | 32 | #include "winutf8.h" |
| 33 | #include " | |
| 33 | #include "ma | |
| 34 | 34 | |
| 35 | 35 | static BOOL SoftwareDirectories_OnInsertBrowse(HWND hDlg, BOOL bBrowse, LPCTSTR lpItem); |
| 36 | 36 | static BOOL SoftwareDirectories_OnDelete(HWND hDlg); |
| r9922 | r9923 | |
| 210 | 210 | |
| 211 | 211 | BOOL PropSheetFilter_Config(const machine_config *drv, const game_driver *gamedrv) |
| 212 | 212 | { |
| 213 | return (drv->m_devicelist.first( | |
| 213 | return (drv->m_devicelist.first( | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| r9922 | r9923 | |
| 405 | 405 | machine_config cfg(*gamedrv); |
| 406 | 406 | |
| 407 | 407 | // identify how many options that we have |
| 408 | device = cfg.m_devicelist.first( | |
| 408 | device = cfg.m_devicelist.first( | |
| 409 | 409 | |
| 410 | 410 | EnableWindow(control, (device != NULL)); |
| 411 | 411 | i = 0; |
| r9922 | r9923 | |
| 416 | 416 | |
| 417 | 417 | // identify the current amount of RAM |
| 418 | 418 | this_ram_string = options_get_string(opts, OPTION_RAMSIZE); |
| 419 | current_ram = (this_ram_string != NULL) ? | |
| 419 | current_ram = (this_ram_string != NULL) ? | |
| 420 | 420 | if (current_ram == 0) |
| 421 | current_ram = | |
| 421 | current_ram = | |
| 422 | 422 | |
| 423 | 423 | // by default, assume index 0 |
| 424 | 424 | current_index = 0; |
| 425 | 425 | |
| 426 | 426 | { |
| 427 | ram = | |
| 427 | ram = | |
| 428 | 428 | t_ramstring = tstring_from_utf8(config->default_size); |
| 429 | 429 | if( !t_ramstring ) |
| 430 | 430 | return FALSE; |
| r9922 | r9923 | |
| 450 | 450 | { |
| 451 | 451 | i++; |
| 452 | 452 | // identify this option |
| 453 | ram = | |
| 453 | ram = | |
| 454 | 454 | |
| 455 | 455 | this_ram_string = p; |
| 456 | 456 |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "lcd.lh" |
| 13 | 13 | #include "lcd_rot.lh" |
| 14 | 14 | |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | /* Globals */ |
| 18 | 18 | const char mess_disclaimer[] = |
| r9922 | r9923 | |
| 50 | 50 | "\n" |
| 51 | 51 | "See config.txt and windows.txt for usage instructions.\n"); |
| 52 | 52 | } |
| 53 | ||
| 54 | /************************************* | |
| 55 | * | |
| 56 | * Code used by print_mame_xml() | |
| 57 | * | |
| 58 | *************************************/ | |
| 59 | ||
| 60 | /* device iteration helpers */ | |
| 61 | #define ram_first(config) (config).m_devicelist.first(MESSRAM) | |
| 62 | #define ram_next(previous) ((previous)->typenext()) | |
| 63 | ||
| 64 | /*------------------------------------------------- | |
| 65 | print_game_ramoptions - prints out all RAM | |
| 66 | options for this system | |
| 67 | -------------------------------------------------*/ | |
| 68 | static void print_game_ramoptions(FILE *out, const game_driver *game, const machine_config &config) | |
| 69 | { | |
| 70 | const device_config *device; | |
| 71 | ||
| 72 | for (device = ram_first(config); device != NULL; device = ram_next(device)) | |
| 73 | { | |
| 74 | ram_config *ram = (ram_config *)downcast<const legacy_device_config_base *>(device)->inline_config(); | |
| 75 | fprintf(out, "\t\t<ramoption default=\"1\">%u</ramoption>\n", messram_parse_string(ram->default_size)); | |
| 76 | if (ram->extra_options != NULL) | |
| 77 | { | |
| 78 | int j; | |
| 79 | int size = strlen(ram->extra_options); | |
| 80 | char * const s = mame_strdup(ram->extra_options); | |
| 81 | char * const e = s + size; | |
| 82 | char *p = s; | |
| 83 | for (j=0;j<size;j++) { | |
| 84 | if (p[j]==',') p[j]=0; | |
| 85 | } | |
| 86 | /* try to parse each option */ | |
| 87 | while(p <= e) | |
| 88 | { | |
| 89 | fprintf(out, "\t\t<ramoption>%u</ramoption>\n", messram_parse_string(p)); | |
| 90 | p += strlen(p); | |
| 91 | if (p == e) | |
| 92 | break; | |
| 93 | p += 1; | |
| 94 | } | |
| 95 | ||
| 96 | osd_free(s); | |
| 97 | } | |
| 98 | } | |
| 99 | } | |
| 100 | ||
| 101 | ||
| 102 | /*------------------------------------------------- | |
| 103 | print_mess_game_xml - print MESS specific game | |
| 104 | information. | |
| 105 | -------------------------------------------------*/ | |
| 106 | ||
| 107 | void print_mess_game_xml(FILE *out, const game_driver *game, const machine_config &config) | |
| 108 | { | |
| 109 | print_game_ramoptions( out, game, config ); | |
| 110 | } | |
| 111 | ||
| 112 | /*************************************************************************** | |
| 113 | LOCAL VARIABLES | |
| 114 | ***************************************************************************/ | |
| 115 | ||
| 116 | const options_entry mess_core_options[] = | |
| 117 | { | |
| 118 | { NULL, NULL, OPTION_HEADER, "MESS SPECIFIC OPTIONS" }, | |
| 119 | { "ramsize;ram", NULL, 0, "size of RAM (if supported by driver)" }, | |
| 120 | { "newui;nu", "0", OPTION_BOOLEAN, "use the new MESS UI" }, | |
| 121 | { NULL } | |
| 122 | }; | |
| 123 | ||
| 124 | /*************************************************************************** | |
| 125 | IMPLEMENTATION | |
| 126 | ***************************************************************************/ | |
| 127 | /*------------------------------------------------- | |
| 128 | mess_options_init - called from core to add | |
| 129 | MESS specific options | |
| 130 | -------------------------------------------------*/ | |
| 131 | ||
| 132 | void mess_options_init(core_options *opts) | |
| 133 | { | |
| 134 | /* add MESS-specific options */ | |
| 135 | options_add_entries(opts, mess_core_options); | |
| 136 | } |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | #ifndef __MESS_H__ |
| 10 | 10 | #define __MESS_H__ |
| 11 | 11 | |
| 12 | #include "options.h" | |
| 13 | ||
| 14 | /****************************************************************************** | |
| 15 | * MESS' version of the GAME() macros of MAME | |
| 16 | * CONS is for consoles | |
| 17 | * COMP is for computers | |
| 18 | ******************************************************************************/ | |
| 19 | ||
| 20 | #define CONS(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,INIT,COMPANY,FULLNAME,FLAGS) \ | |
| 21 | extern const game_driver GAME_NAME(NAME) = \ | |
| 22 | { \ | |
| 23 | __FILE__, \ | |
| 24 | #PARENT, \ | |
| 25 | #NAME, \ | |
| 26 | FULLNAME, \ | |
| 27 | #YEAR, \ | |
| 28 | COMPANY, \ | |
| 29 | MACHINE_CONFIG_NAME(MACHINE), \ | |
| 30 | INPUT_PORTS_NAME(INPUT), \ | |
| 31 | DRIVER_INIT_NAME(INIT), \ | |
| 32 | ROM_NAME(NAME), \ | |
| 33 | #COMPAT, \ | |
| 34 | ROT0|(FLAGS), \ | |
| 35 | NULL \ | |
| 36 | }; | |
| 37 | ||
| 38 | #define COMP(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,INIT,COMPANY,FULLNAME,FLAGS) \ | |
| 39 | extern const game_driver GAME_NAME(NAME) = \ | |
| 40 | { \ | |
| 41 | __FILE__, \ | |
| 42 | #PARENT, \ | |
| 43 | #NAME, \ | |
| 44 | FULLNAME, \ | |
| 45 | #YEAR, \ | |
| 46 | COMPANY, \ | |
| 47 | MACHINE_CONFIG_NAME(MACHINE), \ | |
| 48 | INPUT_PORTS_NAME(INPUT), \ | |
| 49 | DRIVER_INIT_NAME(INIT), \ | |
| 50 | ROM_NAME(NAME), \ | |
| 51 | #COMPAT, \ | |
| 52 | ROT0|(FLAGS), \ | |
| 53 | NULL \ | |
| 54 | }; | |
| 55 | ||
| 56 | 12 | /*************************************************************************** |
| 57 | 13 | CONSTANTS |
| 58 | 14 | ***************************************************************************/ |
| 59 | ||
| 60 | #define OPTION_RAMSIZE "ramsize" | |
| 61 | #define OPTION_WRITECONFIG "writeconfig" | |
| 62 | 15 | #define LCD_FRAMES_PER_SECOND 30 |
| 63 | 16 | |
| 64 | 17 | |
| r9922 | r9923 | |
| 66 | 19 | GLOBALS |
| 67 | 20 | ***************************************************************************/ |
| 68 | 21 | |
| 69 | extern const options_entry mess_core_options[]; | |
| 70 | ||
| 71 | 22 | extern const char layout_lcd[]; /* generic 1:1 lcd screen layout */ |
| 72 | 23 | extern const char layout_lcd_rot[]; /* same, for use with ROT90 or ROT270 */ |
| 73 | 24 | |
| r9922 | r9923 | |
| 79 | 30 | |
| 80 | 31 | void mess_display_help(void); |
| 81 | 32 | |
| 82 | /* code used by print_mame_xml() */ | |
| 83 | void print_mess_game_xml(FILE *out, const game_driver *game, const machine_config &config); | |
| 84 | ||
| 85 | /* initialize MESS specific options (called from MAME core) */ | |
| 86 | void mess_options_init(core_options *opts); | |
| 87 | ||
| 88 | 33 | #endif /* __MESS_H__ */ |
| r9922 | r9923 | |
|---|---|---|
| 18 | 18 | #include "sound/wavwrite.h" |
| 19 | 19 | #include "video/generic.h" |
| 20 | 20 | #include "render.h" |
| 21 | #include " | |
| 21 | #include "ma | |
| 22 | 22 | #include "debug/debugcpu.h" |
| 23 | 23 | |
| 24 | 24 | |
| r9922 | r9923 | |
| 1604 | 1604 | |
| 1605 | 1605 | /* 'ramsize' attribute */ |
| 1606 | 1606 | attr_node = xml_get_attribute(node, "ramsize"); |
| 1607 | current_testcase.ram = attr_node ? | |
| 1607 | current_testcase.ram = attr_node ? | |
| 1608 | 1608 | |
| 1609 | 1609 | /* 'wavwrite' attribute */ |
| 1610 | 1610 | attr_node = xml_get_attribute(node, "wavwrite"); |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "sound/asc.h" |
| 13 | 13 | #include "includes/mac.h" |
| 14 | 14 | #include "streams.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | /*************************************************************************** |
| 18 | 18 | MACROS / CONSTANTS |
| r9922 | r9923 | |
| 140 | 140 | mac_sound *token = get_token(device); |
| 141 | 141 | |
| 142 | 142 | if (buffer) |
| 143 | token->mac_snd_buf_ptr = (UINT16 *) ( | |
| 143 | token->mac_snd_buf_ptr = (UINT16 *) ( | |
| 144 | 144 | else |
| 145 | token->mac_snd_buf_ptr = (UINT16 *) ( | |
| 145 | token->mac_snd_buf_ptr = (UINT16 *) ( | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 |
| r9922 | r9923 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | #include "debug/debugcpu.h" |
| 72 | 72 | #include "debug/debugcon.h" |
| 73 | #include " | |
| 73 | #include "ma | |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | // Ram banking handlers. |
| r9922 | r9923 | |
| 283 | 283 | // |
| 284 | 284 | // Map block, $00-$BF are ram, $FC-$FF are Boot ROM |
| 285 | 285 | // |
| 286 | if ((MapPage*4) < (( | |
| 286 | if ((MapPage*4) < (( | |
| 287 | 287 | { |
| 288 | 288 | if (!is_last_page(Page)) |
| 289 | 289 | { |
| 290 | readbank = & | |
| 290 | readbank = & | |
| 291 | 291 | if(state->LogDatWrites) |
| 292 | 292 | debug_console_printf(machine, "Mapping page %X, pageno=%X, mess_ram)[%X]\n",Page,MapPage,(MapPage*RamPageSize)); |
| 293 | 293 | } |
| 294 | 294 | else |
| 295 | 295 | { |
| 296 | readbank = & | |
| 296 | readbank = & | |
| 297 | 297 | logerror("Error RAM in Last page !\n"); |
| 298 | 298 | } |
| 299 | 299 | writebank=bank_info[Page].handler; |
| r9922 | r9923 | |
| 362 | 362 | |
| 363 | 363 | /* Map video ram to base of area it can use, that way we can take the literal RA */ |
| 364 | 364 | /* from the 6845 without having to mask it ! */ |
| 365 | videoram=& | |
| 365 | videoram=& | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | // Return the value of a page register |
| r9922 | r9923 | |
| 1100 | 1100 | wd17xx_dden_w(fdc, CLEAR_LINE); |
| 1101 | 1101 | wd17xx_set_drive(fdc, 0); |
| 1102 | 1102 | |
| 1103 | state->videoram = | |
| 1103 | state->videoram = | |
| 1104 | 1104 | |
| 1105 | 1105 | dgnbeta_video_reset(&machine); |
| 1106 | 1106 | wd17xx_reset(fdc); |
| r9922 | r9923 | |
|---|---|---|
| 8 | 8 | #include "emuopts.h" |
| 9 | 9 | #include "includes/atari.h" |
| 10 | 10 | #include "ataridev.h" |
| 11 | #include " | |
| 11 | #include "ma | |
| 12 | 12 | |
| 13 | 13 | static int a800_cart_loaded = 0; |
| 14 | 14 | static int a800_cart_is_16k = 0; |
| r9922 | r9923 | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /* install RAM */ |
| 40 | ram_top = MIN( | |
| 40 | ram_top = MIN( | |
| 41 | 41 | memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), |
| 42 | 42 | 0x0000, ram_top, 0, 0, SMH_BANK(2)); |
| 43 | 43 | memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), |
| 44 | 44 | 0x0000, ram_top, 0, 0, SMH_BANK(2)); |
| 45 | memory_set_bankptr(machine, 2, | |
| 45 | memory_set_bankptr(machine, 2, | |
| 46 | 46 | } |
| 47 | 47 | #endif |
| 48 | 48 | |
| r9922 | r9923 | |
| 68 | 68 | } |
| 69 | 69 | else |
| 70 | 70 | { |
| 71 | read_addr = &messram_get_ptr(machine->device("messram"))[0x08000]; | |
| 72 | write_addr = &messram_get_ptr(machine->device("messram"))[0x08000]; | |
| 71 | read_addr = &ram_get_ptr(machine->device(RAM_TAG))[0x08000]; | |
| 72 | write_addr = &ram_get_ptr(machine->device(RAM_TAG))[0x08000]; | |
| 73 | 73 | } |
| 74 | 74 | break; |
| 75 | 75 | } |
| r9922 | r9923 | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /* install RAM */ |
| 122 | ram_top = MIN( | |
| 122 | ram_top = MIN( | |
| 123 | 123 | memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM),0x0000, ram_top, 0, 0, "bank2"); |
| 124 | memory_set_bankptr(machine, "bank2", | |
| 124 | memory_set_bankptr(machine, "bank2", | |
| 125 | 125 | |
| 126 | 126 | /* cartridge */ |
| 127 | 127 | if (has_cart) |
| r9922 | r9923 | |
|---|---|---|
| 22 | 22 | #include "machine/applefdc.h" |
| 23 | 23 | #include "devices/appldriv.h" |
| 24 | 24 | #include "machine/6551.h" |
| 25 | #include " | |
| 25 | #include "ma | |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | static void apple3_update_drives(device_t *device); |
| r9922 | r9923 | |
| 263 | 263 | { |
| 264 | 264 | if (bank != (UINT16) ~0) |
| 265 | 265 | { |
| 266 | bank %= messram_get_size(machine->device("messram")) / 0x8000; | |
| 267 | if ((bank + 1) == (messram_get_size(machine->device("messram")) / 0x8000)) | |
| 266 | bank %= ram_get_size(machine->device(RAM_TAG)) / 0x8000; | |
| 267 | if ((bank + 1) == (ram_get_size(machine->device(RAM_TAG)) / 0x8000)) | |
| 268 | 268 | bank = 0x02; |
| 269 | 269 | } |
| 270 | 270 | offset += ((offs_t) bank) * 0x8000; |
| 271 | offset %= messram_get_size(machine->device("messram")); | |
| 272 | return &messram_get_ptr(machine->device("messram"))[offset]; | |
| 271 | offset %= ram_get_size(machine->device(RAM_TAG)); | |
| 272 | return &ram_get_ptr(machine->device(RAM_TAG))[offset]; | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | |
| r9922 | r9923 | |
| 284 | 284 | if (LOG_MEMORY) |
| 285 | 285 | { |
| 286 | 286 | #ifdef PTR64 |
| 287 | //logerror("\tbank %s --> %02x/%04x [0x%08lx]\n", mame_bank, (unsigned) bank, (unsigned)offset, ptr - | |
| 287 | //logerror("\tbank %s --> %02x/%04x [0x%08lx]\n", mame_bank, (unsigned) bank, (unsigned)offset, ptr - | |
| 288 | 288 | #else |
| 289 | logerror("\tbank %s --> %02x/%04x [0x%08x]\n", mame_bank, (unsigned) bank, (unsigned)offset, ptr - | |
| 289 | logerror("\tbank %s --> %02x/%04x [0x%08x]\n", mame_bank, (unsigned) bank, (unsigned)offset, ptr - | |
| 290 | 290 | #endif |
| 291 | 291 | } |
| 292 | 292 | } |
| r9922 | r9923 | |
| 576 | 576 | else if (offset > 0x9FFF) |
| 577 | 577 | result = apple3_bankaddr(machine,~0, offset - 0x8000); |
| 578 | 578 | else |
| 579 | result = & | |
| 579 | result = & | |
| 580 | 580 | } |
| 581 | 581 | else if ((n >= 0x80) && (n <= 0x8E)) |
| 582 | 582 | { |
| r9922 | r9923 | |
|---|---|---|
| 14 | 14 | #include "sound/sid6581.h" |
| 15 | 15 | #include "machine/6526cia.h" |
| 16 | 16 | #include "machine/cbmiec.h" |
| 17 | #include " | |
| 17 | #include "ma | |
| 18 | 18 | #include "video/vic4567.h" |
| 19 | 19 | |
| 20 | 20 | #define VERBOSE_LEVEL 0 |
| r9922 | r9923 | |
| 646 | 646 | { |
| 647 | 647 | c65_state *state = space->machine->driver_data<c65_state>(); |
| 648 | 648 | UINT8 data = 0xff; |
| 649 | if ( | |
| 649 | if ( | |
| 650 | 650 | data = state->expansion_ram.reg; |
| 651 | 651 | return data; |
| 652 | 652 | } |
| r9922 | r9923 | |
| 657 | 657 | offs_t expansion_ram_begin; |
| 658 | 658 | offs_t expansion_ram_end; |
| 659 | 659 | |
| 660 | if ( | |
| 660 | if ( | |
| 661 | 661 | { |
| 662 | 662 | state->expansion_ram.reg = data; |
| 663 | 663 | |
| 664 | 664 | expansion_ram_begin = 0x80000; |
| 665 | expansion_ram_end = 0x80000 + ( | |
| 665 | expansion_ram_end = 0x80000 + ( | |
| 666 | 666 | |
| 667 | 667 | if (data == 0x00) { |
| 668 | 668 | memory_install_readwrite_bank(space, expansion_ram_begin, expansion_ram_end,0,0,"bank16"); |
| 669 | memory_set_bankptr(space->machine, "bank16", | |
| 669 | memory_set_bankptr(space->machine, "bank16", | |
| 670 | 670 | } else { |
| 671 | 671 | memory_nop_readwrite(space, expansion_ram_begin, expansion_ram_end,0,0); |
| 672 | 672 | } |
| r9922 | r9923 | |
| 1040 | 1040 | { |
| 1041 | 1041 | c65_state *state = machine->driver_data<c65_state>(); |
| 1042 | 1042 | /* clear upper memory */ |
| 1043 | memset( | |
| 1043 | memset( | |
| 1044 | 1044 | |
| 1045 | 1045 | //removed cbm_drive_0_config (SERIAL, 10); |
| 1046 | 1046 | //removed cbm_drive_1_config (SERIAL, 11); |
| r9922 | r9923 | |
|---|---|---|
| 17 | 17 | #include "includes/dai.h" |
| 18 | 18 | #include "machine/pit8253.h" |
| 19 | 19 | #include "machine/tms5501.h" |
| 20 | #include " | |
| 20 | #include "ma | |
| 21 | 21 | |
| 22 | 22 | #define DEBUG_DAI_PORTS 0 |
| 23 | 23 | |
| r9922 | r9923 | |
| 155 | 155 | |
| 156 | 156 | MACHINE_RESET( dai ) |
| 157 | 157 | { |
| 158 | memory_set_bankptr(machine, "bank1", | |
| 158 | memory_set_bankptr(machine, "bank1", | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /*************************************************************************** |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | #include "includes/pocketc.h" |
| 5 | 5 | #include "includes/pc1350.h" |
| 6 | #include " | |
| 6 | #include "ma | |
| 7 | 7 | |
| 8 | 8 | |
| 9 | 9 | |
| r9922 | r9923 | |
| 129 | 129 | timer_set(machine, ATTOTIME_IN_SEC(1), NULL, 0, pc1350_power_up); |
| 130 | 130 | |
| 131 | 131 | memory_install_readwrite_bank(space, 0x6000, 0x6fff, 0, 0, "bank1"); |
| 132 | memory_set_bankptr(machine, "bank1", & | |
| 132 | memory_set_bankptr(machine, "bank1", & | |
| 133 | 133 | |
| 134 | if ( | |
| 134 | if ( | |
| 135 | 135 | { |
| 136 | 136 | memory_install_readwrite_bank(space, 0x4000, 0x5fff, 0, 0, "bank2"); |
| 137 | memory_set_bankptr(machine, "bank2", & | |
| 137 | memory_set_bankptr(machine, "bank2", & | |
| 138 | 138 | } |
| 139 | 139 | else |
| 140 | 140 | { |
| 141 | 141 | memory_nop_readwrite(space, 0x4000, 0x5fff, 0, 0); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | if ( | |
| 144 | if ( | |
| 145 | 145 | { |
| 146 | 146 | memory_install_readwrite_bank(space, 0x2000, 0x3fff, 0, 0, "bank3"); |
| 147 | memory_set_bankptr(machine, "bank3", & | |
| 147 | memory_set_bankptr(machine, "bank3", & | |
| 148 | 148 | } |
| 149 | 149 | else |
| 150 | 150 | { |
| r9922 | r9923 | |
|---|---|---|
| 104 | 104 | #include "devices/cococart.h" |
| 105 | 105 | #include "devices/cartslot.h" |
| 106 | 106 | #include "devices/flopdrv.h" |
| 107 | #include " | |
| 107 | #include "ma | |
| 108 | 108 | #include "crsshair.h" |
| 109 | 109 | |
| 110 | 110 | /*************************************************************************** |
| r9922 | r9923 | |
| 646 | 646 | int trailer_load = 0; |
| 647 | 647 | |
| 648 | 648 | ROM = image.device().machine->region("maincpu")->base(); |
| 649 | rambase = & | |
| 649 | rambase = & | |
| 650 | 650 | rombase = &ROM[rombase_index]; |
| 651 | 651 | pakbase = &ROM[pakbase_index]; |
| 652 | 652 | |
| 653 | if ( | |
| 653 | if ( | |
| 654 | 654 | { |
| 655 | 655 | if (LOG_PAK) |
| 656 | 656 | logerror("Cannot load PAK files without at least 64k.\n"); |
| r9922 | r9923 | |
| 728 | 728 | |
| 729 | 729 | SNAPSHOT_LOAD ( coco3_pak ) |
| 730 | 730 | { |
| 731 | return generic_pak_load(image, (0x70000 % | |
| 731 | return generic_pak_load(image, (0x70000 % | |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | /*************************************************************************** |
| r9922 | r9923 | |
| 1890 | 1890 | to access 32K of ram, and also allows the cocoe driver to access |
| 1891 | 1891 | the full 64K, as this uses Color Basic 1.2, which can configure 64K rams */ |
| 1892 | 1892 | |
| 1893 | if ( | |
| 1893 | if ( | |
| 1894 | 1894 | result = (pia6821_get_output_b(state->pia_0) & 0x80) >> 5; |
| 1895 | else if ( | |
| 1895 | else if ( | |
| 1896 | 1896 | result = 0x04; |
| 1897 | 1897 | else |
| 1898 | 1898 | result = 0x00; /* 4K Rams */ |
| r9922 | r9923 | |
| 1913 | 1913 | as both the 64 and Alpha, always have 64K rams, also the meaning of |
| 1914 | 1914 | the bit is different with respect to the CoCo 1 */ |
| 1915 | 1915 | |
| 1916 | if ( | |
| 1916 | if ( | |
| 1917 | 1917 | result = 0x00; /* 1 bank of 64K, rams */ |
| 1918 | 1918 | else |
| 1919 | 1919 | result = 0x04; /* 2 banks of 16K rams */ |
| r9922 | r9923 | |
| 1930 | 1930 | */ |
| 1931 | 1931 | int result; |
| 1932 | 1932 | |
| 1933 | if ( | |
| 1933 | if ( | |
| 1934 | 1934 | result = 0x00; /* 4K: wire pia1_pb2 low */ |
| 1935 | else if ( | |
| 1935 | else if ( | |
| 1936 | 1936 | result = 0x04; /* 16K: wire pia1_pb2 high */ |
| 1937 | 1937 | else |
| 1938 | 1938 | result = (pia6821_get_output_b(state->pia_0) & 0x40) >> 4; /* 32/64K: wire output of pia0_pb6 to input pia1_pb2 */ |
| r9922 | r9923 | |
| 1975 | 1975 | |
| 1976 | 1976 | switch (map) |
| 1977 | 1977 | { |
| 1978 | case 0x00 : state->bottom_32k=&messram_get_ptr(space->machine->device("messram"))[0x00000]; break; | |
| 1979 | case 0x01 : state->bottom_32k=&messram_get_ptr(space->machine->device("messram"))[0x10000]; break; | |
| 1980 | case 0x02 : state->bottom_32k=&messram_get_ptr(space->machine->device("messram"))[0x18000]; break; | |
| 1981 | case 0x03 : state->bottom_32k=&messram_get_ptr(space->machine->device("messram"))[0x00000]; break; | |
| 1982 | default : state->bottom_32k=&messram_get_ptr(space->machine->device("messram"))[0x00000]; break; // Just to shut the compiler up ! | |
| 1978 | case 0x00 : state->bottom_32k=&ram_get_ptr(space->machine->device(RAM_TAG))[0x00000]; break; | |
| 1979 | case 0x01 : state->bottom_32k=&ram_get_ptr(space->machine->device(RAM_TAG))[0x10000]; break; | |
| 1980 | case 0x02 : state->bottom_32k=&ram_get_ptr(space->machine->device(RAM_TAG))[0x18000]; break; | |
| 1981 | case 0x03 : state->bottom_32k=&ram_get_ptr(space->machine->device(RAM_TAG))[0x00000]; break; | |
| 1982 | default : state->bottom_32k=&ram_get_ptr(space->machine->device(RAM_TAG))[0x00000]; break; // Just to shut the compiler up ! | |
| 1983 | 1983 | } |
| 1984 | 1984 | |
| 1985 | 1985 | setup_memory_map(space->machine); |
| r9922 | r9923 | |
| 2100 | 2100 | /* Lookup the apropreate wbank value dependent on ram size */ |
| 2101 | 2101 | if (memsize==0) |
| 2102 | 2102 | wbank=memmap[block_index].wbank4; |
| 2103 | else if ((memsize==1) && ( | |
| 2103 | else if ((memsize==1) && ( | |
| 2104 | 2104 | wbank=memmap[block_index].wbank16_1; |
| 2105 | else if ((memsize==1) && ( | |
| 2105 | else if ((memsize==1) && ( | |
| 2106 | 2106 | wbank=memmap[block_index].wbank16_2; |
| 2107 | 2107 | else |
| 2108 | 2108 | wbank=memmap[block_index].wbank64; |
| r9922 | r9923 | |
| 2116 | 2116 | if(block_index<8) |
| 2117 | 2117 | memory_set_bankptr(machine, bank, &state->bottom_32k[memmap[wbank-1].start]); |
| 2118 | 2118 | else |
| 2119 | memory_set_bankptr(machine, bank,& | |
| 2119 | memory_set_bankptr(machine, bank,& | |
| 2120 | 2120 | |
| 2121 | 2121 | memory_install_readwrite_bank(space, memmap[block_index].start, memmap[block_index].end, 0, 0, bank); |
| 2122 | 2122 | } |
| r9922 | r9923 | |
| 2162 | 2162 | |
| 2163 | 2163 | if (!sam6883_maptype(device)) // Ignored in maptype 1 |
| 2164 | 2164 | { |
| 2165 | if((messram_get_size(device->machine->device("messram"))>0x8000) && val) | |
| 2166 | state->bottom_32k=&messram_get_ptr(device->machine->device("messram"))[0x8000]; | |
| 2165 | if((ram_get_size(device->machine->device(RAM_TAG))>0x8000) && val) | |
| 2166 | state->bottom_32k=&ram_get_ptr(device->machine->device(RAM_TAG))[0x8000]; | |
| 2167 | 2167 | else |
| 2168 | state->bottom_32k= | |
| 2168 | state->bottom_32k= | |
| 2169 | 2169 | |
| 2170 | 2170 | setup_memory_map(device->machine); |
| 2171 | 2171 | } |
| r9922 | r9923 | |
| 2294 | 2294 | { |
| 2295 | 2295 | coco_state *state = device->machine->driver_data<coco_state>(); |
| 2296 | 2296 | if(val) |
| 2297 | state->bottom_32k= | |
| 2297 | state->bottom_32k= | |
| 2298 | 2298 | |
| 2299 | 2299 | setup_memory_map(device->machine); |
| 2300 | 2300 | } |
| r9922 | r9923 | |
| 2343 | 2343 | /* this GIME register fixes logical addresses $FExx to physical |
| 2344 | 2344 | * addresses $7FExx ($1FExx if 128k */ |
| 2345 | 2345 | assert(offset < 0x200); |
| 2346 | return (( | |
| 2346 | return (( | |
| 2347 | 2347 | } |
| 2348 | 2348 | bank = 7; |
| 2349 | 2349 | offset += 0x1e00; |
| r9922 | r9923 | |
| 2393 | 2393 | } |
| 2394 | 2394 | else |
| 2395 | 2395 | { |
| 2396 | result = ((block * 0x2000) + offset) % | |
| 2396 | result = ((block * 0x2000) + offset) % | |
| 2397 | 2397 | } |
| 2398 | 2398 | return result; |
| 2399 | 2399 | } |
| r9922 | r9923 | |
| 2444 | 2444 | else |
| 2445 | 2445 | { |
| 2446 | 2446 | /* offset into normal RAM */ |
| 2447 | readbank = & | |
| 2447 | readbank = & | |
| 2448 | 2448 | memory_install_write_bank(space, bank_info[i].start, bank_info[i].end, 0, 0, bank); |
| 2449 | 2449 | } |
| 2450 | 2450 | |
| r9922 | r9923 | |
| 2727 | 2727 | { |
| 2728 | 2728 | UINT32 video_base; |
| 2729 | 2729 | video_base = coco3_get_video_base(device->machine, 0xE0, 0x3F); |
| 2730 | return & | |
| 2730 | return & | |
| 2731 | 2731 | } |
| 2732 | 2732 | |
| 2733 | 2733 | |
| r9922 | r9923 | |
| 2872 | 2872 | state->bas_rom_bank = state->rom; |
| 2873 | 2873 | |
| 2874 | 2874 | /* setup default pointer for botom 32K of ram */ |
| 2875 | state->bottom_32k = | |
| 2875 | state->bottom_32k = | |
| 2876 | 2876 | |
| 2877 | 2877 | /* setup printer output callback */ |
| 2878 | 2878 | state->printer_out = init->printer_out_; |
| r9922 | r9923 | |
| 2894 | 2894 | static void generic_coco12_dragon_init(running_machine *machine, const machine_init_interface *init) |
| 2895 | 2895 | { |
| 2896 | 2896 | /* Set default RAM mapping */ |
| 2897 | memory_set_bankptr(machine, "bank1", & | |
| 2897 | memory_set_bankptr(machine, "bank1", & | |
| 2898 | 2898 | |
| 2899 | 2899 | /* Do generic Inits */ |
| 2900 | 2900 | generic_init_machine(machine, init); |
| r9922 | r9923 | |
|---|---|---|
| 38 | 38 | #include "emu.h" |
| 39 | 39 | #include "cpu/lr35902/lr35902.h" |
| 40 | 40 | #include "devices/cartslot.h" |
| 41 | #include " | |
| 41 | #include "ma | |
| 42 | 42 | #include "image.h" |
| 43 | 43 | #include "audio/gb.h" |
| 44 | 44 | #include "includes/gb.h" |
| r9922 | r9923 | |
| 63 | 63 | MBC_UNKNOWN, /* Unknown mapper */ |
| 64 | 64 | }; |
| 65 | 65 | |
| 66 | /* | |
| 66 | /* | |
| 67 | 67 | #define CGB_START_VRAM_BANKS 0x0000 |
| 68 | 68 | #define CGB_START_RAM_BANKS ( 2 * 8 * 1024 ) |
| 69 | 69 | |
| r9922 | r9923 | |
| 373 | 373 | /* Allocate memory for internal ram */ |
| 374 | 374 | for( ii = 0; ii < 8; ii++ ) |
| 375 | 375 | { |
| 376 | state->GBC_RAMMap[ii] = | |
| 376 | state->GBC_RAMMap[ii] = | |
| 377 | 377 | memset (state->GBC_RAMMap[ii], 0, 0x1000); |
| 378 | 378 | } |
| 379 | 379 | } |
| r9922 | r9923 | |
| 1689 | 1689 | { |
| 1690 | 1690 | case 0x00: state->MBCType = MBC_NONE; state->CartType = 0; break; |
| 1691 | 1691 | case 0x01: state->MBCType = MBC_MBC1; state->CartType = 0; break; |
| 1692 | case 0x02: state->MBCType = MBC_MBC1; state->CartType = RAM; break; | |
| 1693 | case 0x03: state->MBCType = MBC_MBC1; state->CartType = RAM | BATTERY; break; | |
| 1692 | case 0x02: state->MBCType = MBC_MBC1; state->CartType = CART_RAM; break; | |
| 1693 | case 0x03: state->MBCType = MBC_MBC1; state->CartType = CART_RAM | BATTERY; break; | |
| 1694 | 1694 | case 0x05: state->MBCType = MBC_MBC2; state->CartType = 0; break; |
| 1695 | 1695 | case 0x06: state->MBCType = MBC_MBC2; state->CartType = BATTERY; break; |
| 1696 | case 0x08: state->MBCType = MBC_NONE; state->CartType = RAM; break; | |
| 1697 | case 0x09: state->MBCType = MBC_NONE; state->CartType = RAM | BATTERY; break; | |
| 1696 | case 0x08: state->MBCType = MBC_NONE; state->CartType = CART_RAM; break; | |
| 1697 | case 0x09: state->MBCType = MBC_NONE; state->CartType = CART_RAM | BATTERY; break; | |
| 1698 | 1698 | case 0x0B: state->MBCType = MBC_MMM01; state->CartType = 0; break; |
| 1699 | case 0x0C: state->MBCType = MBC_MMM01; state->CartType = RAM; break; | |
| 1700 | case 0x0D: state->MBCType = MBC_MMM01; state->CartType = RAM | BATTERY; break; | |
| 1699 | case 0x0C: state->MBCType = MBC_MMM01; state->CartType = CART_RAM; break; | |
| 1700 | case 0x0D: state->MBCType = MBC_MMM01; state->CartType = CART_RAM | BATTERY; break; | |
| 1701 | 1701 | case 0x0F: state->MBCType = MBC_MBC3; state->CartType = TIMER | BATTERY; break; |
| 1702 | case 0x10: state->MBCType = MBC_MBC3; state->CartType = TIMER | RAM | BATTERY; break; | |
| 1702 | case 0x10: state->MBCType = MBC_MBC3; state->CartType = TIMER | CART_RAM | BATTERY; break; | |
| 1703 | 1703 | case 0x11: state->MBCType = MBC_MBC3; state->CartType = 0; break; |
| 1704 | case 0x12: state->MBCType = MBC_MBC3; state->CartType = RAM; break; | |
| 1705 | case 0x13: state->MBCType = MBC_MBC3; state->CartType = RAM | BATTERY; break; | |
| 1704 | case 0x12: state->MBCType = MBC_MBC3; state->CartType = CART_RAM; break; | |
| 1705 | case 0x13: state->MBCType = MBC_MBC3; state->CartType = CART_RAM | BATTERY; break; | |
| 1706 | 1706 | case 0x15: state->MBCType = MBC_MBC4; state->CartType = 0; break; |
| 1707 | case 0x16: state->MBCType = MBC_MBC4; state->CartType = RAM; break; | |
| 1708 | case 0x17: state->MBCType = MBC_MBC4; state->CartType = RAM | BATTERY; break; | |
| 1707 | case 0x16: state->MBCType = MBC_MBC4; state->CartType = CART_RAM; break; | |
| 1708 | case 0x17: state->MBCType = MBC_MBC4; state->CartType = CART_RAM | BATTERY; break; | |
| 1709 | 1709 | case 0x19: state->MBCType = MBC_MBC5; state->CartType = 0; break; |
| 1710 | case 0x1A: state->MBCType = MBC_MBC5; state->CartType = RAM; break; | |
| 1711 | case 0x1B: state->MBCType = MBC_MBC5; state->CartType = RAM | BATTERY; break; | |
| 1710 | case 0x1A: state->MBCType = MBC_MBC5; state->CartType = CART_RAM; break; | |
| 1711 | case 0x1B: state->MBCType = MBC_MBC5; state->CartType = CART_RAM | BATTERY; break; | |
| 1712 | 1712 | case 0x1C: state->MBCType = MBC_MBC5; state->CartType = RUMBLE; break; |
| 1713 | 1713 | case 0x1D: state->MBCType = MBC_MBC5; state->CartType = RUMBLE | SRAM; break; |
| 1714 | 1714 | case 0x1E: state->MBCType = MBC_MBC5; state->CartType = RUMBLE | SRAM | BATTERY; break; |
| r9922 | r9923 | |
|---|---|---|
| 16 | 16 | #include "machine/pic8259.h" |
| 17 | 17 | #include "machine/msm8251.h" |
| 18 | 18 | #include "includes/b2m.h" |
| 19 | #include " | |
| 19 | #include "ma | |
| 20 | 20 | #include "devices/flopdrv.h" |
| 21 | 21 | |
| 22 | 22 | static READ8_HANDLER (b2m_keyboard_r ) |
| r9922 | r9923 | |
| 57 | 57 | case 1 : |
| 58 | 58 | memory_unmap_write(space, 0xe000, 0xffff, 0, 0); |
| 59 | 59 | |
| 60 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 61 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x2800); | |
| 62 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x3000); | |
| 63 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x7000); | |
| 60 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 61 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x2800); | |
| 62 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x3000); | |
| 63 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x7000); | |
| 64 | 64 | memory_set_bankptr(machine, "bank5", rom + 0x10000); |
| 65 | 65 | break; |
| 66 | 66 | #if 0 |
| r9922 | r9923 | |
| 68 | 68 | memory_unmap_write(space, 0x3000, 0x6fff, 0, 0); |
| 69 | 69 | memory_unmap_write(space, 0xe000, 0xffff, 0, 0); |
| 70 | 70 | |
| 71 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 72 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x2800); | |
| 71 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 72 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x2800); | |
| 73 | 73 | memory_set_bankptr(machine, "bank3", rom + 0x12000); |
| 74 | 74 | memory_set_bankptr(machine, "bank4", rom + 0x16000); |
| 75 | 75 | memory_set_bankptr(machine, "bank5", rom + 0x10000); |
| r9922 | r9923 | |
| 79 | 79 | memory_unmap_write(space, 0x2800, 0x2fff, 0, 0); |
| 80 | 80 | memory_unmap_write(space, 0xe000, 0xffff, 0, 0); |
| 81 | 81 | |
| 82 | memory_set_bankptr(machine, "bank1", | |
| 82 | memory_set_bankptr(machine, "bank1", | |
| 83 | 83 | memory_install_read8_handler(space, 0x2800, 0x2fff, 0, 0, b2m_keyboard_r); |
| 84 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x10000); | |
| 85 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x7000); | |
| 84 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000); | |
| 85 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x7000); | |
| 86 | 86 | memory_set_bankptr(machine, "bank5", rom + 0x10000); |
| 87 | 87 | break; |
| 88 | 88 | case 3 : |
| 89 | 89 | memory_unmap_write(space, 0x2800, 0x2fff, 0, 0); |
| 90 | 90 | memory_unmap_write(space, 0xe000, 0xffff, 0, 0); |
| 91 | 91 | |
| 92 | memory_set_bankptr(machine, "bank1", | |
| 92 | memory_set_bankptr(machine, "bank1", | |
| 93 | 93 | memory_install_read8_handler(space, 0x2800, 0x2fff, 0, 0, b2m_keyboard_r); |
| 94 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x14000); | |
| 95 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x7000); | |
| 94 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x14000); | |
| 95 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x7000); | |
| 96 | 96 | memory_set_bankptr(machine, "bank5", rom + 0x10000); |
| 97 | 97 | break; |
| 98 | 98 | case 4 : |
| 99 | 99 | memory_unmap_write(space, 0x2800, 0x2fff, 0, 0); |
| 100 | 100 | memory_unmap_write(space, 0xe000, 0xffff, 0, 0); |
| 101 | 101 | |
| 102 | memory_set_bankptr(machine, "bank1", | |
| 102 | memory_set_bankptr(machine, "bank1", | |
| 103 | 103 | memory_install_read8_handler(space, 0x2800, 0x2fff, 0, 0, b2m_keyboard_r); |
| 104 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x18000); | |
| 105 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x7000); | |
| 104 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x18000); | |
| 105 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x7000); | |
| 106 | 106 | memory_set_bankptr(machine, "bank5", rom + 0x10000); |
| 107 | 107 | |
| 108 | 108 | break; |
| r9922 | r9923 | |
| 110 | 110 | memory_unmap_write(space, 0x2800, 0x2fff, 0, 0); |
| 111 | 111 | memory_unmap_write(space, 0xe000, 0xffff, 0, 0); |
| 112 | 112 | |
| 113 | memory_set_bankptr(machine, "bank1", | |
| 113 | memory_set_bankptr(machine, "bank1", | |
| 114 | 114 | memory_install_read8_handler(space, 0x2800, 0x2fff, 0, 0, b2m_keyboard_r); |
| 115 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x1c000); | |
| 116 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x7000); | |
| 115 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x1c000); | |
| 116 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x7000); | |
| 117 | 117 | memory_set_bankptr(machine, "bank5", rom + 0x10000); |
| 118 | 118 | |
| 119 | 119 | break; |
| 120 | 120 | case 6 : |
| 121 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 122 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x2800); | |
| 123 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x3000); | |
| 124 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x7000); | |
| 125 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0xe000); | |
| 121 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 122 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x2800); | |
| 123 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x3000); | |
| 124 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x7000); | |
| 125 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0xe000); | |
| 126 | 126 | break; |
| 127 | 127 | case 7 : |
| 128 | 128 | memory_unmap_write(space, 0x0000, 0x27ff, 0, 0); |
| r9922 | r9923 | |
|---|---|---|
| 18 | 18 | /* M6502 main CPU */ |
| 19 | 19 | #include "cpu/m6502/m6502.h" |
| 20 | 20 | |
| 21 | #include " | |
| 21 | #include "ma | |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /****************************************************************************** |
| r9922 | r9923 | |
| 171 | 171 | |
| 172 | 172 | MACHINE_START( aim65 ) |
| 173 | 173 | { |
| 174 | device_t *ram = machine->device( | |
| 174 | device_t *ram = machine->device(RAM_TAG | |
| 175 | 175 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 176 | 176 | |
| 177 | 177 | /* Init RAM */ |
| 178 | memory_install_ram(space, 0x0000, | |
| 178 | memory_install_ram(space, 0x0000, | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "includes/thomson.h" |
| 13 | 13 | #include "machine/6821pia.h" |
| 14 | 14 | #include "machine/ctronics.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | #define VERBOSE 0 |
| 18 | 18 | #define VERBOSE_IRQ 0 |
| r9922 | r9923 | |
| 1572 | 1572 | |
| 1573 | 1573 | /* memory */ |
| 1574 | 1574 | thom_cart_bank = 0; |
| 1575 | thom_vram = messram_get_ptr(machine->device("messram")); | |
| 1576 | memory_configure_bank( machine, THOM_BASE_BANK, 0, 1, messram_get_ptr(machine->device("messram")) + 0x4000, 0x2000 ); | |
| 1575 | thom_vram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 1576 | memory_configure_bank( machine, THOM_BASE_BANK, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x4000, 0x2000 ); | |
| 1577 | 1577 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, thom_vram, 0x2000 ); |
| 1578 | 1578 | memory_configure_bank( machine, THOM_CART_BANK, 0, 4, mem + 0x10000, 0x4000 ); |
| 1579 | 1579 | memory_set_bank( machine, THOM_BASE_BANK, 0 ); |
| 1580 | 1580 | memory_set_bank( machine, THOM_VRAM_BANK, 0 ); |
| 1581 | 1581 | memory_set_bank( machine, THOM_CART_BANK, 0 ); |
| 1582 | 1582 | |
| 1583 | if ( | |
| 1583 | if ( | |
| 1584 | 1584 | { |
| 1585 | 1585 | /* install 16 KB or 16 KB + 8 KB memory extensions */ |
| 1586 | 1586 | /* BASIC instruction to see free memory: ?FRE(0) */ |
| 1587 | int extram = | |
| 1587 | int extram = | |
| 1588 | 1588 | memory_install_write_bank(space, 0x8000, 0x8000 + extram - 1, 0, 0, THOM_RAM_BANK); |
| 1589 | 1589 | memory_install_read_bank(space, 0x8000, 0x8000 + extram - 1, 0, 0, THOM_RAM_BANK ); |
| 1590 | memory_configure_bank( machine, THOM_RAM_BANK, 0, 1, | |
| 1590 | memory_configure_bank( machine, THOM_RAM_BANK, 0, 1, | |
| 1591 | 1591 | memory_set_bank( machine, THOM_RAM_BANK, 0 ); |
| 1592 | 1592 | } |
| 1593 | 1593 | |
| r9922 | r9923 | |
| 1665 | 1665 | if ( bank != old_ram_bank ) |
| 1666 | 1666 | LOG_BANK(( "to770_update_ram_bank: RAM bank change %i\n", bank )); |
| 1667 | 1667 | |
| 1668 | if ( | |
| 1668 | if ( | |
| 1669 | 1669 | { |
| 1670 | 1670 | memory_set_bank( machine, THOM_RAM_BANK, bank ); |
| 1671 | 1671 | memory_install_write_bank(space, 0xa000, 0xdfff, 0, 0, THOM_RAM_BANK); |
| r9922 | r9923 | |
| 1829 | 1829 | |
| 1830 | 1830 | /* memory */ |
| 1831 | 1831 | thom_cart_bank = 0; |
| 1832 | thom_vram = messram_get_ptr(machine->device("messram")); | |
| 1833 | memory_configure_bank( machine, THOM_BASE_BANK, 0, 1, messram_get_ptr(machine->device("messram")) + 0x4000, 0x4000 ); | |
| 1834 | memory_configure_bank( machine, THOM_RAM_BANK, 0, 6, messram_get_ptr(machine->device("messram")) + 0x8000, 0x4000 ); | |
| 1832 | thom_vram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 1833 | memory_configure_bank( machine, THOM_BASE_BANK, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x4000, 0x4000 ); | |
| 1834 | memory_configure_bank( machine, THOM_RAM_BANK, 0, 6, ram_get_ptr(machine->device(RAM_TAG)) + 0x8000, 0x4000 ); | |
| 1835 | 1835 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, thom_vram, 0x2000 ); |
| 1836 | 1836 | memory_configure_bank( machine, THOM_CART_BANK, 0, 4, mem + 0x10000, 0x4000 ); |
| 1837 | 1837 | memory_set_bank( machine, THOM_BASE_BANK, 0 ); |
| r9922 | r9923 | |
| 2204 | 2204 | /* memory */ |
| 2205 | 2205 | thom_cart_bank = 0; |
| 2206 | 2206 | mo5_reg_cart = 0; |
| 2207 | thom_vram = messram_get_ptr(machine->device("messram")); | |
| 2208 | memory_configure_bank( machine, THOM_BASE_BANK, 0, 1, messram_get_ptr(machine->device("messram")) + 0x4000, 0x8000 ); | |
| 2207 | thom_vram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 2208 | memory_configure_bank( machine, THOM_BASE_BANK, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x4000, 0x8000 ); | |
| 2209 | 2209 | memory_configure_bank( machine, THOM_CART_BANK, 0, 4, mem + 0x10000, 0x4000 ); |
| 2210 | memory_configure_bank( machine, THOM_CART_BANK, 4, 4, | |
| 2210 | memory_configure_bank( machine, THOM_CART_BANK, 4, 4, | |
| 2211 | 2211 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, thom_vram, 0x2000 ); |
| 2212 | 2212 | memory_set_bank( machine, THOM_BASE_BANK, 0 ); |
| 2213 | 2213 | memory_set_bank( machine, THOM_CART_BANK, 0 ); |
| r9922 | r9923 | |
| 2541 | 2541 | if ( old_ram_bank != bank ) |
| 2542 | 2542 | LOG_BANK(( "to9_update_ram_bank: bank %i selected (pia=$%02X disk=%i)\n", bank, portb & 0xf8, disk )); |
| 2543 | 2543 | |
| 2544 | if ( | |
| 2544 | if ( | |
| 2545 | 2545 | { |
| 2546 | 2546 | memory_set_bank( machine, THOM_RAM_BANK, bank ); |
| 2547 | 2547 | memory_install_write_bank( space, 0xa000, 0xdfff, 0, 0, THOM_RAM_BANK); |
| r9922 | r9923 | |
| 3166 | 3166 | to7_midi_init(machine); |
| 3167 | 3167 | |
| 3168 | 3168 | /* memory */ |
| 3169 | thom_vram = | |
| 3169 | thom_vram = | |
| 3170 | 3170 | thom_cart_bank = 0; |
| 3171 | 3171 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, thom_vram, 0x2000 ); |
| 3172 | 3172 | memory_configure_bank( machine, THOM_CART_BANK, 0, 12, mem + 0x10000, 0x4000 ); |
| 3173 | memory_configure_bank( machine, THOM_BASE_BANK, 0, 1, messram_get_ptr(machine->device("messram")) + 0x4000, 0x4000 ); | |
| 3174 | memory_configure_bank( machine, THOM_RAM_BANK, 0, 10, messram_get_ptr(machine->device("messram")) + 0x8000, 0x4000 ); | |
| 3173 | memory_configure_bank( machine, THOM_BASE_BANK, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x4000, 0x4000 ); | |
| 3174 | memory_configure_bank( machine, THOM_RAM_BANK, 0, 10, ram_get_ptr(machine->device(RAM_TAG)) + 0x8000, 0x4000 ); | |
| 3175 | 3175 | memory_set_bank( machine, THOM_VRAM_BANK, 0 ); |
| 3176 | 3176 | memory_set_bank( machine, THOM_CART_BANK, 0 ); |
| 3177 | 3177 | memory_set_bank( machine, THOM_BASE_BANK, 0 ); |
| r9922 | r9923 | |
| 3608 | 3608 | undistorted space, such as cartridge, page 0 (video), or page 1 |
| 3609 | 3609 | */ |
| 3610 | 3610 | to8_data_vpage = bank; |
| 3611 | if ( | |
| 3611 | if ( | |
| 3612 | 3612 | { |
| 3613 | 3613 | memory_set_bank( machine, TO8_DATA_LO, to8_data_vpage ); |
| 3614 | 3614 | memory_set_bank( machine, TO8_DATA_HI, to8_data_vpage ); |
| r9922 | r9923 | |
| 3650 | 3650 | /* RAM space */ |
| 3651 | 3651 | to8_cart_vpage = to8_reg_cart & 31; |
| 3652 | 3652 | bank = 8 + to8_cart_vpage; |
| 3653 | if ((to8_cart_vpage < 8 || | |
| 3653 | if ((to8_cart_vpage < 8 || | |
| 3654 | 3654 | if (to8_cart_vpage <= 4) { |
| 3655 | 3655 | memory_install_write8_handler( space, 0x0000, 0x3fff, 0, 0,to8_vcart_w); |
| 3656 | 3656 | } else { |
| r9922 | r9923 | |
| 3688 | 3688 | } |
| 3689 | 3689 | } |
| 3690 | 3690 | |
| 3691 | if ( | |
| 3691 | if ( | |
| 3692 | 3692 | { |
| 3693 | 3693 | memory_set_bank( machine, THOM_CART_BANK, bank ); |
| 3694 | 3694 | } |
| r9922 | r9923 | |
| 4160 | 4160 | |
| 4161 | 4161 | /* memory */ |
| 4162 | 4162 | thom_cart_bank = 0; |
| 4163 | thom_vram = | |
| 4163 | thom_vram = | |
| 4164 | 4164 | memory_configure_bank( machine, THOM_CART_BANK, 0, 8, mem + 0x10000, 0x4000 ); |
| 4165 | memory_configure_bank( machine, THOM_CART_BANK, 8, 32, messram_get_ptr(machine->device("messram")), 0x4000 ); | |
| 4166 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, messram_get_ptr(machine->device("messram")), 0x2000 ); | |
| 4167 | memory_configure_bank( machine, TO8_SYS_LO, 0, 1, messram_get_ptr(machine->device("messram")) + 0x6000, 0x4000 ); | |
| 4168 | memory_configure_bank( machine, TO8_SYS_HI, 0, 1, messram_get_ptr(machine->device("messram")) + 0x4000, 0x4000 ); | |
| 4169 | memory_configure_bank( machine, TO8_DATA_LO, 0, 32, messram_get_ptr(machine->device("messram")) + 0x2000, 0x4000 ); | |
| 4170 | memory_configure_bank( machine, TO8_DATA_HI, 0, 32, messram_get_ptr(machine->device("messram")) + 0x0000, 0x4000 ); | |
| 4165 | memory_configure_bank( machine, THOM_CART_BANK, 8, 32, ram_get_ptr(machine->device(RAM_TAG)), 0x4000 ); | |
| 4166 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, ram_get_ptr(machine->device(RAM_TAG)), 0x2000 ); | |
| 4167 | memory_configure_bank( machine, TO8_SYS_LO, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x6000, 0x4000 ); | |
| 4168 | memory_configure_bank( machine, TO8_SYS_HI, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x4000, 0x4000 ); | |
| 4169 | memory_configure_bank( machine, TO8_DATA_LO, 0, 32, ram_get_ptr(machine->device(RAM_TAG)) + 0x2000, 0x4000 ); | |
| 4170 | memory_configure_bank( machine, TO8_DATA_HI, 0, 32, ram_get_ptr(machine->device(RAM_TAG)) + 0x0000, 0x4000 ); | |
| 4171 | 4171 | memory_configure_bank( machine, TO8_BIOS_BANK, 0, 2, mem + 0x30800, 0x2000 ); |
| 4172 | 4172 | memory_set_bank( machine, THOM_CART_BANK, 0 ); |
| 4173 | 4173 | memory_set_bank( machine, THOM_VRAM_BANK, 0 ); |
| r9922 | r9923 | |
| 4330 | 4330 | |
| 4331 | 4331 | /* memory */ |
| 4332 | 4332 | thom_cart_bank = 0; |
| 4333 | thom_vram = | |
| 4333 | thom_vram = | |
| 4334 | 4334 | memory_configure_bank( machine, THOM_CART_BANK, 0, 8, mem + 0x10000, 0x4000 ); |
| 4335 | memory_configure_bank( machine, THOM_CART_BANK, 8, 32, messram_get_ptr(machine->device("messram")), 0x4000 ); | |
| 4336 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, messram_get_ptr(machine->device("messram")), 0x2000 ); | |
| 4337 | memory_configure_bank( machine, TO8_SYS_LO, 0, 1, messram_get_ptr(machine->device("messram")) + 0x6000, 0x4000 ); | |
| 4338 | memory_configure_bank( machine, TO8_SYS_HI, 0, 1, messram_get_ptr(machine->device("messram")) + 0x4000, 0x4000 ); | |
| 4339 | memory_configure_bank( machine, TO8_DATA_LO, 0, 32, messram_get_ptr(machine->device("messram")) + 0x2000, 0x4000 ); | |
| 4340 | memory_configure_bank( machine, TO8_DATA_HI, 0, 32, messram_get_ptr(machine->device("messram")) + 0x0000, 0x4000 ); | |
| 4335 | memory_configure_bank( machine, THOM_CART_BANK, 8, 32, ram_get_ptr(machine->device(RAM_TAG)), 0x4000 ); | |
| 4336 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, ram_get_ptr(machine->device(RAM_TAG)), 0x2000 ); | |
| 4337 | memory_configure_bank( machine, TO8_SYS_LO, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x6000, 0x4000 ); | |
| 4338 | memory_configure_bank( machine, TO8_SYS_HI, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x4000, 0x4000 ); | |
| 4339 | memory_configure_bank( machine, TO8_DATA_LO, 0, 32, ram_get_ptr(machine->device(RAM_TAG)) + 0x2000, 0x4000 ); | |
| 4340 | memory_configure_bank( machine, TO8_DATA_HI, 0, 32, ram_get_ptr(machine->device(RAM_TAG)) + 0x0000, 0x4000 ); | |
| 4341 | 4341 | memory_configure_bank( machine, TO8_BIOS_BANK, 0, 2, mem + 0x30800, 0x2000 ); |
| 4342 | 4342 | memory_set_bank( machine, THOM_CART_BANK, 0 ); |
| 4343 | 4343 | memory_set_bank( machine, THOM_VRAM_BANK, 0 ); |
| r9922 | r9923 | |
| 4954 | 4954 | /* memory */ |
| 4955 | 4955 | thom_cart_bank = 0; |
| 4956 | 4956 | mo5_reg_cart = 0; |
| 4957 | thom_vram = | |
| 4957 | thom_vram = | |
| 4958 | 4958 | memory_configure_bank( machine, THOM_CART_BANK, 0, 4, mem + 0x10000, 0x4000 ); |
| 4959 | 4959 | memory_configure_bank( machine, THOM_CART_BANK, 4, 2, mem + 0x1f000, 0x4000 ); |
| 4960 | 4960 | memory_configure_bank( machine, THOM_CART_BANK, 6, 2, mem + 0x28000, 0x4000 ); |
| 4961 | memory_configure_bank( machine, THOM_CART_BANK, 8, 8, messram_get_ptr(machine->device("messram")), 0x4000 ); | |
| 4962 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, messram_get_ptr(machine->device("messram")), 0x2000 ); | |
| 4963 | memory_configure_bank( machine, TO8_SYS_LO, 0, 1, messram_get_ptr(machine->device("messram")) + 0x6000, 0x4000 ); | |
| 4964 | memory_configure_bank( machine, TO8_SYS_HI, 0, 1, messram_get_ptr(machine->device("messram")) + 0x4000, 0x4000 ); | |
| 4965 | memory_configure_bank( machine, TO8_DATA_LO, 0, 8, messram_get_ptr(machine->device("messram")) + 0x2000, 0x4000 ); | |
| 4966 | memory_configure_bank( machine, TO8_DATA_HI, 0, 8, messram_get_ptr(machine->device("messram")) + 0x0000, 0x4000 ); | |
| 4961 | memory_configure_bank( machine, THOM_CART_BANK, 8, 8, ram_get_ptr(machine->device(RAM_TAG)), 0x4000 ); | |
| 4962 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, ram_get_ptr(machine->device(RAM_TAG)), 0x2000 ); | |
| 4963 | memory_configure_bank( machine, TO8_SYS_LO, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x6000, 0x4000 ); | |
| 4964 | memory_configure_bank( machine, TO8_SYS_HI, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x4000, 0x4000 ); | |
| 4965 | memory_configure_bank( machine, TO8_DATA_LO, 0, 8, ram_get_ptr(machine->device(RAM_TAG)) + 0x2000, 0x4000 ); | |
| 4966 | memory_configure_bank( machine, TO8_DATA_HI, 0, 8, ram_get_ptr(machine->device(RAM_TAG)) + 0x0000, 0x4000 ); | |
| 4967 | 4967 | memory_configure_bank( machine, TO8_BIOS_BANK, 0, 2, mem + 0x23000, 0x4000 ); |
| 4968 | 4968 | memory_set_bank( machine, THOM_CART_BANK, 0 ); |
| 4969 | 4969 | memory_set_bank( machine, THOM_VRAM_BANK, 0 ); |
| r9922 | r9923 | |
| 5214 | 5214 | /* memory */ |
| 5215 | 5215 | thom_cart_bank = 0; |
| 5216 | 5216 | mo5_reg_cart = 0; |
| 5217 | thom_vram = | |
| 5217 | thom_vram = | |
| 5218 | 5218 | memory_configure_bank( machine, THOM_CART_BANK, 0, 4, mem + 0x10000, 0x4000 ); |
| 5219 | 5219 | memory_configure_bank( machine, THOM_CART_BANK, 4, 2, mem + 0x1f000, 0x4000 ); |
| 5220 | 5220 | memory_configure_bank( machine, THOM_CART_BANK, 6, 2, mem + 0x28000, 0x4000 ); |
| 5221 | memory_configure_bank( machine, THOM_CART_BANK, 8, 8, messram_get_ptr(machine->device("messram")), 0x4000 ); | |
| 5222 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, messram_get_ptr(machine->device("messram")), 0x2000 ); | |
| 5223 | memory_configure_bank( machine, TO8_SYS_LO, 0, 1, messram_get_ptr(machine->device("messram")) + 0x6000, 0x4000 ); | |
| 5224 | memory_configure_bank( machine, TO8_SYS_HI, 0, 1, messram_get_ptr(machine->device("messram")) + 0x4000, 0x4000 ); | |
| 5225 | memory_configure_bank( machine, TO8_DATA_LO, 0, 8, messram_get_ptr(machine->device("messram")) + 0x2000, 0x4000 ); | |
| 5226 | memory_configure_bank( machine, TO8_DATA_HI, 0, 8, messram_get_ptr(machine->device("messram")) + 0x0000, 0x4000 ); | |
| 5221 | memory_configure_bank( machine, THOM_CART_BANK, 8, 8, ram_get_ptr(machine->device(RAM_TAG)), 0x4000 ); | |
| 5222 | memory_configure_bank( machine, THOM_VRAM_BANK, 0, 2, ram_get_ptr(machine->device(RAM_TAG)), 0x2000 ); | |
| 5223 | memory_configure_bank( machine, TO8_SYS_LO, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x6000, 0x4000 ); | |
| 5224 | memory_configure_bank( machine, TO8_SYS_HI, 0, 1, ram_get_ptr(machine->device(RAM_TAG)) + 0x4000, 0x4000 ); | |
| 5225 | memory_configure_bank( machine, TO8_DATA_LO, 0, 8, ram_get_ptr(machine->device(RAM_TAG)) + 0x2000, 0x4000 ); | |
| 5226 | memory_configure_bank( machine, TO8_DATA_HI, 0, 8, ram_get_ptr(machine->device(RAM_TAG)) + 0x0000, 0x4000 ); | |
| 5227 | 5227 | memory_configure_bank( machine, TO8_BIOS_BANK, 0, 2, mem + 0x23000, 0x4000 ); |
| 5228 | 5228 | memory_set_bank( machine, THOM_CART_BANK, 0 ); |
| 5229 | 5229 | memory_set_bank( machine, THOM_VRAM_BANK, 0 ); |
| r9922 | r9923 | |
|---|---|---|
| 16 | 16 | #include "includes/pmd85.h" |
| 17 | 17 | #include "machine/msm8251.h" |
| 18 | 18 | #include "machine/pit8253.h" |
| 19 | #include " | |
| 19 | #include "ma | |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | |
| r9922 | r9923 | |
| 44 | 44 | |
| 45 | 45 | memory_set_bankptr(machine, "bank1", mem + 0x010000); |
| 46 | 46 | memory_set_bankptr(machine, "bank3", mem + 0x010000); |
| 47 | memory_set_bankptr(machine, "bank5", | |
| 47 | memory_set_bankptr(machine, "bank5", | |
| 48 | 48 | |
| 49 | 49 | memory_set_bankptr(machine, "bank6", mem + 0x010000); |
| 50 | 50 | memory_set_bankptr(machine, "bank7", mem + 0x010000); |
| 51 | memory_set_bankptr(machine, "bank8", | |
| 51 | memory_set_bankptr(machine, "bank8", | |
| 52 | 52 | } |
| 53 | 53 | else |
| 54 | 54 | { |
| r9922 | r9923 | |
| 61 | 61 | memory_install_read_bank(space, 0x1000, 0x1fff, 0, 0, "bank2"); |
| 62 | 62 | memory_install_read_bank(space, 0x3000, 0x3fff, 0, 0, "bank4"); |
| 63 | 63 | |
| 64 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 65 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x1000); | |
| 66 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 67 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x3000); | |
| 68 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 64 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 65 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x1000); | |
| 66 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 67 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x3000); | |
| 68 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| r9922 | r9923 | |
| 82 | 82 | memory_unmap_write(space, 0x2000, 0x2fff, 0, 0); |
| 83 | 83 | |
| 84 | 84 | memory_set_bankptr(machine, "bank1", mem + 0x010000); |
| 85 | memory_set_bankptr(machine, "bank2", | |
| 85 | memory_set_bankptr(machine, "bank2", | |
| 86 | 86 | memory_set_bankptr(machine, "bank3", mem + 0x010000); |
| 87 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0xb000); | |
| 88 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 87 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0xb000); | |
| 88 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 89 | 89 | memory_set_bankptr(machine, "bank6", mem + 0x010000); |
| 90 | memory_set_bankptr(machine, "bank7", | |
| 90 | memory_set_bankptr(machine, "bank7", | |
| 91 | 91 | memory_set_bankptr(machine, "bank8", mem + 0x010000); |
| 92 | memory_set_bankptr(machine, "bank9", messram_get_ptr(machine->device("messram")) + 0xb000); | |
| 93 | memory_set_bankptr(machine, "bank10", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 92 | memory_set_bankptr(machine, "bank9", ram_get_ptr(machine->device(RAM_TAG)) + 0xb000); | |
| 93 | memory_set_bankptr(machine, "bank10", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 94 | 94 | |
| 95 | 95 | } |
| 96 | 96 | else |
| r9922 | r9923 | |
| 98 | 98 | memory_install_write_bank(space, 0x0000, 0x0fff, 0, 0, "bank1"); |
| 99 | 99 | memory_install_write_bank(space, 0x2000, 0x2fff, 0, 0, "bank3"); |
| 100 | 100 | |
| 101 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 102 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x1000); | |
| 103 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 104 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x5000); | |
| 105 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 101 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 102 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x1000); | |
| 103 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 104 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x5000); | |
| 105 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| r9922 | r9923 | |
| 121 | 121 | memory_set_bankptr(machine, "bank6", mem + 0x010000); |
| 122 | 122 | memory_set_bankptr(machine, "bank7", mem + 0x010000); |
| 123 | 123 | memory_set_bankptr(machine, "bank8", mem + 0x010000); |
| 124 | memory_set_bankptr(machine, "bank9", messram_get_ptr(machine->device("messram"))); | |
| 125 | memory_set_bankptr(machine, "bank10", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 126 | memory_set_bankptr(machine, "bank11", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 127 | memory_set_bankptr(machine, "bank12", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 128 | memory_set_bankptr(machine, "bank13", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 129 | memory_set_bankptr(machine, "bank14", messram_get_ptr(machine->device("messram")) + 0xa000); | |
| 130 | memory_set_bankptr(machine, "bank15", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 131 | memory_set_bankptr(machine, "bank16", messram_get_ptr(machine->device("messram")) + 0xe000); | |
| 124 | memory_set_bankptr(machine, "bank9", ram_get_ptr(machine->device(RAM_TAG))); | |
| 125 | memory_set_bankptr(machine, "bank10", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 126 | memory_set_bankptr(machine, "bank11", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 127 | memory_set_bankptr(machine, "bank12", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 128 | memory_set_bankptr(machine, "bank13", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 129 | memory_set_bankptr(machine, "bank14", ram_get_ptr(machine->device(RAM_TAG)) + 0xa000); | |
| 130 | memory_set_bankptr(machine, "bank15", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 131 | memory_set_bankptr(machine, "bank16", ram_get_ptr(machine->device(RAM_TAG)) + 0xe000); | |
| 132 | 132 | } |
| 133 | 133 | else |
| 134 | 134 | { |
| 135 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 136 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 137 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 138 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 139 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 140 | memory_set_bankptr(machine, "bank6", messram_get_ptr(machine->device("messram")) + 0xa000); | |
| 141 | memory_set_bankptr(machine, "bank7", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 142 | memory_set_bankptr(machine, "bank8", state->pmd853_memory_mapping ? machine->region("maincpu")->base() + 0x010000 : messram_get_ptr(machine->device("messram")) + 0xe000); | |
| 135 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 136 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 137 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 138 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 139 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 140 | memory_set_bankptr(machine, "bank6", ram_get_ptr(machine->device(RAM_TAG)) + 0xa000); | |
| 141 | memory_set_bankptr(machine, "bank7", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 142 | memory_set_bankptr(machine, "bank8", state->pmd853_memory_mapping ? machine->region("maincpu")->base() + 0x010000 : ram_get_ptr(machine->device(RAM_TAG)) + 0xe000); | |
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| r9922 | r9923 | |
| 158 | 158 | |
| 159 | 159 | memory_set_bankptr(machine, "bank1", mem + 0x010000); |
| 160 | 160 | memory_set_bankptr(machine, "bank2", mem + 0x011000); |
| 161 | memory_set_bankptr(machine, "bank4", | |
| 161 | memory_set_bankptr(machine, "bank4", | |
| 162 | 162 | memory_set_bankptr(machine, "bank5", mem + 0x010000); |
| 163 | 163 | memory_set_bankptr(machine, "bank6", mem + 0x011000); |
| 164 | memory_set_bankptr(machine, "bank7", | |
| 164 | memory_set_bankptr(machine, "bank7", | |
| 165 | 165 | } |
| 166 | 166 | else |
| 167 | 167 | { |
| r9922 | r9923 | |
| 169 | 169 | memory_install_write_bank(space, 0x1000, 0x33ff, 0, 0, "bank2"); |
| 170 | 170 | memory_install_write_bank(space, 0x3400, 0x3fff, 0, 0, "bank3"); |
| 171 | 171 | |
| 172 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 173 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x1000); | |
| 174 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x3400); | |
| 175 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 172 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 173 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x1000); | |
| 174 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x3400); | |
| 175 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| r9922 | r9923 | |
| 188 | 188 | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 189 | 189 | |
| 190 | 190 | memory_set_bankptr(machine, "bank1", mem + 0x010000); |
| 191 | memory_set_bankptr(machine, "bank2", | |
| 191 | memory_set_bankptr(machine, "bank2", | |
| 192 | 192 | memory_set_bankptr(machine, "bank3", mem + 0x010000); |
| 193 | memory_set_bankptr(machine, "bank4", | |
| 193 | memory_set_bankptr(machine, "bank4", | |
| 194 | 194 | } |
| 195 | 195 | else |
| 196 | 196 | { |
| 197 | 197 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 198 | 198 | |
| 199 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 200 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 199 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 200 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| r9922 | r9923 | |
| 212 | 212 | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 213 | 213 | |
| 214 | 214 | memory_set_bankptr(machine, "bank1", mem + 0x010000); |
| 215 | memory_set_bankptr(machine, "bank2", | |
| 215 | memory_set_bankptr(machine, "bank2", | |
| 216 | 216 | memory_set_bankptr(machine, "bank3", mem + 0x010000); |
| 217 | memory_set_bankptr(machine, "bank4", | |
| 217 | memory_set_bankptr(machine, "bank4", | |
| 218 | 218 | } |
| 219 | 219 | else |
| 220 | 220 | { |
| 221 | 221 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 222 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 223 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 222 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 223 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
| r9922 | r9923 | |
| 963 | 963 | state->ppi_port_outputs[i][j] = 0; |
| 964 | 964 | |
| 965 | 965 | /* memory initialization */ |
| 966 | memset( | |
| 966 | memset( | |
| 967 | 967 | state->pmd853_memory_mapping = 1; |
| 968 | 968 | state->startup_mem_map = 1; |
| 969 | 969 | state->update_memory(machine); |
| r9922 | r9923 | |
|---|---|---|
| 52 | 52 | **********************************************************************/ |
| 53 | 53 | |
| 54 | 54 | #include "machine/6883sam.h" |
| 55 | #include " | |
| 55 | #include "ma | |
| 56 | 56 | |
| 57 | 57 | #define LOG_VIDEO_POSITION 0 |
| 58 | 58 | |
| r9922 | r9923 | |
| 223 | 223 | logerror("sam_m6847_get_video_ram(): scanline=%d video_position=0x%04X\n", scanline, video_position); |
| 224 | 224 | |
| 225 | 225 | /* return actual position */ |
| 226 | ram_base = sam->intf->get_rambase ? sam->intf->get_rambase(device) : | |
| 226 | ram_base = sam->intf->get_rambase ? sam->intf->get_rambase(device) : | |
| 227 | 227 | return &ram_base[video_position]; |
| 228 | 228 | } |
| 229 | 229 |
| r9922 | r9923 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | #include "devices/cartslot.h" |
| 18 | 18 | #include "devices/cassette.h" |
| 19 | #include " | |
| 19 | #include "ma | |
| 20 | 20 | |
| 21 | 21 | #define VERBOSE_LEVEL 0 |
| 22 | 22 | #define DBG_LOG( MACHINE, N, M, A ) \ |
| r9922 | r9923 | |
| 701 | 701 | state->superpet = 0; |
| 702 | 702 | state->cbm8096 = 0; |
| 703 | 703 | |
| 704 | memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, | |
| 704 | memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, | |
| 705 | 705 | memory_set_bankptr(machine, "bank10", state->memory); |
| 706 | 706 | |
| 707 | if ( | |
| 707 | if ( | |
| 708 | 708 | { |
| 709 | memory_nop_readwrite(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), | |
| 709 | memory_nop_readwrite(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), | |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | /* 2114 poweron ? 64 x 0xff, 64x 0, and so on */ |
| 713 | for (i = 0; i < | |
| 713 | for (i = 0; i < | |
| 714 | 714 | { |
| 715 | 715 | memset (state->memory + i, i & 0x40 ? 0 : 0xff, 0x40); |
| 716 | 716 | } |
| r9922 | r9923 | |
| 727 | 727 | DRIVER_INIT( pet2001 ) |
| 728 | 728 | { |
| 729 | 729 | pet_state *state = machine->driver_data<pet_state>(); |
| 730 | state->memory = | |
| 730 | state->memory = | |
| 731 | 731 | pet_common_driver_init(machine); |
| 732 | 732 | state->pet_basic1 = 1; |
| 733 | 733 | pet_vh_init(machine); |
| r9922 | r9923 | |
| 736 | 736 | DRIVER_INIT( pet ) |
| 737 | 737 | { |
| 738 | 738 | pet_state *state = machine->driver_data<pet_state>(); |
| 739 | state->memory = | |
| 739 | state->memory = | |
| 740 | 740 | pet_common_driver_init(machine); |
| 741 | 741 | pet_vh_init(machine); |
| 742 | 742 | } |
| r9922 | r9923 | |
| 756 | 756 | DRIVER_INIT( superpet ) |
| 757 | 757 | { |
| 758 | 758 | pet_state *state = machine->driver_data<pet_state>(); |
| 759 | state->memory = | |
| 759 | state->memory = | |
| 760 | 760 | pet_common_driver_init(machine); |
| 761 | 761 | state->superpet = 1; |
| 762 | 762 |
| r9922 | r9923 | |
|---|---|---|
| 14 | 14 | #include "cpu/m6502/m6502.h" |
| 15 | 15 | #include "devices/cassette.h" |
| 16 | 16 | #include "devices/cartslot.h" |
| 17 | #include " | |
| 17 | #include "ma | |
| 18 | 18 | #include "includes/c16.h" |
| 19 | 19 | #include "machine/cbmiec.h" |
| 20 | 20 | #include "sound/sid6581.h" |
| r9922 | r9923 | |
| 108 | 108 | { |
| 109 | 109 | c16_state *state = machine->driver_data<c16_state>(); |
| 110 | 110 | UINT8 *rom = machine->region("maincpu")->base(); |
| 111 | memory_set_bankptr(machine, "bank9", | |
| 111 | memory_set_bankptr(machine, "bank9", | |
| 112 | 112 | |
| 113 | 113 | switch (state->lowrom) |
| 114 | 114 | { |
| r9922 | r9923 | |
| 185 | 185 | |
| 186 | 186 | ted7360_rom_switch_w(state->ted7360, 0); |
| 187 | 187 | |
| 188 | memory_set_bankptr(space->machine, "bank2", messram_get_ptr(state->messram) + (0x8000 % messram_get_size(state->messram))); | |
| 189 | memory_set_bankptr(space->machine, "bank3", messram_get_ptr(state->messram) + (0xc000 % messram_get_size(state->messram))); | |
| 190 | memory_set_bankptr(space->machine, "bank4", messram_get_ptr(state->messram) + (0xfc00 % messram_get_size(state->messram))); | |
| 191 | memory_set_bankptr(space->machine, "bank8", messram_get_ptr(state->messram) + (0xff20 % messram_get_size(state->messram))); | |
| 188 | memory_set_bankptr(space->machine, "bank2", ram_get_ptr(state->messram) + (0x8000 % ram_get_size(state->messram))); | |
| 189 | memory_set_bankptr(space->machine, "bank3", ram_get_ptr(state->messram) + (0xc000 % ram_get_size(state->messram))); | |
| 190 | memory_set_bankptr(space->machine, "bank4", ram_get_ptr(state->messram) + (0xfc00 % ram_get_size(state->messram))); | |
| 191 | memory_set_bankptr(space->machine, "bank8", ram_get_ptr(state->messram) + (0xff20 % ram_get_size(state->messram))); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | UINT8 c16_read_keyboard( running_machine *machine, int databus ) |
| r9922 | r9923 | |
| 336 | 336 | int c16_dma_read( running_machine *machine, int offset ) |
| 337 | 337 | { |
| 338 | 338 | c16_state *state = machine->driver_data<c16_state>(); |
| 339 | return | |
| 339 | return | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | int c16_dma_read_rom( running_machine *machine, int offset ) |
| r9922 | r9923 | |
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | return | |
| 380 | return | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | void c16_interrupt( running_machine *machine, int level ) |
| r9922 | r9923 | |
| 463 | 463 | |
| 464 | 464 | if (state->pal) |
| 465 | 465 | { |
| 466 | memory_set_bankptr(machine, "bank1", | |
| 466 | memory_set_bankptr(machine, "bank1", | |
| 467 | 467 | |
| 468 | memory_set_bankptr(machine, "bank5", messram_get_ptr(state->messram) + (0x4000 % messram_get_size(state->messram))); | |
| 469 | memory_set_bankptr(machine, "bank6", messram_get_ptr(state->messram) + (0x8000 % messram_get_size(state->messram))); | |
| 470 | memory_set_bankptr(machine, "bank7", messram_get_ptr(state->messram) + (0xc000 % messram_get_size(state->messram))); | |
| 468 | memory_set_bankptr(machine, "bank5", ram_get_ptr(state->messram) + (0x4000 % ram_get_size(state->messram))); | |
| 469 | memory_set_bankptr(machine, "bank6", ram_get_ptr(state->messram) + (0x8000 % ram_get_size(state->messram))); | |
| 470 | memory_set_bankptr(machine, "bank7", ram_get_ptr(state->messram) + (0xc000 % ram_get_size(state->messram))); | |
| 471 | 471 | |
| 472 | 472 | memory_install_write_bank(space, 0xff20, 0xff3d, 0, 0,"bank10"); |
| 473 | 473 | memory_install_write_bank(space, 0xff40, 0xffff, 0, 0, "bank11"); |
| 474 | memory_set_bankptr(machine, "bank10", messram_get_ptr(state->messram) + (0xff20 % messram_get_size(state->messram))); | |
| 475 | memory_set_bankptr(machine, "bank11", messram_get_ptr(state->messram) + (0xff40 % messram_get_size(state->messram))); | |
| 474 | memory_set_bankptr(machine, "bank10", ram_get_ptr(state->messram) + (0xff20 % ram_get_size(state->messram))); | |
| 475 | memory_set_bankptr(machine, "bank11", ram_get_ptr(state->messram) + (0xff40 % ram_get_size(state->messram))); | |
| 476 | 476 | } |
| 477 | 477 | else |
| 478 | 478 | { |
| 479 | 479 | memory_install_write_bank(space, 0x4000, 0xfcff, 0, 0, "bank10"); |
| 480 | memory_set_bankptr(machine, "bank10", | |
| 480 | memory_set_bankptr(machine, "bank10", | |
| 481 | 481 | } |
| 482 | 482 | } |
| 483 | 483 | |
| r9922 | r9923 | |
| 489 | 489 | { |
| 490 | 490 | c16_state *state = space->machine->driver_data<c16_state>(); |
| 491 | 491 | |
| 492 | messram_get_ptr(state->messram)[0x1400 + offset] = data; | |
| 493 | messram_get_ptr(state->messram)[0x5400 + offset] = data; | |
| 494 | messram_get_ptr(state->messram)[0x9400 + offset] = data; | |
| 495 | messram_get_ptr(state->messram)[0xd400 + offset] = data; | |
| 492 | ram_get_ptr(state->messram)[0x1400 + offset] = data; | |
| 493 | ram_get_ptr(state->messram)[0x5400 + offset] = data; | |
| 494 | ram_get_ptr(state->messram)[0x9400 + offset] = data; | |
| 495 | ram_get_ptr(state->messram)[0xd400 + offset] = data; | |
| 496 | 496 | |
| 497 | 497 | sid6581_w(state->sid, offset, data); |
| 498 | 498 | } |
| r9922 | r9923 | |
| 501 | 501 | { |
| 502 | 502 | c16_state *state = space->machine->driver_data<c16_state>(); |
| 503 | 503 | |
| 504 | | |
| 504 | | |
| 505 | 505 | |
| 506 | 506 | sid6581_w(state->sid, offset, data); |
| 507 | 507 | } |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "cpu/i8085/i8085.h" |
| 12 | 12 | #include "video/i8275.h" |
| 13 | 13 | #include "includes/rt1715.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | MACHINE_RESET( rt1715 ) |
| 18 | 18 | { |
| 19 | 19 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 20 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x0800); | |
| 21 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram"))); | |
| 20 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x0800); | |
| 21 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG))); | |
| 22 | 22 | } |
| r9922 | r9923 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | #include "machine/kb_keytro.h" |
| 35 | 35 | |
| 36 | #include " | |
| 36 | #include "ma | |
| 37 | 37 | |
| 38 | 38 | #define LOG_PORT80 0 |
| 39 | 39 | #define LOG_KBDC 0 |
| r9922 | r9923 | |
| 173 | 173 | soundblaster_config(&soundblaster); |
| 174 | 174 | kbdc8042_init(machine, at8042); |
| 175 | 175 | |
| 176 | if ( | |
| 176 | if ( | |
| 177 | 177 | { |
| 178 | offs_t ram_limit = 0x100000 + | |
| 178 | offs_t ram_limit = 0x100000 + | |
| 179 | 179 | memory_install_read_bank(space, 0x100000, ram_limit - 1, 0, 0, "bank1"); |
| 180 | 180 | memory_install_write_bank(space, 0x100000, ram_limit - 1, 0, 0, "bank1"); |
| 181 | memory_set_bankptr(machine, "bank1", | |
| 181 | memory_set_bankptr(machine, "bank1", | |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | |
| r9922 | r9923 | |
| 420 | 420 | { |
| 421 | 421 | at_state *st = machine->driver_data<at_state>(); |
| 422 | 422 | pic8259_ir6_w(st->pic8259_master, state); |
| 423 | //if ( messram_get_ptr(machine->device("messram"))[0x0490] == 0x74 ) | |
| 424 | // messram_get_ptr(machine->device("messram"))[0x0490] = 0x54; | |
| 423 | //if ( ram_get_ptr(machine->device(RAM_TAG))[0x0490] == 0x74 ) | |
| 424 | // ram_get_ptr(machine->device(RAM_TAG))[0x0490] = 0x54; | |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "machine/wd17xx.h" |
| 14 | 14 | #include "devices/cassette.h" |
| 15 | 15 | #include "includes/vector06.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | |
| r9922 | r9923 | |
| 161 | 161 | machine->device("maincpu")->reset(); |
| 162 | 162 | } |
| 163 | 163 | if ((val & 2)==2) { |
| 164 | memory_set_bankptr(machine, "bank1", | |
| 164 | memory_set_bankptr(machine, "bank1", | |
| 165 | 165 | machine->device("maincpu")->reset(); |
| 166 | 166 | } |
| 167 | 167 | } |
| r9922 | r9923 | |
| 190 | 190 | memory_install_write_bank(space, 0x8000, 0xffff, 0, 0, "bank4"); |
| 191 | 191 | |
| 192 | 192 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 193 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x0000); | |
| 194 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 195 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 193 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x0000); | |
| 194 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 195 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 196 | 196 | |
| 197 | 197 | state->keyboard_mask = 0; |
| 198 | 198 | state->color_index = 0; |
| r9922 | r9923 | |
|---|---|---|
| 17 | 17 | #include "sound/ay8910.h" |
| 18 | 18 | #include "includes/orion.h" |
| 19 | 19 | #include "includes/radio86.h" |
| 20 | #include " | |
| 20 | #include "ma | |
| 21 | 21 | |
| 22 | 22 | #define SCREEN_WIDTH_384 48 |
| 23 | 23 | #define SCREEN_WIDTH_480 60 |
| r9922 | r9923 | |
| 158 | 158 | orion_state *state = space->machine->driver_data<orion_state>(); |
| 159 | 159 | if (data!=state->orion128_memory_page ) |
| 160 | 160 | { |
| 161 | memory_set_bankptr(space->machine, "bank1", | |
| 161 | memory_set_bankptr(space->machine, "bank1", | |
| 162 | 162 | state->orion128_memory_page = (data & 3); |
| 163 | 163 | } |
| 164 | 164 | } |
| r9922 | r9923 | |
| 170 | 170 | state->orion128_video_mode = 0; |
| 171 | 171 | state->orion128_memory_page = -1; |
| 172 | 172 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0xf800); |
| 173 | memory_set_bankptr(machine, "bank2", | |
| 173 | memory_set_bankptr(machine, "bank2", | |
| 174 | 174 | state->orion128_video_width = SCREEN_WIDTH_384; |
| 175 | 175 | orion_set_video_mode(machine,384); |
| 176 | 176 | radio86_init_keyboard(machine); |
| r9922 | r9923 | |
| 288 | 288 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 289 | 289 | if ((state->orionz80_dispatcher & 0x80)==0) |
| 290 | 290 | { // dispatcher on |
| 291 | memory_set_bankptr(machine, "bank1", | |
| 291 | memory_set_bankptr(machine, "bank1", | |
| 292 | 292 | } |
| 293 | 293 | else |
| 294 | 294 | { // dispatcher off |
| 295 | memory_set_bankptr(machine, "bank1", | |
| 295 | memory_set_bankptr(machine, "bank1", | |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | memory_set_bankptr(machine, "bank2", | |
| 298 | memory_set_bankptr(machine, "bank2", | |
| 299 | 299 | |
| 300 | 300 | if ((state->orionz80_dispatcher & 0x20) == 0) |
| 301 | 301 | { |
| r9922 | r9923 | |
| 313 | 313 | memory_unmap_write(space, 0xfc00, 0xfeff, 0, 0); |
| 314 | 314 | memory_install_write8_handler(space, 0xff00, 0xffff, 0, 0, orionz80_sound_w); |
| 315 | 315 | |
| 316 | memory_set_bankptr(machine, "bank3", | |
| 316 | memory_set_bankptr(machine, "bank3", | |
| 317 | 317 | memory_set_bankptr(machine, "bank5", machine->region("maincpu")->base() + 0xf800); |
| 318 | 318 | |
| 319 | 319 | } |
| 320 | 320 | else |
| 321 | 321 | { |
| 322 | 322 | /* if it is full memory access */ |
| 323 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0xf000 + 0x10000 * state->orionz80_memory_page); | |
| 324 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0xf400 + 0x10000 * state->orionz80_memory_page); | |
| 325 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0xf800 + 0x10000 * state->orionz80_memory_page); | |
| 323 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0xf000 + 0x10000 * state->orionz80_memory_page); | |
| 324 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0xf400 + 0x10000 * state->orionz80_memory_page); | |
| 325 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0xf800 + 0x10000 * state->orionz80_memory_page); | |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | |
| r9922 | r9923 | |
| 365 | 365 | |
| 366 | 366 | |
| 367 | 367 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0xf800); |
| 368 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 369 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0xf000); | |
| 368 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 369 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0xf000); | |
| 370 | 370 | memory_set_bankptr(machine, "bank5", machine->region("maincpu")->base() + 0xf800); |
| 371 | 371 | |
| 372 | 372 | |
| r9922 | r9923 | |
| 447 | 447 | |
| 448 | 448 | if ((state->orionpro_dispatcher & 0x01)==0x00) |
| 449 | 449 | { // RAM0 segment disabled |
| 450 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram")) + 0x10000 * page); | |
| 451 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x10000 * page + 0x2000); | |
| 450 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000 * page); | |
| 451 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000 * page + 0x2000); | |
| 452 | 452 | } |
| 453 | 453 | else |
| 454 | 454 | { |
| 455 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram")) + (state->orionpro_ram0_segment & 31) * 0x4000); | |
| 456 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + (state->orionpro_ram0_segment & 31) * 0x4000 + 0x2000); | |
| 455 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG)) + (state->orionpro_ram0_segment & 31) * 0x4000); | |
| 456 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + (state->orionpro_ram0_segment & 31) * 0x4000 + 0x2000); | |
| 457 | 457 | } |
| 458 | 458 | if ((state->orionpro_dispatcher & 0x10)==0x10) |
| 459 | 459 | { // ROM1 enabled |
| r9922 | r9923 | |
| 468 | 468 | |
| 469 | 469 | if ((state->orionpro_dispatcher & 0x02)==0x00) |
| 470 | 470 | { // RAM1 segment disabled |
| 471 | memory_set_bankptr(machine, "bank3", | |
| 471 | memory_set_bankptr(machine, "bank3", | |
| 472 | 472 | } |
| 473 | 473 | else |
| 474 | 474 | { |
| 475 | memory_set_bankptr(machine, "bank3", | |
| 475 | memory_set_bankptr(machine, "bank3", | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | if ((state->orionpro_dispatcher & 0x04)==0x00) |
| 479 | 479 | { // RAM2 segment disabled |
| 480 | memory_set_bankptr(machine, "bank4", | |
| 480 | memory_set_bankptr(machine, "bank4", | |
| 481 | 481 | } |
| 482 | 482 | else |
| 483 | 483 | { |
| 484 | memory_set_bankptr(machine, "bank4", | |
| 484 | memory_set_bankptr(machine, "bank4", | |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | memory_set_bankptr(machine, "bank5", | |
| 487 | memory_set_bankptr(machine, "bank5", | |
| 488 | 488 | |
| 489 | 489 | if (is128) |
| 490 | 490 | { |
| 491 | memory_set_bankptr(machine, "bank6", | |
| 491 | memory_set_bankptr(machine, "bank6", | |
| 492 | 492 | |
| 493 | 493 | memory_install_write8_handler(space, 0xf400, 0xf4ff, 0, 0, orion128_system_w); |
| 494 | 494 | memory_install_write8_handler(space, 0xf500, 0xf5ff, 0, 0, orion128_romdisk_w); |
| r9922 | r9923 | |
| 506 | 506 | memory_install_write8_handler(space, 0xff00, 0xffff, 0, 0, orionz80_sound_w); |
| 507 | 507 | |
| 508 | 508 | |
| 509 | memory_set_bankptr(machine, "bank8", | |
| 509 | memory_set_bankptr(machine, "bank8", | |
| 510 | 510 | } |
| 511 | 511 | else |
| 512 | 512 | { |
| 513 | 513 | if ((state->orionpro_dispatcher & 0x40)==0x40) |
| 514 | 514 | { // FIX F000 enabled |
| 515 | memory_set_bankptr(machine, "bank6", messram_get_ptr(machine->device("messram")) + 0x10000 * 0 + 0xf000); | |
| 516 | memory_set_bankptr(machine, "bank7", messram_get_ptr(machine->device("messram")) + 0x10000 * 0 + 0xf400); | |
| 517 | memory_set_bankptr(machine, "bank8", messram_get_ptr(machine->device("messram")) + 0x10000 * 0 + 0xf800); | |
| 515 | memory_set_bankptr(machine, "bank6", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000 * 0 + 0xf000); | |
| 516 | memory_set_bankptr(machine, "bank7", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000 * 0 + 0xf400); | |
| 517 | memory_set_bankptr(machine, "bank8", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000 * 0 + 0xf800); | |
| 518 | 518 | } |
| 519 | 519 | else |
| 520 | 520 | { |
| 521 | memory_set_bankptr(machine, "bank6", messram_get_ptr(machine->device("messram")) + 0x10000 * page + 0xf000); | |
| 522 | memory_set_bankptr(machine, "bank7", messram_get_ptr(machine->device("messram")) + 0x10000 * page + 0xf400); | |
| 523 | memory_set_bankptr(machine, "bank8", messram_get_ptr(machine->device("messram")) + 0x10000 * page + 0xf800); | |
| 521 | memory_set_bankptr(machine, "bank6", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000 * page + 0xf000); | |
| 522 | memory_set_bankptr(machine, "bank7", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000 * page + 0xf400); | |
| 523 | memory_set_bankptr(machine, "bank8", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000 * page + 0xf800); | |
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | } |
| r9922 | r9923 | |
|---|---|---|
| 17 | 17 | #include "devices/snapquik.h" |
| 18 | 18 | #include "devices/cassette.h" |
| 19 | 19 | #include "devices/flopdrv.h" |
| 20 | #include " | |
| 20 | #include "ma | |
| 21 | 21 | |
| 22 | 22 | #define NASCOM1_KEY_RESET 0x02 |
| 23 | 23 | #define NASCOM1_KEY_INCR 0x01 |
| r9922 | r9923 | |
| 271 | 271 | |
| 272 | 272 | DRIVER_INIT( nascom1 ) |
| 273 | 273 | { |
| 274 | switch ( | |
| 274 | switch ( | |
| 275 | 275 | { |
| 276 | 276 | case 1 * 1024: |
| 277 | 277 | memory_nop_readwrite(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), |
| r9922 | r9923 | |
| 283 | 283 | 0x1400, 0x4fff, 0, 0, "bank1"); |
| 284 | 284 | memory_nop_readwrite(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), |
| 285 | 285 | 0x5000, 0xafff, 0, 0); |
| 286 | memory_set_bankptr(machine, "bank1", | |
| 286 | memory_set_bankptr(machine, "bank1", | |
| 287 | 287 | break; |
| 288 | 288 | |
| 289 | 289 | case 32 * 1024: |
| r9922 | r9923 | |
| 291 | 291 | 0x1400, 0x8fff, 0, 0, "bank1"); |
| 292 | 292 | memory_nop_readwrite(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), |
| 293 | 293 | 0x9000, 0xafff, 0, 0); |
| 294 | memory_set_bankptr(machine, "bank1", | |
| 294 | memory_set_bankptr(machine, "bank1", | |
| 295 | 295 | break; |
| 296 | 296 | |
| 297 | 297 | case 40 * 1024: |
| 298 | 298 | memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), |
| 299 | 299 | 0x1400, 0xafff, 0, 0, "bank1"); |
| 300 | memory_set_bankptr(machine, "bank1", | |
| 300 | memory_set_bankptr(machine, "bank1", | |
| 301 | 301 | break; |
| 302 | 302 | } |
| 303 | 303 | } |
| r9922 | r9923 | |
|---|---|---|
| 23 | 23 | #include "sound/beep.h" |
| 24 | 24 | #include "includes/osborne1.h" |
| 25 | 25 | #include "devices/flopdrv.h" |
| 26 | #include " | |
| 26 | #include "ma | |
| 27 | 27 | |
| 28 | 28 | #define RAMMODE (0x01) |
| 29 | 29 | |
| r9922 | r9923 | |
| 34 | 34 | /* Check whether regular RAM is enabled */ |
| 35 | 35 | if ( ! state->bank2_enabled || ( state->in_irq_handler && state->bankswitch == RAMMODE ) ) |
| 36 | 36 | { |
| 37 | | |
| 37 | | |
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | |
| r9922 | r9923 | |
| 45 | 45 | /* Check whether regular RAM is enabled */ |
| 46 | 46 | if ( ! state->bank2_enabled || ( state->in_irq_handler && state->bankswitch == RAMMODE ) ) |
| 47 | 47 | { |
| 48 | | |
| 48 | | |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| r9922 | r9923 | |
| 61 | 61 | /* Check whether regular RAM is enabled */ |
| 62 | 62 | if ( ! state->bank2_enabled ) |
| 63 | 63 | { |
| 64 | data = | |
| 64 | data = | |
| 65 | 65 | } |
| 66 | 66 | else |
| 67 | 67 | { |
| r9922 | r9923 | |
| 112 | 112 | /* Check whether regular RAM is enabled */ |
| 113 | 113 | if ( ! state->bank2_enabled ) |
| 114 | 114 | { |
| 115 | | |
| 115 | | |
| 116 | 116 | } |
| 117 | 117 | else |
| 118 | 118 | { |
| 119 | 119 | if ( state->in_irq_handler && state->bankswitch == RAMMODE ) |
| 120 | 120 | { |
| 121 | | |
| 121 | | |
| 122 | 122 | } |
| 123 | 123 | /* Handle writes to the I/O area */ |
| 124 | 124 | switch( offset & 0x0F00 ) |
| r9922 | r9923 | |
| 145 | 145 | /* Check whether regular RAM is enabled */ |
| 146 | 146 | if ( ! state->bank2_enabled || ( state->in_irq_handler && state->bankswitch == RAMMODE ) ) |
| 147 | 147 | { |
| 148 | | |
| 148 | | |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| r9922 | r9923 | |
| 192 | 192 | } |
| 193 | 193 | else |
| 194 | 194 | { |
| 195 | memory_set_bankptr(space->machine,"bank1", messram_get_ptr(space->machine->device("messram")) ); | |
| 196 | memory_set_bankptr(space->machine,"bank2", messram_get_ptr(space->machine->device("messram")) + 0x1000 ); | |
| 197 | memory_set_bankptr(space->machine,"bank3", messram_get_ptr(space->machine->device("messram")) + 0x3000 ); | |
| 195 | memory_set_bankptr(space->machine,"bank1", ram_get_ptr(space->machine->device(RAM_TAG)) ); | |
| 196 | memory_set_bankptr(space->machine,"bank2", ram_get_ptr(space->machine->device(RAM_TAG)) + 0x1000 ); | |
| 197 | memory_set_bankptr(space->machine,"bank3", ram_get_ptr(space->machine->device(RAM_TAG)) + 0x3000 ); | |
| 198 | 198 | } |
| 199 | state->bank4_ptr = | |
| 199 | state->bank4_ptr = | |
| 200 | 200 | memory_set_bankptr(space->machine,"bank4", state->bank4_ptr ); |
| 201 | 201 | state->bankswitch = offset; |
| 202 | 202 | state->in_irq_handler = 0; |
| r9922 | r9923 | |
| 210 | 210 | { |
| 211 | 211 | if ( ! state->bank2_enabled ) |
| 212 | 212 | { |
| 213 | direct.explicit_configure(0x2000, 0x2fff, 0x0fff, | |
| 213 | direct.explicit_configure(0x2000, 0x2fff, 0x0fff, | |
| 214 | 214 | return ~0; |
| 215 | 215 | } |
| 216 | 216 | } |
| r9922 | r9923 | |
| 363 | 363 | |
| 364 | 364 | for ( x = 0; x < 52; x++ ) |
| 365 | 365 | { |
| 366 | UINT8 character = | |
| 366 | UINT8 character = | |
| 367 | 367 | UINT8 cursor = character & 0x80; |
| 368 | UINT8 dim = | |
| 368 | UINT8 dim = | |
| 369 | 369 | UINT8 bits = state->charrom[ state->charline * 128 + ( character & 0x7F ) ]; |
| 370 | 370 | int bit; |
| 371 | 371 | |
| r9922 | r9923 | |
| 451 | 451 | |
| 452 | 452 | state->charrom = machine->region( "gfx1" )->base(); |
| 453 | 453 | |
| 454 | memset( | |
| 454 | memset( | |
| 455 | 455 | |
| 456 | 456 | for(drive=0;drive<2;drive++) |
| 457 | 457 | { |
| r9922 | r9923 | |
|---|---|---|
| 45 | 45 | #include "devices/snapquik.h" |
| 46 | 46 | #include "includes/amstrad.h" |
| 47 | 47 | #include "sound/ay8910.h" |
| 48 | #include " | |
| 48 | #include "ma | |
| 49 | 49 | |
| 50 | 50 | #define MANUFACTURER_NAME 0x07 |
| 51 | 51 | #define TV_REFRESH_RATE 0x10 |
| r9922 | r9923 | |
| 507 | 507 | } |
| 508 | 508 | return; |
| 509 | 509 | } |
| 510 | command = ( | |
| 510 | command = ( | |
| 511 | 511 | // logerror("DMA #%i: address %04x: command %04x\n",channel,state->asic.dma_addr[channel],command); |
| 512 | 512 | switch (command & 0xf000) |
| 513 | 513 | { |
| r9922 | r9923 | |
| 615 | 615 | state->gate_array.address = ( ( state->gate_array.ma & 0x2000 ) << 2 ) | ( ( state->gate_array.ra & 0x06 ) << 11 ) | ( ( state->gate_array.ra & 0x01 ) << 14 ) | ( ( state->gate_array.ma & 0x7ff ) << 1 ); |
| 616 | 616 | else |
| 617 | 617 | state->gate_array.address = ( ( state->gate_array.ma & 0x3000 ) << 2 ) | ( ( state->gate_array.ra & 0x07 ) << 11 ) | ( ( state->gate_array.ma & 0x3ff ) << 1 ); |
| 618 | state->gate_array.data = | |
| 618 | state->gate_array.data = | |
| 619 | 619 | state->gate_array.colour = state->GateArray_render_colours[ state->gate_array.mode_lookup[state->gate_array.data] ]; |
| 620 | 620 | state->gate_array.colour_ticks = state->gate_array.max_colour_ticks; |
| 621 | 621 | state->gate_array.ticks = 0; |
| r9922 | r9923 | |
| 651 | 651 | switch( state->gate_array.ticks) |
| 652 | 652 | { |
| 653 | 653 | case 8: |
| 654 | state->gate_array.data = | |
| 654 | state->gate_array.data = | |
| 655 | 655 | state->gate_array.colour = state->GateArray_render_colours[ state->gate_array.mode_lookup[state->gate_array.data] ]; |
| 656 | 656 | break; |
| 657 | 657 | case 16: |
| r9922 | r9923 | |
| 687 | 687 | ma += state->asic.horiz_disp; |
| 688 | 688 | } |
| 689 | 689 | state->gate_array.address = ( ( ma & 0x3000 ) << 2 ) | ( ( state->gate_array.ra & 0x07 ) << 11 ) | ( ( ma & 0x3ff ) << 1 ); |
| 690 | state->gate_array.data = | |
| 690 | state->gate_array.data = | |
| 691 | 691 | caddr = 0x2400 + state->gate_array.mode_lookup[state->gate_array.data] * 2; |
| 692 | 692 | state->gate_array.colour = state->asic.ram[caddr] + ( state->asic.ram[caddr+1] << 8 ); |
| 693 | 693 | state->gate_array.colour_ticks = state->gate_array.max_colour_ticks; |
| r9922 | r9923 | |
| 739 | 739 | { |
| 740 | 740 | UINT16 caddr; |
| 741 | 741 | |
| 742 | state->gate_array.data = | |
| 742 | state->gate_array.data = | |
| 743 | 743 | caddr = 0x2400 + state->gate_array.mode_lookup[state->gate_array.data] * 2; |
| 744 | 744 | state->gate_array.colour = state->asic.ram[caddr] + ( state->asic.ram[caddr+1] << 8 ); |
| 745 | 745 | } |
| r9922 | r9923 | |
| 1550 | 1550 | for (i=0;i<4;i++) |
| 1551 | 1551 | { |
| 1552 | 1552 | BankIndex = RamConfigurations[(ConfigurationIndex << 2) + i]; |
| 1553 | BankAddr = | |
| 1553 | BankAddr = | |
| 1554 | 1554 | state->Aleste_RamBanks[i] = BankAddr; |
| 1555 | 1555 | state->AmstradCPC_RamBanks[i] = BankAddr; |
| 1556 | 1556 | } |
| r9922 | r9923 | |
| 1962 | 1962 | switch(page) |
| 1963 | 1963 | { |
| 1964 | 1964 | case 0: /* 0x0000 - 0x3fff */ |
| 1965 | memory_set_bankptr(space->machine,"bank1",messram_get_ptr(space->machine->device("messram"))+ramptr); | |
| 1966 | memory_set_bankptr(space->machine,"bank2",messram_get_ptr(space->machine->device("messram"))+ramptr+0x2000); | |
| 1967 | memory_set_bankptr(space->machine,"bank9",messram_get_ptr(space->machine->device("messram"))+ramptr); | |
| 1968 | memory_set_bankptr(space->machine,"bank10",messram_get_ptr(space->machine->device("messram"))+ramptr+0x2000); | |
| 1969 | state->Aleste_RamBanks[0] = messram_get_ptr(space->machine->device("messram"))+ramptr; | |
| 1965 | memory_set_bankptr(space->machine,"bank1",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr); | |
| 1966 | memory_set_bankptr(space->machine,"bank2",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr+0x2000); | |
| 1967 | memory_set_bankptr(space->machine,"bank9",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr); | |
| 1968 | memory_set_bankptr(space->machine,"bank10",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr+0x2000); | |
| 1969 | state->Aleste_RamBanks[0] = ram_get_ptr(space->machine->device(RAM_TAG))+ramptr; | |
| 1970 | 1970 | state->aleste_active_page[0] = data; |
| 1971 | 1971 | logerror("RAM: RAM location 0x%06x (page %02x) mapped to 0x0000\n",ramptr,rampage); |
| 1972 | 1972 | break; |
| 1973 | 1973 | case 1: /* 0x4000 - 0x7fff */ |
| 1974 | memory_set_bankptr(space->machine,"bank3",messram_get_ptr(space->machine->device("messram"))+ramptr); | |
| 1975 | memory_set_bankptr(space->machine,"bank4",messram_get_ptr(space->machine->device("messram"))+ramptr+0x2000); | |
| 1976 | memory_set_bankptr(space->machine,"bank11",messram_get_ptr(space->machine->device("messram"))+ramptr); | |
| 1977 | memory_set_bankptr(space->machine,"bank12",messram_get_ptr(space->machine->device("messram"))+ramptr+0x2000); | |
| 1978 | state->Aleste_RamBanks[1] = messram_get_ptr(space->machine->device("messram"))+ramptr; | |
| 1974 | memory_set_bankptr(space->machine,"bank3",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr); | |
| 1975 | memory_set_bankptr(space->machine,"bank4",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr+0x2000); | |
| 1976 | memory_set_bankptr(space->machine,"bank11",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr); | |
| 1977 | memory_set_bankptr(space->machine,"bank12",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr+0x2000); | |
| 1978 | state->Aleste_RamBanks[1] = ram_get_ptr(space->machine->device(RAM_TAG))+ramptr; | |
| 1979 | 1979 | state->aleste_active_page[1] = data; |
| 1980 | 1980 | logerror("RAM: RAM location 0x%06x (page %02x) mapped to 0x4000\n",ramptr,rampage); |
| 1981 | 1981 | break; |
| 1982 | 1982 | case 2: /* 0x8000 - 0xbfff */ |
| 1983 | memory_set_bankptr(space->machine,"bank5",messram_get_ptr(space->machine->device("messram"))+ramptr); | |
| 1984 | memory_set_bankptr(space->machine,"bank6",messram_get_ptr(space->machine->device("messram"))+ramptr+0x2000); | |
| 1985 | memory_set_bankptr(space->machine,"bank13",messram_get_ptr(space->machine->device("messram"))+ramptr); | |
| 1986 | memory_set_bankptr(space->machine,"bank14",messram_get_ptr(space->machine->device("messram"))+ramptr+0x2000); | |
| 1987 | state->Aleste_RamBanks[2] = messram_get_ptr(space->machine->device("messram"))+ramptr; | |
| 1983 | memory_set_bankptr(space->machine,"bank5",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr); | |
| 1984 | memory_set_bankptr(space->machine,"bank6",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr+0x2000); | |
| 1985 | memory_set_bankptr(space->machine,"bank13",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr); | |
| 1986 | memory_set_bankptr(space->machine,"bank14",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr+0x2000); | |
| 1987 | state->Aleste_RamBanks[2] = ram_get_ptr(space->machine->device(RAM_TAG))+ramptr; | |
| 1988 | 1988 | state->aleste_active_page[2] = data; |
| 1989 | 1989 | logerror("RAM: RAM location 0x%06x (page %02x) mapped to 0x8000\n",ramptr,rampage); |
| 1990 | 1990 | break; |
| 1991 | 1991 | case 3: /* 0xc000 - 0xffff */ |
| 1992 | memory_set_bankptr(space->machine,"bank7",messram_get_ptr(space->machine->device("messram"))+ramptr); | |
| 1993 | memory_set_bankptr(space->machine,"bank8",messram_get_ptr(space->machine->device("messram"))+ramptr+0x2000); | |
| 1994 | memory_set_bankptr(space->machine,"bank15",messram_get_ptr(space->machine->device("messram"))+ramptr); | |
| 1995 | memory_set_bankptr(space->machine,"bank16",messram_get_ptr(space->machine->device("messram"))+ramptr+0x2000); | |
| 1996 | state->Aleste_RamBanks[3] = messram_get_ptr(space->machine->device("messram"))+ramptr; | |
| 1992 | memory_set_bankptr(space->machine,"bank7",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr); | |
| 1993 | memory_set_bankptr(space->machine,"bank8",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr+0x2000); | |
| 1994 | memory_set_bankptr(space->machine,"bank15",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr); | |
| 1995 | memory_set_bankptr(space->machine,"bank16",ram_get_ptr(space->machine->device(RAM_TAG))+ramptr+0x2000); | |
| 1996 | state->Aleste_RamBanks[3] = ram_get_ptr(space->machine->device(RAM_TAG))+ramptr; | |
| 1997 | 1997 | state->aleste_active_page[3] = data; |
| 1998 | 1998 | logerror("RAM: RAM location 0x%06x (page %02x) mapped to 0xc000\n",ramptr,rampage); |
| 1999 | 1999 | break; |
| r9922 | r9923 | |
| 2500 | 2500 | MemorySize = 64*1024; |
| 2501 | 2501 | } |
| 2502 | 2502 | |
| 2503 | memcpy( | |
| 2503 | memcpy( | |
| 2504 | 2504 | } |
| 2505 | 2505 | amstrad_rethinkMemory(machine); |
| 2506 | 2506 | } |
| r9922 | r9923 | |
|---|---|---|
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | 12 | #include "includes/llc.h" |
| 13 | #include " | |
| 13 | #include "ma | |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | |
| r9922 | r9923 | |
| 107 | 107 | DRIVER_INIT(llc2) |
| 108 | 108 | { |
| 109 | 109 | llc_state *state = machine->driver_data<llc_state>(); |
| 110 | state->video_ram = | |
| 110 | state->video_ram = | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | MACHINE_RESET( llc2 ) |
| r9922 | r9923 | |
| 124 | 124 | memory_set_bankptr(machine, "bank3", machine->region("maincpu")->base() + 0x6000); |
| 125 | 125 | |
| 126 | 126 | memory_install_write_bank(space, 0xc000, 0xffff, 0, 0, "bank4"); |
| 127 | memory_set_bankptr(machine, "bank4", | |
| 127 | memory_set_bankptr(machine, "bank4", | |
| 128 | 128 | |
| 129 | 129 | } |
| 130 | 130 | |
| r9922 | r9923 | |
| 133 | 133 | address_space *mem_space = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 134 | 134 | |
| 135 | 135 | memory_install_write_bank(mem_space, 0x0000, 0xbfff, 0, 0, "bank1"); |
| 136 | memory_set_bankptr(space->machine, "bank1", | |
| 136 | memory_set_bankptr(space->machine, "bank1", | |
| 137 | 137 | |
| 138 | 138 | memory_install_write_bank(mem_space, 0x4000, 0x5fff, 0, 0, "bank2"); |
| 139 | memory_set_bankptr(space->machine, "bank2", | |
| 139 | memory_set_bankptr(space->machine, "bank2", | |
| 140 | 140 | |
| 141 | 141 | memory_install_write_bank(mem_space, 0x6000, 0xbfff, 0, 0, "bank3"); |
| 142 | memory_set_bankptr(space->machine, "bank3", | |
| 142 | memory_set_bankptr(space->machine, "bank3", | |
| 143 | 143 | |
| 144 | 144 | memory_install_write_bank(mem_space, 0xc000, 0xffff, 0, 0, "bank4"); |
| 145 | memory_set_bankptr(space->machine, "bank4", | |
| 145 | memory_set_bankptr(space->machine, "bank4", | |
| 146 | 146 | |
| 147 | 147 | } |
| 148 | 148 | |
| r9922 | r9923 | |
| 155 | 155 | memory_set_bankptr(space->machine, "bank2", space->machine->region("maincpu")->base() + 0x10000); |
| 156 | 156 | } else { |
| 157 | 157 | memory_install_write_bank(mem_space, 0x4000, 0x5fff, 0, 0, "bank2"); |
| 158 | memory_set_bankptr(space->machine, "bank2", | |
| 158 | memory_set_bankptr(space->machine, "bank2", | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | } |
| r9922 | r9923 | |
|---|---|---|
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "includes/samcoupe.h" |
| 9 | 9 | #include "machine/msm6242.h" |
| 10 | #include " | |
| 10 | #include "ma | |
| 11 | 11 | |
| 12 | 12 | /*************************************************************************** |
| 13 | 13 | CONSTANTS |
| r9922 | r9923 | |
| 48 | 48 | UINT8 *mem; |
| 49 | 49 | |
| 50 | 50 | /* bank 3 */ |
| 51 | if (state->lext >> 6 < messram_get_size(space->machine->device("messram")) >> 20) | |
| 52 | mem = &messram_get_ptr(space->machine->device("messram"))[(messram_get_size(space->machine->device("messram")) & 0xfffff) + (state->lext >> 6) * 0x100000 + (state->lext & 0x3f) * 0x4000]; | |
| 51 | if (state->lext >> 6 < ram_get_size(space->machine->device(RAM_TAG)) >> 20) | |
| 52 | mem = &ram_get_ptr(space->machine->device(RAM_TAG))[(ram_get_size(space->machine->device(RAM_TAG)) & 0xfffff) + (state->lext >> 6) * 0x100000 + (state->lext & 0x3f) * 0x4000]; | |
| 53 | 53 | else |
| 54 | 54 | mem = NULL; |
| 55 | 55 | |
| 56 | 56 | samcoupe_update_bank(space, 3, mem, FALSE); |
| 57 | 57 | |
| 58 | 58 | /* bank 4 */ |
| 59 | if (state->hext >> 6 < messram_get_size(space->machine->device("messram")) >> 20) | |
| 60 | mem = &messram_get_ptr(space->machine->device("messram"))[(messram_get_size(space->machine->device("messram")) & 0xfffff) + (state->hext >> 6) * 0x100000 + (state->hext & 0x3f) * 0x4000]; | |
| 59 | if (state->hext >> 6 < ram_get_size(space->machine->device(RAM_TAG)) >> 20) | |
| 60 | mem = &ram_get_ptr(space->machine->device(RAM_TAG))[(ram_get_size(space->machine->device(RAM_TAG)) & 0xfffff) + (state->hext >> 6) * 0x100000 + (state->hext & 0x3f) * 0x4000]; | |
| 61 | 61 | else |
| 62 | 62 | mem = NULL; |
| 63 | 63 | |
| r9922 | r9923 | |
| 68 | 68 | void samcoupe_update_memory(address_space *space) |
| 69 | 69 | { |
| 70 | 70 | samcoupe_state *state = space->machine->driver_data<samcoupe_state>(); |
| 71 | const int PAGE_MASK = (( | |
| 71 | const int PAGE_MASK = (( | |
| 72 | 72 | UINT8 *rom = space->machine->region("maincpu")->base(); |
| 73 | 73 | UINT8 *memory; |
| 74 | 74 | int is_readonly; |
| r9922 | r9923 | |
| 77 | 77 | if (state->lmpr & LMPR_RAM0) /* Is ram paged in at bank 1 */ |
| 78 | 78 | { |
| 79 | 79 | if ((state->lmpr & 0x1F) <= PAGE_MASK) |
| 80 | memory = & | |
| 80 | memory = & | |
| 81 | 81 | else |
| 82 | 82 | memory = NULL; /* Attempt to page in non existant ram region */ |
| 83 | 83 | is_readonly = FALSE; |
| r9922 | r9923 | |
| 92 | 92 | |
| 93 | 93 | /* BANK2 */ |
| 94 | 94 | if (((state->lmpr + 1) & 0x1f) <= PAGE_MASK) |
| 95 | memory = & | |
| 95 | memory = & | |
| 96 | 96 | else |
| 97 | 97 | memory = NULL; /* Attempt to page in non existant ram region */ |
| 98 | 98 | samcoupe_update_bank(space, 2, memory, FALSE); |
| r9922 | r9923 | |
| 106 | 106 | { |
| 107 | 107 | /* BANK3 */ |
| 108 | 108 | if ((state->hmpr & 0x1F) <= PAGE_MASK ) |
| 109 | memory = & | |
| 109 | memory = & | |
| 110 | 110 | else |
| 111 | 111 | memory = NULL; /* Attempt to page in non existant ram region */ |
| 112 | 112 | samcoupe_update_bank(space, 3, memory, FALSE); |
| r9922 | r9923 | |
| 121 | 121 | else |
| 122 | 122 | { |
| 123 | 123 | if (((state->hmpr + 1) & 0x1f) <= PAGE_MASK) |
| 124 | memory = & | |
| 124 | memory = & | |
| 125 | 125 | else |
| 126 | 126 | memory = NULL; /* Attempt to page in non existant ram region */ |
| 127 | 127 | is_readonly = FALSE; |
| r9922 | r9923 | |
| 131 | 131 | |
| 132 | 132 | /* video memory location */ |
| 133 | 133 | if (state->vmpr & 0x40) /* if bit set in 2 bank screen mode */ |
| 134 | state->videoram = & | |
| 134 | state->videoram = & | |
| 135 | 135 | else |
| 136 | state->videoram = & | |
| 136 | state->videoram = & | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 |
| r9922 | r9923 | |
|---|---|---|
| 124 | 124 | #include "includes/comx35.h" |
| 125 | 125 | #include "machine/rescap.h" |
| 126 | 126 | #include "devices/flopdrv.h" |
| 127 | #include " | |
| 127 | #include "ma | |
| 128 | 128 | |
| 129 | 129 | enum |
| 130 | 130 | { |
| r9922 | r9923 | |
| 599 | 599 | memory_configure_bank(machine, "bank1", BANK_PRINTER_THERMAL, 1, machine->region("thermal")->base(), 0); |
| 600 | 600 | memory_configure_bank(machine, "bank1", BANK_JOYCARD, 1, machine->region(CDP1802_TAG)->base(), 0); |
| 601 | 601 | memory_configure_bank(machine, "bank1", BANK_80_COLUMNS, 1, machine->region("80column")->base(), 0); |
| 602 | memory_configure_bank(machine, "bank1", BANK_RAMCARD, 4, | |
| 602 | memory_configure_bank(machine, "bank1", BANK_RAMCARD, 4, | |
| 603 | 603 | |
| 604 | 604 | memory_set_bank(machine, "bank1", 0); |
| 605 | 605 |
| r9922 | r9923 | |
|---|---|---|
| 19 | 19 | #include "formats/svi_cas.h" |
| 20 | 20 | #include "sound/dac.h" |
| 21 | 21 | #include "sound/ay8910.h" |
| 22 | #include " | |
| 22 | #include "ma | |
| 23 | 23 | |
| 24 | 24 | enum { |
| 25 | 25 | SVI_INTERNAL = 0, |
| r9922 | r9923 | |
| 717 | 717 | } |
| 718 | 718 | break; |
| 719 | 719 | case SVI_EXPRAM2: |
| 720 | if ( | |
| 720 | if ( | |
| 721 | 721 | { |
| 722 | state->svi.bankLow_ptr = | |
| 722 | state->svi.bankLow_ptr = | |
| 723 | 723 | state->svi.bankLow_read_only = 0; |
| 724 | 724 | } |
| 725 | 725 | break; |
| 726 | 726 | case SVI_EXPRAM3: |
| 727 | if ( | |
| 727 | if ( | |
| 728 | 728 | { |
| 729 | state->svi.bankLow_ptr = | |
| 729 | state->svi.bankLow_ptr = | |
| 730 | 730 | state->svi.bankLow_read_only = 0; |
| 731 | 731 | } |
| 732 | 732 | break; |
| r9922 | r9923 | |
| 738 | 738 | switch( state->svi.bankHigh1 ) |
| 739 | 739 | { |
| 740 | 740 | case SVI_INTERNAL: |
| 741 | if ( | |
| 741 | if ( | |
| 742 | 742 | { |
| 743 | state->svi.bankHigh2_ptr = | |
| 743 | state->svi.bankHigh2_ptr = | |
| 744 | 744 | state->svi.bankHigh2_read_only = 0; |
| 745 | 745 | } |
| 746 | 746 | else |
| 747 | 747 | { |
| 748 | state->svi.bankHigh1_ptr = | |
| 748 | state->svi.bankHigh1_ptr = | |
| 749 | 749 | state->svi.bankHigh1_read_only = 0; |
| 750 | state->svi.bankHigh2_ptr = | |
| 750 | state->svi.bankHigh2_ptr = | |
| 751 | 751 | state->svi.bankHigh2_read_only = 0; |
| 752 | 752 | } |
| 753 | 753 | break; |
| 754 | 754 | case SVI_EXPRAM2: |
| 755 | if ( | |
| 755 | if ( | |
| 756 | 756 | { |
| 757 | state->svi.bankHigh1_ptr = | |
| 757 | state->svi.bankHigh1_ptr = | |
| 758 | 758 | state->svi.bankHigh1_read_only = 0; |
| 759 | state->svi.bankHigh2_ptr = | |
| 759 | state->svi.bankHigh2_ptr = | |
| 760 | 760 | state->svi.bankHigh2_read_only = 0; |
| 761 | 761 | } |
| 762 | 762 | break; |
| 763 | 763 | case SVI_EXPRAM3: |
| 764 | if ( | |
| 764 | if ( | |
| 765 | 765 | { |
| 766 | state->svi.bankHigh1_ptr = | |
| 766 | state->svi.bankHigh1_ptr = | |
| 767 | 767 | state->svi.bankHigh1_read_only = 0; |
| 768 | state->svi.bankHigh2_ptr = | |
| 768 | state->svi.bankHigh2_ptr = | |
| 769 | 769 | state->svi.bankHigh2_read_only = 0; |
| 770 | 770 | } |
| 771 | 771 | break; |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | 12 | #include "includes/galaxy.h" |
| 13 | 13 | #include "devices/cassette.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | |
| 16 | 16 | /*************************************************************************** |
| 17 | 17 | I/O devices |
| r9922 | r9923 | |
| 95 | 95 | cpu_set_reg(cpu, Z80_I, data[0x40]); |
| 96 | 96 | cpu_set_reg(cpu, Z80_R, (data[0x44] & 0x7f) | (data[0x48] & 0x80)); |
| 97 | 97 | |
| 98 | memcpy ( | |
| 98 | memcpy ( | |
| 99 | 99 | |
| 100 | 100 | break; |
| 101 | 101 | case GALAXY_SNAPSHOT_V2_SIZE: |
| r9922 | r9923 | |
| 122 | 122 | cpu_set_reg(cpu, Z80_I, data[0x19]); |
| 123 | 123 | cpu_set_reg(cpu, Z80_R, data[0x1a]); |
| 124 | 124 | |
| 125 | memcpy ( | |
| 125 | memcpy ( | |
| 126 | 126 | |
| 127 | 127 | break; |
| 128 | 128 | } |
| r9922 | r9923 | |
| 160 | 160 | DRIVER_INIT( galaxy ) |
| 161 | 161 | { |
| 162 | 162 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 163 | memory_install_readwrite_bank( space, 0x2800, 0x2800 + messram_get_size(machine->device("messram")) - 1, 0, 0, "bank1"); | |
| 164 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 163 | memory_install_readwrite_bank( space, 0x2800, 0x2800 + ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0, "bank1"); | |
| 164 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 165 | 165 | |
| 166 | if ( | |
| 166 | if ( | |
| 167 | 167 | { |
| 168 | memory_nop_readwrite( space, 0x2800 + | |
| 168 | memory_nop_readwrite( space, 0x2800 + | |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "includes/zx.h" |
| 12 | 12 | #include "devices/cassette.h" |
| 13 | 13 | #include "sound/speaker.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | |
| 16 | 16 | #define video_screen_get_refresh(screen) (((screen_config *)(screen)->inline_config)->refresh) |
| 17 | 17 | |
| r9922 | r9923 | |
| 51 | 51 | { |
| 52 | 52 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 53 | 53 | |
| 54 | memory_install_read_bank(space, 0x4000, 0x4000 + messram_get_size(machine->device("messram")) - 1, 0, 0, "bank1"); | |
| 55 | memory_install_write8_handler(space, 0x4000, 0x4000 + messram_get_size(machine->device("messram")) - 1, 0, 0, zx_ram_w); | |
| 54 | memory_install_read_bank(space, 0x4000, 0x4000 + ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0, "bank1"); | |
| 55 | memory_install_write8_handler(space, 0x4000, 0x4000 + ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0, zx_ram_w); | |
| 56 | 56 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x4000); |
| 57 | 57 | } |
| 58 | 58 |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | #include "includes/pocketc.h" |
| 5 | 5 | #include "includes/pc1401.h" |
| 6 | #include " | |
| 6 | #include "ma | |
| 7 | 7 | |
| 8 | 8 | /* C-CE while reset, program will not be destroyed! */ |
| 9 | 9 |
| r9922 | r9923 | |
|---|---|---|
| 116 | 116 | #include "devices/flopdrv.h" |
| 117 | 117 | #include "cpu/g65816/g65816.h" |
| 118 | 118 | #include "sound/es5503.h" |
| 119 | #include " | |
| 119 | #include "ma | |
| 120 | 120 | #include "debugger.h" |
| 121 | 121 | |
| 122 | 122 | #define LOG_C0XX 0 |
| r9922 | r9923 | |
| 1193 | 1193 | { |
| 1194 | 1194 | apple2gs_state *state = space->machine->driver_data<apple2gs_state>(); |
| 1195 | 1195 | offset += 0x000400; |
| 1196 | | |
| 1196 | | |
| 1197 | 1197 | |
| 1198 | 1198 | if (!(state->shadow & 0x01)) |
| 1199 | 1199 | { |
| r9922 | r9923 | |
| 1205 | 1205 | { |
| 1206 | 1206 | apple2gs_state *state = space->machine->driver_data<apple2gs_state>(); |
| 1207 | 1207 | offset += 0x010400; |
| 1208 | | |
| 1208 | | |
| 1209 | 1209 | |
| 1210 | 1210 | if (!(state->shadow & 0x01)) |
| 1211 | 1211 | { |
| r9922 | r9923 | |
| 1217 | 1217 | { |
| 1218 | 1218 | apple2gs_state *state = space->machine->driver_data<apple2gs_state>(); |
| 1219 | 1219 | offset += 0x002000; |
| 1220 | | |
| 1220 | | |
| 1221 | 1221 | |
| 1222 | 1222 | if (!(state->shadow & 0x02)) |
| 1223 | 1223 | { |
| r9922 | r9923 | |
| 1229 | 1229 | { |
| 1230 | 1230 | apple2gs_state *state = space->machine->driver_data<apple2gs_state>(); |
| 1231 | 1231 | offset += 0x012000; |
| 1232 | | |
| 1232 | | |
| 1233 | 1233 | |
| 1234 | 1234 | if (!(state->shadow & 0x12) || !(state->shadow & 0x08)) |
| 1235 | 1235 | { |
| r9922 | r9923 | |
| 1241 | 1241 | { |
| 1242 | 1242 | apple2gs_state *state = space->machine->driver_data<apple2gs_state>(); |
| 1243 | 1243 | offset += 0x004000; |
| 1244 | | |
| 1244 | | |
| 1245 | 1245 | |
| 1246 | 1246 | if ((offset >= 0x004000) && (offset <= 0x005FFF)) |
| 1247 | 1247 | { |
| r9922 | r9923 | |
| 1254 | 1254 | { |
| 1255 | 1255 | apple2gs_state *state = space->machine->driver_data<apple2gs_state>(); |
| 1256 | 1256 | offset += 0x014000; |
| 1257 | | |
| 1257 | | |
| 1258 | 1258 | |
| 1259 | 1259 | if ((offset >= 0x014000) && (offset <= 0x015FFF)) |
| 1260 | 1260 | { |
| r9922 | r9923 | |
| 1502 | 1502 | |
| 1503 | 1503 | if ((state->shadow & 0x40) && ((address & 0xF00000) == 0x000000)) |
| 1504 | 1504 | { |
| 1505 | result = | |
| 1505 | result = | |
| 1506 | 1506 | } |
| 1507 | 1507 | else if ((address & 0x000F00) == 0x000000) |
| 1508 | 1508 | { |
| r9922 | r9923 | |
| 1529 | 1529 | |
| 1530 | 1530 | if ((state->shadow & 0x40) && ((address & 0xF00000) == 0x000000)) |
| 1531 | 1531 | { |
| 1532 | | |
| 1532 | | |
| 1533 | 1533 | } |
| 1534 | 1534 | else if ((address & 0x000F00) == 0x000000) |
| 1535 | 1535 | { |
| r9922 | r9923 | |
| 1556 | 1556 | { |
| 1557 | 1557 | if ((state->shadow & 0x40) && ((address & 0xF00000) == 0x000000)) |
| 1558 | 1558 | { |
| 1559 | opptr = & | |
| 1559 | opptr = & | |
| 1560 | 1560 | } |
| 1561 | 1561 | else if ((address & 0x000F00) == 0x000000) |
| 1562 | 1562 | { |
| r9922 | r9923 | |
| 1634 | 1634 | state_save_register_item_array(machine, "APPLE2GS_SLOWMEM", NULL, 0, state->slowmem); |
| 1635 | 1635 | |
| 1636 | 1636 | /* install expanded memory */ |
| 1637 | memory_install_readwrite_bank(space, 0x010000, messram_get_size(machine->device("messram")) - 1, 0, 0, "bank1"); | |
| 1638 | memory_set_bankptr(machine,"bank1", messram_get_ptr(machine->device("messram")) + 0x010000); | |
| 1637 | memory_install_readwrite_bank(space, 0x010000, ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0, "bank1"); | |
| 1638 | memory_set_bankptr(machine,"bank1", ram_get_ptr(machine->device(RAM_TAG)) + 0x010000); | |
| 1639 | 1639 | |
| 1640 | 1640 | /* install hi memory */ |
| 1641 | 1641 | memory_install_read_bank(space, 0xe00000, 0xe1ffff, 0, 0, "bank2"); |
| r9922 | r9923 | |
| 1750 | 1750 | apple2gs_setup_memory(machine); |
| 1751 | 1751 | |
| 1752 | 1752 | /* save state stuff. note that the driver takes care of docram. */ |
| 1753 | state_save_register_global_array(machine, | |
| 1753 | state_save_register_global_array(machine, | |
| 1754 | 1754 | |
| 1755 | 1755 | state_save_register_item(machine, "NEWVIDEO", NULL, 0, state->newvideo); |
| 1756 | 1756 |
| r9922 | r9923 | |
|---|---|---|
| 94 | 94 | #include "sound/asc.h" |
| 95 | 95 | #include "includes/mac.h" |
| 96 | 96 | #include "debug/debugcpu.h" |
| 97 | #include " | |
| 97 | #include "ma | |
| 98 | 98 | #include "debugger.h" |
| 99 | 99 | |
| 100 | 100 | #define ADB_IS_BITBANG ((mac->m_model == MODEL_MAC_SE || mac->m_model == MODEL_MAC_CLASSIC) || (mac->m_model >= MODEL_MAC_II && mac->m_model <= MODEL_MAC_IICI) || (mac->m_model == MODEL_MAC_SE30)) |
| r9922 | r9923 | |
| 402 | 402 | else |
| 403 | 403 | { |
| 404 | 404 | /* RAM */ |
| 405 | memory_size = messram_get_size(m_ram); | |
| 406 | memory_data = messram_get_ptr(m_ram); | |
| 405 | memory_size = ram_get_size(m_ram); | |
| 406 | memory_data = ram_get_ptr(m_ram); | |
| 407 | 407 | is_rom = FALSE; |
| 408 | 408 | } |
| 409 | 409 | |
| r9922 | r9923 | |
| 480 | 480 | else |
| 481 | 481 | { |
| 482 | 482 | /* RAM */ |
| 483 | memory_size = messram_get_size(m_ram); | |
| 484 | memory_data = messram_get_ptr(m_ram); | |
| 483 | memory_size = ram_get_size(m_ram); | |
| 484 | memory_data = ram_get_ptr(m_ram); | |
| 485 | 485 | is_rom = FALSE; |
| 486 | 486 | } |
| 487 | 487 | |
| r9922 | r9923 | |
| 3108 | 3108 | mac_set_sound_buffer(machine->device("custom"), 1); |
| 3109 | 3109 | |
| 3110 | 3110 | // classic will fail RAM test and try to boot appletalk if RAM is not all zero |
| 3111 | memset( | |
| 3111 | memset( | |
| 3112 | 3112 | } |
| 3113 | 3113 | |
| 3114 | 3114 | m_scsi_interrupt = 0; |
| r9922 | r9923 | |
| 3208 | 3208 | else if (model < MODEL_MAC_II) |
| 3209 | 3209 | { |
| 3210 | 3210 | /* set up RAM mirror at 0x600000-0x6fffff (0x7fffff ???) */ |
| 3211 | mac_install_memory(machine, 0x600000, 0x6fffff, | |
| 3211 | mac_install_memory(machine, 0x600000, 0x6fffff, | |
| 3212 | 3212 | |
| 3213 | 3213 | /* set up ROM at 0x400000-0x43ffff (-0x5fffff for mac 128k/512k/512ke) */ |
| 3214 | 3214 | mac_install_memory(machine, 0x400000, (model >= MODEL_MAC_PLUS) ? 0x43ffff : 0x5fffff, |
| r9922 | r9923 | |
| 3218 | 3218 | mac->m_overlay = -1; |
| 3219 | 3219 | mac->set_memory_overlay(1); |
| 3220 | 3220 | |
| 3221 | memset( | |
| 3221 | memset( | |
| 3222 | 3222 | |
| 3223 | 3223 | if ((model == MODEL_MAC_SE) || (model == MODEL_MAC_CLASSIC) || (model == MODEL_MAC_CLASSIC_II) || (model == MODEL_MAC_LC) || |
| 3224 | 3224 | (model == MODEL_MAC_LC_II) || (model == MODEL_MAC_LC_III) || (model == MODEL_MAC_LC_III_PLUS) || ((mac->m_model >= MODEL_MAC_II) && (mac->m_model <= MODEL_MAC_SE30)) || |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "mpc105.h" |
| 11 | 11 | #include "machine/pci.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | #define LOG_MPC105 1 |
| 15 | 15 | |
| r9922 | r9923 | |
| 58 | 58 | | (((mpc105->bank_registers[(bank / 4) + 6] >> (bank % 4) * 8)) & 0x03) << 28 |
| 59 | 59 | | 0x000FFFFF; |
| 60 | 60 | |
| 61 | end = MIN(end, begin + | |
| 61 | end = MIN(end, begin + | |
| 62 | 62 | |
| 63 | 63 | if ((begin + 0x100000) <= end) |
| 64 | 64 | { |
| 65 | 65 | if (LOG_MPC105) |
| 66 | logerror("\tbank #%d [%02d]: 0x%08X - 0x%08X [%p-%p]\n", bank, bank + mpc105->bank_base, begin, end, | |
| 66 | logerror("\tbank #%d [%02d]: 0x%08X - 0x%08X [%p-%p]\n", bank, bank + mpc105->bank_base, begin, end, | |
| 67 | 67 | |
| 68 | 68 | if (mpc105->bank_base > 0) |
| 69 | 69 | { |
| r9922 | r9923 | |
| 78 | 78 | 0, 0, (write64_space_func) (FPTR)(bank + mpc105->bank_base)); |
| 79 | 79 | } |
| 80 | 80 | sprintf(bank_str,"bank%d",bank + mpc105->bank_base); |
| 81 | memory_set_bankptr(machine, bank_str, | |
| 81 | memory_set_bankptr(machine, bank_str, | |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | } |
| r9922 | r9923 | |
|---|---|---|
| 19 | 19 | #include "machine/ctronics.h" |
| 20 | 20 | #include "sound/speaker.h" |
| 21 | 21 | #include "devices/cassette.h" |
| 22 | #include " | |
| 22 | #include "ma | |
| 23 | 23 | |
| 24 | 24 | #ifndef VERBOSE |
| 25 | 25 | #define VERBOSE 1 |
| r9922 | r9923 | |
| 182 | 182 | |
| 183 | 183 | /* ram from 0xa000 to 0xbfff */ |
| 184 | 184 | memory_install_readwrite_bank(spc, 0xa000, 0xbfff, 0, 0, "bank5"); |
| 185 | memory_set_bankptr(space->machine, "bank5", | |
| 185 | memory_set_bankptr(space->machine, "bank5", | |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | |
| r9922 | r9923 | |
| 194 | 194 | address_space *spc = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 195 | 195 | |
| 196 | 196 | memory_install_readwrite_bank(spc, 0x0000, 0x0fff, 0, 0, "bank1"); |
| 197 | memory_set_bankptr(space->machine, "bank1", | |
| 197 | memory_set_bankptr(space->machine, "bank1", | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | WRITE8_HANDLER( mz800_bank_0_w ) |
| r9922 | r9923 | |
| 202 | 202 | address_space *spc = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 203 | 203 | |
| 204 | 204 | memory_install_readwrite_bank(spc, 0x0000, 0x7fff, 0, 0, "bank1"); |
| 205 | memory_set_bankptr(space->machine, "bank1", | |
| 205 | memory_set_bankptr(space->machine, "bank1", | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | READ8_HANDLER( mz800_bank_1_r ) |
| r9922 | r9923 | |
| 212 | 212 | |
| 213 | 213 | /* switch in ram from 0x1000 to 0x1fff */ |
| 214 | 214 | memory_install_readwrite_bank(spc, 0x1000, 0x1fff, 0, 0, "bank2"); |
| 215 | memory_set_bankptr(space->machine, "bank2", | |
| 215 | memory_set_bankptr(space->machine, "bank2", | |
| 216 | 216 | |
| 217 | 217 | if (mz->mz700_mode) |
| 218 | 218 | { |
| 219 | 219 | /* ram from 0xc000 to 0xcfff */ |
| 220 | 220 | memory_install_readwrite_bank(spc, 0xc000, 0xcfff, 0, 0, "bank6"); |
| 221 | memory_set_bankptr(space->machine, "bank6", | |
| 221 | memory_set_bankptr(space->machine, "bank6", | |
| 222 | 222 | } |
| 223 | 223 | else |
| 224 | 224 | { |
| 225 | 225 | /* ram from 0x8000 to 0xbfff */ |
| 226 | 226 | memory_install_readwrite_bank(spc, 0x8000, 0xbfff, 0, 0, "bank4"); |
| 227 | memory_set_bankptr(space->machine, "bank4", | |
| 227 | memory_set_bankptr(space->machine, "bank4", | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | return 0xff; |
| r9922 | r9923 | |
| 241 | 241 | if (!mz->mz700_ram_lock) |
| 242 | 242 | { |
| 243 | 243 | memory_install_readwrite_bank(spc, 0xd000, 0xffff, 0, 0, "bank7"); |
| 244 | memory_set_bankptr(space->machine, "bank7", | |
| 244 | memory_set_bankptr(space->machine, "bank7", | |
| 245 | 245 | mz->mz700_ram_vram = FALSE; |
| 246 | 246 | } |
| 247 | 247 | } |
| r9922 | r9923 | |
| 251 | 251 | if (!mz->mz800_ram_lock) |
| 252 | 252 | { |
| 253 | 253 | memory_install_readwrite_bank(spc, 0xe000, 0xffff, 0, 0, "bank8"); |
| 254 | memory_set_bankptr(space->machine, "bank8", | |
| 254 | memory_set_bankptr(space->machine, "bank8", | |
| 255 | 255 | mz->mz800_ram_monitor = FALSE; |
| 256 | 256 | } |
| 257 | 257 | } |
| r9922 | r9923 | |
| 330 | 330 | |
| 331 | 331 | /* rest is ram is always ram in mz700 mode */ |
| 332 | 332 | memory_install_readwrite_bank(spc, 0x1000, 0xcfff, 0, 0, "bank2"); |
| 333 | memory_set_bankptr(space->machine, "bank2", | |
| 333 | memory_set_bankptr(space->machine, "bank2", | |
| 334 | 334 | } |
| 335 | 335 | else |
| 336 | 336 | { |
| r9922 | r9923 | |
| 341 | 341 | |
| 342 | 342 | /* ram from 0x2000 to 0x7fff */ |
| 343 | 343 | memory_install_readwrite_bank(spc, 0x2000, 0x7fff, 0, 0, "bank3"); |
| 344 | memory_set_bankptr(space->machine, "bank3", | |
| 344 | memory_set_bankptr(space->machine, "bank3", | |
| 345 | 345 | |
| 346 | 346 | if (mz->hires_mode) |
| 347 | 347 | { |
| r9922 | r9923 | |
| 357 | 357 | |
| 358 | 358 | /* ram from 0xa000 to 0xbfff */ |
| 359 | 359 | memory_install_readwrite_bank(spc, 0xa000, 0xbfff, 0, 0, "bank5"); |
| 360 | memory_set_bankptr(space->machine, "bank5", | |
| 360 | memory_set_bankptr(space->machine, "bank5", | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /* ram from 0xc000 to 0xdfff */ |
| 364 | 364 | memory_install_readwrite_bank(spc, 0xc000, 0xdfff, 0, 0, "bank6"); |
| 365 | memory_set_bankptr(space->machine, "bank6", | |
| 365 | memory_set_bankptr(space->machine, "bank6", | |
| 366 | 366 | |
| 367 | 367 | /* mz800 monitor rom from 0xe000 to 0xffff */ |
| 368 | 368 | memory_install_read_bank(spc, 0xe000, 0xffff, 0, 0, "bank8"); |
| r9922 | r9923 | |
|---|---|---|
| 18 | 18 | #include "machine/6532riot.h" |
| 19 | 19 | #include "machine/74145.h" |
| 20 | 20 | #include "sound/speaker.h" |
| 21 | #include " | |
| 21 | #include "ma | |
| 22 | 22 | |
| 23 | 23 | #define LED_REFRESH_DELAY ATTOTIME_IN_USEC(70) |
| 24 | 24 | |
| r9922 | r9923 | |
| 288 | 288 | { |
| 289 | 289 | sym1_state *state = machine->driver_data<sym1_state>(); |
| 290 | 290 | /* wipe expansion memory banks that are not installed */ |
| 291 | if ( | |
| 291 | if ( | |
| 292 | 292 | { |
| 293 | 293 | memory_nop_readwrite(cputag_get_address_space( machine, "maincpu", ADDRESS_SPACE_PROGRAM ), |
| 294 | | |
| 294 | | |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /* allocate a timer to refresh the led display */ |
| r9922 | r9923 | |
|---|---|---|
| 16 | 16 | #include "sound/ay8910.h" |
| 17 | 17 | #include "sound/dac.h" |
| 18 | 18 | #include "devices/flopdrv.h" |
| 19 | #include " | |
| 19 | #include "ma | |
| 20 | 20 | |
| 21 | 21 | #define AYWriteReg(chip,port,value) \ |
| 22 | 22 | ay8910_address_w(ay8910, 0,port); \ |
| r9922 | r9923 | |
| 149 | 149 | memset(gfx + i * 8, i, 8); |
| 150 | 150 | |
| 151 | 151 | /* set up RAM */ |
| 152 | memory_install_read_bank(space, 0x4000, 0x4000 + messram_get_size(machine->device("messram")) - 1, 0, 0, "bank1"); | |
| 153 | memory_install_write8_handler(space, 0x4000, 0x4000 + messram_get_size(machine->device("messram")) - 1, 0, 0, cgenie_videoram_w); | |
| 154 | state->videoram = messram_get_ptr(machine->device("messram")); | |
| 155 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 152 | memory_install_read_bank(space, 0x4000, 0x4000 + ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0, "bank1"); | |
| 153 | memory_install_write8_handler(space, 0x4000, 0x4000 + ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0, cgenie_videoram_w); | |
| 154 | state->videoram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 155 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 156 | 156 | timer_pulse(machine, ATTOTIME_IN_HZ(11025), NULL, 0, handle_cassette_input ); |
| 157 | 157 | } |
| 158 | 158 |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | 12 | #include "devices/cassette.h" |
| 13 | 13 | #include "includes/ondra.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | static device_t *cassette_device_image(running_machine *machine) |
| r9922 | r9923 | |
| 46 | 46 | memory_set_bankptr(machine, "bank1", mem + 0x010000); |
| 47 | 47 | } else { |
| 48 | 48 | memory_install_write_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, "bank1"); |
| 49 | memory_set_bankptr(machine, "bank1", | |
| 49 | memory_set_bankptr(machine, "bank1", | |
| 50 | 50 | } |
| 51 | memory_set_bankptr(machine, "bank2", | |
| 51 | memory_set_bankptr(machine, "bank2", | |
| 52 | 52 | if (state->bank2_status==0) { |
| 53 | 53 | memory_install_readwrite_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, "bank3"); |
| 54 | memory_set_bankptr(machine, "bank3", | |
| 54 | memory_set_bankptr(machine, "bank3", | |
| 55 | 55 | } else { |
| 56 | 56 | memory_unmap_write(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0); |
| 57 | 57 | memory_install_read8_handler (cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe000, 0xffff, 0, 0, ondra_keyboard_r); |
| r9922 | r9923 | |
|---|---|---|
| 16 | 16 | #include "machine/i8255a.h" |
| 17 | 17 | #include "includes/lviv.h" |
| 18 | 18 | #include "sound/speaker.h" |
| 19 | #include " | |
| 19 | #include "ma | |
| 20 | 20 | |
| 21 | 21 | #define LVIV_SNAPSHOT_SIZE 82219 |
| 22 | 22 | |
| r9922 | r9923 | |
| 29 | 29 | lviv_state *state = machine->driver_data<lviv_state>(); |
| 30 | 30 | if (state->ppi_port_outputs[0][2] & 0x02) |
| 31 | 31 | { |
| 32 | memory_set_bankptr(machine,"bank1", messram_get_ptr(machine->device("messram"))); | |
| 33 | memory_set_bankptr(machine,"bank2", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 32 | memory_set_bankptr(machine,"bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 33 | memory_set_bankptr(machine,"bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 34 | 34 | } |
| 35 | 35 | else |
| 36 | 36 | { |
| 37 | memory_set_bankptr(machine,"bank1", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 38 | memory_set_bankptr(machine,"bank2", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 37 | memory_set_bankptr(machine,"bank1", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 38 | memory_set_bankptr(machine,"bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| r9922 | r9923 | |
| 182 | 182 | memory_install_write_bank(cpuspace, 0x8000, 0xbfff, 0, 0, "bank3"); |
| 183 | 183 | memory_unmap_write(cpuspace, 0xC000, 0xffff, 0, 0); |
| 184 | 184 | |
| 185 | memory_set_bankptr(space->machine,"bank1", messram_get_ptr(space->machine->device("messram"))); | |
| 186 | memory_set_bankptr(space->machine,"bank2", messram_get_ptr(space->machine->device("messram")) + 0x4000); | |
| 187 | memory_set_bankptr(space->machine,"bank3", messram_get_ptr(space->machine->device("messram")) + 0x8000); | |
| 185 | memory_set_bankptr(space->machine,"bank1", ram_get_ptr(space->machine->device(RAM_TAG))); | |
| 186 | memory_set_bankptr(space->machine,"bank2", ram_get_ptr(space->machine->device(RAM_TAG)) + 0x4000); | |
| 187 | memory_set_bankptr(space->machine,"bank3", ram_get_ptr(space->machine->device(RAM_TAG)) + 0x8000); | |
| 188 | 188 | memory_set_bankptr(space->machine,"bank4", space->machine->region("maincpu")->base() + 0x010000); |
| 189 | 189 | } |
| 190 | 190 | else |
| r9922 | r9923 | |
| 234 | 234 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 235 | 235 | space->set_direct_update_handler(direct_update_delegate_create_static(lviv_directoverride, *machine)); |
| 236 | 236 | |
| 237 | state->video_ram = | |
| 237 | state->video_ram = | |
| 238 | 238 | |
| 239 | 239 | state->startup_mem_map = 1; |
| 240 | 240 | |
| r9922 | r9923 | |
| 250 | 250 | |
| 251 | 251 | /*timer_pulse(machine, TIME_IN_NSEC(200), NULL, 0, lviv_draw_pixel);*/ |
| 252 | 252 | |
| 253 | /*memset( | |
| 253 | /*memset( | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
| r9922 | r9923 | |
| 295 | 295 | cpu_set_reg(machine->device("maincpu"), I8085_PC, (hi << 8) | lo); |
| 296 | 296 | |
| 297 | 297 | /* Memory dump */ |
| 298 | memcpy (messram_get_ptr(machine->device("messram")), data+0x0011, 0xc000); | |
| 299 | memcpy (messram_get_ptr(machine->device("messram"))+0xc000, data+0x10011, 0x4000); | |
| 298 | memcpy (ram_get_ptr(machine->device(RAM_TAG)), data+0x0011, 0xc000); | |
| 299 | memcpy (ram_get_ptr(machine->device(RAM_TAG))+0xc000, data+0x10011, 0x4000); | |
| 300 | 300 | |
| 301 | 301 | /* Ports */ |
| 302 | 302 | state->ppi_port_outputs[0][0] = data[0x14011+0xc0]; |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | #include "includes/pocketc.h" |
| 5 | 5 | #include "includes/pc1403.h" |
| 6 | #include " | |
| 6 | #include "ma | |
| 7 | 7 | |
| 8 | 8 | /* C-CE while reset, program will not be destroyed! */ |
| 9 | 9 |
| r9922 | r9923 | |
|---|---|---|
| 17 | 17 | #include "includes/radio86.h" |
| 18 | 18 | #include "includes/partner.h" |
| 19 | 19 | #include "devices/flopdrv.h" |
| 20 | #include " | |
| 20 | #include "ma | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | /* Driver initialization */ |
| r9922 | r9923 | |
| 168 | 168 | memory_set_bankptr(machine, "bank1", rom + 0x10000); |
| 169 | 169 | } else { |
| 170 | 170 | if (state->mem_page==7) { |
| 171 | memory_set_bankptr(machine, "bank1", | |
| 171 | memory_set_bankptr(machine, "bank1", | |
| 172 | 172 | } else { |
| 173 | memory_set_bankptr(machine, "bank1", | |
| 173 | memory_set_bankptr(machine, "bank1", | |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | // BANK 2 (0x0800 - 0x3fff) |
| 178 | 178 | if (state->mem_page==7) { |
| 179 | memory_set_bankptr(machine, "bank2", | |
| 179 | memory_set_bankptr(machine, "bank2", | |
| 180 | 180 | } else { |
| 181 | memory_set_bankptr(machine, "bank2", | |
| 181 | memory_set_bankptr(machine, "bank2", | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | // BANK 3 (0x4000 - 0x5fff) |
| 185 | 185 | if (state->mem_page==7) { |
| 186 | memory_set_bankptr(machine, "bank3", | |
| 186 | memory_set_bankptr(machine, "bank3", | |
| 187 | 187 | } else { |
| 188 | 188 | if (state->mem_page==10) { |
| 189 | 189 | //window 1 |
| 190 | 190 | memory_unmap_write(space, 0x4000, 0x5fff, 0, 0); |
| 191 | 191 | partner_window_1(machine, 3, 0, rom); |
| 192 | 192 | } else { |
| 193 | memory_set_bankptr(machine, "bank3", | |
| 193 | memory_set_bankptr(machine, "bank3", | |
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | // BANK 4 (0x6000 - 0x7fff) |
| 198 | 198 | if (state->mem_page==7) { |
| 199 | memory_set_bankptr(machine, "bank4", | |
| 199 | memory_set_bankptr(machine, "bank4", | |
| 200 | 200 | } else { |
| 201 | memory_set_bankptr(machine, "bank4", | |
| 201 | memory_set_bankptr(machine, "bank4", | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | // BANK 5 (0x8000 - 0x9fff) |
| r9922 | r9923 | |
| 216 | 216 | partner_window_1(machine, 5, 0, rom); |
| 217 | 217 | break; |
| 218 | 218 | case 7: |
| 219 | memory_set_bankptr(machine, "bank5", | |
| 219 | memory_set_bankptr(machine, "bank5", | |
| 220 | 220 | break; |
| 221 | 221 | default: |
| 222 | memory_set_bankptr(machine, "bank5", | |
| 222 | memory_set_bankptr(machine, "bank5", | |
| 223 | 223 | break; |
| 224 | 224 | } |
| 225 | 225 | |
| r9922 | r9923 | |
| 238 | 238 | memory_set_bankptr(machine, "bank6", rom + 0x12000); // BASIC |
| 239 | 239 | break; |
| 240 | 240 | case 7: |
| 241 | memory_set_bankptr(machine, "bank6", | |
| 241 | memory_set_bankptr(machine, "bank6", | |
| 242 | 242 | break; |
| 243 | 243 | default: |
| 244 | memory_set_bankptr(machine, "bank6", | |
| 244 | memory_set_bankptr(machine, "bank6", | |
| 245 | 245 | break; |
| 246 | 246 | } |
| 247 | 247 | |
| r9922 | r9923 | |
| 261 | 261 | memory_set_bankptr(machine, "bank7", rom + 0x13800); // BASIC |
| 262 | 262 | break; |
| 263 | 263 | case 7: |
| 264 | memory_set_bankptr(machine, "bank7", | |
| 264 | memory_set_bankptr(machine, "bank7", | |
| 265 | 265 | break; |
| 266 | 266 | default: |
| 267 | memory_set_bankptr(machine, "bank7", | |
| 267 | memory_set_bankptr(machine, "bank7", | |
| 268 | 268 | break; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | // BANK 8 (0xc000 - 0xc7ff) |
| 272 | 272 | switch (state->mem_page) { |
| 273 | 273 | case 7: |
| 274 | memory_set_bankptr(machine, "bank8", | |
| 274 | memory_set_bankptr(machine, "bank8", | |
| 275 | 275 | break; |
| 276 | 276 | case 8: |
| 277 | 277 | case 10: |
| r9922 | r9923 | |
| 279 | 279 | memory_set_bankptr(machine, "bank8", rom + 0x10000); |
| 280 | 280 | break; |
| 281 | 281 | default: |
| 282 | memory_set_bankptr(machine, "bank8", | |
| 282 | memory_set_bankptr(machine, "bank8", | |
| 283 | 283 | break; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | // BANK 9 (0xc800 - 0xcfff) |
| 287 | 287 | switch (state->mem_page) { |
| 288 | 288 | case 7: |
| 289 | memory_set_bankptr(machine, "bank9", | |
| 289 | memory_set_bankptr(machine, "bank9", | |
| 290 | 290 | break; |
| 291 | 291 | case 8: |
| 292 | 292 | case 9: |
| r9922 | r9923 | |
| 299 | 299 | memory_set_bankptr(machine, "bank9", rom + 0x10800); |
| 300 | 300 | break; |
| 301 | 301 | default: |
| 302 | memory_set_bankptr(machine, "bank9", | |
| 302 | memory_set_bankptr(machine, "bank9", | |
| 303 | 303 | break; |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | // BANK 10 (0xd000 - 0xd7ff) |
| 307 | 307 | switch (state->mem_page) { |
| 308 | 308 | case 7: |
| 309 | memory_set_bankptr(machine, "bank10", | |
| 309 | memory_set_bankptr(machine, "bank10", | |
| 310 | 310 | break; |
| 311 | 311 | case 8: |
| 312 | 312 | case 9: |
| r9922 | r9923 | |
| 315 | 315 | partner_window_2(machine, 10, 0x0800, rom); |
| 316 | 316 | break; |
| 317 | 317 | default: |
| 318 | memory_set_bankptr(machine, "bank10", | |
| 318 | memory_set_bankptr(machine, "bank10", | |
| 319 | 319 | break; |
| 320 | 320 | } |
| 321 | 321 |
| r9922 | r9923 | |
|---|---|---|
| 50 | 50 | #include "cpu/m6502/m6502.h" |
| 51 | 51 | #include "image.h" |
| 52 | 52 | #include "devices/cassette.h" |
| 53 | #include " | |
| 53 | #include "ma | |
| 54 | 54 | |
| 55 | 55 | static TIMER_CALLBACK(apple1_kbd_poll); |
| 56 | 56 | static TIMER_CALLBACK(apple1_kbd_strobe_end); |
| r9922 | r9923 | |
| 146 | 146 | { |
| 147 | 147 | address_space* space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 148 | 148 | /* Set up the handlers for MESS's dynamically-sized RAM. */ |
| 149 | memory_install_readwrite_bank(space,0x0000, messram_get_size(machine->device("messram")) - 1, 0, 0, "bank1"); | |
| 150 | memory_set_bankptr(machine,"bank1", messram_get_ptr(machine->device("messram"))); | |
| 149 | memory_install_readwrite_bank(space,0x0000, ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0, "bank1"); | |
| 150 | memory_set_bankptr(machine,"bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 151 | 151 | |
| 152 | 152 | /* Poll the keyboard input ports periodically. These include both |
| 153 | 153 | ordinary keys and the RESET and CLEAR SCREEN pushbutton |
| r9922 | r9923 | |
| 244 | 244 | |
| 245 | 245 | end_addr = start_addr + datasize - 1; |
| 246 | 246 | |
| 247 | if ((start_addr < 0xE000 && end_addr > | |
| 247 | if ((start_addr < 0xE000 && end_addr > | |
| 248 | 248 | || end_addr > 0xEFFF) |
| 249 | 249 | { |
| 250 | 250 | logerror("apple1 - Snapshot won't fit in this memory configuration;\n" |
| r9922 | r9923 | |
|---|---|---|
| 108 | 108 | #include "machine/intelfsh.h" |
| 109 | 109 | #include "machine/8042kbdc.h" |
| 110 | 110 | #include "machine/53c810.h" |
| 111 | #include " | |
| 111 | #include "ma | |
| 112 | 112 | |
| 113 | 113 | #define LOG_CPUIMASK 1 |
| 114 | 114 | #define LOG_UART 1 |
| r9922 | r9923 | |
| 1122 | 1122 | memory_set_bankptr(machine, "bank2", machine->region("user2")->base()); |
| 1123 | 1123 | |
| 1124 | 1124 | /* install MESS managed RAM */ |
| 1125 | memory_install_readwrite_bank(space_0, 0, messram_get_size(machine->device("messram")) - 1, 0, 0x02000000, "bank3"); | |
| 1126 | memory_install_readwrite_bank(space_1, 0, messram_get_size(machine->device("messram")) - 1, 0, 0x02000000, "bank3"); | |
| 1127 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram"))); | |
| 1125 | memory_install_readwrite_bank(space_0, 0, ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0x02000000, "bank3"); | |
| 1126 | memory_install_readwrite_bank(space_1, 0, ram_get_size(machine->device(RAM_TAG)) - 1, 0, 0x02000000, "bank3"); | |
| 1127 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG))); | |
| 1128 | 1128 | |
| 1129 | 1129 | pc_vga_init(machine, &bebox_vga_interface, &cirrus_svga_interface); |
| 1130 | 1130 | kbdc8042_init(machine, &bebox_8042_interface); |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "includes/mtx.h" |
| 12 | 12 | #include "cpu/z80/z80.h" |
| 13 | 13 | #include "devices/cassette.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | #include "devices/snapquik.h" |
| 16 | 16 | #include "machine/ctronics.h" |
| 17 | 17 | #include "machine/z80ctc.h" |
| r9922 | r9923 | |
| 74 | 74 | */ |
| 75 | 75 | |
| 76 | 76 | address_space *program = cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM); |
| 77 | device_t *messram = machine->device( | |
| 77 | device_t *messram = machine->device(RAM_TAG | |
| 78 | 78 | |
| 79 | 79 | // UINT8 cbm_mode = data >> 7 & 0x01; |
| 80 | 80 | UINT8 rom_page = data >> 4 & 0x07; |
| r9922 | r9923 | |
| 84 | 84 | memory_set_bank(machine, "bank2", rom_page); |
| 85 | 85 | |
| 86 | 86 | /* set ram bank, for invalid pages a nop-handler will be installed */ |
| 87 | if (ram_page >= | |
| 87 | if (ram_page >= | |
| 88 | 88 | { |
| 89 | 89 | memory_nop_readwrite(program, 0x4000, 0x7fff, 0, 0); |
| 90 | 90 | memory_nop_readwrite(program, 0x8000, 0xbfff, 0, 0); |
| 91 | 91 | } |
| 92 | else if (ram_page + 1 == | |
| 92 | else if (ram_page + 1 == | |
| 93 | 93 | { |
| 94 | 94 | memory_nop_readwrite(program, 0x4000, 0x7fff, 0, 0); |
| 95 | 95 | memory_install_readwrite_bank(program, 0x8000, 0xbfff, 0, 0, "bank4"); |
| r9922 | r9923 | |
| 404 | 404 | MACHINE_START( mtx512 ) |
| 405 | 405 | { |
| 406 | 406 | mtx_state *state = machine->driver_data<mtx_state>(); |
| 407 | device_t *messram = machine->device( | |
| 407 | device_t *messram = machine->device(RAM_TAG | |
| 408 | 408 | |
| 409 | 409 | /* find devices */ |
| 410 | 410 | state->z80ctc = machine->device(Z80CTC_TAG); |
| r9922 | r9923 | |
| 414 | 414 | /* configure memory */ |
| 415 | 415 | memory_set_bankptr(machine, "bank1", machine->region("user1")->base()); |
| 416 | 416 | memory_configure_bank(machine, "bank2", 0, 8, machine->region("user2")->base(), 0x2000); |
| 417 | memory_configure_bank(machine, "bank3", 0, messram_get_size(messram)/0x4000/2, messram_get_ptr(messram), 0x4000); | |
| 418 | memory_configure_bank(machine, "bank4", 0, messram_get_size(messram)/0x4000/2, messram_get_ptr(messram) + messram_get_size(messram)/2, 0x4000); | |
| 417 | memory_configure_bank(machine, "bank3", 0, ram_get_size(messram)/0x4000/2, ram_get_ptr(messram), 0x4000); | |
| 418 | memory_configure_bank(machine, "bank4", 0, ram_get_size(messram)/0x4000/2, ram_get_ptr(messram) + ram_get_size(messram)/2, 0x4000); | |
| 419 | 419 | |
| 420 | 420 | /* setup tms9928a */ |
| 421 | 421 | TMS9928A_configure(&tms9928a_interface); |
| r9922 | r9923 | |
|---|---|---|
| 16 | 16 | #include "machine/pit8253.h" |
| 17 | 17 | #include "machine/wd17xx.h" |
| 18 | 18 | #include "includes/special.h" |
| 19 | #include " | |
| 19 | #include "ma | |
| 20 | 20 | #include "devices/flopdrv.h" |
| 21 | 21 | |
| 22 | 22 | |
| r9922 | r9923 | |
| 148 | 148 | static WRITE8_HANDLER( video_memory_w ) |
| 149 | 149 | { |
| 150 | 150 | special_state *state = space->machine->driver_data<special_state>(); |
| 151 | | |
| 151 | | |
| 152 | 152 | state->specimx_colorram[offset] = state->specimx_color; |
| 153 | 153 | } |
| 154 | 154 | |
| r9922 | r9923 | |
| 169 | 169 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 170 | 170 | memory_install_write_bank(space, 0xc000, 0xffbf, 0, 0, "bank3"); |
| 171 | 171 | memory_install_write_bank(space, 0xffc0, 0xffdf, 0, 0, "bank4"); |
| 172 | memory_set_bankptr(machine, "bank4", | |
| 172 | memory_set_bankptr(machine, "bank4", | |
| 173 | 173 | switch(i) |
| 174 | 174 | { |
| 175 | 175 | case 0 : |
| 176 | 176 | memory_install_write_bank(space, 0x0000, 0x8fff, 0, 0, "bank1"); |
| 177 | 177 | memory_install_write8_handler(space, 0x9000, 0xbfff, 0, 0, video_memory_w); |
| 178 | 178 | |
| 179 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 180 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x9000); | |
| 181 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 179 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 180 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x9000); | |
| 181 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 182 | 182 | break; |
| 183 | 183 | case 1 : |
| 184 | 184 | memory_install_write_bank(space, 0x0000, 0x8fff, 0, 0, "bank1"); |
| 185 | 185 | memory_install_write_bank(space, 0x9000, 0xbfff, 0, 0, "bank2"); |
| 186 | 186 | |
| 187 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram")) + 0x10000); | |
| 188 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x19000); | |
| 189 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x1c000); | |
| 187 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000); | |
| 188 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x19000); | |
| 189 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x1c000); | |
| 190 | 190 | break; |
| 191 | 191 | case 2 : |
| 192 | 192 | memory_unmap_write(space, 0x0000, 0x8fff, 0, 0); |
| r9922 | r9923 | |
| 196 | 196 | memory_set_bankptr(machine, "bank2", machine->region("maincpu")->base() + 0x19000); |
| 197 | 197 | if (data & 0x80) |
| 198 | 198 | { |
| 199 | memory_set_bankptr(machine, "bank3", | |
| 199 | memory_set_bankptr(machine, "bank3", | |
| 200 | 200 | } |
| 201 | 201 | else |
| 202 | 202 | { |
| 203 | memory_set_bankptr(machine, "bank3", | |
| 203 | memory_set_bankptr(machine, "bank3", | |
| 204 | 204 | } |
| 205 | 205 | break; |
| 206 | 206 | } |
| r9922 | r9923 | |
| 328 | 328 | case 1: |
| 329 | 329 | case 2: |
| 330 | 330 | case 3: |
| 331 | memory_set_bankptr(machine, "bank1", | |
| 331 | memory_set_bankptr(machine, "bank1", | |
| 332 | 332 | break; |
| 333 | 333 | case 0: |
| 334 | 334 | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| r9922 | r9923 | |
| 340 | 340 | case 1: |
| 341 | 341 | case 2: |
| 342 | 342 | case 3: |
| 343 | memory_set_bankptr(machine, "bank2", | |
| 343 | memory_set_bankptr(machine, "bank2", | |
| 344 | 344 | break; |
| 345 | 345 | case 0: |
| 346 | 346 | memory_unmap_write(space, 0x4000, 0x8fff, 0, 0); |
| r9922 | r9923 | |
| 352 | 352 | case 1: |
| 353 | 353 | case 2: |
| 354 | 354 | case 3: |
| 355 | memory_set_bankptr(machine, "bank3", | |
| 355 | memory_set_bankptr(machine, "bank3", | |
| 356 | 356 | break; |
| 357 | 357 | case 0: |
| 358 | 358 | memory_unmap_write(space, 0x9000, 0xbfff, 0, 0); |
| r9922 | r9923 | |
| 364 | 364 | case 1: |
| 365 | 365 | case 2: |
| 366 | 366 | case 3: |
| 367 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x10000*(bank4-1) + 0x0c000); | |
| 368 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0x10000*(bank4-1) + 0x0f000); | |
| 369 | memory_set_bankptr(machine, "bank6", messram_get_ptr(machine->device("messram")) + 0x10000*(bank4-1) + 0x0f800); | |
| 367 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000*(bank4-1) + 0x0c000); | |
| 368 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000*(bank4-1) + 0x0f000); | |
| 369 | memory_set_bankptr(machine, "bank6", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000*(bank4-1) + 0x0f800); | |
| 370 | 370 | break; |
| 371 | 371 | case 0: |
| 372 | 372 | memory_unmap_write(space, 0xc000, 0xefff, 0, 0); |
| r9922 | r9923 | |
|---|---|---|
| 54 | 54 | #include "debug/debugcpu.h" |
| 55 | 55 | #include "debug/debugcon.h" |
| 56 | 56 | #include "devices/flopdrv.h" |
| 57 | #include " | |
| 57 | #include "ma | |
| 58 | 58 | #include "machine/er59256.h" |
| 59 | 59 | #include "machine/pic8259.h" |
| 60 | 60 | #include "machine/pit8253.h" |
| r9922 | r9923 | |
| 1881 | 1881 | { |
| 1882 | 1882 | rmnimbus_state *state = machine->driver_data<rmnimbus_state>(); |
| 1883 | 1883 | address_space *space = cputag_get_address_space( machine, MAINCPU_TAG, ADDRESS_SPACE_PROGRAM ); |
| 1884 | int ramsize = | |
| 1884 | int ramsize = | |
| 1885 | 1885 | int ramblock = 0; |
| 1886 | 1886 | int blockno; |
| 1887 | 1887 | char bank[10]; |
| 1888 | UINT8 *ram = & | |
| 1888 | UINT8 *ram = & | |
| 1889 | 1889 | UINT8 *map_blocks[3]; |
| 1890 | 1890 | UINT8 *map_base; |
| 1891 | 1891 | int map_blockno; |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "emu.h" |
| 13 | 13 | #include "tf20.h" |
| 14 | 14 | #include "cpu/z80/z80.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | #include "machine/upd7201.h" |
| 17 | 17 | #include "machine/upd765.h" |
| 18 | 18 | #include "devices/flopdrv.h" |
| r9922 | r9923 | |
| 76 | 76 | address_space *prg = cpu_get_address_space(space->cpu, ADDRESS_SPACE_PROGRAM); |
| 77 | 77 | |
| 78 | 78 | /* switch in ram */ |
| 79 | memory_install_ram(prg, 0x0000, 0x7fff, 0, 0, | |
| 79 | memory_install_ram(prg, 0x0000, 0x7fff, 0, 0, | |
| 80 | 80 | |
| 81 | 81 | return 0xff; |
| 82 | 82 | } |
| r9922 | r9923 | |
| 345 | 345 | tf20->floppy_1 = device->subdevice(FLOPPY_1); |
| 346 | 346 | |
| 347 | 347 | /* enable second half of ram */ |
| 348 | memory_install_ram(prg, 0x8000, 0xffff, 0, 0, | |
| 348 | memory_install_ram(prg, 0x8000, 0xffff, 0, 0, | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | static DEVICE_RESET( tf20 ) |
| r9922 | r9923 | |
|---|---|---|
| 20 | 20 | #include "machine/pcf8593.h" |
| 21 | 21 | #include "machine/at45dbxx.h" |
| 22 | 22 | #include "machine/sst39vfx.h" |
| 23 | #include " | |
| 23 | #include "ma | |
| 24 | 24 | |
| 25 | 25 | #ifndef _H8S2XXX_H_ |
| 26 | 26 | #define H8S_IO(xxxx) ((xxxx) - 0xFE40) |
| r9922 | r9923 | |
| 84 | 84 | { |
| 85 | 85 | memory_install_read_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), start, start + size - 1, 0, mirror - size, "bank1"); |
| 86 | 86 | memory_install_write_bank(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), start, start + size - 1, 0, mirror - size, "bank1"); |
| 87 | memory_set_bankptr( machine, "bank1", | |
| 87 | memory_set_bankptr( machine, "bank1", | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | DRIVER_INIT( cybikov1 ) |
| 91 | 91 | { |
| 92 | 92 | _logerror( 0, ("init_cybikov1\n")); |
| 93 | init_ram_handler(machine, 0x200000, | |
| 93 | init_ram_handler(machine, 0x200000, | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | DRIVER_INIT( cybikov2 ) |
| 97 | 97 | { |
| 98 | 98 | _logerror( 0, ("init_cybikov2\n")); |
| 99 | init_ram_handler(machine, 0x200000, | |
| 99 | init_ram_handler(machine, 0x200000, | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | DRIVER_INIT( cybikoxt ) |
| 103 | 103 | { |
| 104 | 104 | _logerror( 0, ("init_cybikoxt\n")); |
| 105 | init_ram_handler(machine, 0x400000, | |
| 105 | init_ram_handler(machine, 0x400000, | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | //////////////////// |
| r9922 | r9923 | |
|---|---|---|
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/i8085/i8085.h" |
| 12 | 12 | #include "includes/pp01.h" |
| 13 | #include " | |
| 13 | #include "ma | |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | WRITE8_HANDLER( pp01_video_write_mode_w ) |
| r9922 | r9923 | |
| 27 | 27 | if (BIT(state->video_write_mode,3)) { |
| 28 | 28 | // Copy mode |
| 29 | 29 | if(BIT(state->video_write_mode,0)) { |
| 30 | | |
| 30 | | |
| 31 | 31 | } else { |
| 32 | | |
| 32 | | |
| 33 | 33 | } |
| 34 | 34 | if(BIT(state->video_write_mode,1)) { |
| 35 | | |
| 35 | | |
| 36 | 36 | } else { |
| 37 | | |
| 37 | | |
| 38 | 38 | } |
| 39 | 39 | if(BIT(state->video_write_mode,2)) { |
| 40 | | |
| 40 | | |
| 41 | 41 | } else { |
| 42 | | |
| 42 | | |
| 43 | 43 | } |
| 44 | 44 | } else { |
| 45 | 45 | if (block==0) { |
| 46 | | |
| 46 | | |
| 47 | 47 | } |
| 48 | 48 | if (block==1) { |
| 49 | | |
| 49 | | |
| 50 | 50 | } |
| 51 | 51 | if (block==2) { |
| 52 | | |
| 52 | | |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | } |
| r9922 | r9923 | |
| 118 | 118 | break; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | memory_set_bankptr(machine, bank, | |
| 121 | memory_set_bankptr(machine, bank, | |
| 122 | 122 | } else if (data>=0xF8) { |
| 123 | 123 | memory_install_read_bank (space, startaddr, endaddr, 0, 0, bank); |
| 124 | 124 | memory_unmap_write(space, startaddr, endaddr, 0, 0); |
| r9922 | r9923 | |
|---|---|---|
| 22 | 22 | #include "devices/flopdrv.h" |
| 23 | 23 | #include "image.h" |
| 24 | 24 | #include "devices/cassette.h" |
| 25 | #include " | |
| 25 | #include "ma | |
| 26 | 26 | #include "sound/speaker.h" |
| 27 | 27 | #include "profiler.h" |
| 28 | 28 | |
| r9922 | r9923 | |
| 203 | 203 | else |
| 204 | 204 | { |
| 205 | 205 | /* RAM */ |
| 206 | if (end_r >= messram_get_size(machine->device("messram"))) | |
| 207 | end_r = messram_get_size(machine->device("messram")) - 1; | |
| 206 | if (end_r >= ram_get_size(machine->device(RAM_TAG))) | |
| 207 | end_r = ram_get_size(machine->device(RAM_TAG)) - 1; | |
| 208 | 208 | offset = meminfo.read_mem & APPLE2_MEM_MASK; |
| 209 | 209 | if (end_r >= begin) |
| 210 | rbase = & | |
| 210 | rbase = & | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /* install the actual handlers */ |
| r9922 | r9923 | |
| 286 | 286 | else |
| 287 | 287 | { |
| 288 | 288 | /* RAM */ |
| 289 | if (end_w >= messram_get_size(machine->device("messram"))) | |
| 290 | end_w = messram_get_size(machine->device("messram")) - 1; | |
| 289 | if (end_w >= ram_get_size(machine->device(RAM_TAG))) | |
| 290 | end_w = ram_get_size(machine->device(RAM_TAG)) - 1; | |
| 291 | 291 | offset = meminfo.write_mem & APPLE2_MEM_MASK; |
| 292 | 292 | if (end_w >= begin) |
| 293 | wbase = & | |
| 293 | wbase = & | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
| r9922 | r9923 | |
| 1018 | 1018 | //CMemory::mState |= CMemory::kVBLBar; // N: VBL' is true // FIX: MESS? |
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | return | |
| 1021 | return | |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | |
| r9922 | r9923 | |
| 1094 | 1094 | static WRITE8_HANDLER ( apple2_mainram0400_w ) |
| 1095 | 1095 | { |
| 1096 | 1096 | offset += 0x400; |
| 1097 | | |
| 1097 | | |
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | static WRITE8_HANDLER ( apple2_mainram2000_w ) |
| 1101 | 1101 | { |
| 1102 | 1102 | offset += 0x2000; |
| 1103 | | |
| 1103 | | |
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | static WRITE8_HANDLER ( apple2_auxram0400_w ) |
| 1107 | 1107 | { |
| 1108 | 1108 | offset += 0x10400; |
| 1109 | | |
| 1109 | | |
| 1110 | 1110 | } |
| 1111 | 1111 | |
| 1112 | 1112 | static WRITE8_HANDLER ( apple2_auxram2000_w ) |
| 1113 | 1113 | { |
| 1114 | 1114 | offset += 0x12000; |
| 1115 | | |
| 1115 | | |
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | |
| r9922 | r9923 | |
| 1613 | 1613 | if (machine->region("maincpu")->bytes() < 0x8000) |
| 1614 | 1614 | a2_mask &= ~VAR_ROMSWITCH; |
| 1615 | 1615 | |
| 1616 | if ( | |
| 1616 | if ( | |
| 1617 | 1617 | a2_mask &= ~(VAR_RAMRD | VAR_RAMWRT | VAR_80STORE | VAR_ALTZP | VAR_80COL); |
| 1618 | 1618 | } |
| 1619 | 1619 |
| r9922 | r9923 | |
|---|---|---|
| 45 | 45 | #include "machine/8237dma.h" |
| 46 | 46 | |
| 47 | 47 | #include "machine/kb_keytro.h" |
| 48 | #include " | |
| 48 | #include "ma | |
| 49 | 49 | |
| 50 | 50 | #define VERBOSE_PIO 0 /* PIO (keyboard controller) */ |
| 51 | 51 | |
| r9922 | r9923 | |
| 618 | 618 | * 6-7 The number of floppy disk drives |
| 619 | 619 | */ |
| 620 | 620 | data = input_port_read(device->machine, "DSW0") & 0xF3; |
| 621 | switch ( | |
| 621 | switch ( | |
| 622 | 622 | { |
| 623 | 623 | case 16 * 1024: |
| 624 | 624 | data |= 0x00; |
| r9922 | r9923 | |
| 669 | 669 | /* read hi nibble of SW2 */ |
| 670 | 670 | data = data & 0xf0; |
| 671 | 671 | |
| 672 | switch ( | |
| 672 | switch ( | |
| 673 | 673 | { |
| 674 | 674 | case 64 * 1024: data |= 0x00; break; |
| 675 | 675 | case 128 * 1024: data |= 0x02; break; |
| r9922 | r9923 | |
| 687 | 687 | case 896 * 1024: data |= 0x0B; break; |
| 688 | 688 | case 960 * 1024: data |= 0x0D; break; |
| 689 | 689 | } |
| 690 | if ( | |
| 690 | if ( | |
| 691 | 691 | data |= 0x0D; |
| 692 | 692 | |
| 693 | 693 | PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data)); |
| r9922 | r9923 | |
| 1032 | 1032 | |
| 1033 | 1033 | data&=~0x80; |
| 1034 | 1034 | data &= ~0x04; /* floppy drive installed */ |
| 1035 | if ( | |
| 1035 | if ( | |
| 1036 | 1036 | data &= ~0x08; |
| 1037 | 1037 | data = ( data & ~0x01 ) | ( pcjr_keyb.latch ? 0x01: 0x00 ); |
| 1038 | 1038 | if ( ! ( st->ppi_portb & 0x08 ) ) |
| r9922 | r9923 | |
| 1152 | 1152 | init_pc_common(machine, flags, set_keyb_int_func); |
| 1153 | 1153 | |
| 1154 | 1154 | /* MESS managed RAM */ |
| 1155 | if ( messram_get_ptr(machine->device("messram")) ) | |
| 1156 | memory_set_bankptr( machine, "bank10", messram_get_ptr(machine->device("messram")) ); | |
| 1155 | if ( ram_get_ptr(machine->device(RAM_TAG)) ) | |
| 1156 | memory_set_bankptr( machine, "bank10", ram_get_ptr(machine->device(RAM_TAG)) ); | |
| 1157 | 1157 | |
| 1158 | 1158 | /* FDC/HDC hardware */ |
| 1159 | 1159 | pc_hdc_setup(machine, set_hdc_int_func); |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "sound/cdp1869.h" |
| 12 | 12 | #include "devices/cassette.h" |
| 13 | 13 | #include "includes/pecom.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | |
| 16 | 16 | static TIMER_CALLBACK( reset_tick ) |
| 17 | 17 | { |
| r9922 | r9923 | |
| 40 | 40 | memory_install_read_bank (space, 0xf000, 0xf7ff, 0, 0, "bank3"); |
| 41 | 41 | memory_install_read_bank (space, 0xf800, 0xffff, 0, 0, "bank4"); |
| 42 | 42 | memory_set_bankptr(machine, "bank1", rom + 0x8000); |
| 43 | memory_set_bankptr(machine, "bank2", | |
| 43 | memory_set_bankptr(machine, "bank2", | |
| 44 | 44 | memory_set_bankptr(machine, "bank3", rom + 0xf000); |
| 45 | 45 | memory_set_bankptr(machine, "bank4", rom + 0xf800); |
| 46 | 46 | |
| r9922 | r9923 | |
| 79 | 79 | address_space *space2 = cputag_get_address_space(space->machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM); |
| 80 | 80 | UINT8 *rom = space->machine->region(CDP1802_TAG)->base(); |
| 81 | 81 | memory_install_write_bank(cputag_get_address_space(space->machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, "bank1"); |
| 82 | memory_set_bankptr(space->machine, "bank1", | |
| 82 | memory_set_bankptr(space->machine, "bank1", | |
| 83 | 83 | |
| 84 | 84 | if (data==2) |
| 85 | 85 | { |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "includes/pk8020.h" |
| 12 | 12 | #include "cpu/i8085/i8085.h" |
| 13 | 13 | #include "machine/wd17xx.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | #include "devices/flopdrv.h" |
| 16 | 16 | |
| 17 | 17 | static void pk8020_set_bank(running_machine *machine,UINT8 data); |
| r9922 | r9923 | |
| 49 | 49 | |
| 50 | 50 | static READ8_HANDLER(sysreg_r) |
| 51 | 51 | { |
| 52 | return | |
| 52 | return | |
| 53 | 53 | } |
| 54 | 54 | static WRITE8_HANDLER(sysreg_w) |
| 55 | 55 | { |
| r9922 | r9923 | |
| 74 | 74 | static READ8_HANDLER(text_r) |
| 75 | 75 | { |
| 76 | 76 | pk8020_state *state = space->machine->driver_data<pk8020_state>(); |
| 77 | if (state->attr == 3) state->text_attr=messram_get_ptr(space->machine->device("messram"))[0x40400+offset]; | |
| 78 | return messram_get_ptr(space->machine->device("messram"))[0x40000+offset]; | |
| 77 | if (state->attr == 3) state->text_attr=ram_get_ptr(space->machine->device(RAM_TAG))[0x40400+offset]; | |
| 78 | return ram_get_ptr(space->machine->device(RAM_TAG))[0x40000+offset]; | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | static WRITE8_HANDLER(text_w) |
| 82 | 82 | { |
| 83 | 83 | pk8020_state *state = space->machine->driver_data<pk8020_state>(); |
| 84 | | |
| 84 | | |
| 85 | 85 | switch (state->attr) { |
| 86 | 86 | case 0: break; |
| 87 | case 1: messram_get_ptr(space->machine->device("messram"))[0x40400+offset]=0x01;break; | |
| 88 | case 2: messram_get_ptr(space->machine->device("messram"))[0x40400+offset]=0x00;break; | |
| 89 | case 3: messram_get_ptr(space->machine->device("messram"))[0x40400+offset]=state->text_attr;break; | |
| 87 | case 1: ram_get_ptr(space->machine->device(RAM_TAG))[0x40400+offset]=0x01;break; | |
| 88 | case 2: ram_get_ptr(space->machine->device(RAM_TAG))[0x40400+offset]=0x00;break; | |
| 89 | case 3: ram_get_ptr(space->machine->device(RAM_TAG))[0x40400+offset]=state->text_attr;break; | |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | static READ8_HANDLER(gzu_r) |
| 94 | 94 | { |
| 95 | 95 | pk8020_state *state = space->machine->driver_data<pk8020_state>(); |
| 96 | UINT8 *addr = | |
| 96 | UINT8 *addr = | |
| 97 | 97 | UINT8 p0 = addr[offset]; |
| 98 | 98 | UINT8 p1 = addr[offset + 0x4000]; |
| 99 | 99 | UINT8 p2 = addr[offset + 0x8000]; |
| r9922 | r9923 | |
| 128 | 128 | static WRITE8_HANDLER(gzu_w) |
| 129 | 129 | { |
| 130 | 130 | pk8020_state *state = space->machine->driver_data<pk8020_state>(); |
| 131 | UINT8 *addr = | |
| 131 | UINT8 *addr = | |
| 132 | 132 | UINT8 *plane_0 = addr; |
| 133 | 133 | UINT8 *plane_1 = addr + 0x4000; |
| 134 | 134 | UINT8 *plane_2 = addr + 0x8000; |
| r9922 | r9923 | |
| 241 | 241 | memory_install_read_bank (space, 0x0000, 0x37ff, 0, 0, "bank1"); |
| 242 | 242 | memory_install_write_bank(space, 0x0000, 0x37ff, 0, 0, "bank2"); |
| 243 | 243 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 244 | memory_set_bankptr(machine, "bank2", | |
| 244 | memory_set_bankptr(machine, "bank2", | |
| 245 | 245 | // Keyboard |
| 246 | 246 | memory_install_read8_handler (space, 0x3800, 0x39ff, 0, 0, keyboard_r); |
| 247 | 247 | memory_install_write_bank(space, 0x3800, 0x39ff, 0, 0, "bank3"); |
| 248 | memory_set_bankptr(machine, "bank3", | |
| 248 | memory_set_bankptr(machine, "bank3", | |
| 249 | 249 | // System reg |
| 250 | 250 | memory_install_read8_handler (space, 0x3a00, 0x3aff, 0, 0, sysreg_r); |
| 251 | 251 | memory_install_write8_handler(space, 0x3a00, 0x3aff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 258 | 258 | // RAM |
| 259 | 259 | memory_install_read_bank (space, 0x4000, 0xffff, 0, 0, "bank4"); |
| 260 | 260 | memory_install_write_bank(space, 0x4000, 0xffff, 0, 0, "bank5"); |
| 261 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 262 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 261 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 262 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 263 | 263 | } |
| 264 | 264 | break; |
| 265 | 265 | case 0x01 : { |
| r9922 | r9923 | |
| 267 | 267 | memory_install_read_bank (space, 0x0000, 0x1fff, 0, 0, "bank1"); |
| 268 | 268 | memory_install_write_bank(space, 0x0000, 0x1fff, 0, 0, "bank2"); |
| 269 | 269 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 270 | memory_set_bankptr(machine, "bank2", | |
| 270 | memory_set_bankptr(machine, "bank2", | |
| 271 | 271 | // RAM |
| 272 | 272 | memory_install_read_bank (space, 0x2000, 0xffff, 0, 0, "bank3"); |
| 273 | 273 | memory_install_write_bank(space, 0x2000, 0xffff, 0, 0, "bank4"); |
| 274 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 275 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 274 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 275 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 276 | 276 | } |
| 277 | 277 | break; |
| 278 | 278 | case 0x02 : { |
| r9922 | r9923 | |
| 280 | 280 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 281 | 281 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 282 | 282 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 283 | memory_set_bankptr(machine, "bank2", | |
| 283 | memory_set_bankptr(machine, "bank2", | |
| 284 | 284 | // RAM |
| 285 | 285 | memory_install_read_bank (space, 0x4000, 0xffff, 0, 0, "bank3"); |
| 286 | 286 | memory_install_write_bank(space, 0x4000, 0xffff, 0, 0, "bank4"); |
| 287 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 288 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 287 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 288 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 289 | 289 | } |
| 290 | 290 | break; |
| 291 | 291 | case 0x03 : { |
| 292 | 292 | // RAM |
| 293 | 293 | memory_install_read_bank (space, 0x0000, 0xffff, 0, 0, "bank1"); |
| 294 | 294 | memory_install_write_bank(space, 0x0000, 0xffff, 0, 0, "bank2"); |
| 295 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 296 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram"))); | |
| 295 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 296 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG))); | |
| 297 | 297 | } |
| 298 | 298 | break; |
| 299 | 299 | case 0x04 : |
| r9922 | r9923 | |
| 303 | 303 | memory_install_read_bank (space, 0x0000, 0x1fff, 0, 0, "bank1"); |
| 304 | 304 | memory_install_write_bank(space, 0x0000, 0x1fff, 0, 0, "bank2"); |
| 305 | 305 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 306 | memory_set_bankptr(machine, "bank2", | |
| 306 | memory_set_bankptr(machine, "bank2", | |
| 307 | 307 | // RAM |
| 308 | 308 | memory_install_read_bank (space, 0x2000, 0xf7ff, 0, 0, "bank3"); |
| 309 | 309 | memory_install_write_bank(space, 0x2000, 0xf7ff, 0, 0, "bank4"); |
| 310 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 311 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 310 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 311 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 312 | 312 | // Keyboard |
| 313 | 313 | memory_install_read8_handler (space, 0xf800, 0xf9ff, 0, 0, keyboard_r); |
| 314 | 314 | memory_install_write_bank(space, 0xf800, 0xf9ff, 0, 0, "bank5"); |
| 315 | memory_set_bankptr(machine, "bank5", | |
| 315 | memory_set_bankptr(machine, "bank5", | |
| 316 | 316 | // System reg |
| 317 | 317 | memory_install_read8_handler (space, 0xfa00, 0xfaff, 0, 0, sysreg_r); |
| 318 | 318 | memory_install_write8_handler(space, 0xfa00, 0xfaff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 330 | 330 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 331 | 331 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 332 | 332 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 333 | memory_set_bankptr(machine, "bank2", | |
| 333 | memory_set_bankptr(machine, "bank2", | |
| 334 | 334 | // RAM |
| 335 | 335 | memory_install_read_bank (space, 0x4000, 0xf7ff, 0, 0, "bank3"); |
| 336 | 336 | memory_install_write_bank(space, 0x4000, 0xf7ff, 0, 0, "bank4"); |
| 337 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 338 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 337 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 338 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 339 | 339 | // Keyboard |
| 340 | 340 | memory_install_read8_handler (space, 0xf800, 0xf9ff, 0, 0, keyboard_r); |
| 341 | 341 | memory_install_write_bank(space, 0xf800, 0xf9ff, 0, 0, "bank5"); |
| 342 | memory_set_bankptr(machine, "bank5", | |
| 342 | memory_set_bankptr(machine, "bank5", | |
| 343 | 343 | // System reg |
| 344 | 344 | memory_install_read8_handler (space, 0xfa00, 0xfaff, 0, 0, sysreg_r); |
| 345 | 345 | memory_install_write8_handler(space, 0xfa00, 0xfaff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 356 | 356 | // RAM |
| 357 | 357 | memory_install_read_bank (space, 0x0000, 0xf7ff, 0, 0, "bank1"); |
| 358 | 358 | memory_install_write_bank(space, 0x0000, 0xf7ff, 0, 0, "bank2"); |
| 359 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 360 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram"))); | |
| 359 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 360 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG))); | |
| 361 | 361 | // Keyboard |
| 362 | 362 | memory_install_read8_handler (space, 0xf800, 0xf9ff, 0, 0, keyboard_r); |
| 363 | 363 | memory_install_write_bank(space, 0xf800, 0xf9ff, 0, 0, "bank3"); |
| 364 | memory_set_bankptr(machine, "bank3", | |
| 364 | memory_set_bankptr(machine, "bank3", | |
| 365 | 365 | // System reg |
| 366 | 366 | memory_install_read8_handler (space, 0xfa00, 0xfaff, 0, 0, sysreg_r); |
| 367 | 367 | memory_install_write8_handler(space, 0xfa00, 0xfaff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 379 | 379 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 380 | 380 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 381 | 381 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 382 | memory_set_bankptr(machine, "bank2", | |
| 382 | memory_set_bankptr(machine, "bank2", | |
| 383 | 383 | // Keyboard |
| 384 | 384 | memory_install_read8_handler (space, 0x3800, 0x39ff, 0, 0, keyboard_r); |
| 385 | 385 | memory_install_write_bank(space, 0x3800, 0x39ff, 0, 0, "bank3"); |
| 386 | memory_set_bankptr(machine, "bank3", | |
| 386 | memory_set_bankptr(machine, "bank3", | |
| 387 | 387 | // System reg |
| 388 | 388 | memory_install_read8_handler (space, 0x3a00, 0x3aff, 0, 0, sysreg_r); |
| 389 | 389 | memory_install_write8_handler(space, 0x3a00, 0x3aff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 396 | 396 | // RAM |
| 397 | 397 | memory_install_read_bank (space, 0x4000, 0xbfff, 0, 0, "bank4"); |
| 398 | 398 | memory_install_write_bank(space, 0x4000, 0xbfff, 0, 0, "bank5"); |
| 399 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 400 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 399 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 400 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 401 | 401 | // Video RAM |
| 402 | 402 | memory_install_read8_handler (space, 0xc000, 0xffff, 0, 0, gzu_r); |
| 403 | 403 | memory_install_write8_handler(space, 0xc000, 0xffff, 0, 0, gzu_w); |
| r9922 | r9923 | |
| 410 | 410 | memory_install_read_bank (space, 0x0000, 0x1fff, 0, 0, "bank1"); |
| 411 | 411 | memory_install_write_bank(space, 0x0000, 0x1fff, 0, 0, "bank2"); |
| 412 | 412 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 413 | memory_set_bankptr(machine, "bank2", | |
| 413 | memory_set_bankptr(machine, "bank2", | |
| 414 | 414 | // RAM |
| 415 | 415 | memory_install_read_bank (space, 0x2000, 0xbfff, 0, 0, "bank3"); |
| 416 | 416 | memory_install_write_bank(space, 0x2000, 0xbfff, 0, 0, "bank4"); |
| 417 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 418 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 417 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 418 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 419 | 419 | // Video RAM |
| 420 | 420 | memory_install_read8_handler (space, 0xc000, 0xffff, 0, 0, gzu_r); |
| 421 | 421 | memory_install_write8_handler(space, 0xc000, 0xffff, 0, 0, gzu_w); |
| r9922 | r9923 | |
| 427 | 427 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 428 | 428 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 429 | 429 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 430 | memory_set_bankptr(machine, "bank2", | |
| 430 | memory_set_bankptr(machine, "bank2", | |
| 431 | 431 | // RAM |
| 432 | 432 | memory_install_read_bank (space, 0x4000, 0xbfff, 0, 0, "bank3"); |
| 433 | 433 | memory_install_write_bank(space, 0x4000, 0xbfff, 0, 0, "bank4"); |
| 434 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 435 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 434 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 435 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 436 | 436 | // Video RAM |
| 437 | 437 | memory_install_read8_handler (space, 0xc000, 0xffff, 0, 0, gzu_r); |
| 438 | 438 | memory_install_write8_handler(space, 0xc000, 0xffff, 0, 0, gzu_w); |
| r9922 | r9923 | |
| 443 | 443 | // RAM |
| 444 | 444 | memory_install_read_bank (space, 0x0000, 0xbfff, 0, 0, "bank1"); |
| 445 | 445 | memory_install_write_bank(space, 0x0000, 0xbfff, 0, 0, "bank2"); |
| 446 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram")) + 0x0000); | |
| 447 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x0000); | |
| 446 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG)) + 0x0000); | |
| 447 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x0000); | |
| 448 | 448 | // Video RAM |
| 449 | 449 | memory_install_read8_handler (space, 0xc000, 0xffff, 0, 0, gzu_r); |
| 450 | 450 | memory_install_write8_handler(space, 0xc000, 0xffff, 0, 0, gzu_w); |
| r9922 | r9923 | |
| 457 | 457 | memory_install_read_bank (space, 0x0000, 0x1fff, 0, 0, "bank1"); |
| 458 | 458 | memory_install_write_bank(space, 0x0000, 0x1fff, 0, 0, "bank2"); |
| 459 | 459 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 460 | memory_set_bankptr(machine, "bank2", | |
| 460 | memory_set_bankptr(machine, "bank2", | |
| 461 | 461 | // RAM |
| 462 | 462 | memory_install_read_bank (space, 0x2000, 0x3fff, 0, 0, "bank3"); |
| 463 | 463 | memory_install_write_bank(space, 0x2000, 0x3fff, 0, 0, "bank4"); |
| 464 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 465 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 464 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 465 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 466 | 466 | // Video RAM |
| 467 | 467 | memory_install_read8_handler (space, 0x4000, 0x7fff, 0, 0, gzu_r); |
| 468 | 468 | memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, gzu_w); |
| 469 | 469 | // RAM |
| 470 | 470 | memory_install_read_bank (space, 0x8000, 0xfdff, 0, 0, "bank5"); |
| 471 | 471 | memory_install_write_bank(space, 0x8000, 0xfdff, 0, 0, "bank6"); |
| 472 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 473 | memory_set_bankptr(machine, "bank6", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 472 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 473 | memory_set_bankptr(machine, "bank6", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 474 | 474 | // Devices |
| 475 | 475 | memory_install_read8_handler (space, 0xfe00, 0xfeff, 0, 0, devices_r); |
| 476 | 476 | memory_install_write8_handler(space, 0xfe00, 0xfeff, 0, 0, devices_w); |
| r9922 | r9923 | |
| 485 | 485 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 486 | 486 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 487 | 487 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 488 | memory_set_bankptr(machine, "bank2", | |
| 488 | memory_set_bankptr(machine, "bank2", | |
| 489 | 489 | // Video RAM |
| 490 | 490 | memory_install_read8_handler (space, 0x4000, 0x7fff, 0, 0, gzu_r); |
| 491 | 491 | memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, gzu_w); |
| 492 | 492 | // RAM |
| 493 | 493 | memory_install_read_bank (space, 0x8000, 0xfdff, 0, 0, "bank5"); |
| 494 | 494 | memory_install_write_bank(space, 0x8000, 0xfdff, 0, 0, "bank6"); |
| 495 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 496 | memory_set_bankptr(machine, "bank6", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 495 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 496 | memory_set_bankptr(machine, "bank6", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 497 | 497 | // Devices |
| 498 | 498 | memory_install_read8_handler (space, 0xfe00, 0xfeff, 0, 0, devices_r); |
| 499 | 499 | memory_install_write8_handler(space, 0xfe00, 0xfeff, 0, 0, devices_w); |
| r9922 | r9923 | |
| 507 | 507 | // RAM |
| 508 | 508 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 509 | 509 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 510 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram")) + 0x0000); | |
| 511 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x0000); | |
| 510 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG)) + 0x0000); | |
| 511 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x0000); | |
| 512 | 512 | // Video RAM |
| 513 | 513 | memory_install_read8_handler (space, 0x4000, 0x7fff, 0, 0, gzu_r); |
| 514 | 514 | memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, gzu_w); |
| 515 | 515 | // RAM |
| 516 | 516 | memory_install_read_bank (space, 0x8000, 0xfdff, 0, 0, "bank3"); |
| 517 | 517 | memory_install_write_bank(space, 0x8000, 0xfdff, 0, 0, "bank4"); |
| 518 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 519 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 518 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 519 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 520 | 520 | // Devices |
| 521 | 521 | memory_install_read8_handler (space, 0xfe00, 0xfeff, 0, 0, devices_r); |
| 522 | 522 | memory_install_write8_handler(space, 0xfe00, 0xfeff, 0, 0, devices_w); |
| r9922 | r9923 | |
| 531 | 531 | memory_install_read_bank (space, 0x0000, 0x5fff, 0, 0, "bank1"); |
| 532 | 532 | memory_install_write_bank(space, 0x0000, 0x5fff, 0, 0, "bank2"); |
| 533 | 533 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 534 | memory_set_bankptr(machine, "bank2", | |
| 534 | memory_set_bankptr(machine, "bank2", | |
| 535 | 535 | // RAM |
| 536 | 536 | memory_install_read_bank (space, 0x6000, 0xf7ff, 0, 0, "bank3"); |
| 537 | 537 | memory_install_write_bank(space, 0x6000, 0xf7ff, 0, 0, "bank4"); |
| 538 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 539 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 538 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 539 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 540 | 540 | // Keyboard |
| 541 | 541 | memory_install_read8_handler (space, 0xf800, 0xf9ff, 0, 0, keyboard_r); |
| 542 | 542 | memory_install_write_bank(space, 0xf800, 0xf9ff, 0, 0, "bank5"); |
| 543 | memory_set_bankptr(machine, "bank5", | |
| 543 | memory_set_bankptr(machine, "bank5", | |
| 544 | 544 | // System reg |
| 545 | 545 | memory_install_read8_handler (space, 0xfa00, 0xfaff, 0, 0, sysreg_r); |
| 546 | 546 | memory_install_write8_handler(space, 0xfa00, 0xfaff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 558 | 558 | memory_install_read_bank (space, 0x0000, 0x1fff, 0, 0, "bank1"); |
| 559 | 559 | memory_install_write_bank(space, 0x0000, 0x1fff, 0, 0, "bank2"); |
| 560 | 560 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 561 | memory_set_bankptr(machine, "bank2", | |
| 561 | memory_set_bankptr(machine, "bank2", | |
| 562 | 562 | // RAM |
| 563 | 563 | memory_install_read_bank (space, 0x2000, 0xf7ff, 0, 0, "bank3"); |
| 564 | 564 | memory_install_write_bank(space, 0x2000, 0xf7ff, 0, 0, "bank4"); |
| 565 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 566 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 565 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 566 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 567 | 567 | // Keyboard |
| 568 | 568 | memory_install_read8_handler (space, 0xf800, 0xf9ff, 0, 0, keyboard_r); |
| 569 | 569 | memory_install_write_bank(space, 0xf800, 0xf9ff, 0, 0, "bank5"); |
| 570 | memory_set_bankptr(machine, "bank5", | |
| 570 | memory_set_bankptr(machine, "bank5", | |
| 571 | 571 | // System reg |
| 572 | 572 | memory_install_read8_handler (space, 0xfa00, 0xfaff, 0, 0, sysreg_r); |
| 573 | 573 | memory_install_write8_handler(space, 0xfa00, 0xfaff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 585 | 585 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 586 | 586 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 587 | 587 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 588 | memory_set_bankptr(machine, "bank2", | |
| 588 | memory_set_bankptr(machine, "bank2", | |
| 589 | 589 | // RAM |
| 590 | 590 | memory_install_read_bank (space, 0x4000, 0xf7ff, 0, 0, "bank3"); |
| 591 | 591 | memory_install_write_bank(space, 0x4000, 0xf7ff, 0, 0, "bank4"); |
| 592 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 593 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 592 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 593 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 594 | 594 | // Keyboard |
| 595 | 595 | memory_install_read8_handler (space, 0xf800, 0xf9ff, 0, 0, keyboard_r); |
| 596 | 596 | memory_install_write_bank(space, 0xf800, 0xf9ff, 0, 0, "bank5"); |
| 597 | memory_set_bankptr(machine, "bank5", | |
| 597 | memory_set_bankptr(machine, "bank5", | |
| 598 | 598 | // System reg |
| 599 | 599 | memory_install_read8_handler (space, 0xfa00, 0xfaff, 0, 0, sysreg_r); |
| 600 | 600 | memory_install_write8_handler(space, 0xfa00, 0xfaff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 611 | 611 | // RAM |
| 612 | 612 | memory_install_read_bank (space, 0x0000, 0xf7ff, 0, 0, "bank1"); |
| 613 | 613 | memory_install_write_bank(space, 0x0000, 0xf7ff, 0, 0, "bank2"); |
| 614 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram")) + 0x0000); | |
| 615 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x0000); | |
| 614 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG)) + 0x0000); | |
| 615 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x0000); | |
| 616 | 616 | // Keyboard |
| 617 | 617 | memory_install_read8_handler (space, 0xf800, 0xf9ff, 0, 0, keyboard_r); |
| 618 | 618 | memory_install_write_bank(space, 0xf800, 0xf9ff, 0, 0, "bank3"); |
| 619 | memory_set_bankptr(machine, "bank3", | |
| 619 | memory_set_bankptr(machine, "bank3", | |
| 620 | 620 | // System reg |
| 621 | 621 | memory_install_read8_handler (space, 0xfa00, 0xfaff, 0, 0, sysreg_r); |
| 622 | 622 | memory_install_write8_handler(space, 0xfa00, 0xfaff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 634 | 634 | memory_install_read_bank (space, 0x0000, 0x5fff, 0, 0, "bank1"); |
| 635 | 635 | memory_install_write_bank(space, 0x0000, 0x5fff, 0, 0, "bank2"); |
| 636 | 636 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 637 | memory_set_bankptr(machine, "bank2", | |
| 637 | memory_set_bankptr(machine, "bank2", | |
| 638 | 638 | // RAM |
| 639 | 639 | memory_install_read_bank (space, 0x6000, 0xfdff, 0, 0, "bank3"); |
| 640 | 640 | memory_install_write_bank(space, 0x6000, 0xfdff, 0, 0, "bank4"); |
| 641 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 642 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 641 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 642 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 643 | 643 | // Devices |
| 644 | 644 | memory_install_read8_handler (space, 0xfe00, 0xfeff, 0, 0, devices_r); |
| 645 | 645 | memory_install_write8_handler(space, 0xfe00, 0xfeff, 0, 0, devices_w); |
| r9922 | r9923 | |
| 654 | 654 | memory_install_read_bank (space, 0x0000, 0x1fff, 0, 0, "bank1"); |
| 655 | 655 | memory_install_write_bank(space, 0x0000, 0x1fff, 0, 0, "bank2"); |
| 656 | 656 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 657 | memory_set_bankptr(machine, "bank2", | |
| 657 | memory_set_bankptr(machine, "bank2", | |
| 658 | 658 | // RAM |
| 659 | 659 | memory_install_read_bank (space, 0x2000, 0xfdff, 0, 0, "bank3"); |
| 660 | 660 | memory_install_write_bank(space, 0x2000, 0xfdff, 0, 0, "bank4"); |
| 661 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 662 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 661 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 662 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 663 | 663 | // Devices |
| 664 | 664 | memory_install_read8_handler (space, 0xfe00, 0xfeff, 0, 0, devices_r); |
| 665 | 665 | memory_install_write8_handler(space, 0xfe00, 0xfeff, 0, 0, devices_w); |
| r9922 | r9923 | |
| 674 | 674 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 675 | 675 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 676 | 676 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 677 | memory_set_bankptr(machine, "bank2", | |
| 677 | memory_set_bankptr(machine, "bank2", | |
| 678 | 678 | // RAM |
| 679 | 679 | memory_install_read_bank (space, 0x4000, 0xfdff, 0, 0, "bank3"); |
| 680 | 680 | memory_install_write_bank(space, 0x4000, 0xfdff, 0, 0, "bank4"); |
| 681 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 682 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 681 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 682 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 683 | 683 | // Devices |
| 684 | 684 | memory_install_read8_handler (space, 0xfe00, 0xfeff, 0, 0, devices_r); |
| 685 | 685 | memory_install_write8_handler(space, 0xfe00, 0xfeff, 0, 0, devices_w); |
| r9922 | r9923 | |
| 693 | 693 | // RAM |
| 694 | 694 | memory_install_read_bank (space, 0x0000, 0xfdff, 0, 0, "bank1"); |
| 695 | 695 | memory_install_write_bank(space, 0x0000, 0xfdff, 0, 0, "bank2"); |
| 696 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 697 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram"))); | |
| 696 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 697 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG))); | |
| 698 | 698 | // Devices |
| 699 | 699 | memory_install_read8_handler (space, 0xfe00, 0xfeff, 0, 0, devices_r); |
| 700 | 700 | memory_install_write8_handler(space, 0xfe00, 0xfeff, 0, 0, devices_w); |
| r9922 | r9923 | |
| 709 | 709 | memory_install_read_bank (space, 0x0000, 0x5fff, 0, 0, "bank1"); |
| 710 | 710 | memory_install_write_bank(space, 0x0000, 0x5fff, 0, 0, "bank2"); |
| 711 | 711 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 712 | memory_set_bankptr(machine, "bank2", | |
| 712 | memory_set_bankptr(machine, "bank2", | |
| 713 | 713 | // RAM |
| 714 | 714 | memory_install_read_bank (space, 0x6000, 0xbeff, 0, 0, "bank3"); |
| 715 | 715 | memory_install_write_bank(space, 0x6000, 0xbeff, 0, 0, "bank4"); |
| 716 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 717 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 716 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 717 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 718 | 718 | // System reg |
| 719 | 719 | memory_install_read8_handler (space, 0xbf00, 0xbfff, 0, 0, sysreg_r); |
| 720 | 720 | memory_install_write8_handler(space, 0xbf00, 0xbfff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 729 | 729 | memory_install_read_bank (space, 0x0000, 0x1fff, 0, 0, "bank1"); |
| 730 | 730 | memory_install_write_bank(space, 0x0000, 0x1fff, 0, 0, "bank2"); |
| 731 | 731 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 732 | memory_set_bankptr(machine, "bank2", | |
| 732 | memory_set_bankptr(machine, "bank2", | |
| 733 | 733 | // RAM |
| 734 | 734 | memory_install_read_bank (space, 0x2000, 0xbeff, 0, 0, "bank3"); |
| 735 | 735 | memory_install_write_bank(space, 0x2000, 0xbeff, 0, 0, "bank4"); |
| 736 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 737 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 736 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 737 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 738 | 738 | // System reg |
| 739 | 739 | memory_install_read8_handler (space, 0xbf00, 0xbfff, 0, 0, sysreg_r); |
| 740 | 740 | memory_install_write8_handler(space, 0xbf00, 0xbfff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 749 | 749 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 750 | 750 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 751 | 751 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 752 | memory_set_bankptr(machine, "bank2", | |
| 752 | memory_set_bankptr(machine, "bank2", | |
| 753 | 753 | // RAM |
| 754 | 754 | memory_install_read_bank (space, 0x4000, 0xbeff, 0, 0, "bank3"); |
| 755 | 755 | memory_install_write_bank(space, 0x4000, 0xbeff, 0, 0, "bank4"); |
| 756 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 757 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 756 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 757 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 758 | 758 | // System reg |
| 759 | 759 | memory_install_read8_handler (space, 0xbf00, 0xbfff, 0, 0, sysreg_r); |
| 760 | 760 | memory_install_write8_handler(space, 0xbf00, 0xbfff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 768 | 768 | // RAM |
| 769 | 769 | memory_install_read_bank (space, 0x0000, 0xbeff, 0, 0, "bank1"); |
| 770 | 770 | memory_install_write_bank(space, 0x0000, 0xbeff, 0, 0, "bank2"); |
| 771 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 772 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram"))); | |
| 771 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 772 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG))); | |
| 773 | 773 | // System reg |
| 774 | 774 | memory_install_read8_handler (space, 0xbf00, 0xbfff, 0, 0, sysreg_r); |
| 775 | 775 | memory_install_write8_handler(space, 0xbf00, 0xbfff, 0, 0, sysreg_w); |
| r9922 | r9923 | |
| 784 | 784 | memory_install_read_bank (space, 0x0000, 0x5fff, 0, 0, "bank1"); |
| 785 | 785 | memory_install_write_bank(space, 0x0000, 0x5fff, 0, 0, "bank2"); |
| 786 | 786 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 787 | memory_set_bankptr(machine, "bank2", | |
| 787 | memory_set_bankptr(machine, "bank2", | |
| 788 | 788 | // RAM |
| 789 | 789 | memory_install_read_bank (space, 0x6000, 0xbfff, 0, 0, "bank3"); |
| 790 | 790 | memory_install_write_bank(space, 0x6000, 0xbfff, 0, 0, "bank4"); |
| 791 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 792 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x6000); | |
| 791 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 792 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x6000); | |
| 793 | 793 | // Video RAM |
| 794 | 794 | memory_install_read8_handler (space, 0xc000, 0xffff, 0, 0, gzu_r); |
| 795 | 795 | memory_install_write8_handler(space, 0xc000, 0xffff, 0, 0, gzu_w); |
| r9922 | r9923 | |
| 801 | 801 | memory_install_read_bank (space, 0x0000, 0x1fff, 0, 0, "bank1"); |
| 802 | 802 | memory_install_write_bank(space, 0x0000, 0x1fff, 0, 0, "bank2"); |
| 803 | 803 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 804 | memory_set_bankptr(machine, "bank2", | |
| 804 | memory_set_bankptr(machine, "bank2", | |
| 805 | 805 | // RAM |
| 806 | 806 | memory_install_read_bank (space, 0x2000, 0xbfff, 0, 0, "bank3"); |
| 807 | 807 | memory_install_write_bank(space, 0x2000, 0xbfff, 0, 0, "bank4"); |
| 808 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 809 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x2000); | |
| 808 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 809 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x2000); | |
| 810 | 810 | // Video RAM |
| 811 | 811 | memory_install_read8_handler (space, 0xc000, 0xffff, 0, 0, gzu_r); |
| 812 | 812 | memory_install_write8_handler(space, 0xc000, 0xffff, 0, 0, gzu_w); |
| r9922 | r9923 | |
| 818 | 818 | memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 819 | 819 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank2"); |
| 820 | 820 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000); |
| 821 | memory_set_bankptr(machine, "bank2", | |
| 821 | memory_set_bankptr(machine, "bank2", | |
| 822 | 822 | // RAM |
| 823 | 823 | memory_install_read_bank (space, 0x4000, 0xbfff, 0, 0, "bank3"); |
| 824 | 824 | memory_install_write_bank(space, 0x4000, 0xbfff, 0, 0, "bank4"); |
| 825 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 826 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 825 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 826 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 827 | 827 | // Video RAM |
| 828 | 828 | memory_install_read8_handler (space, 0xc000, 0xffff, 0, 0, gzu_r); |
| 829 | 829 | memory_install_write8_handler(space, 0xc000, 0xffff, 0, 0, gzu_w); |
| r9922 | r9923 | |
| 834 | 834 | // RAM |
| 835 | 835 | memory_install_read_bank (space, 0x0000, 0xbfff, 0, 0, "bank1"); |
| 836 | 836 | memory_install_write_bank(space, 0x0000, 0xbfff, 0, 0, "bank2"); |
| 837 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 838 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram"))); | |
| 837 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 838 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG))); | |
| 839 | 839 | // Video RAM |
| 840 | 840 | memory_install_read8_handler (space, 0xc000, 0xffff, 0, 0, gzu_r); |
| 841 | 841 | memory_install_write8_handler(space, 0xc000, 0xffff, 0, 0, gzu_w); |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | /* Devices */ |
| 14 | 14 | #include "devices/cassette.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | #define KC_DEBUG 1 |
| 18 | 18 | #define LOG(x) do { if (KC_DEBUG) logerror x; } while (0) |
| r9922 | r9923 | |
| 111 | 111 | addr = (header->load_address_l & 0x0ff) | ((header->load_address_h & 0x0ff)<<8); |
| 112 | 112 | |
| 113 | 113 | for (i=0; i<datasize; i++) |
| 114 | | |
| 114 | | |
| 115 | 115 | return IMAGE_INIT_PASS; |
| 116 | 116 | } |
| 117 | 117 | |
| r9922 | r9923 | |
| 1101 | 1101 | /* ram8 block chosen */ |
| 1102 | 1102 | ram8_block = ((state->kc85_84_data)>>4) & 0x01; |
| 1103 | 1103 | |
| 1104 | mem_ptr = | |
| 1104 | mem_ptr = | |
| 1105 | 1105 | |
| 1106 | 1106 | memory_set_bankptr(machine, "bank3", mem_ptr); |
| 1107 | 1107 | memory_set_bankptr(machine, "bank4", mem_ptr+0x02800); |
| r9922 | r9923 | |
| 1167 | 1167 | |
| 1168 | 1168 | /* yes; set address of bank */ |
| 1169 | 1169 | memory_install_read_bank(space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 1170 | memory_set_bankptr(machine, "bank1", | |
| 1170 | memory_set_bankptr(machine, "bank1", | |
| 1171 | 1171 | |
| 1172 | 1172 | /* write protect ram? */ |
| 1173 | 1173 | if ((state->kc85_pio_data[0] & (1<<3))==0) |
| r9922 | r9923 | |
| 1184 | 1184 | |
| 1185 | 1185 | /* ram is enabled and write enabled; and set address of bank */ |
| 1186 | 1186 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank7"); |
| 1187 | memory_set_bankptr(machine, "bank7", | |
| 1187 | memory_set_bankptr(machine, "bank7", | |
| 1188 | 1188 | } |
| 1189 | 1189 | } |
| 1190 | 1190 | else |
| r9922 | r9923 | |
| 1208 | 1208 | { |
| 1209 | 1209 | UINT8 *mem_ptr; |
| 1210 | 1210 | |
| 1211 | mem_ptr = | |
| 1211 | mem_ptr = | |
| 1212 | 1212 | |
| 1213 | 1213 | /* yes */ |
| 1214 | 1214 | memory_install_read_bank(space, 0x4000, 0x7fff, 0, 0, "bank2"); |
| r9922 | r9923 | |
| 1462 | 1462 | /* yes */ |
| 1463 | 1463 | memory_install_read_bank(space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 1464 | 1464 | /* set address of bank */ |
| 1465 | memory_set_bankptr(machine, "bank1", | |
| 1465 | memory_set_bankptr(machine, "bank1", | |
| 1466 | 1466 | |
| 1467 | 1467 | /* write protect ram? */ |
| 1468 | 1468 | if ((state->kc85_pio_data[0] & (1<<3))==0) |
| r9922 | r9923 | |
| 1480 | 1480 | /* ram is enabled and write enabled */ |
| 1481 | 1481 | memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank6"); |
| 1482 | 1482 | /* set address of bank */ |
| 1483 | memory_set_bankptr(machine, "bank6", | |
| 1483 | memory_set_bankptr(machine, "bank6", | |
| 1484 | 1484 | } |
| 1485 | 1485 | } |
| 1486 | 1486 | else |
| r9922 | r9923 | |
| 1504 | 1504 | { |
| 1505 | 1505 | /* IRM enabled */ |
| 1506 | 1506 | LOG(("IRM enabled\n")); |
| 1507 | ram_page = | |
| 1507 | ram_page = | |
| 1508 | 1508 | |
| 1509 | 1509 | memory_set_bankptr(machine, "bank3", ram_page); |
| 1510 | 1510 | memory_set_bankptr(machine, "bank8", ram_page); |
| r9922 | r9923 | |
| 1515 | 1515 | { |
| 1516 | 1516 | /* RAM8 ACCESS */ |
| 1517 | 1517 | LOG(("RAM8 enabled\n")); |
| 1518 | ram_page = | |
| 1518 | ram_page = | |
| 1519 | 1519 | |
| 1520 | 1520 | memory_set_bankptr(machine, "bank3", ram_page); |
| 1521 | 1521 | memory_install_read_bank(space, 0x8000, 0xbfff, 0, 0, "bank3"); |
| r9922 | r9923 | |
| 1858 | 1858 | state->kc85_pio_data[0] = 0x0f; |
| 1859 | 1859 | state->kc85_pio_data[1] = 0x0f1; |
| 1860 | 1860 | |
| 1861 | memory_set_bankptr(machine, "bank2",messram_get_ptr(machine->device("messram"))+0x0c000); | |
| 1862 | memory_set_bankptr(machine, "bank7",messram_get_ptr(machine->device("messram"))+0x0c000); | |
| 1861 | memory_set_bankptr(machine, "bank2",ram_get_ptr(machine->device(RAM_TAG))+0x0c000); | |
| 1862 | memory_set_bankptr(machine, "bank7",ram_get_ptr(machine->device(RAM_TAG))+0x0c000); | |
| 1863 | 1863 | |
| 1864 | 1864 | state->kc85_z80pio = machine->device("z80pio"); |
| 1865 | 1865 |
| r9922 | r9923 | |
|---|---|---|
| 82 | 82 | #include "emu.h" |
| 83 | 83 | #include "includes/dgn_beta.h" |
| 84 | 84 | #include "video/m6845.h" |
| 85 | #include " | |
| 85 | #include "ma | |
| 86 | 86 | |
| 87 | 87 | #include "debug/debugcpu.h" |
| 88 | 88 | #include "debug/debugcon.h" |
| r9922 | r9923 | |
| 288 | 288 | |
| 289 | 289 | state->GCtrl=0; |
| 290 | 290 | |
| 291 | videoram= | |
| 291 | videoram= | |
| 292 | 292 | |
| 293 | 293 | state->ClkMax=65000; |
| 294 | 294 | state->FlashCount=0; |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/apple3.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | #define BLACK 0 |
| 15 | 15 | #define DKRED 1 |
| r9922 | r9923 | |
| 101 | 101 | { |
| 102 | 102 | for (x = 0; x < 40; x++) |
| 103 | 103 | { |
| 104 | offset = messram_get_size(machine->device("messram")) - 0x8000 + text_map[y] + x + (state->flags & VAR_VM2 ? 0x0400 : 0x0000); | |
| 105 | ch = messram_get_ptr(machine->device("messram"))[offset]; | |
| 104 | offset = ram_get_size(machine->device(RAM_TAG)) - 0x8000 + text_map[y] + x + (state->flags & VAR_VM2 ? 0x0400 : 0x0000); | |
| 105 | ch = ram_get_ptr(machine->device(RAM_TAG))[offset]; | |
| 106 | 106 | |
| 107 | 107 | if (state->flags & VAR_VM0) |
| 108 | 108 | { |
| 109 | 109 | /* color text */ |
| 110 | offset = messram_get_size(machine->device("messram")) - 0x8000 + text_map[y] + x + (state->flags & VAR_VM2 ? 0x0000 : 0x0400); | |
| 111 | bg = (messram_get_ptr(machine->device("messram"))[offset] >> 0) & 0x0F; | |
| 112 | fg = (messram_get_ptr(machine->device("messram"))[offset] >> 4) & 0x0F; | |
| 110 | offset = ram_get_size(machine->device(RAM_TAG)) - 0x8000 + text_map[y] + x + (state->flags & VAR_VM2 ? 0x0000 : 0x0400); | |
| 111 | bg = (ram_get_ptr(machine->device(RAM_TAG))[offset] >> 0) & 0x0F; | |
| 112 | fg = (ram_get_ptr(machine->device(RAM_TAG))[offset] >> 4) & 0x0F; | |
| 113 | 113 | } |
| 114 | 114 | else |
| 115 | 115 | { |
| r9922 | r9923 | |
| 157 | 157 | { |
| 158 | 158 | for (x = 0; x < 40; x++) |
| 159 | 159 | { |
| 160 | offset = | |
| 160 | offset = | |
| 161 | 161 | |
| 162 | 162 | /* first character */ |
| 163 | ch = | |
| 163 | ch = | |
| 164 | 164 | char_data = &state->char_mem[(ch & 0x7F) * 8]; |
| 165 | 165 | fg = (ch & 0x80) ? GREEN : BLACK; |
| 166 | 166 | bg = (ch & 0x80) ? BLACK : GREEN; |
| r9922 | r9923 | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /* second character */ |
| 178 | ch = | |
| 178 | ch = | |
| 179 | 179 | char_data = &state->char_mem[(ch & 0x7F) * 8]; |
| 180 | 180 | fg = (ch & 0x80) ? GREEN : BLACK; |
| 181 | 181 | bg = (ch & 0x80) ? BLACK : GREEN; |
| r9922 | r9923 | |
| 206 | 206 | for (y = 0; y < 192; y++) |
| 207 | 207 | { |
| 208 | 208 | if (state->flags & VAR_VM2) |
| 209 | pix_info = & | |
| 209 | pix_info = & | |
| 210 | 210 | else |
| 211 | pix_info = & | |
| 211 | pix_info = & | |
| 212 | 212 | ptr = BITMAP_ADDR16(bitmap, y, 0); |
| 213 | 213 | |
| 214 | 214 | for (i = 0; i < 40; i++) |
| r9922 | r9923 | |
| 252 | 252 | { |
| 253 | 253 | if (state->flags & VAR_VM2) |
| 254 | 254 | { |
| 255 | pix_info = &messram_get_ptr(machine->device("messram"))[state->hgr_map[y]]; | |
| 256 | col_info = &messram_get_ptr(machine->device("messram"))[state->hgr_map[y] - 0x2000]; | |
| 255 | pix_info = &ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y]]; | |
| 256 | col_info = &ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y] - 0x2000]; | |
| 257 | 257 | } |
| 258 | 258 | else |
| 259 | 259 | { |
| 260 | pix_info = &messram_get_ptr(machine->device("messram"))[state->hgr_map[y] - 0x2000]; | |
| 261 | col_info = &messram_get_ptr(machine->device("messram"))[state->hgr_map[y]]; | |
| 260 | pix_info = &ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y] - 0x2000]; | |
| 261 | col_info = &ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y]]; | |
| 262 | 262 | } |
| 263 | 263 | ptr = BITMAP_ADDR16(bitmap, y, 0); |
| 264 | 264 | |
| r9922 | r9923 | |
| 297 | 297 | { |
| 298 | 298 | if (state->flags & VAR_VM2) |
| 299 | 299 | { |
| 300 | pix_info1 = &messram_get_ptr(machine->device("messram"))[state->hgr_map[y]]; | |
| 301 | pix_info2 = &messram_get_ptr(machine->device("messram"))[state->hgr_map[y] + 0x2000]; | |
| 300 | pix_info1 = &ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y]]; | |
| 301 | pix_info2 = &ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y] + 0x2000]; | |
| 302 | 302 | } |
| 303 | 303 | else |
| 304 | 304 | { |
| 305 | pix_info1 = &messram_get_ptr(machine->device("messram"))[state->hgr_map[y] - 0x2000]; | |
| 306 | pix_info2 = &messram_get_ptr(machine->device("messram"))[state->hgr_map[y]]; | |
| 305 | pix_info1 = &ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y] - 0x2000]; | |
| 306 | pix_info2 = &ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y]]; | |
| 307 | 307 | } |
| 308 | 308 | ptr = BITMAP_ADDR16(bitmap, y, 0); |
| 309 | 309 | |
| r9922 | r9923 | |
| 337 | 337 | pen = BITMAP_ADDR16(bitmap, y, 0); |
| 338 | 338 | for (i = 0; i < 20; i++) |
| 339 | 339 | { |
| 340 | pix.b.l = messram_get_ptr(machine->device("messram"))[state->hgr_map[y] - 0x2000 + (i * 2) + (state->flags & VAR_VM2 ? 1 : 0) + 0]; | |
| 341 | pix.b.h = messram_get_ptr(machine->device("messram"))[state->hgr_map[y] - 0x0000 + (i * 2) + (state->flags & VAR_VM2 ? 1 : 0) + 0]; | |
| 342 | pix.b.h2 = messram_get_ptr(machine->device("messram"))[state->hgr_map[y] - 0x2000 + (i * 2) + (state->flags & VAR_VM2 ? 1 : 0) + 1]; | |
| 343 | pix.b.h3 = messram_get_ptr(machine->device("messram"))[state->hgr_map[y] - 0x0000 + (i * 2) + (state->flags & VAR_VM2 ? 1 : 0) + 1]; | |
| 340 | pix.b.l = ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y] - 0x2000 + (i * 2) + (state->flags & VAR_VM2 ? 1 : 0) + 0]; | |
| 341 | pix.b.h = ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y] - 0x0000 + (i * 2) + (state->flags & VAR_VM2 ? 1 : 0) + 0]; | |
| 342 | pix.b.h2 = ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y] - 0x2000 + (i * 2) + (state->flags & VAR_VM2 ? 1 : 0) + 1]; | |
| 343 | pix.b.h3 = ram_get_ptr(machine->device(RAM_TAG))[state->hgr_map[y] - 0x0000 + (i * 2) + (state->flags & VAR_VM2 ? 1 : 0) + 1]; | |
| 344 | 344 | |
| 345 | 345 | pen[ 0] = pen[ 1] = pen[ 2] = pen[ 3] = ((pix.d >> 0) & 0x0F); |
| 346 | 346 | pen[ 4] = pen[ 5] = pen[ 6] = pen[ 7] = ((pix.d >> 4) & 0x07) | ((pix.d >> 1) & 0x08); |
| r9922 | r9923 | |
|---|---|---|
| 15 | 15 | #include "emu.h" |
| 16 | 16 | #include "sound/asc.h" |
| 17 | 17 | #include "includes/mac.h" |
| 18 | #include " | |
| 18 | #include "ma | |
| 19 | 19 | |
| 20 | 20 | PALETTE_INIT( mac ) |
| 21 | 21 | { |
| r9922 | r9923 | |
| 43 | 43 | int y, x, b; |
| 44 | 44 | mac_state *mac = screen->machine->driver_data<mac_state>(); |
| 45 | 45 | |
| 46 | video_base = messram_get_size(screen->machine->device("messram")) - (mac->screen_buffer ? MAC_MAIN_SCREEN_BUF_OFFSET : MAC_ALT_SCREEN_BUF_OFFSET); | |
| 47 | video_ram = (const UINT16 *) (messram_get_ptr(screen->machine->device("messram")) + video_base); | |
| 46 | video_base = ram_get_size(screen->machine->device(RAM_TAG)) - (mac->screen_buffer ? MAC_MAIN_SCREEN_BUF_OFFSET : MAC_ALT_SCREEN_BUF_OFFSET); | |
| 47 | video_ram = (const UINT16 *) (ram_get_ptr(screen->machine->device(RAM_TAG)) + video_base); | |
| 48 | 48 | |
| 49 | 49 | for (y = 0; y < MAC_V_VIS; y++) |
| 50 | 50 | { |
| r9922 | r9923 | |
| 420 | 420 | UINT32 *scanline; |
| 421 | 421 | int x, y, hres, vres; |
| 422 | 422 | mac_state *mac = screen->machine->driver_data<mac_state>(); |
| 423 | UINT8 *vram8 = (UINT8 *) | |
| 423 | UINT8 *vram8 = (UINT8 *) | |
| 424 | 424 | |
| 425 | 425 | switch (mac->m_rbv_montype) |
| 426 | 426 | { |
| r9922 | r9923 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "includes/nc.h" |
| 11 | #include " | |
| 11 | #include "ma | |
| 12 | 12 | |
| 13 | 13 | /*************************************************************************** |
| 14 | 14 | Start the video hardware emulation. |
| r9922 | r9923 | |
| 91 | 91 | { |
| 92 | 92 | int by; |
| 93 | 93 | /* 64 bytes per line */ |
| 94 | char *line_ptr = ((char*) | |
| 94 | char *line_ptr = ((char*) | |
| 95 | 95 | |
| 96 | 96 | x = 0; |
| 97 | 97 | for (by=0; by<width>>3; by++) |
| r9922 | r9923 | |
|---|---|---|
| 7 | 7 | ***************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include " | |
| 10 | #include "ma | |
| 11 | 11 | #include "includes/z88.h" |
| 12 | 12 | |
| 13 | 13 | |
| r9922 | r9923 | |
| 119 | 119 | /* convert absolute offset into correct address to get data from */ |
| 120 | 120 | static unsigned char *z88_convert_address(running_machine *machine, unsigned long offset) |
| 121 | 121 | { |
| 122 | // return | |
| 122 | // return | |
| 123 | 123 | if (offset>(32*16384)) |
| 124 | 124 | { |
| 125 | 125 | unsigned long get_offset; |
| 126 | 126 | get_offset = offset - (32*16384); |
| 127 | 127 | get_offset = get_offset & 0x01fffff; |
| 128 | return | |
| 128 | return | |
| 129 | 129 | } |
| 130 | 130 | else |
| 131 | 131 | { |
| r9922 | r9923 | |
|---|---|---|
| 1 | 1 | #include "emu.h" |
| 2 | 2 | #include "includes/pcw16.h" |
| 3 | #include " | |
| 3 | #include "ma | |
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | /* 16 colours, + 1 for border */ |
| r9922 | r9923 | |
| 157 | 157 | VIDEO_UPDATE( pcw16 ) |
| 158 | 158 | { |
| 159 | 159 | pcw16_state *state = screen->machine->driver_data<pcw16_state>(); |
| 160 | unsigned char *pScanLine = (unsigned char *) | |
| 160 | unsigned char *pScanLine = (unsigned char *) | |
| 161 | 161 | |
| 162 | 162 | int y; |
| 163 | 163 | int x; |
| r9922 | r9923 | |
| 240 | 240 | { |
| 241 | 241 | int byte; |
| 242 | 242 | |
| 243 | byte = | |
| 243 | byte = | |
| 244 | 244 | |
| 245 | 245 | switch (mode) |
| 246 | 246 | { |
| r9922 | r9923 | |
|---|---|---|
| 14 | 14 | ****************************************************************************/ |
| 15 | 15 | |
| 16 | 16 | #include "emu.h" |
| 17 | #include " | |
| 17 | #include "ma | |
| 18 | 18 | #include "includes/enterp.h" |
| 19 | 19 | |
| 20 | 20 | /* given a colour index in range 0..255 gives the Red component */ |
| r9922 | r9923 | |
| 1029 | 1029 | ep_state *state = machine->driver_data<ep_state>(); |
| 1030 | 1030 | state->nick = auto_alloc_clear(machine, NICK_STATE); |
| 1031 | 1031 | |
| 1032 | state->nick->videoram = | |
| 1032 | state->nick->videoram = | |
| 1033 | 1033 | Nick_Init(state->nick); |
| 1034 | 1034 | VIDEO_START_CALL(generic_bitmapped); |
| 1035 | 1035 | } |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/b2m.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | VIDEO_START( b2m ) |
| 15 | 15 | { |
| r9922 | r9923 | |
| 28 | 28 | for (y = 0; y < 256; y++) |
| 29 | 29 | { |
| 30 | 30 | if (state->b2m_video_page==0) { |
| 31 | code1 = messram_get_ptr(screen->machine->device("messram"))[0x11000 + x*256 + ((y + state->b2m_video_scroll) & 0xff)]; | |
| 32 | code2 = messram_get_ptr(screen->machine->device("messram"))[0x15000 + x*256 + ((y + state->b2m_video_scroll) & 0xff)]; | |
| 31 | code1 = ram_get_ptr(screen->machine->device(RAM_TAG))[0x11000 + x*256 + ((y + state->b2m_video_scroll) & 0xff)]; | |
| 32 | code2 = ram_get_ptr(screen->machine->device(RAM_TAG))[0x15000 + x*256 + ((y + state->b2m_video_scroll) & 0xff)]; | |
| 33 | 33 | } else { |
| 34 | code1 = messram_get_ptr(screen->machine->device("messram"))[0x19000 + x*256 + ((y + state->b2m_video_scroll) & 0xff)]; | |
| 35 | code2 = messram_get_ptr(screen->machine->device("messram"))[0x1d000 + x*256 + ((y + state->b2m_video_scroll) & 0xff)]; | |
| 34 | code1 = ram_get_ptr(screen->machine->device(RAM_TAG))[0x19000 + x*256 + ((y + state->b2m_video_scroll) & 0xff)]; | |
| 35 | code2 = ram_get_ptr(screen->machine->device(RAM_TAG))[0x1d000 + x*256 + ((y + state->b2m_video_scroll) & 0xff)]; | |
| 36 | 36 | } |
| 37 | 37 | for (b = 7; b >= 0; b--) |
| 38 | 38 | { |
| r9922 | r9923 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "includes/pmd85.h" |
| 13 | #include " | |
| 13 | #include "ma | |
| 14 | 14 | |
| 15 | 15 | const unsigned char pmd85_palette[3*3] = |
| 16 | 16 | { |
| r9922 | r9923 | |
| 42 | 42 | UINT16 *scanline = BITMAP_ADDR16(bitmap, pmd85_scanline, 0); |
| 43 | 43 | |
| 44 | 44 | /* address of current line in PMD-85 video memory */ |
| 45 | UINT8* pmd85_video_ram_line = | |
| 45 | UINT8* pmd85_video_ram_line = | |
| 46 | 46 | |
| 47 | 47 | for (x=0; x<288; x+=6) |
| 48 | 48 | { |
| r9922 | r9923 | |
|---|---|---|
| 28 | 28 | #include "emu.h" |
| 29 | 29 | #include "includes/x68k.h" |
| 30 | 30 | #include "machine/68901mfp.h" |
| 31 | #include " | |
| 31 | #include "ma | |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | |
| r9922 | r9923 | |
| 1259 | 1259 | // popmessage("Graphic layer scroll - %i, %i - %i, %i - %i, %i - %i, %i", |
| 1260 | 1260 | // state->crtc.reg[12],state->crtc.reg[13],state->crtc.reg[14],state->crtc.reg[15],state->crtc.reg[16],state->crtc.reg[17],state->crtc.reg[18],state->crtc.reg[19]); |
| 1261 | 1261 | // popmessage("IOC IRQ status - %02x",state->ioc.irqstatus); |
| 1262 | // popmessage("RAM: mouse data - %02x %02x %02x %02x", | |
| 1262 | // popmessage("RAM: mouse data - %02x %02x %02x %02x", | |
| 1263 | 1263 | #endif |
| 1264 | 1264 | return 0; |
| 1265 | 1265 | } |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/ondra.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | |
| r9922 | r9923 | |
| 31 | 31 | { |
| 32 | 32 | for (y = 127; y >=0; y--) |
| 33 | 33 | { |
| 34 | code1 = messram_get_ptr(screen->machine->device("messram"))[0xd700 + Vaddr + 0x80]; | |
| 35 | code2 = messram_get_ptr(screen->machine->device("messram"))[0xd700 + Vaddr + 0x00]; | |
| 34 | code1 = ram_get_ptr(screen->machine->device(RAM_TAG))[0xd700 + Vaddr + 0x80]; | |
| 35 | code2 = ram_get_ptr(screen->machine->device(RAM_TAG))[0xd700 + Vaddr + 0x00]; | |
| 36 | 36 | for (b = 0; b < 8; b++) |
| 37 | 37 | { |
| 38 | 38 | *BITMAP_ADDR16(bitmap, 2*y, x*8+b) = ((code1 << b) & 0x80) ? 1 : 0; |
| r9922 | r9923 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | #include "emu.h" |
| 17 | 17 | #include "includes/spectrum.h" |
| 18 | #include " | |
| 18 | #include "ma | |
| 19 | 19 | |
| 20 | 20 | INLINE void spectrum_plot_pixel(bitmap_t *bitmap, int x, int y, UINT32 color) |
| 21 | 21 | { |
| r9922 | r9923 | |
| 64 | 64 | scrx=TS2068_LEFT_BORDER; |
| 65 | 65 | scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0); |
| 66 | 66 | |
| 67 | scr= | |
| 67 | scr= | |
| 68 | 68 | attr=scr + 0x2000; |
| 69 | 69 | |
| 70 | 70 | for (x=0;x<32;x++) |
| r9922 | r9923 | |
| 108 | 108 | scrx=TS2068_LEFT_BORDER; |
| 109 | 109 | scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0); |
| 110 | 110 | |
| 111 | scr1= | |
| 111 | scr1= | |
| 112 | 112 | scr2=scr1 + 0x2000; |
| 113 | 113 | |
| 114 | 114 | for (x=0;x<32;x++) |
| r9922 | r9923 | |
| 144 | 144 | scrx=TS2068_LEFT_BORDER; |
| 145 | 145 | scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0); |
| 146 | 146 | |
| 147 | scr = messram_get_ptr(machine->device("messram")) + y*32 + screen*0x2000; | |
| 148 | attr = messram_get_ptr(machine->device("messram")) + ((scry>>3)*32) + screen*0x2000 + 0x1800; | |
| 147 | scr = ram_get_ptr(machine->device(RAM_TAG)) + y*32 + screen*0x2000; | |
| 148 | attr = ram_get_ptr(machine->device(RAM_TAG)) + ((scry>>3)*32) + screen*0x2000 + 0x1800; | |
| 149 | 149 | |
| 150 | 150 | for (x=0;x<32;x++) |
| 151 | 151 | { |
| r9922 | r9923 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "includes/pcw.h" |
| 11 | #include " | |
| 11 | #include "ma | |
| 12 | 12 | |
| 13 | 13 | INLINE void pcw_plot_pixel(bitmap_t *bitmap, int x, int y, UINT32 color) |
| 14 | 14 | { |
| r9922 | r9923 | |
| 107 | 107 | |
| 108 | 108 | x = PCW_BORDER_WIDTH; |
| 109 | 109 | |
| 110 | roller_ram_ptr = | |
| 110 | roller_ram_ptr = | |
| 111 | 111 | |
| 112 | 112 | /* get line address */ |
| 113 | 113 | /* b16-14 control which bank the line is to be found in, b13-3 the address in the bank (in 16-byte units), and b2-0 the offset. Thus a roller RAM address bbbxxxxxxxxxxxyyy indicates bank bbb, address 00xxxxxxxxxxx0yyy. */ |
| 114 | 114 | line_data = ((unsigned char *)roller_ram_ptr)[0] | (((unsigned char *)roller_ram_ptr)[1]<<8); |
| 115 | 115 | |
| 116 | 116 | /* calculate address of pixel data */ |
| 117 | line_ptr = | |
| 117 | line_ptr = | |
| 118 | 118 | |
| 119 | 119 | for (by=0; by<90; by++) |
| 120 | 120 | { |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/vector06.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | VIDEO_START( vector06 ) |
| 15 | 15 | { |
| r9922 | r9923 | |
| 34 | 34 | { |
| 35 | 35 | // port A form 8255 also used as scroll |
| 36 | 36 | draw_y = ((255-y-state->keyboard_mask) & 0xff) +32; |
| 37 | code1 = messram_get_ptr(screen->machine->device("messram"))[0x8000 + x*256 + y]; | |
| 38 | code2 = messram_get_ptr(screen->machine->device("messram"))[0xa000 + x*256 + y]; | |
| 39 | code3 = messram_get_ptr(screen->machine->device("messram"))[0xc000 + x*256 + y]; | |
| 40 | code4 = messram_get_ptr(screen->machine->device("messram"))[0xe000 + x*256 + y]; | |
| 37 | code1 = ram_get_ptr(screen->machine->device(RAM_TAG))[0x8000 + x*256 + y]; | |
| 38 | code2 = ram_get_ptr(screen->machine->device(RAM_TAG))[0xa000 + x*256 + y]; | |
| 39 | code3 = ram_get_ptr(screen->machine->device(RAM_TAG))[0xc000 + x*256 + y]; | |
| 40 | code4 = ram_get_ptr(screen->machine->device(RAM_TAG))[0xe000 + x*256 + y]; | |
| 41 | 41 | for (b = 0; b < 8; b++) |
| 42 | 42 | { |
| 43 | 43 | col = ((code1 >> b) & 0x01) * 8 + ((code2 >> b) & 0x01) * 4 + ((code3 >> b) & 0x01)* 2+ ((code4 >> b) & 0x01); |
| r9922 | r9923 | |
|---|---|---|
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/mc68328.h" |
| 12 | 12 | #include "machine/mc68328.h" |
| 13 | #include " | |
| 13 | #include "ma | |
| 14 | 14 | |
| 15 | 15 | /* THIS IS PRETTY MUCH TOTALLY WRONG AND DOESN'T REFLECT THE MC68328'S INTERNAL FUNCTIONALITY AT ALL! */ |
| 16 | 16 | PALETTE_INIT( mc68328 ) |
| r9922 | r9923 | |
| 29 | 29 | device_t *mc68328_device = screen->machine->device(MC68328_TAG); |
| 30 | 30 | mc68328_t* mc68328 = mc68328_get_safe_token( mc68328_device ); |
| 31 | 31 | |
| 32 | const UINT16 *video_ram = (const UINT16 *)( | |
| 32 | const UINT16 *video_ram = (const UINT16 *)( | |
| 33 | 33 | UINT16 word; |
| 34 | 34 | UINT16 *line; |
| 35 | 35 | int y, x, b; |
| r9922 | r9923 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "includes/orion.h" |
| 13 | #include " | |
| 13 | #include "ma | |
| 14 | 14 | |
| 15 | 15 | VIDEO_START( orion128 ) |
| 16 | 16 | { |
| r9922 | r9923 | |
| 30 | 30 | { |
| 31 | 31 | for (y = 0; y < 256; y++) |
| 32 | 32 | { |
| 33 | code1 = messram_get_ptr(screen->machine->device("messram"))[part1addr + y + x*256]; | |
| 34 | code2 = messram_get_ptr(screen->machine->device("messram"))[part2addr + y + x*256]; | |
| 35 | code3 = messram_get_ptr(screen->machine->device("messram"))[part1addr + y + x*256 + 0x4000]; | |
| 36 | code4 = messram_get_ptr(screen->machine->device("messram"))[part2addr + y + x*256 + 0x4000]; | |
| 33 | code1 = ram_get_ptr(screen->machine->device(RAM_TAG))[part1addr + y + x*256]; | |
| 34 | code2 = ram_get_ptr(screen->machine->device(RAM_TAG))[part2addr + y + x*256]; | |
| 35 | code3 = ram_get_ptr(screen->machine->device(RAM_TAG))[part1addr + y + x*256 + 0x4000]; | |
| 36 | code4 = ram_get_ptr(screen->machine->device(RAM_TAG))[part2addr + y + x*256 + 0x4000]; | |
| 37 | 37 | if ((video_mode==14) || (video_mode==15)) { |
| 38 | 38 | code2 = state->orionpro_pseudo_color; |
| 39 | 39 | } |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "video/pc_video_mess.h" |
| 14 | 14 | #include "video/mc6845.h" |
| 15 | 15 | #include "machine/pic8259.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | |
| 18 | 18 | /*************************************************************************** |
| 19 | 19 | |
| r9922 | r9923 | |
| 763 | 763 | dram = ((data & 0x07) << 14); |
| 764 | 764 | vram = ((data & 0x38) << (14-3)); |
| 765 | 765 | } |
| 766 | memory_set_bankptr( machine, "bank14", messram_get_ptr(machine->device("messram")) + vram ); | |
| 767 | pcjr.displayram = messram_get_ptr(machine->device("messram")) + dram; | |
| 766 | memory_set_bankptr( machine, "bank14", ram_get_ptr(machine->device(RAM_TAG)) + vram ); | |
| 767 | pcjr.displayram = ram_get_ptr(machine->device(RAM_TAG)) + dram; | |
| 768 | 768 | pc_pcjr_mode_switch(machine); |
| 769 | 769 | } |
| 770 | 770 | } |
| r9922 | r9923 | |
|---|---|---|
| 86 | 86 | |
| 87 | 87 | #include "emu.h" |
| 88 | 88 | #include "machine/pic8259.h" |
| 89 | #include " | |
| 89 | #include "ma | |
| 90 | 90 | #include "includes/fmtowns.h" |
| 91 | 91 | |
| 92 | 92 | //#define CRTC_REG_DISP 1 |
| r9922 | r9923 | |
| 149 | 149 | UINT8 ret = 0; |
| 150 | 150 | |
| 151 | 151 | if(state->towns_mainmem_enable != 0) |
| 152 | return | |
| 152 | return | |
| 153 | 153 | |
| 154 | 154 | offset = offset << 2; |
| 155 | 155 | |
| r9922 | r9923 | |
| 174 | 174 | |
| 175 | 175 | if(state->towns_mainmem_enable != 0) |
| 176 | 176 | { |
| 177 | | |
| 177 | | |
| 178 | 178 | return; |
| 179 | 179 | } |
| 180 | 180 | offset = offset << 2; |
| r9922 | r9923 | |
| 335 | 335 | towns_state* state = space->machine->driver_data<towns_state>(); |
| 336 | 336 | |
| 337 | 337 | if(state->towns_mainmem_enable != 0) |
| 338 | return | |
| 338 | return | |
| 339 | 339 | |
| 340 | 340 | return towns_video_cff80_r(space,offset); |
| 341 | 341 | } |
| r9922 | r9923 | |
| 346 | 346 | |
| 347 | 347 | if(state->towns_mainmem_enable != 0) |
| 348 | 348 | { |
| 349 | | |
| 349 | | |
| 350 | 350 | return; |
| 351 | 351 | } |
| 352 | 352 | towns_video_cff80_w(space,offset,data); |
| r9922 | r9923 | |
| 609 | 609 | READ8_HANDLER(towns_spriteram_low_r) |
| 610 | 610 | { |
| 611 | 611 | towns_state* state = space->machine->driver_data<towns_state>(); |
| 612 | UINT8* RAM = | |
| 612 | UINT8* RAM = | |
| 613 | 613 | UINT8* ROM = space->machine->region("user")->base(); |
| 614 | 614 | |
| 615 | 615 | if(offset < 0x1000) |
| r9922 | r9923 | |
| 648 | 648 | WRITE8_HANDLER(towns_spriteram_low_w) |
| 649 | 649 | { |
| 650 | 650 | towns_state* state = space->machine->driver_data<towns_state>(); |
| 651 | UINT8* RAM = | |
| 651 | UINT8* RAM = | |
| 652 | 652 | |
| 653 | 653 | if(offset < 0x1000) |
| 654 | 654 | { // 0xc8000-0xc8fff |
| r9922 | r9923 | |
|---|---|---|
| 31 | 31 | #include "machine/6883sam.h" |
| 32 | 32 | #include "video/coco6847.h" |
| 33 | 33 | #include "includes/coco.h" |
| 34 | #include " | |
| 34 | #include "ma | |
| 35 | 35 | |
| 36 | 36 | #if defined(__GNUC__) && (__GNUC__ >= 3) |
| 37 | 37 | #define RESTRICT __restrict__ |
| r9922 | r9923 | |
| 534 | 534 | memcpy_dirty(&dirty, scanline_record->palette, video->palette_ram, 16); |
| 535 | 535 | |
| 536 | 536 | /* get ready to copy the video memory; get position and offsets */ |
| 537 | video_data = & | |
| 537 | video_data = & | |
| 538 | 538 | video_offset = (state->gimereg[15] & 0x7F) * 2; |
| 539 | 539 | video_data_size = sizeof(scanline_record->data); |
| 540 | 540 |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/special.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | |
| r9922 | r9923 | |
| 103 | 103 | { |
| 104 | 104 | for (y = 0; y < 256; y++) |
| 105 | 105 | { |
| 106 | code = | |
| 106 | code = | |
| 107 | 107 | color = state->specimx_colorram[y + x*256]; |
| 108 | 108 | for (b = 7; b >= 0; b--) |
| 109 | 109 | { |
| r9922 | r9923 | |
| 146 | 146 | UINT8 *erik_video_ram_p1; |
| 147 | 147 | UINT8 *erik_video_ram_p2; |
| 148 | 148 | |
| 149 | erik_video_ram_p1 = messram_get_ptr(screen->machine->device("messram")) + 0x9000; | |
| 150 | erik_video_ram_p2 = messram_get_ptr(screen->machine->device("messram")) + 0xd000; | |
| 149 | erik_video_ram_p1 = ram_get_ptr(screen->machine->device(RAM_TAG)) + 0x9000; | |
| 150 | erik_video_ram_p2 = ram_get_ptr(screen->machine->device(RAM_TAG)) + 0xd000; | |
| 151 | 151 | |
| 152 | 152 | for (x = 0; x < 48; x++) |
| 153 | 153 | { |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/pp01.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | VIDEO_START( pp01 ) |
| 15 | 15 | { |
| r9922 | r9923 | |
| 26 | 26 | { |
| 27 | 27 | for (x = 0; x < 32; x++) |
| 28 | 28 | { |
| 29 | code_r = messram_get_ptr(screen->machine->device("messram"))[0x6000 + ((y+state->video_scroll)&0xff)*32 + x]; | |
| 30 | code_g = messram_get_ptr(screen->machine->device("messram"))[0xa000 + ((y+state->video_scroll)&0xff)*32 + x]; | |
| 31 | code_b = messram_get_ptr(screen->machine->device("messram"))[0xe000 + ((y+state->video_scroll)&0xff)*32 + x]; | |
| 29 | code_r = ram_get_ptr(screen->machine->device(RAM_TAG))[0x6000 + ((y+state->video_scroll)&0xff)*32 + x]; | |
| 30 | code_g = ram_get_ptr(screen->machine->device(RAM_TAG))[0xa000 + ((y+state->video_scroll)&0xff)*32 + x]; | |
| 31 | code_b = ram_get_ptr(screen->machine->device(RAM_TAG))[0xe000 + ((y+state->video_scroll)&0xff)*32 + x]; | |
| 32 | 32 | for (b = 0; b < 8; b++) |
| 33 | 33 | { |
| 34 | 34 | col = (((code_r >> b) & 0x01) ? 4 : 0) + (((code_g >> b) & 0x01) ? 2 : 0) + (((code_b >> b) & 0x01) ? 1 : 0); |
| r9922 | r9923 | |
|---|---|---|
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "includes/apple2.h" |
| 9 | 9 | #include "profiler.h" |
| 10 | #include " | |
| 10 | #include "ma | |
| 11 | 11 | |
| 12 | 12 | /***************************************************************************/ |
| 13 | 13 | |
| r9922 | r9923 | |
| 451 | 451 | |
| 452 | 452 | VIDEO_START( apple2 ) |
| 453 | 453 | { |
| 454 | apple2_video_start(machine, | |
| 454 | apple2_video_start(machine, | |
| 455 | 455 | |
| 456 | 456 | /* hack to fix the colors on apple2/apple2p */ |
| 457 | 457 | fgcolor = 0; |
| r9922 | r9923 | |
| 461 | 461 | |
| 462 | 462 | VIDEO_START( apple2p ) |
| 463 | 463 | { |
| 464 | apple2_video_start(machine, | |
| 464 | apple2_video_start(machine, | |
| 465 | 465 | |
| 466 | 466 | /* hack to fix the colors on apple2/apple2p */ |
| 467 | 467 | fgcolor = 0; |
| r9922 | r9923 | |
| 471 | 471 | |
| 472 | 472 | VIDEO_START( apple2e ) |
| 473 | 473 | { |
| 474 | apple2_video_start(machine, | |
| 474 | apple2_video_start(machine, | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 |
| r9922 | r9923 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "includes/pk8020.h" |
| 11 | #include " | |
| 11 | #include "ma | |
| 12 | 12 | |
| 13 | 13 | VIDEO_START( pk8020 ) |
| 14 | 14 | { |
| r9922 | r9923 | |
| 24 | 24 | { |
| 25 | 25 | for (x = 0; x < 64; x++) |
| 26 | 26 | { |
| 27 | UINT8 chr = messram_get_ptr(screen->machine->device("messram"))[x +(y*64) + 0x40000]; | |
| 28 | UINT8 attr= messram_get_ptr(screen->machine->device("messram"))[x +(y*64) + 0x40400]; | |
| 27 | UINT8 chr = ram_get_ptr(screen->machine->device(RAM_TAG))[x +(y*64) + 0x40000]; | |
| 28 | UINT8 attr= ram_get_ptr(screen->machine->device(RAM_TAG))[x +(y*64) + 0x40400]; | |
| 29 | 29 | for (j = 0; j < 16; j++) { |
| 30 | 30 | UINT32 addr = 0x10000 + x + ((y*16+j)*64) + (state->video_page * 0xC000); |
| 31 | UINT8 code1 = messram_get_ptr(screen->machine->device("messram"))[addr]; | |
| 32 | UINT8 code2 = messram_get_ptr(screen->machine->device("messram"))[addr + 0x4000]; | |
| 33 | UINT8 code3 = messram_get_ptr(screen->machine->device("messram"))[addr + 0x8000]; | |
| 31 | UINT8 code1 = ram_get_ptr(screen->machine->device(RAM_TAG))[addr]; | |
| 32 | UINT8 code2 = ram_get_ptr(screen->machine->device(RAM_TAG))[addr + 0x4000]; | |
| 33 | UINT8 code3 = ram_get_ptr(screen->machine->device(RAM_TAG))[addr + 0x8000]; | |
| 34 | 34 | UINT8 code4 = gfx[((chr<<4) + j) + (state->font*0x1000)]; |
| 35 | 35 | if (attr) code4 ^= 0xff; |
| 36 | 36 | for (b = 0; b < 8; b++) |
| r9922 | r9923 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "includes/kc.h" |
| 11 | #include " | |
| 11 | #include "ma | |
| 12 | 12 | |
| 13 | 13 | /* KC85/4 and KC85/3 common graphics hardware */ |
| 14 | 14 | |
| r9922 | r9923 | |
| 717 | 717 | { |
| 718 | 718 | #if 0 |
| 719 | 719 | /* colour ram takes up 0x02800 bytes */ |
| 720 | unsigned char *pixel_ram = | |
| 720 | unsigned char *pixel_ram = | |
| 721 | 721 | unsigned char *colour_ram = pixel_ram + 0x02800; |
| 722 | 722 | |
| 723 | 723 | int x,y; |
| r9922 | r9923 | |
| 758 | 758 | |
| 759 | 759 | struct grab_info grab_data; |
| 760 | 760 | |
| 761 | grab_data.pixel_ram = messram_get_ptr(screen->machine->device("messram"))+0x08000; | |
| 762 | grab_data.colour_ram = messram_get_ptr(screen->machine->device("messram"))+0x08000 + 0x02800; | |
| 761 | grab_data.pixel_ram = ram_get_ptr(screen->machine->device(RAM_TAG))+0x08000; | |
| 762 | grab_data.colour_ram = ram_get_ptr(screen->machine->device(RAM_TAG))+0x08000 + 0x02800; | |
| 763 | 763 | |
| 764 | 764 | kc85_common_process_frame(screen->machine, bitmap, kc85_3_pixel_grab_callback,&grab_data); |
| 765 | 765 |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | #ifndef __VIXEN__ |
| 4 | 4 | #define __VIXEN__ |
| 5 | 5 | |
| 6 | #include "machine/ram.h" | |
| 7 | ||
| 6 | 8 | #define Z8400A_TAG "5f" |
| 7 | 9 | #define FDC1797_TAG "5n" |
| 8 | 10 | #define P8155H_TAG "2n" |
| r9922 | r9923 | |
| 23 | 25 | m_usart(*this, P8251A_TAG), |
| 24 | 26 | m_discrete(*this, DISCRETE_TAG), |
| 25 | 27 | m_ieee488(*this, IEEE488_TAG), |
| 26 | m_ram(*this, | |
| 28 | m_ram(*this, RAM_TAG | |
| 27 | 29 | m_floppy0(*this, FLOPPY_0), |
| 28 | 30 | m_floppy1(*this, FLOPPY_1), |
| 29 | 31 | m_fdint(0), |
| r9922 | r9923 | |
|---|---|---|
| 6 | 6 | #include "cpu/cosmac/cosmac.h" |
| 7 | 7 | #include "audio/vp550.h" |
| 8 | 8 | #include "audio/vp595.h" |
| 9 | #include "machine/ram.h" | |
| 9 | 10 | |
| 10 | 11 | #define SCREEN_TAG "screen" |
| 11 | 12 | #define CDP1802_TAG "u1" |
| r9922 | r9923 | |
| 59 | 60 | m_vp595(*this, VP595_TAG), |
| 60 | 61 | m_vp550(*this, VP550_TAG), |
| 61 | 62 | m_vp551(*this, VP551_TAG), |
| 62 | m_ram(*this, | |
| 63 | m_ram(*this, RAM_TAG | |
| 63 | 64 | { } |
| 64 | 65 | |
| 65 | 66 | required_device<cosmac_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #include "machine/8530scc.h" |
| 13 | 13 | #include "machine/6522via.h" |
| 14 | #include "machine/ram.h" | |
| 14 | 15 | |
| 15 | 16 | /* for Egret and CUDA streaming MCU commands, command types */ |
| 16 | 17 | typedef enum |
| r9922 | r9923 | |
| 182 | 183 | m_via1(*this, "via6522_0"), |
| 183 | 184 | m_via2(*this, "via6522_1"), |
| 184 | 185 | m_asc(*this, "asc"), |
| 185 | m_ram(*this, | |
| 186 | m_ram(*this, RAM_TAG | |
| 186 | 187 | { } |
| 187 | 188 | |
| 188 | 189 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 1 | 1 | #ifndef __BW12__ |
| 2 | 2 | #define __BW12__ |
| 3 | 3 | |
| 4 | #include "machine/ram.h" | |
| 5 | ||
| 4 | 6 | #define SCREEN_TAG "screen" |
| 5 | 7 | #define Z80_TAG "ic35" |
| 6 | 8 | #define MC6845_TAG "ic14" |
| r9922 | r9923 | |
| 27 | 29 | m_kbc(*this, AY3600_TAG), |
| 28 | 30 | m_crtc(*this, MC6845_TAG), |
| 29 | 31 | m_centronics(*this, CENTRONICS_TAG), |
| 30 | m_ram(*this, | |
| 32 | m_ram(*this, RAM_TAG | |
| 31 | 33 | m_floppy0(*this, FLOPPY_0), |
| 32 | 34 | m_floppy1(*this, FLOPPY_1), |
| 33 | 35 | m_floppy_timer(*this, FLOPPY_TIMER_TAG) |
| r9922 | r9923 | |
|---|---|---|
| 21 | 21 | #endif |
| 22 | 22 | |
| 23 | 23 | /* Cartridge types */ |
| 24 | #define RAM | |
| 24 | #define CART_RAM | |
| 25 | 25 | #define BATTERY 0x02 /* Cartridge has a battery to save RAM */ |
| 26 | 26 | #define TIMER 0x04 /* Cartridge has a real-time-clock (MBC3 only) */ |
| 27 | 27 | #define RUMBLE 0x08 /* Cartridge has a rumble motor (MBC5 only) */ |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | #ifndef __XOR100__ |
| 4 | 4 | #define __XOR100__ |
| 5 | 5 | |
| 6 | #include "machine/ram.h" | |
| 7 | ||
| 6 | 8 | #define SCREEN_TAG "screen" |
| 7 | 9 | #define Z80_TAG "5b" |
| 8 | 10 | #define I8251_A_TAG "12b" |
| r9922 | r9923 | |
| 24 | 26 | m_uart_b(*this, I8251_B_TAG), |
| 25 | 27 | m_fdc(*this, WD1795_TAG), |
| 26 | 28 | m_ctc(*this, Z80CTC_TAG), |
| 27 | m_ram(*this, | |
| 29 | m_ram(*this, RAM_TAG | |
| 28 | 30 | m_terminal(*this, TERMINAL_TAG), |
| 29 | 31 | m_floppy0(*this, FLOPPY_0), |
| 30 | 32 | m_floppy1(*this, FLOPPY_1) |
| r9922 | r9923 | |
|---|---|---|
| 4 | 4 | #define __TMC600__ |
| 5 | 5 | |
| 6 | 6 | #include "cpu/cosmac/cosmac.h" |
| 7 | #include "machine/ram.h" | |
| 7 | 8 | |
| 8 | 9 | #define SCREEN_TAG "screen" |
| 9 | 10 | #define CDP1802_TAG "cdp1802" |
| r9922 | r9923 | |
| 22 | 23 | m_maincpu(*this, CDP1802_TAG), |
| 23 | 24 | m_vis(*this, CDP1869_TAG), |
| 24 | 25 | m_cassette(*this, CASSETTE_TAG), |
| 25 | m_ram(*this, | |
| 26 | m_ram(*this, RAM_TAG | |
| 26 | 27 | { } |
| 27 | 28 | |
| 28 | 29 | required_device<cosmac_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 7 | 7 | #ifndef __ABC80__ |
| 8 | 8 | #define __ABC80__ |
| 9 | 9 | |
| 10 | #include "machine/ram.h" | |
| 11 | ||
| 10 | 12 | #define ABC80_XTAL 11980800.0 |
| 11 | 13 | |
| 12 | 14 | #define ABC80_HTOTAL 384 |
| r9922 | r9923 | |
| 55 | 57 | m_pio(*this, Z80PIO_TAG), |
| 56 | 58 | m_rs232(*this, RS232_TAG), |
| 57 | 59 | m_cassette(*this, CASSETTE_TAG), |
| 58 | m_ram(*this, | |
| 60 | m_ram(*this, RAM_TAG | |
| 59 | 61 | { } |
| 60 | 62 | |
| 61 | 63 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | #ifndef __VICTOR9K__ |
| 4 | 4 | #define __VICTOR9K__ |
| 5 | 5 | |
| 6 | #include "machine/ram.h" | |
| 7 | ||
| 6 | 8 | #define SCREEN_TAG "screen" |
| 7 | 9 | #define I8088_TAG "8l" |
| 8 | 10 | #define I8048_TAG "5d" |
| r9922 | r9923 | |
| 36 | 38 | m_via1(*this, M6522_1_TAG), |
| 37 | 39 | m_cvsd(*this, HC55516_TAG), |
| 38 | 40 | m_crtc(*this, HD46505S_TAG), |
| 39 | m_ram(*this, | |
| 41 | m_ram(*this, RAM_TAG | |
| 40 | 42 | m_floppy0(*this, FLOPPY_0), |
| 41 | 43 | m_floppy1(*this, FLOPPY_1) |
| 42 | 44 | { } |
| r9922 | r9923 | |
|---|---|---|
| 1 | 1 | #ifndef __SG1000__ |
| 2 | 2 | #define __SG1000__ |
| 3 | 3 | |
| 4 | #include "machine/ram.h" | |
| 5 | ||
| 4 | 6 | #define SCREEN_TAG "screen" |
| 5 | 7 | #define Z80_TAG "z80" |
| 6 | 8 | #define SN76489A_TAG "sn76489a" |
| r9922 | r9923 | |
| 30 | 32 | sg1000_state(running_machine &machine, const driver_device_config_base &config) |
| 31 | 33 | : driver_device(machine, config), |
| 32 | 34 | m_maincpu(*this, Z80_TAG), |
| 33 | m_ram(*this, | |
| 35 | m_ram(*this, RAM_TAG | |
| 34 | 36 | { } |
| 35 | 37 | |
| 36 | 38 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 1 | 1 | #ifndef __BW2__ |
| 2 | 2 | #define __BW2__ |
| 3 | 3 | |
| 4 | #include "machine/ram.h" | |
| 5 | ||
| 4 | 6 | #define SCREEN_TAG "screen" |
| 5 | 7 | #define Z80_TAG "ic1" |
| 6 | 8 | #define I8255A_TAG "ic4" |
| r9922 | r9923 | |
| 34 | 36 | m_fdc(*this, WD2797_TAG), |
| 35 | 37 | m_lcdc(*this, MSM6255_TAG), |
| 36 | 38 | m_centronics(*this, CENTRONICS_TAG), |
| 37 | m_ram(*this, | |
| 39 | m_ram(*this, RAM_TAG | |
| 38 | 40 | m_floppy0(*this, FLOPPY_0), |
| 39 | 41 | m_floppy1(*this, FLOPPY_1) |
| 40 | 42 | { } |
| r9922 | r9923 | |
|---|---|---|
| 2 | 2 | #define __V1050__ |
| 3 | 3 | |
| 4 | 4 | #include "devices/flopdrv.h" |
| 5 | #include "machine/ram.h" | |
| 5 | 6 | |
| 6 | 7 | #define SCREEN_TAG "screen" |
| 7 | 8 | |
| r9922 | r9923 | |
| 50 | 51 | m_fdc(*this, MB8877_TAG), |
| 51 | 52 | m_crtc(*this, H46505_TAG), |
| 52 | 53 | m_centronics(*this, CENTRONICS_TAG), |
| 53 | m_ram(*this, | |
| 54 | m_ram(*this, RAM_TAG | |
| 54 | 55 | m_discrete(*this, DISCRETE_TAG), |
| 55 | 56 | m_floppy0(*this, FLOPPY_0), |
| 56 | 57 | m_floppy1(*this, FLOPPY_1), |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | #ifndef __QL__ |
| 4 | 4 | #define __QL__ |
| 5 | 5 | |
| 6 | #include "machine/ram.h" | |
| 7 | ||
| 6 | 8 | #define SCREEN_TAG "screen" |
| 7 | 9 | |
| 8 | 10 | #define M68008_TAG "ic18" |
| r9922 | r9923 | |
| 30 | 32 | m_speaker(*this, SPEAKER_TAG), |
| 31 | 33 | m_mdv1(*this, MDV_1), |
| 32 | 34 | m_mdv2(*this, MDV_2), |
| 33 | m_ram(*this, | |
| 35 | m_ram(*this, RAM_TAG | |
| 34 | 36 | { } |
| 35 | 37 | |
| 36 | 38 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 6 | 6 | #include "machine/abc77.h" |
| 7 | 7 | #include "machine/z80ctc.h" |
| 8 | 8 | #include "machine/z80dart.h" |
| 9 | #include "machine/ram.h" | |
| 9 | 10 | |
| 10 | 11 | |
| 11 | ||
| 12 | 12 | //************************************************************************** |
| 13 | 13 | // MACROS / CONSTANTS |
| 14 | 14 | //************************************************************************** |
| r9922 | r9923 | |
| 63 | 63 | m_dart(*this, Z80DART_TAG), |
| 64 | 64 | m_sio(*this, Z80SIO_TAG), |
| 65 | 65 | m_discrete(*this, "discrete"), |
| 66 | m_ram(*this, | |
| 66 | m_ram(*this, RAM_TAG | |
| 67 | 67 | { } |
| 68 | 68 | |
| 69 | 69 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
| 159 | 159 | m_crtc(*this, MC6845_TAG), |
| 160 | 160 | abc77(*this, ABC77_TAG), |
| 161 | 161 | m_discrete(*this, "discrete"), |
| 162 | m_ram(*this, | |
| 162 | m_ram(*this, RAM_TAG | |
| 163 | 163 | { } |
| 164 | 164 | |
| 165 | 165 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
| 214 | 214 | m_crtc(*this, MC6845_TAG), |
| 215 | 215 | m_rtc(*this, E0516_TAG), |
| 216 | 216 | abc77(*this, ABC77_TAG), |
| 217 | m_ram(*this, | |
| 217 | m_ram(*this, RAM_TAG | |
| 218 | 218 | { } |
| 219 | 219 | |
| 220 | 220 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | #ifndef __TEK405X__ |
| 4 | 4 | #define __TEK405X__ |
| 5 | 5 | |
| 6 | #include "machine/ram.h" | |
| 7 | ||
| 6 | 8 | #define MC6800_TAG "u61" |
| 7 | 9 | #define MC6820_Y_TAG "u561" |
| 8 | 10 | #define MC6820_X_TAG "u565" |
| r9922 | r9923 | |
| 29 | 31 | m_acia(*this, MC6850_TAG), |
| 30 | 32 | m_ieee(*this, IEEE488_TAG), |
| 31 | 33 | m_speaker(*this, SPEAKER_TAG), |
| 32 | m_ram(*this, | |
| 34 | m_ram(*this, RAM_TAG | |
| 33 | 35 | { } |
| 34 | 36 | |
| 35 | 37 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
| 132 | 134 | tek4052_state(running_machine &machine, const driver_device_config_base &config) |
| 133 | 135 | : driver_device(machine, config), |
| 134 | 136 | m_maincpu(*this, AM2901A_TAG), |
| 135 | m_ram(*this, | |
| 137 | m_ram(*this, RAM_TAG | |
| 136 | 138 | { } |
| 137 | 139 | |
| 138 | 140 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | #ifndef __BULLET__ |
| 4 | 4 | #define __BULLET__ |
| 5 | 5 | |
| 6 | #include "machine/ram.h" | |
| 7 | ||
| 6 | 8 | #define Z80_TAG "u20" |
| 7 | 9 | #define Z80CTC_TAG "u1" |
| 8 | 10 | #define Z80DMA_TAG "u50" |
| r9922 | r9923 | |
| 22 | 24 | m_dart(*this, Z80DART_TAG), |
| 23 | 25 | m_dmac(*this, Z80DMA_TAG), |
| 24 | 26 | m_fdc(*this, MB8877_TAG), |
| 25 | m_ram(*this, | |
| 27 | m_ram(*this, RAM_TAG | |
| 26 | 28 | m_floppy0(*this, FLOPPY_0), |
| 27 | 29 | m_floppy1(*this, FLOPPY_1), |
| 28 | 30 | m_terminal(*this, TERMINAL_TAG), |
| r9922 | r9923 | |
|---|---|---|
| 2 | 2 | #define __KYOCERA__ |
| 3 | 3 | |
| 4 | 4 | #include "video/hd61830.h" |
| 5 | #include "machine/ram.h" | |
| 5 | 6 | |
| 6 | 7 | #define SCREEN_TAG "screen" |
| 7 | 8 | #define I8085_TAG "m19" |
| r9922 | r9923 | |
| 51 | 52 | m_centronics(*this, CENTRONICS_TAG), |
| 52 | 53 | m_speaker(*this, SPEAKER_TAG), |
| 53 | 54 | m_cassette(*this, CASSETTE_TAG), |
| 54 | m_ram(*this, | |
| 55 | m_ram(*this, RAM_TAG | |
| 55 | 56 | { } |
| 56 | 57 | |
| 57 | 58 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
| 145 | 146 | m_centronics(*this, CENTRONICS_TAG), |
| 146 | 147 | m_speaker(*this, SPEAKER_TAG), |
| 147 | 148 | m_cassette(*this, CASSETTE_TAG), |
| 148 | m_ram(*this, | |
| 149 | m_ram(*this, RAM_TAG | |
| 149 | 150 | { } |
| 150 | 151 | |
| 151 | 152 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 6 | 6 | #include "machine/cdp1871.h" |
| 7 | 7 | #include "devices/snapquik.h" |
| 8 | 8 | #include "machine/wd17xx.h" |
| 9 | #include "machine/ram.h" | |
| 9 | 10 | |
| 10 | 11 | #define SCREEN_TAG "screen" |
| 11 | 12 | #define MC6845_SCREEN_TAG "screen80" |
| r9922 | r9923 | |
| 49 | 50 | m_fdc(*this, WD1770_TAG), |
| 50 | 51 | m_kbe(*this, CDP1871_TAG), |
| 51 | 52 | m_cassette(*this, CASSETTE_TAG), |
| 52 | m_ram(*this, | |
| 53 | m_ram(*this, RAM_TAG | |
| 53 | 54 | { } |
| 54 | 55 | |
| 55 | 56 | required_device<cosmac_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 1 | 1 | #ifndef __XEROX820__ |
| 2 | 2 | #define __XEROX820__ |
| 3 | 3 | |
| 4 | #include "machine/ram.h" | |
| 5 | ||
| 4 | 6 | #define SCREEN_TAG "screen" |
| 5 | 7 | |
| 6 | 8 | #define Z80_TAG "u46" |
| r9922 | r9923 | |
| 24 | 26 | m_kbpio(*this, Z80KBPIO_TAG), |
| 25 | 27 | m_ctc(*this, Z80CTC_TAG), |
| 26 | 28 | m_fdc(*this, WD1771_TAG), |
| 27 | m_ram(*this, | |
| 29 | m_ram(*this, RAM_TAG | |
| 28 | 30 | m_floppy0(*this, FLOPPY_0), |
| 29 | 31 | m_floppy1(*this, FLOPPY_1) |
| 30 | 32 | { } |
| r9922 | r9923 | |
|---|---|---|
| 3 | 3 | #ifndef __OB68K1A__ |
| 4 | 4 | #define __OB68K1A__ |
| 5 | 5 | |
| 6 | #include "machine/ram.h" | |
| 7 | ||
| 6 | 8 | #define MC68000L10_TAG "u50" |
| 7 | 9 | #define MC6821_0_TAG "u32" |
| 8 | 10 | #define MC6821_1_TAG "u33" |
| r9922 | r9923 | |
| 23 | 25 | m_pia0(*this, MC6821_0_TAG), |
| 24 | 26 | m_pia1(*this, MC6821_1_TAG), |
| 25 | 27 | m_terminal(*this, TERMINAL_TAG), |
| 26 | m_ram(*this, | |
| 28 | m_ram(*this, RAM_TAG | |
| 27 | 29 | { } |
| 28 | 30 | |
| 29 | 31 | required_device<cpu_device> m_maincpu; |
| r9922 | r9923 | |
|---|---|---|
| 1 | 1 | #ifndef __TANDY2K__ |
| 2 | 2 | #define __TANDY2K__ |
| 3 | 3 | |
| 4 | #include "machine/ram.h" | |
| 5 | ||
| 4 | 6 | #define SCREEN_TAG "screen" |
| 5 | 7 | #define I80186_TAG "u76" |
| 6 | 8 | #define I8048_TAG "m1" |
| r9922 | r9923 | |
| 35 | 37 | m_vac(*this, CRT9021B_TAG), |
| 36 | 38 | m_centronics(*this, CENTRONICS_TAG), |
| 37 | 39 | m_speaker(*this, SPEAKER_TAG), |
| 38 | m_ram(*this, | |
| 40 | m_ram(*this, RAM_TAG | |
| 39 | 41 | m_floppy0(*this, FLOPPY_0), |
| 40 | 42 | m_floppy1(*this, FLOPPY_1) |
| 41 | 43 | { } |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "imageutl.h" |
| 11 | 11 | #include "formats/comx35_comx.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | /*************************************************************************** |
| 15 | 15 | PARAMETERS |
| r9922 | r9923 | |
| 52 | 52 | UINT8 header[16] = {0}; |
| 53 | 53 | int size = image.length(); |
| 54 | 54 | |
| 55 | if (size > | |
| 55 | if (size > | |
| 56 | 56 | { |
| 57 | 57 | return IMAGE_INIT_FAIL; |
| 58 | 58 | } |
| r9922 | r9923 | |
|---|---|---|
| 436 | 436 | $(MESS_FORMATS)/fdi_dsk.o \ |
| 437 | 437 | $(MESS_DEVICES)/flopdrv.o \ |
| 438 | 438 | $(MESS_DEVICES)/harddriv.o \ |
| 439 | $(MESS_DEVICES)/messram.o \ | |
| 440 | 439 | $(MESS_DEVICES)/microdrv.o \ |
| 441 | 440 | $(MESS_DEVICES)/multcart.o \ |
| 442 | 441 | $(MESS_DEVICES)/printer.o \ |
| r9922 | r9923 | |
|---|---|---|
| 231 | 231 | #include "video/cdp1861.h" |
| 232 | 232 | #include "video/cdp1862.h" |
| 233 | 233 | #include "machine/rescap.h" |
| 234 | #include " | |
| 234 | #include "ma | |
| 235 | 235 | |
| 236 | 236 | static QUICKLOAD_LOAD( vip ); |
| 237 | 237 | |
| r9922 | r9923 | |
| 261 | 261 | { |
| 262 | 262 | /* enable RAM */ |
| 263 | 263 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 264 | UINT8 *ram = | |
| 264 | UINT8 *ram = | |
| 265 | 265 | |
| 266 | switch ( | |
| 266 | switch ( | |
| 267 | 267 | { |
| 268 | 268 | case 1 * 1024: |
| 269 | 269 | memory_install_ram(program, 0x0000, 0x03ff, 0, 0x7c00, ram); |
| r9922 | r9923 | |
| 598 | 598 | |
| 599 | 599 | void vip_state::machine_start() |
| 600 | 600 | { |
| 601 | UINT8 *ram = | |
| 601 | UINT8 *ram = | |
| 602 | 602 | |
| 603 | 603 | /* randomize RAM contents */ |
| 604 | for (UINT16 addr = 0; addr < | |
| 604 | for (UINT16 addr = 0; addr < | |
| 605 | 605 | { |
| 606 | 606 | ram[addr] = machine->rand() & 0xff; |
| 607 | 607 | } |
| r9922 | r9923 | |
| 726 | 726 | MCFG_CASSETTE_ADD("cassette", vip_cassette_config) |
| 727 | 727 | |
| 728 | 728 | /* internal ram */ |
| 729 | MCFG_RAM_ADD( | |
| 729 | MCFG_RAM_ADD(RAM_TAG | |
| 730 | 730 | MCFG_RAM_DEFAULT_SIZE("2K") |
| 731 | 731 | MCFG_RAM_EXTRA_OPTIONS("4K") |
| 732 | 732 | MACHINE_CONFIG_END |
| 733 | 733 | |
| 734 | 734 | static MACHINE_CONFIG_DERIVED( vp111, vip ) |
| 735 | 735 | /* internal ram */ |
| 736 | MCFG_RAM_MODIFY( | |
| 736 | MCFG_RAM_MODIFY(RAM_TAG | |
| 737 | 737 | MCFG_RAM_DEFAULT_SIZE("1K") |
| 738 | 738 | MCFG_RAM_EXTRA_OPTIONS("2K,4K") |
| 739 | 739 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 778 | 778 | chip8_size = image.device().machine->region("chip8x")->bytes(); |
| 779 | 779 | } |
| 780 | 780 | |
| 781 | if ((size + chip8_size) > | |
| 781 | if ((size + chip8_size) > | |
| 782 | 782 | { |
| 783 | 783 | return IMAGE_INIT_FAIL; |
| 784 | 784 | } |
| r9922 | r9923 | |
|---|---|---|
| 46 | 46 | #include "formats/coco_dsk.h" |
| 47 | 47 | #include "devices/flopdrv.h" |
| 48 | 48 | #include "devices/coco_vhd.h" |
| 49 | #include " | |
| 49 | #include "ma | |
| 50 | 50 | |
| 51 | 51 | /* |
| 52 | 52 | Colour codes are as below acording to os-9 headers, however the presise values |
| r9922 | r9923 | |
| 351 | 351 | MCFG_FLOPPY_4_DRIVES_ADD(dgnbeta_floppy_config) |
| 352 | 352 | |
| 353 | 353 | /* internal ram */ |
| 354 | MCFG_RAM_ADD( | |
| 354 | MCFG_RAM_ADD(RAM_TAG | |
| 355 | 355 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 356 | 356 | MCFG_RAM_EXTRA_OPTIONS("128K,384K,512K,640K,768K") |
| 357 | 357 | /* Ram size can now be configured, since the machine was known as either the Dragon Beta or */ |
| r9922 | r9923 | |
|---|---|---|
| 22 | 22 | #include "video/dm9368.h" |
| 23 | 23 | #include "machine/rescap.h" |
| 24 | 24 | #include "elf2.lh" |
| 25 | #include " | |
| 25 | #include "ma | |
| 26 | 26 | |
| 27 | 27 | #define RUN(_machine) BIT(input_port_read((_machine), "SPECIAL"), 0) |
| 28 | 28 | #define LOAD(_machine) BIT(input_port_read((_machine), "SPECIAL"), 1) |
| r9922 | r9923 | |
| 65 | 65 | if (MEMORY_PROTECT(space->machine)) |
| 66 | 66 | { |
| 67 | 67 | /* latch data from memory */ |
| 68 | data = | |
| 68 | data = | |
| 69 | 69 | } |
| 70 | 70 | else |
| 71 | 71 | { |
| 72 | 72 | /* write latched data to memory */ |
| 73 | | |
| 73 | | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /* write data to 7 segment displays */ |
| r9922 | r9923 | |
| 274 | 274 | /* setup memory banking */ |
| 275 | 275 | memory_install_read_bank(program, 0x0000, 0x00ff, 0, 0, "bank1"); |
| 276 | 276 | memory_install_write8_handler(program, 0x0000, 0x00ff, 0, 0, memory_w); |
| 277 | memory_configure_bank(machine, "bank1", 0, 1, | |
| 277 | memory_configure_bank(machine, "bank1", 0, 1, | |
| 278 | 278 | memory_set_bank(machine, "bank1", 0); |
| 279 | 279 | |
| 280 | 280 | /* register for state saving */ |
| r9922 | r9923 | |
| 320 | 320 | MCFG_QUICKLOAD_ADD("quickload", elf, "bin", 0) |
| 321 | 321 | |
| 322 | 322 | /* internal ram */ |
| 323 | MCFG_RAM_ADD( | |
| 323 | MCFG_RAM_ADD(RAM_TAG | |
| 324 | 324 | MCFG_RAM_DEFAULT_SIZE("256") |
| 325 | 325 | MACHINE_CONFIG_END |
| 326 | 326 | |
| r9922 | r9923 | |
| 336 | 336 | { |
| 337 | 337 | int size = image.length(); |
| 338 | 338 | |
| 339 | if (size > | |
| 339 | if (size > | |
| 340 | 340 | { |
| 341 | 341 | return IMAGE_INIT_FAIL; |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | image.fread( | |
| 344 | image.fread( | |
| 345 | 345 | |
| 346 | 346 | return IMAGE_INIT_PASS; |
| 347 | 347 | } |
| r9922 | r9923 | |
|---|---|---|
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include " | |
| 10 | #include "ma | |
| 11 | 11 | #include "cpu/mcs51/mcs51.h" |
| 12 | 12 | |
| 13 | 13 | |
| r9922 | r9923 | |
| 88 | 88 | // On the board there are two M5M44256BJ-7 chips |
| 89 | 89 | // Which are DRAM 256K x 4bit |
| 90 | 90 | /* internal ram */ |
| 91 | MCFG_RAM_ADD( | |
| 91 | MCFG_RAM_ADD(RAM_TAG | |
| 92 | 92 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 93 | 93 | MACHINE_CONFIG_END |
| 94 | 94 |
| r9922 | r9923 | |
|---|---|---|
| 7 | 7 | #include "machine/upd1990a.h" |
| 8 | 8 | #include "video/sed1330.h" |
| 9 | 9 | #include "video/mc6845.h" |
| 10 | #include " | |
| 10 | #include "ma | |
| 11 | 11 | |
| 12 | 12 | /* |
| 13 | 13 | |
| r9922 | r9923 | |
| 142 | 142 | break; |
| 143 | 143 | |
| 144 | 144 | case 3: /* RAM cartridge */ |
| 145 | if ( | |
| 145 | if ( | |
| 146 | 146 | { |
| 147 | 147 | memory_install_readwrite_bank(program, 0x8000, 0xbfff, 0, 0, "bank3"); |
| 148 | 148 | memory_set_bank(machine, "bank3", 3); // TODO or 4 |
| r9922 | r9923 | |
| 527 | 527 | |
| 528 | 528 | /* set up A0/A1 memory banking */ |
| 529 | 529 | memory_configure_bank(machine, "bank1", 0, 4, machine->region(Z80_TAG)->base(), 0x8000); |
| 530 | memory_configure_bank(machine, "bank1", 4, 2, | |
| 530 | memory_configure_bank(machine, "bank1", 4, 2, | |
| 531 | 531 | memory_set_bank(machine, "bank1", 0); |
| 532 | 532 | |
| 533 | 533 | /* set up A2 memory banking */ |
| 534 | memory_configure_bank(machine, "bank3", 0, 5, | |
| 534 | memory_configure_bank(machine, "bank3", 0, 5, | |
| 535 | 535 | memory_set_bank(machine, "bank3", 0); |
| 536 | 536 | |
| 537 | 537 | /* set up A3 memory banking */ |
| 538 | memory_configure_bank(machine, "bank4", 0, 1, | |
| 538 | memory_configure_bank(machine, "bank4", 0, 1, | |
| 539 | 539 | memory_configure_bank(machine, "bank4", 1, 1, state->crt_ram, 0); |
| 540 | 540 | memory_set_bank(machine, "bank4", 0); |
| 541 | 541 | |
| 542 | 542 | /* set up A4 memory banking */ |
| 543 | memory_configure_bank(machine, "bank5", 0, 1, | |
| 543 | memory_configure_bank(machine, "bank5", 0, 1, | |
| 544 | 544 | memory_set_bank(machine, "bank5", 0); |
| 545 | 545 | |
| 546 | 546 | /* bank switch */ |
| r9922 | r9923 | |
| 669 | 669 | MCFG_CARTSLOT_NOT_MANDATORY |
| 670 | 670 | |
| 671 | 671 | /* internal ram */ |
| 672 | MCFG_RAM_ADD( | |
| 672 | MCFG_RAM_ADD(RAM_TAG | |
| 673 | 673 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 674 | 674 | MCFG_RAM_EXTRA_OPTIONS("96K") |
| 675 | 675 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 690 | 690 | MCFG_FRAGMENT_ADD(pc8500_video) |
| 691 | 691 | |
| 692 | 692 | /* internal ram */ |
| 693 | MCFG_RAM_MODIFY( | |
| 693 | MCFG_RAM_MODIFY(RAM_TAG | |
| 694 | 694 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 695 | 695 | MACHINE_CONFIG_END |
| 696 | 696 |
| r9922 | r9923 | |
|---|---|---|
| 18 | 18 | #include "formats/ap2_dsk.h" |
| 19 | 19 | #include "machine/6551.h" |
| 20 | 20 | #include "machine/6522via.h" |
| 21 | #include " | |
| 21 | #include "ma | |
| 22 | 22 | #include "devices/appldriv.h" |
| 23 | 23 | |
| 24 | 24 | static ADDRESS_MAP_START( apple3_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| r9922 | r9923 | |
| 109 | 109 | MCFG_VIA6522_ADD("via6522_1", 2000000, apple3_via_1_intf) |
| 110 | 110 | |
| 111 | 111 | /* internal ram */ |
| 112 | MCFG_RAM_ADD( | |
| 112 | MCFG_RAM_ADD(RAM_TAG | |
| 113 | 113 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 114 | 114 | MACHINE_CONFIG_END |
| 115 | 115 |
| r9922 | r9923 | |
|---|---|---|
| 14 | 14 | #include "machine/6821pia.h" |
| 15 | 15 | #include "machine/z80dart.h" |
| 16 | 16 | #include "machine/pit8253.h" |
| 17 | #include " | |
| 17 | #include "ma | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #define MAIN_CLOCK 23961600 |
| r9922 | r9923 | |
| 27 | 27 | : driver_device(machine, config), |
| 28 | 28 | maincpu( *this, "maincpu" ), |
| 29 | 29 | mb8877( *this, "mb8877" ), |
| 30 | messram( *this, | |
| 30 | messram( *this, RAM_TAG | |
| 31 | 31 | pia_0( *this, "pia_0" ), |
| 32 | 32 | pia_1( *this, "pia_1" ), |
| 33 | 33 | sio( *this, "sio" ), |
| r9922 | r9923 | |
| 65 | 65 | |
| 66 | 66 | void set_banks(running_machine *machine) |
| 67 | 67 | { |
| 68 | UINT8 * | |
| 68 | UINT8 * | |
| 69 | 69 | |
| 70 | ram_0000 = | |
| 70 | ram_0000 = | |
| 71 | 71 | |
| 72 | 72 | if ( pia0_porta & 0x01 ) |
| 73 | 73 | ram_0000 += 0x10000; |
| r9922 | r9923 | |
| 82 | 82 | { |
| 83 | 83 | memory_set_bankptr( machine, "0000", machine->region("maincpu")->base()); |
| 84 | 84 | /* When BIOS is enabled 2000-3FFF is set to the "ROM RAM" */ |
| 85 | memory_set_bankptr( machine, "2000", | |
| 85 | memory_set_bankptr( machine, "2000", | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if ( pia0_porta & 0x40 ) |
| r9922 | r9923 | |
| 654 | 654 | MCFG_FLOPPY_2_DRIVES_ADD(osbexec_floppy_config) |
| 655 | 655 | |
| 656 | 656 | /* internal ram */ |
| 657 | MCFG_RAM_ADD( | |
| 657 | MCFG_RAM_ADD(RAM_TAG | |
| 658 | 658 | MCFG_RAM_DEFAULT_SIZE("136K") /* 128KB Main RAM + RAM in ROM bank (8) */ |
| 659 | 659 | MACHINE_CONFIG_END |
| 660 | 660 |
| r9922 | r9923 | |
|---|---|---|
| 66 | 66 | #include "includes/c64.h" |
| 67 | 67 | #include "includes/c65.h" |
| 68 | 68 | #include "machine/cbmiec.h" |
| 69 | #include " | |
| 69 | #include "ma | |
| 70 | 70 | |
| 71 | 71 | /************************************* |
| 72 | 72 | * |
| r9922 | r9923 | |
| 328 | 328 | MCFG_FRAGMENT_ADD(c64_cartslot) |
| 329 | 329 | |
| 330 | 330 | /* internal ram */ |
| 331 | MCFG_RAM_ADD( | |
| 331 | MCFG_RAM_ADD(RAM_TAG | |
| 332 | 332 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 333 | 333 | MCFG_RAM_EXTRA_OPTIONS("640K,4224K") |
| 334 | 334 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 66 | 66 | #include "machine/pit8253.h" |
| 67 | 67 | #include "machine/tms5501.h" |
| 68 | 68 | #include "devices/cassette.h" |
| 69 | #include " | |
| 69 | #include "ma | |
| 70 | 70 | |
| 71 | 71 | /* I/O ports */ |
| 72 | 72 | static ADDRESS_MAP_START( dai_io , ADDRESS_SPACE_IO, 8) |
| r9922 | r9923 | |
| 245 | 245 | MCFG_TMS5501_ADD( "tms5501", dai_tms5501_interface ) |
| 246 | 246 | |
| 247 | 247 | /* internal ram */ |
| 248 | MCFG_RAM_ADD( | |
| 248 | MCFG_RAM_ADD(RAM_TAG | |
| 249 | 249 | MCFG_RAM_DEFAULT_SIZE("48K") |
| 250 | 250 | MACHINE_CONFIG_END |
| 251 | 251 |
| r9922 | r9923 | |
|---|---|---|
| 28 | 28 | #include "sound/ay8910.h" |
| 29 | 29 | #include "machine/ctronics.h" |
| 30 | 30 | #include "machine/rescap.h" |
| 31 | #include " | |
| 31 | #include "ma | |
| 32 | 32 | |
| 33 | 33 | /* Memory Banking */ |
| 34 | 34 | |
| r9922 | r9923 | |
| 41 | 41 | memory_set_bank(machine, "bank2", state->mc6845_bank); |
| 42 | 42 | |
| 43 | 43 | /* extended RAM */ |
| 44 | if ( | |
| 44 | if ( | |
| 45 | 45 | { |
| 46 | 46 | memory_install_readwrite_bank(program, 0x4000, 0x7fff, 0, 0, "bank3"); |
| 47 | 47 | } |
| r9922 | r9923 | |
| 53 | 53 | /* MC6847 video RAM */ |
| 54 | 54 | if (state->mc6847_bank) |
| 55 | 55 | { |
| 56 | if ( | |
| 56 | if ( | |
| 57 | 57 | { |
| 58 | 58 | memory_install_readwrite_bank(program, 0x8000, 0x97ff, 0, 0, "bank4"); |
| 59 | 59 | } |
| r9922 | r9923 | |
| 70 | 70 | memory_set_bank(machine, "bank4", state->mc6847_bank); |
| 71 | 71 | |
| 72 | 72 | /* extended RAM */ |
| 73 | if ( | |
| 73 | if ( | |
| 74 | 74 | { |
| 75 | 75 | memory_install_readwrite_bank(program, 0x9800, 0xbfff, 0, 0, "bank5"); |
| 76 | 76 | } |
| r9922 | r9923 | |
| 532 | 532 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics) |
| 533 | 533 | |
| 534 | 534 | /* internal ram */ |
| 535 | MCFG_RAM_ADD( | |
| 535 | MCFG_RAM_ADD(RAM_TAG | |
| 536 | 536 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 537 | 537 | MCFG_RAM_EXTRA_OPTIONS("48K") |
| 538 | 538 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | #include "emu.h" |
| 15 | 15 | #include "cpu/m68000/m68000.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | #include "machine/wd17xx.h" |
| 18 | 18 | #include "devices/flopdrv.h" |
| 19 | 19 | #include "unixpc.lh" |
| r9922 | r9923 | |
| 29 | 29 | unixpc_state(running_machine &machine, const driver_device_config_base &config) |
| 30 | 30 | : driver_device(machine, config), |
| 31 | 31 | m_maincpu(*this, "maincpu"), |
| 32 | m_ram(*this, | |
| 32 | m_ram(*this, RAM_TAG | |
| 33 | 33 | m_wd2797(*this, "wd2797"), |
| 34 | 34 | m_floppy(*this, FLOPPY_0) |
| 35 | 35 | { } |
| r9922 | r9923 | |
| 63 | 63 | WRITE16_MEMBER( unixpc_state::romlmap_w ) |
| 64 | 64 | { |
| 65 | 65 | if (BIT(data, 15)) |
| 66 | memory_install_ram(&space, 0x000000, 0x3fffff, 0, 0, | |
| 66 | memory_install_ram(&space, 0x000000, 0x3fffff, 0, 0, | |
| 67 | 67 | else |
| 68 | 68 | memory_install_rom(&space, 0x000000, 0x3fffff, 0, 0, space.machine->region("bootrom")->base()); |
| 69 | 69 | } |
| r9922 | r9923 | |
| 215 | 215 | MCFG_PALETTE_INIT(black_and_white) |
| 216 | 216 | |
| 217 | 217 | // internal ram |
| 218 | MCFG_RAM_ADD( | |
| 218 | MCFG_RAM_ADD(RAM_TAG | |
| 219 | 219 | MCFG_RAM_DEFAULT_SIZE("1M") |
| 220 | 220 | MCFG_RAM_EXTRA_OPTIONS("2M") |
| 221 | 221 |
| r9922 | r9923 | |
|---|---|---|
| 45 | 45 | #include "devices/coco_vhd.h" |
| 46 | 46 | #include "sound/ay8910.h" |
| 47 | 47 | #include "sound/dac.h" |
| 48 | #include " | |
| 48 | #include "ma | |
| 49 | 49 | #include "coco3.lh" |
| 50 | 50 | |
| 51 | 51 | #define SHOW_FULL_AREA 0 |
| r9922 | r9923 | |
| 792 | 792 | MCFG_DRAGON_CARTRIDGE_NMI_CALLBACK(coco_nmi_w) |
| 793 | 793 | |
| 794 | 794 | /* internal ram */ |
| 795 | MCFG_RAM_ADD( | |
| 795 | MCFG_RAM_ADD(RAM_TAG | |
| 796 | 796 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 797 | 797 | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 798 | 798 | |
| r9922 | r9923 | |
| 841 | 841 | MCFG_DRAGON_CARTRIDGE_NMI_CALLBACK(coco_nmi_w) |
| 842 | 842 | |
| 843 | 843 | /* internal ram */ |
| 844 | MCFG_RAM_ADD( | |
| 844 | MCFG_RAM_ADD(RAM_TAG | |
| 845 | 845 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 846 | 846 | |
| 847 | 847 | MCFG_FLOPPY_4_DRIVES_ADD(coco_floppy_config) |
| r9922 | r9923 | |
| 890 | 890 | MCFG_DRAGON_CARTRIDGE_NMI_CALLBACK(coco_nmi_w) |
| 891 | 891 | |
| 892 | 892 | /* internal ram */ |
| 893 | MCFG_RAM_ADD( | |
| 893 | MCFG_RAM_ADD(RAM_TAG | |
| 894 | 894 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 895 | 895 | |
| 896 | 896 | MCFG_FLOPPY_4_DRIVES_ADD(coco_floppy_config) |
| r9922 | r9923 | |
| 949 | 949 | MCFG_FLOPPY_4_DRIVES_ADD(coco_floppy_config) |
| 950 | 950 | |
| 951 | 951 | /* internal ram */ |
| 952 | MCFG_RAM_ADD( | |
| 952 | MCFG_RAM_ADD(RAM_TAG | |
| 953 | 953 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 954 | 954 | MACHINE_CONFIG_END |
| 955 | 955 | |
| r9922 | r9923 | |
| 996 | 996 | MCFG_DRAGON_CARTRIDGE_NMI_CALLBACK(coco_nmi_w) |
| 997 | 997 | |
| 998 | 998 | /* internal ram */ |
| 999 | MCFG_RAM_ADD( | |
| 999 | MCFG_RAM_ADD(RAM_TAG | |
| 1000 | 1000 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1001 | 1001 | |
| 1002 | 1002 | MCFG_FLOPPY_4_DRIVES_ADD(coco_floppy_config) |
| r9922 | r9923 | |
| 1043 | 1043 | MCFG_COCO_CARTRIDGE_NMI_CALLBACK(coco_nmi_w) |
| 1044 | 1044 | |
| 1045 | 1045 | /* internal ram */ |
| 1046 | MCFG_RAM_ADD( | |
| 1046 | MCFG_RAM_ADD(RAM_TAG | |
| 1047 | 1047 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1048 | 1048 | MCFG_RAM_EXTRA_OPTIONS("4K,32K,64K") |
| 1049 | 1049 | |
| r9922 | r9923 | |
| 1090 | 1090 | MCFG_COCO_CARTRIDGE_NMI_CALLBACK(coco_nmi_w) |
| 1091 | 1091 | |
| 1092 | 1092 | /* internal ram */ |
| 1093 | MCFG_RAM_ADD( | |
| 1093 | MCFG_RAM_ADD(RAM_TAG | |
| 1094 | 1094 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1095 | 1095 | MCFG_RAM_EXTRA_OPTIONS("16K") |
| 1096 | 1096 | |
| r9922 | r9923 | |
| 1137 | 1137 | MCFG_COCO_CARTRIDGE_NMI_CALLBACK(coco_nmi_w) |
| 1138 | 1138 | |
| 1139 | 1139 | /* internal ram */ |
| 1140 | MCFG_RAM_ADD( | |
| 1140 | MCFG_RAM_ADD(RAM_TAG | |
| 1141 | 1141 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1142 | 1142 | MCFG_RAM_EXTRA_OPTIONS("16K") |
| 1143 | 1143 | |
| r9922 | r9923 | |
| 1196 | 1196 | MCFG_COCO_CARTRIDGE_NMI_CALLBACK(coco_nmi_w) |
| 1197 | 1197 | |
| 1198 | 1198 | /* internal ram */ |
| 1199 | MCFG_RAM_ADD( | |
| 1199 | MCFG_RAM_ADD(RAM_TAG | |
| 1200 | 1200 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 1201 | 1201 | MCFG_RAM_EXTRA_OPTIONS("128K,2M,8M") |
| 1202 | 1202 | |
| r9922 | r9923 | |
| 1222 | 1222 | static MACHINE_CONFIG_DERIVED( cocoe, coco ) |
| 1223 | 1223 | |
| 1224 | 1224 | /* internal ram */ |
| 1225 | MCFG_RAM_MODIFY( | |
| 1225 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1226 | 1226 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1227 | 1227 | MCFG_RAM_EXTRA_OPTIONS("4K,16K,32K") |
| 1228 | 1228 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "sound/ay8910.h" |
| 14 | 14 | #include "sound/wave.h" |
| 15 | 15 | #include "devices/cassette.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | class spc1000_state : public driver_device |
| r9922 | r9923 | |
| 43 | 43 | memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base()); |
| 44 | 44 | memory_set_bankptr(space->machine, "bank3", space->machine->region("maincpu")->base()); |
| 45 | 45 | } else { |
| 46 | memory_set_bankptr(space->machine, "bank1", messram_get_ptr(space->machine->device("messram"))); | |
| 47 | memory_set_bankptr(space->machine, "bank3", messram_get_ptr(space->machine->device("messram")) + 0x8000); | |
| 46 | memory_set_bankptr(space->machine, "bank1", ram_get_ptr(space->machine->device(RAM_TAG))); | |
| 47 | memory_set_bankptr(space->machine, "bank3", ram_get_ptr(space->machine->device(RAM_TAG)) + 0x8000); | |
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| r9922 | r9923 | |
| 56 | 56 | memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base()); |
| 57 | 57 | memory_set_bankptr(space->machine, "bank3", space->machine->region("maincpu")->base()); |
| 58 | 58 | } else { |
| 59 | memory_set_bankptr(space->machine, "bank1", messram_get_ptr(space->machine->device("messram"))); | |
| 60 | memory_set_bankptr(space->machine, "bank3", messram_get_ptr(space->machine->device("messram")) + 0x8000); | |
| 59 | memory_set_bankptr(space->machine, "bank1", ram_get_ptr(space->machine->device(RAM_TAG))); | |
| 60 | memory_set_bankptr(space->machine, "bank3", ram_get_ptr(space->machine->device(RAM_TAG)) + 0x8000); | |
| 61 | 61 | } |
| 62 | 62 | return 0; |
| 63 | 63 | } |
| r9922 | r9923 | |
| 220 | 220 | memory_install_write_bank(space, 0x8000, 0xffff, 0, 0, "bank4"); |
| 221 | 221 | |
| 222 | 222 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base()); |
| 223 | memory_set_bankptr(machine, "bank2", | |
| 223 | memory_set_bankptr(machine, "bank2", | |
| 224 | 224 | memory_set_bankptr(machine, "bank3", machine->region("maincpu")->base()); |
| 225 | memory_set_bankptr(machine, "bank4", | |
| 225 | memory_set_bankptr(machine, "bank4", | |
| 226 | 226 | |
| 227 | 227 | state->IPLK = 1; |
| 228 | 228 | } |
| r9922 | r9923 | |
| 327 | 327 | MCFG_CASSETTE_ADD( "cassette", spc1000_cassette_config ) |
| 328 | 328 | |
| 329 | 329 | /* internal ram */ |
| 330 | MCFG_RAM_ADD( | |
| 330 | MCFG_RAM_ADD(RAM_TAG | |
| 331 | 331 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 332 | 332 | MACHINE_CONFIG_END |
| 333 | 333 |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "includes/pc1251.h" |
| 13 | 13 | #include "includes/pc1350.h" |
| 14 | 14 | #include "includes/pc1403.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | /* pc1430 no peek poke operations! */ |
| 18 | 18 | |
| r9922 | r9923 | |
| 859 | 859 | MCFG_VIDEO_UPDATE( pc1350 ) |
| 860 | 860 | |
| 861 | 861 | /* internal ram */ |
| 862 | MCFG_RAM_ADD( | |
| 862 | MCFG_RAM_ADD(RAM_TAG | |
| 863 | 863 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 864 | 864 | MCFG_RAM_EXTRA_OPTIONS("12K,20K") |
| 865 | 865 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 436 | 436 | ***************************************************************************/ |
| 437 | 437 | |
| 438 | 438 | #include "emu.h" |
| 439 | #include "machine/ram.h" | |
| 439 | 440 | #include "cpu/lr35902/lr35902.h" |
| 440 | 441 | #include "devices/cartslot.h" |
| 441 | #include "devices/messram.h" | |
| 442 | 442 | #include "rendlay.h" |
| 443 | 443 | #include "audio/gb.h" |
| 444 | 444 | #include "includes/gb.h" |
| r9922 | r9923 | |
| 640 | 640 | MCFG_PALETTE_INIT(gbc) |
| 641 | 641 | |
| 642 | 642 | /* internal ram */ |
| 643 | MCFG_RAM_ADD( | |
| 643 | MCFG_RAM_ADD(RAM_TAG | |
| 644 | 644 | MCFG_RAM_DEFAULT_SIZE("48K") /* 2 pages of 8KB VRAM, 8 pages of 4KB RAM */ |
| 645 | 645 | |
| 646 | 646 | MCFG_CARTSLOT_ADD("cart") |
| r9922 | r9923 | |
|---|---|---|
| 22 | 22 | #include "cpu/z80/z80.h" |
| 23 | 23 | #include "formats/basicdsk.h" |
| 24 | 24 | #include "devices/flopdrv.h" |
| 25 | #include " | |
| 25 | #include "ma | |
| 26 | 26 | #include "machine/com8116.h" |
| 27 | 27 | #include "machine/ctronics.h" |
| 28 | 28 | #include "machine/i8255a.h" |
| r9922 | r9923 | |
| 44 | 44 | void xor100_state::bankswitch() |
| 45 | 45 | { |
| 46 | 46 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 47 | int banks = | |
| 47 | int banks = | |
| 48 | 48 | |
| 49 | 49 | switch (m_mode) |
| 50 | 50 | { |
| r9922 | r9923 | |
| 518 | 518 | |
| 519 | 519 | void xor100_state::machine_start() |
| 520 | 520 | { |
| 521 | int banks = messram_get_size(m_ram) / 0x10000; | |
| 522 | UINT8 *ram = messram_get_ptr(m_ram); | |
| 521 | int banks = ram_get_size(m_ram) / 0x10000; | |
| 522 | UINT8 *ram = ram_get_ptr(m_ram); | |
| 523 | 523 | UINT8 *rom = machine->region(Z80_TAG)->base(); |
| 524 | 524 | |
| 525 | 525 | /* setup memory banking */ |
| r9922 | r9923 | |
| 579 | 579 | MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, xor100_terminal_intf) |
| 580 | 580 | |
| 581 | 581 | /* internal ram */ |
| 582 | MCFG_RAM_ADD( | |
| 582 | MCFG_RAM_ADD(RAM_TAG | |
| 583 | 583 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 584 | 584 | MCFG_RAM_EXTRA_OPTIONS("128K,192K,256K,320K,384K,448K,512K") |
| 585 | 585 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 14 | 14 | #include "includes/mc68328.h" |
| 15 | 15 | #include "sound/dac.h" |
| 16 | 16 | #include "debugger.h" |
| 17 | #include " | |
| 17 | #include "ma | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | class palm_state : public driver_device |
| r9922 | r9923 | |
| 107 | 107 | { |
| 108 | 108 | palm_state *state = machine->driver_data<palm_state>(); |
| 109 | 109 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 110 | memory_install_read_bank (space, 0x000000, messram_get_size(machine->device("messram")) - 1, messram_get_size(machine->device("messram")) - 1, 0, "bank1"); | |
| 111 | memory_install_write_bank(space, 0x000000, messram_get_size(machine->device("messram")) - 1, messram_get_size(machine->device("messram")) - 1, 0, "bank1"); | |
| 112 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 110 | memory_install_read_bank (space, 0x000000, ram_get_size(machine->device(RAM_TAG)) - 1, ram_get_size(machine->device(RAM_TAG)) - 1, 0, "bank1"); | |
| 111 | memory_install_write_bank(space, 0x000000, ram_get_size(machine->device(RAM_TAG)) - 1, ram_get_size(machine->device(RAM_TAG)) - 1, 0, "bank1"); | |
| 112 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 113 | 113 | |
| 114 | 114 | state_save_register_global(machine, state->port_f_latch); |
| 115 | 115 | state_save_register_global(machine, state->spim_data); |
| r9922 | r9923 | |
| 122 | 122 | { |
| 123 | 123 | // Copy boot ROM |
| 124 | 124 | UINT8* bios = machine->region("bios")->base(); |
| 125 | memset(messram_get_ptr(machine->device("messram")), 0, messram_get_size(machine->device("messram"))); | |
| 126 | memcpy(messram_get_ptr(machine->device("messram")), bios, 0x20000); | |
| 125 | memset(ram_get_ptr(machine->device(RAM_TAG)), 0, ram_get_size(machine->device(RAM_TAG))); | |
| 126 | memcpy(ram_get_ptr(machine->device(RAM_TAG)), bios, 0x20000); | |
| 127 | 127 | |
| 128 | 128 | machine->device("maincpu")->reset(); |
| 129 | 129 | } |
| r9922 | r9923 | |
| 435 | 435 | static MACHINE_CONFIG_DERIVED( pilot1k, palm ) |
| 436 | 436 | |
| 437 | 437 | /* internal ram */ |
| 438 | MCFG_RAM_ADD( | |
| 438 | MCFG_RAM_ADD(RAM_TAG | |
| 439 | 439 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 440 | 440 | MCFG_RAM_EXTRA_OPTIONS("512K,1M,2M,4M,8M") |
| 441 | 441 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 443 | 443 | static MACHINE_CONFIG_DERIVED( pilot5k, palm ) |
| 444 | 444 | |
| 445 | 445 | /* internal ram */ |
| 446 | MCFG_RAM_ADD( | |
| 446 | MCFG_RAM_ADD(RAM_TAG | |
| 447 | 447 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 448 | 448 | MCFG_RAM_EXTRA_OPTIONS("1M,2M,4M,8M") |
| 449 | 449 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 451 | 451 | static MACHINE_CONFIG_DERIVED( palmpro, palm ) |
| 452 | 452 | |
| 453 | 453 | /* internal ram */ |
| 454 | MCFG_RAM_ADD( | |
| 454 | MCFG_RAM_ADD(RAM_TAG | |
| 455 | 455 | MCFG_RAM_DEFAULT_SIZE("1M") |
| 456 | 456 | MCFG_RAM_EXTRA_OPTIONS("2M,4M,8M") |
| 457 | 457 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 459 | 459 | static MACHINE_CONFIG_DERIVED( palmiii, palm ) |
| 460 | 460 | |
| 461 | 461 | /* internal ram */ |
| 462 | MCFG_RAM_ADD( | |
| 462 | MCFG_RAM_ADD(RAM_TAG | |
| 463 | 463 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 464 | 464 | MCFG_RAM_EXTRA_OPTIONS("4M,8M") |
| 465 | 465 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 467 | 467 | static MACHINE_CONFIG_DERIVED( palmv, palm ) |
| 468 | 468 | |
| 469 | 469 | /* internal ram */ |
| 470 | MCFG_RAM_ADD( | |
| 470 | MCFG_RAM_ADD(RAM_TAG | |
| 471 | 471 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 472 | 472 | MCFG_RAM_EXTRA_OPTIONS("4M,8M") |
| 473 | 473 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 475 | 475 | static MACHINE_CONFIG_DERIVED( palmvx, palm ) |
| 476 | 476 | |
| 477 | 477 | /* internal ram */ |
| 478 | MCFG_RAM_ADD( | |
| 478 | MCFG_RAM_ADD(RAM_TAG | |
| 479 | 479 | MCFG_RAM_DEFAULT_SIZE("8M") |
| 480 | 480 | MACHINE_CONFIG_END |
| 481 | 481 |
| r9922 | r9923 | |
|---|---|---|
| 90 | 90 | #include "cpu/cosmac/cosmac.h" |
| 91 | 91 | #include "sound/cdp1869.h" |
| 92 | 92 | #include "includes/tmc600.h" |
| 93 | #include " | |
| 93 | #include "ma | |
| 94 | 94 | |
| 95 | 95 | /* Read/Write Handlers */ |
| 96 | 96 | |
| r9922 | r9923 | |
| 252 | 252 | address_space *program = cputag_get_address_space(machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM); |
| 253 | 253 | |
| 254 | 254 | /* configure RAM */ |
| 255 | switch ( | |
| 255 | switch ( | |
| 256 | 256 | { |
| 257 | 257 | case 8*1024: |
| 258 | 258 | memory_unmap_readwrite(program, 0x8000, 0xbfff, 0, 0); |
| r9922 | r9923 | |
| 305 | 305 | MCFG_FLOPPY_2_DRIVES_ADD(tmc600_floppy_config) |
| 306 | 306 | |
| 307 | 307 | /* internal ram */ |
| 308 | MCFG_RAM_ADD( | |
| 308 | MCFG_RAM_ADD(RAM_TAG | |
| 309 | 309 | MCFG_RAM_DEFAULT_SIZE("8K") |
| 310 | 310 | MCFG_RAM_EXTRA_OPTIONS("16K,24K") |
| 311 | 311 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 17 | 17 | #include "machine/wd17xx.h" |
| 18 | 18 | #include "devices/flopdrv.h" |
| 19 | 19 | #include "formats/basicdsk.h" |
| 20 | #include " | |
| 20 | #include "ma | |
| 21 | 21 | #include "includes/b2m.h" |
| 22 | 22 | |
| 23 | 23 | |
| r9922 | r9923 | |
| 244 | 244 | MCFG_FLOPPY_2_DRIVES_ADD(b2m_floppy_config) |
| 245 | 245 | |
| 246 | 246 | /* internal ram */ |
| 247 | MCFG_RAM_ADD( | |
| 247 | MCFG_RAM_ADD(RAM_TAG | |
| 248 | 248 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 249 | 249 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 250 | 250 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 20 | 20 | #include "machine/6532riot.h" |
| 21 | 21 | #include "machine/6821pia.h" |
| 22 | 22 | #include "devices/cartslot.h" |
| 23 | #include " | |
| 23 | #include "ma | |
| 24 | 24 | #include "aim65.lh" |
| 25 | 25 | |
| 26 | 26 | |
| r9922 | r9923 | |
| 222 | 222 | MCFG_CARTSLOT_NOT_MANDATORY |
| 223 | 223 | |
| 224 | 224 | /* internal ram */ |
| 225 | MCFG_RAM_ADD( | |
| 225 | MCFG_RAM_ADD(RAM_TAG | |
| 226 | 226 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 227 | 227 | MCFG_RAM_EXTRA_OPTIONS("1K,2K,3K") |
| 228 | 228 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 77 | 77 | #include "formats/cbm_snqk.h" |
| 78 | 78 | #include "cpu/m6502/m6502.h" |
| 79 | 79 | #include "devices/cartslot.h" |
| 80 | #include " | |
| 80 | #include "ma | |
| 81 | 81 | #include "machine/6522via.h" |
| 82 | 82 | #include "machine/c1541.h" |
| 83 | 83 | #include "machine/cbmiec.h" |
| r9922 | r9923 | |
| 532 | 532 | state->via1->set_unscaled_clock(cputag_get_clock(machine, M6502_TAG)); |
| 533 | 533 | |
| 534 | 534 | /* memory expansions */ |
| 535 | switch ( | |
| 535 | switch ( | |
| 536 | 536 | { |
| 537 | 537 | case 32*1024: |
| 538 | 538 | memory_install_ram(program, 0x6000, 0x7fff, 0, 0, NULL); |
| r9922 | r9923 | |
| 707 | 707 | MCFG_SOFTWARE_LIST_ADD("cart_list","vic1001_cart") |
| 708 | 708 | |
| 709 | 709 | /* internal ram */ |
| 710 | MCFG_RAM_ADD( | |
| 710 | MCFG_RAM_ADD(RAM_TAG | |
| 711 | 711 | MCFG_RAM_DEFAULT_SIZE("5K") |
| 712 | 712 | MCFG_RAM_EXTRA_OPTIONS("8K,16K,24K,32K") |
| 713 | 713 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 74 | 74 | #include "machine/ctronics.h" |
| 75 | 75 | #include "devices/flopdrv.h" |
| 76 | 76 | #include "formats/basicdsk.h" |
| 77 | #include " | |
| 77 | #include "ma | |
| 78 | 78 | #include "machine/serial.h" |
| 79 | 79 | |
| 80 | 80 | |
| r9922 | r9923 | |
| 339 | 339 | /* 0x10000 - 0x1ffff: 64 KB external ROM cartridge */ |
| 340 | 340 | /* 0x20000 - 0x247ff: 18 KB floppy / network ROM controllers */ |
| 341 | 341 | |
| 342 | /* | |
| 342 | /* | |
| 343 | 343 | 0x0000 - 0x3fff: 16 KB video RAM (actually 8 K x 8 bits + 8 K x 6 bits) |
| 344 | 344 | 0x4000 - 0x5fff: 8 KB base RAM |
| 345 | 345 | 0x6000 - 0x9fff: 16 KB extended RAM |
| r9922 | r9923 | |
| 670 | 670 | MCFG_CARTSLOT_LOAD(to7_cartridge) |
| 671 | 671 | |
| 672 | 672 | /* internal ram */ |
| 673 | MCFG_RAM_ADD( | |
| 673 | MCFG_RAM_ADD(RAM_TAG | |
| 674 | 674 | MCFG_RAM_DEFAULT_SIZE("40K") |
| 675 | 675 | MCFG_RAM_EXTRA_OPTIONS("24K,48K") |
| 676 | 676 | |
| r9922 | r9923 | |
| 761 | 761 | /* 0x10000 - 0x1ffff: 64 KB external ROM cartridge */ |
| 762 | 762 | /* 0x20000 - 0x247ff: 18 KB floppy / network ROM controllers */ |
| 763 | 763 | |
| 764 | /* | |
| 764 | /* | |
| 765 | 765 | 0x00000 - 0x03fff: 16 KB video RAM |
| 766 | 766 | 0x04000 - 0x07fff: 16 KB unbanked base RAM |
| 767 | 767 | 0x08000 - 0x1ffff: 6 * 16 KB banked extended RAM |
| r9922 | r9923 | |
| 855 | 855 | MCFG_MC6846_MODIFY( "mc6846", to770_timer ) |
| 856 | 856 | |
| 857 | 857 | /* internal ram */ |
| 858 | MCFG_RAM_MODIFY( | |
| 858 | MCFG_RAM_MODIFY(RAM_TAG | |
| 859 | 859 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 860 | 860 | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 861 | 861 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 948 | 948 | /* 0x10000 - 0x1ffff: 16 KB integrated BASIC / 64 KB external cartridge */ |
| 949 | 949 | /* 0x20000 - 0x247ff: 18 KB floppy / network ROM controllers */ |
| 950 | 950 | |
| 951 | /* | |
| 951 | /* | |
| 952 | 952 | 0x00000 - 0x03fff: 16 KB video RAM |
| 953 | 953 | 0x04000 - 0x0bfff: 32 KB unbanked base RAM |
| 954 | 954 | 0x0c000 - 0x1bfff: 4 * 16 KB bank extended RAM |
| r9922 | r9923 | |
| 1041 | 1041 | MCFG_CARTSLOT_LOAD(mo5_cartridge) |
| 1042 | 1042 | |
| 1043 | 1043 | /* internal ram */ |
| 1044 | MCFG_RAM_MODIFY( | |
| 1044 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1045 | 1045 | MCFG_RAM_DEFAULT_SIZE("112K") |
| 1046 | 1046 | MACHINE_CONFIG_END |
| 1047 | 1047 | |
| r9922 | r9923 | |
| 1153 | 1153 | /* 0x20000 - 0x3ffff: 128 KB internal software ROM */ |
| 1154 | 1154 | /* 0x40000 - 0x447ff: 18 KB external floppy / network ROM controllers */ |
| 1155 | 1155 | |
| 1156 | /* | |
| 1156 | /* | |
| 1157 | 1157 | 0x00000 - 0x03fff: 16 KB video RAM |
| 1158 | 1158 | 0x04000 - 0x07fff: 16 KB unbanked base RAM |
| 1159 | 1159 | 0x08000 - 0x2ffff: 10 * 16 KB banked extended RAM |
| r9922 | r9923 | |
| 1378 | 1378 | MCFG_MC6846_MODIFY( "mc6846", to9_timer ) |
| 1379 | 1379 | |
| 1380 | 1380 | /* internal ram */ |
| 1381 | MCFG_RAM_MODIFY( | |
| 1381 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1382 | 1382 | MCFG_RAM_DEFAULT_SIZE("192K") |
| 1383 | 1383 | MCFG_RAM_EXTRA_OPTIONS("128K") |
| 1384 | 1384 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1479 | 1479 | /* 0x30000 - 0x33fff: 16 KB BIOS ROM */ |
| 1480 | 1480 | /* 0x34000 - 0x387ff: 18 KB external floppy / network ROM controllers */ |
| 1481 | 1481 | |
| 1482 | /* | |
| 1482 | /* | |
| 1483 | 1483 | |
| 1484 | 1484 | ADDRESS_MAP_END |
| 1485 | 1485 | |
| r9922 | r9923 | |
| 1596 | 1596 | MCFG_MC6846_MODIFY( "mc6846", to8_timer ) |
| 1597 | 1597 | |
| 1598 | 1598 | /* internal ram */ |
| 1599 | MCFG_RAM_MODIFY( | |
| 1599 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1600 | 1600 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 1601 | 1601 | MCFG_RAM_EXTRA_OPTIONS("256K") |
| 1602 | 1602 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1677 | 1677 | /* 0x30000 - 0x33fff: 16 KB BIOS ROM */ |
| 1678 | 1678 | /* 0x34000 - 0x387ff: 18 KB external floppy / network ROM controllers */ |
| 1679 | 1679 | |
| 1680 | /* | |
| 1680 | /* | |
| 1681 | 1681 | |
| 1682 | 1682 | ADDRESS_MAP_END |
| 1683 | 1683 | |
| r9922 | r9923 | |
| 1745 | 1745 | MCFG_MC6846_MODIFY( "mc6846", to9p_timer ) |
| 1746 | 1746 | |
| 1747 | 1747 | /* internal ram */ |
| 1748 | MCFG_RAM_MODIFY( | |
| 1748 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1749 | 1749 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 1750 | 1750 | MACHINE_CONFIG_END |
| 1751 | 1751 | |
| r9922 | r9923 | |
| 1838 | 1838 | /* 0x20000 - 0x2ffff: 64 KB BIOS ROM */ |
| 1839 | 1839 | /* 0x30000 - 0x347ff: 16 KB floppy / network ROM controllers */ |
| 1840 | 1840 | |
| 1841 | /* | |
| 1841 | /* | |
| 1842 | 1842 | |
| 1843 | 1843 | ADDRESS_MAP_END |
| 1844 | 1844 | |
| r9922 | r9923 | |
| 2081 | 2081 | MCFG_CARTSLOT_LOAD(mo5_cartridge) |
| 2082 | 2082 | |
| 2083 | 2083 | /* internal ram */ |
| 2084 | MCFG_RAM_MODIFY( | |
| 2084 | MCFG_RAM_MODIFY(RAM_TAG | |
| 2085 | 2085 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 2086 | 2086 | MACHINE_CONFIG_END |
| 2087 | 2087 | |
| r9922 | r9923 | |
| 2152 | 2152 | /* 0x20000 - 0x2ffff: 64 KB BIOS ROM */ |
| 2153 | 2153 | /* 0x30000 - 0x347ff: 16 KB floppy / network ROM controllers */ |
| 2154 | 2154 | |
| 2155 | /* | |
| 2155 | /* | |
| 2156 | 2156 | |
| 2157 | 2157 | ADDRESS_MAP_END |
| 2158 | 2158 | |
| r9922 | r9923 | |
| 2307 | 2307 | MCFG_CARTSLOT_LOAD(mo5_cartridge) |
| 2308 | 2308 | |
| 2309 | 2309 | /* internal ram */ |
| 2310 | MCFG_RAM_MODIFY( | |
| 2310 | MCFG_RAM_MODIFY(RAM_TAG | |
| 2311 | 2311 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 2312 | 2312 | MACHINE_CONFIG_END |
| 2313 | 2313 |
| r9922 | r9923 | |
|---|---|---|
| 153 | 153 | #include "sound/speaker.h" |
| 154 | 154 | #include "formats/tzx_cas.h" |
| 155 | 155 | #include "machine/beta.h" |
| 156 | #include " | |
| 156 | #include "ma | |
| 157 | 157 | |
| 158 | 158 | /****************************************************************************************************/ |
| 159 | 159 | /* Zs Scorpion 256 */ |
| r9922 | r9923 | |
| 186 | 186 | static void scorpion_update_memory(running_machine *machine) |
| 187 | 187 | { |
| 188 | 188 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 189 | UINT8 *messram = | |
| 189 | UINT8 *messram = | |
| 190 | 190 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 191 | 191 | |
| 192 | 192 | state->screen_location = messram + ((state->port_7ffd_data & 8) ? (7<<14) : (5<<14)); |
| r9922 | r9923 | |
| 305 | 305 | static MACHINE_RESET( scorpion ) |
| 306 | 306 | { |
| 307 | 307 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 308 | UINT8 *messram = | |
| 308 | UINT8 *messram = | |
| 309 | 309 | device_t *beta = machine->device(BETA_DISK_TAG); |
| 310 | 310 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 311 | 311 | |
| r9922 | r9923 | |
| 399 | 399 | MCFG_BETA_DISK_ADD(BETA_DISK_TAG) |
| 400 | 400 | |
| 401 | 401 | /* internal ram */ |
| 402 | MCFG_RAM_MODIFY( | |
| 402 | MCFG_RAM_MODIFY(RAM_TAG | |
| 403 | 403 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 404 | 404 | MACHINE_CONFIG_END |
| 405 | 405 |
| r9922 | r9923 | |
|---|---|---|
| 183 | 183 | #include "cpu/z80/z80daisy.h" |
| 184 | 184 | #include "devices/cassette.h" |
| 185 | 185 | #include "devices/flopdrv.h" |
| 186 | #include " | |
| 186 | #include "ma | |
| 187 | 187 | #include "devices/printer.h" |
| 188 | 188 | #include "machine/abcbus.h" |
| 189 | 189 | #include "machine/abc830.h" |
| r9922 | r9923 | |
| 676 | 676 | void abc80_state::machine_start() |
| 677 | 677 | { |
| 678 | 678 | /* configure RAM expansion */ |
| 679 | if ( | |
| 679 | if ( | |
| 680 | 680 | { |
| 681 | 681 | memory_unmap_readwrite(cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM), 0x8000, 0xbfff, 0, 0); |
| 682 | 682 | } |
| r9922 | r9923 | |
| 728 | 728 | MCFG_CASSETTE_ADD(CASSETTE_TAG, abc80_cassette_config) |
| 729 | 729 | |
| 730 | 730 | /* internal ram */ |
| 731 | MCFG_RAM_ADD( | |
| 731 | MCFG_RAM_ADD(RAM_TAG | |
| 732 | 732 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 733 | 733 | MCFG_RAM_EXTRA_OPTIONS("32K") |
| 734 | 734 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 178 | 178 | #include "machine/pit8253.h" |
| 179 | 179 | #include "machine/msm8251.h" |
| 180 | 180 | #include "formats/pmd_pmd.h" |
| 181 | #include " | |
| 181 | #include "ma | |
| 182 | 182 | |
| 183 | 183 | /* I/O ports */ |
| 184 | 184 | |
| r9922 | r9923 | |
| 579 | 579 | MCFG_MSM8251_ADD("uart", default_msm8251_interface) |
| 580 | 580 | |
| 581 | 581 | /* internal ram */ |
| 582 | MCFG_RAM_ADD( | |
| 582 | MCFG_RAM_ADD(RAM_TAG | |
| 583 | 583 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 584 | 584 | MACHINE_CONFIG_END |
| 585 | 585 |
| r9922 | r9923 | |
|---|---|---|
| 277 | 277 | #include "devices/snapquik.h" |
| 278 | 278 | #include "devices/cartslot.h" |
| 279 | 279 | #include "devices/cassette.h" |
| 280 | #include " | |
| 280 | #include "ma | |
| 281 | 281 | #include "formats/tzx_cas.h" |
| 282 | 282 | #include "formats/spec_snqk.h" |
| 283 | 283 | |
| r9922 | r9923 | |
| 624 | 624 | { |
| 625 | 625 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 626 | 626 | |
| 627 | switch ( | |
| 627 | switch ( | |
| 628 | 628 | { |
| 629 | 629 | case 48*1024: |
| 630 | 630 | memory_install_ram(space, 0x8000, 0xffff, 0, 0, NULL); // Fall through |
| r9922 | r9923 | |
| 753 | 753 | MACHINE_CONFIG_DERIVED( spectrum, spectrum_common ) |
| 754 | 754 | |
| 755 | 755 | /* internal ram */ |
| 756 | MCFG_RAM_ADD( | |
| 756 | MCFG_RAM_ADD(RAM_TAG | |
| 757 | 757 | MCFG_RAM_DEFAULT_SIZE("48K") // It's likely, but still to be checked, that many clones were produced only |
| 758 | 758 | MCFG_RAM_EXTRA_OPTIONS("16K") // in the 48k configuration, while others have extra memory (80k, 128K, 1024K) |
| 759 | 759 | MCFG_RAM_DEFAULT_VALUE(0xff) // available via bankswitching. |
| r9922 | r9923 | |
|---|---|---|
| 6 | 6 | #include "formats/atarist_dsk.h" |
| 7 | 7 | #include "devices/cartslot.h" |
| 8 | 8 | #include "devices/flopdrv.h" |
| 9 | #include " | |
| 9 | #include "ma | |
| 10 | 10 | #include "machine/6850acia.h" |
| 11 | 11 | #include "machine/68901mfp.h" |
| 12 | 12 | #include "machine/8530scc.h" |
| r9922 | r9923 | |
| 483 | 483 | if (state->dmasnd_samples == 0) |
| 484 | 484 | { |
| 485 | 485 | int i; |
| 486 | UINT8 *RAM = | |
| 486 | UINT8 *RAM = | |
| 487 | 487 | |
| 488 | 488 | for (i = 0; i < 8; i++) |
| 489 | 489 | { |
| r9922 | r9923 | |
| 1467 | 1467 | static void atarist_configure_memory(running_machine *machine) |
| 1468 | 1468 | { |
| 1469 | 1469 | address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM); |
| 1470 | UINT8 *RAM = | |
| 1470 | UINT8 *RAM = | |
| 1471 | 1471 | |
| 1472 | switch ( | |
| 1472 | switch ( | |
| 1473 | 1473 | { |
| 1474 | 1474 | case 256 * 1024: |
| 1475 | 1475 | memory_install_ram(program, 0x000008, 0x03ffff, 0, 0, RAM + 8); |
| r9922 | r9923 | |
| 1654 | 1654 | static void stbook_configure_memory(running_machine *machine) |
| 1655 | 1655 | { |
| 1656 | 1656 | address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM); |
| 1657 | UINT8 *RAM = | |
| 1657 | UINT8 *RAM = | |
| 1658 | 1658 | |
| 1659 | switch ( | |
| 1659 | switch ( | |
| 1660 | 1660 | { |
| 1661 | 1661 | case 1024 * 1024: |
| 1662 | 1662 | memory_install_ram(program, 0x000008, 0x07ffff, 0, 0x080000, RAM + 8); |
| r9922 | r9923 | |
| 1870 | 1870 | MCFG_FRAGMENT_ADD(atarist_cartslot) |
| 1871 | 1871 | |
| 1872 | 1872 | /* internal ram */ |
| 1873 | MCFG_RAM_ADD( | |
| 1873 | MCFG_RAM_ADD(RAM_TAG | |
| 1874 | 1874 | MCFG_RAM_DEFAULT_SIZE("1024K") // 1040ST |
| 1875 | 1875 | MCFG_RAM_EXTRA_OPTIONS("512K,256K") // 520ST, 260ST |
| 1876 | 1876 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1883 | 1883 | MCFG_MACHINE_START(megast) |
| 1884 | 1884 | |
| 1885 | 1885 | /* internal ram */ |
| 1886 | MCFG_RAM_MODIFY( | |
| 1886 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1887 | 1887 | MCFG_RAM_DEFAULT_SIZE("4M") // Mega ST 4 |
| 1888 | 1888 | MCFG_RAM_EXTRA_OPTIONS("2M,1M") // Mega ST 2 ,Mega ST 1 |
| 1889 | 1889 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1941 | 1941 | MCFG_FRAGMENT_ADD(atarist_cartslot) |
| 1942 | 1942 | |
| 1943 | 1943 | /* internal ram */ |
| 1944 | MCFG_RAM_ADD( | |
| 1944 | MCFG_RAM_ADD(RAM_TAG | |
| 1945 | 1945 | MCFG_RAM_DEFAULT_SIZE("1024K") // 1040STe |
| 1946 | 1946 | MCFG_RAM_EXTRA_OPTIONS("512K") // 520STe |
| 1947 | 1947 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1956 | 1956 | MCFG_FLOPPY_2_DRIVES_MODIFY(megaste_floppy_config) |
| 1957 | 1957 | |
| 1958 | 1958 | /* internal ram */ |
| 1959 | MCFG_RAM_MODIFY( | |
| 1959 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1960 | 1960 | MCFG_RAM_DEFAULT_SIZE("4M") // Mega STe 4 |
| 1961 | 1961 | MCFG_RAM_EXTRA_OPTIONS("2M,1M") // Mega STe 2 ,Mega STe 1 |
| 1962 | 1962 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 2008 | 2008 | MCFG_FRAGMENT_ADD(atarist_cartslot) |
| 2009 | 2009 | |
| 2010 | 2010 | /* internal ram */ |
| 2011 | MCFG_RAM_ADD( | |
| 2011 | MCFG_RAM_ADD(RAM_TAG | |
| 2012 | 2012 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 2013 | 2013 | MCFG_RAM_EXTRA_OPTIONS("1M") |
| 2014 | 2014 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 69 | 69 | #include "devices/flopdrv.h" |
| 70 | 70 | #include "devices/cartslot.h" |
| 71 | 71 | #include "devices/cassette.h" |
| 72 | #include " | |
| 72 | #include "ma | |
| 73 | 73 | #include "devices/printer.h" |
| 74 | 74 | #include "formats/basicdsk.h" |
| 75 | 75 | #include "machine/ctronics.h" |
| r9922 | r9923 | |
| 1019 | 1019 | |
| 1020 | 1020 | /* configure memory banking */ |
| 1021 | 1021 | memory_configure_bank(machine, "bank1", 0, 1, machine->region(Z80_TAG)->base(), 0); |
| 1022 | memory_configure_bank(machine, "bank1", 1, 1, messram_get_ptr(m_ram), 0); | |
| 1023 | memory_configure_bank(machine, "bank2", 0, 1, messram_get_ptr(m_ram), 0); | |
| 1022 | memory_configure_bank(machine, "bank1", 1, 1, ram_get_ptr(m_ram), 0); | |
| 1023 | memory_configure_bank(machine, "bank2", 0, 1, ram_get_ptr(m_ram), 0); | |
| 1024 | 1024 | |
| 1025 | 1025 | /* register for state saving */ |
| 1026 | 1026 | state_save_register_global(machine, m_keylatch); |
| r9922 | r9923 | |
| 1075 | 1075 | MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000") |
| 1076 | 1076 | |
| 1077 | 1077 | /* internal ram */ |
| 1078 | MCFG_RAM_ADD( | |
| 1078 | MCFG_RAM_ADD(RAM_TAG | |
| 1079 | 1079 | MCFG_RAM_DEFAULT_SIZE("1K") |
| 1080 | 1080 | MACHINE_CONFIG_END |
| 1081 | 1081 | |
| r9922 | r9923 | |
| 1093 | 1093 | MCFG_CARTSLOT_NOT_MANDATORY |
| 1094 | 1094 | MCFG_CARTSLOT_LOAD(omv_cart) |
| 1095 | 1095 | |
| 1096 | MCFG_RAM_MODIFY( | |
| 1096 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1097 | 1097 | MCFG_RAM_DEFAULT_SIZE("2K") |
| 1098 | 1098 | MACHINE_CONFIG_END |
| 1099 | 1099 | |
| r9922 | r9923 | |
| 1134 | 1134 | MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000") |
| 1135 | 1135 | |
| 1136 | 1136 | /* internal ram */ |
| 1137 | MCFG_RAM_ADD( | |
| 1137 | MCFG_RAM_ADD(RAM_TAG | |
| 1138 | 1138 | MCFG_RAM_DEFAULT_SIZE("2K") |
| 1139 | 1139 | MACHINE_CONFIG_END |
| 1140 | 1140 | |
| r9922 | r9923 | |
| 1171 | 1171 | MCFG_CASSETTE_ADD(CASSETTE_TAG, sc3000_cassette_config) |
| 1172 | 1172 | |
| 1173 | 1173 | /* internal ram */ |
| 1174 | MCFG_RAM_ADD( | |
| 1174 | MCFG_RAM_ADD(RAM_TAG | |
| 1175 | 1175 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1176 | 1176 | MACHINE_CONFIG_END |
| 1177 | 1177 |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "includes/eti660.h" |
| 14 | 14 | #include "cpu/cosmac/cosmac.h" |
| 15 | 15 | #include "devices/cassette.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | #include "machine/6821pia.h" |
| 18 | 18 | #include "machine/rescap.h" |
| 19 | 19 | #include "sound/cdp1864.h" |
| r9922 | r9923 | |
| 334 | 334 | MCFG_CASSETTE_ADD(CASSETTE_TAG, eti660_cassette_config) |
| 335 | 335 | |
| 336 | 336 | /* internal ram */ |
| 337 | MCFG_RAM_ADD( | |
| 337 | MCFG_RAM_ADD(RAM_TAG | |
| 338 | 338 | MCFG_RAM_DEFAULT_SIZE("3K") |
| 339 | 339 | MACHINE_CONFIG_END |
| 340 | 340 |
| r9922 | r9923 | |
|---|---|---|
| 33 | 33 | #include "cpu/m6800/m6800.h" |
| 34 | 34 | #include "devices/cartslot.h" |
| 35 | 35 | #include "devices/cassette.h" |
| 36 | #include " | |
| 36 | #include "ma | |
| 37 | 37 | #include "machine/msm8251.h" |
| 38 | 38 | #include "machine/pf10.h" |
| 39 | 39 | #include "sound/wave.h" |
| r9922 | r9923 | |
| 87 | 87 | { |
| 88 | 88 | px8_state *state = machine->driver_data<px8_state>(); |
| 89 | 89 | address_space *program = cputag_get_address_space(machine, UPD70008_TAG, ADDRESS_SPACE_PROGRAM); |
| 90 | UINT8 *ram = | |
| 90 | UINT8 *ram = | |
| 91 | 91 | UINT8 *ipl_rom = machine->region(UPD70008_TAG)->base(); |
| 92 | 92 | |
| 93 | 93 | if (!state->bank0) |
| r9922 | r9923 | |
| 909 | 909 | MCFG_CASSETTE_ADD(CASSETTE_TAG, px8_cassette_config) |
| 910 | 910 | |
| 911 | 911 | /* internal ram */ |
| 912 | MCFG_RAM_ADD( | |
| 912 | MCFG_RAM_ADD(RAM_TAG | |
| 913 | 913 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 914 | 914 | MACHINE_CONFIG_END |
| 915 | 915 |
| r9922 | r9923 | |
|---|---|---|
| 45 | 45 | #include "includes/phc25.h" |
| 46 | 46 | #include "cpu/z80/z80.h" |
| 47 | 47 | #include "devices/cassette.h" |
| 48 | #include " | |
| 48 | #include "ma | |
| 49 | 49 | #include "machine/ctronics.h" |
| 50 | 50 | #include "video/m6847.h" |
| 51 | 51 | #include "sound/ay8910.h" |
| r9922 | r9923 | |
| 391 | 391 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics) |
| 392 | 392 | |
| 393 | 393 | /* internal ram */ |
| 394 | MCFG_RAM_ADD( | |
| 394 | MCFG_RAM_ADD(RAM_TAG | |
| 395 | 395 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 396 | 396 | MACHINE_CONFIG_END |
| 397 | 397 |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "video/i8275.h" |
| 13 | 13 | #include "video/upd7220.h" |
| 14 | 14 | #include "sound/speaker.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | #include "includes/mikromik.h" |
| 17 | 17 | |
| 18 | 18 | /* |
| r9922 | r9923 | |
| 679 | 679 | memory_install_read_bank(program, 0x0000, 0x0fff, 0, 0, "bank1"); |
| 680 | 680 | memory_unmap_write(program, 0x0000, 0x0fff, 0, 0); |
| 681 | 681 | memory_configure_bank(machine, "bank1", 0, 1, machine->region("bios")->base(), 0); |
| 682 | memory_configure_bank(machine, "bank1", 1, 1, | |
| 682 | memory_configure_bank(machine, "bank1", 1, 1, | |
| 683 | 683 | memory_set_bank(machine, "bank1", 0); |
| 684 | 684 | |
| 685 | 685 | /* register for state saving */ |
| r9922 | r9923 | |
| 749 | 749 | MCFG_FLOPPY_2_DRIVES_ADD(mm1_floppy_config) |
| 750 | 750 | |
| 751 | 751 | /* internal ram */ |
| 752 | MCFG_RAM_ADD( | |
| 752 | MCFG_RAM_ADD(RAM_TAG | |
| 753 | 753 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 754 | 754 | MACHINE_CONFIG_END |
| 755 | 755 |
| r9922 | r9923 | |
|---|---|---|
| 157 | 157 | #include "sound/ay8910.h" |
| 158 | 158 | #include "sound/speaker.h" |
| 159 | 159 | #include "formats/tzx_cas.h" |
| 160 | #include " | |
| 160 | #include "ma | |
| 161 | 161 | |
| 162 | 162 | static const ay8910_interface spectrum_ay_interface = |
| 163 | 163 | { |
| r9922 | r9923 | |
| 192 | 192 | void spectrum_128_update_memory(running_machine *machine) |
| 193 | 193 | { |
| 194 | 194 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 195 | UINT8 *messram = | |
| 195 | UINT8 *messram = | |
| 196 | 196 | unsigned char *ChosenROM; |
| 197 | 197 | int ROMSelection; |
| 198 | 198 | |
| r9922 | r9923 | |
| 255 | 255 | static MACHINE_RESET( spectrum_128 ) |
| 256 | 256 | { |
| 257 | 257 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 258 | UINT8 *messram = | |
| 258 | UINT8 *messram = | |
| 259 | 259 | |
| 260 | 260 | memset(messram,0,128*1024); |
| 261 | 261 | /* 0x0000-0x3fff always holds ROM */ |
| r9922 | r9923 | |
| 315 | 315 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 316 | 316 | |
| 317 | 317 | /* internal ram */ |
| 318 | MCFG_RAM_MODIFY( | |
| 318 | MCFG_RAM_MODIFY(RAM_TAG | |
| 319 | 319 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 320 | 320 | MACHINE_CONFIG_END |
| 321 | 321 |
| r9922 | r9923 | |
|---|---|---|
| 387 | 387 | #include "includes/pet.h" |
| 388 | 388 | #include "machine/cbmipt.h" |
| 389 | 389 | #include "video/mc6845.h" |
| 390 | #include " | |
| 390 | #include "ma | |
| 391 | 391 | #include "machine/c2040.h" |
| 392 | 392 | |
| 393 | 393 | /* devices config */ |
| r9922 | r9923 | |
| 698 | 698 | MCFG_FRAGMENT_ADD(pet_cartslot) |
| 699 | 699 | |
| 700 | 700 | /* internal ram */ |
| 701 | MCFG_RAM_ADD( | |
| 701 | MCFG_RAM_ADD(RAM_TAG | |
| 702 | 702 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 703 | 703 | MCFG_RAM_EXTRA_OPTIONS("8K,16K") |
| 704 | 704 | |
| r9922 | r9923 | |
| 717 | 717 | MCFG_FRAGMENT_ADD(pet_cartslot) |
| 718 | 718 | |
| 719 | 719 | /* internal ram */ |
| 720 | MCFG_RAM_ADD( | |
| 720 | MCFG_RAM_ADD(RAM_TAG | |
| 721 | 721 | MCFG_RAM_DEFAULT_SIZE("8K") |
| 722 | 722 | MCFG_RAM_EXTRA_OPTIONS("4K") |
| 723 | 723 | |
| r9922 | r9923 | |
| 771 | 771 | MCFG_FRAGMENT_ADD(pet4_cartslot) |
| 772 | 772 | |
| 773 | 773 | /* internal ram */ |
| 774 | MCFG_RAM_ADD( | |
| 774 | MCFG_RAM_ADD(RAM_TAG | |
| 775 | 775 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 776 | 776 | |
| 777 | 777 | /* IEEE bus */ |
| r9922 | r9923 | |
|---|---|---|
| 116 | 116 | #include "audio/ted7360.h" |
| 117 | 117 | #include "audio/t6721.h" |
| 118 | 118 | #include "cpu/m6502/m6502.h" |
| 119 | #include " | |
| 119 | #include "ma | |
| 120 | 120 | #include "formats/cbm_snqk.h" |
| 121 | 121 | #include "includes/cbm.h" |
| 122 | 122 | #include "includes/c16.h" |
| r9922 | r9923 | |
| 452 | 452 | state->ted7360 = machine->device("ted7360"); |
| 453 | 453 | state->serbus = machine->device("iec"); |
| 454 | 454 | state->cassette = machine->device("cassette"); |
| 455 | state->messram = machine->device( | |
| 455 | state->messram = machine->device(RAM_TAG | |
| 456 | 456 | state->sid = machine->device("sid"); |
| 457 | 457 | |
| 458 | 458 | state_save_register_global(machine, state->old_level); |
| r9922 | r9923 | |
| 504 | 504 | MCFG_CBM_IEC_ADD("iec", c16_iec_no_drives) |
| 505 | 505 | |
| 506 | 506 | /* internal ram */ |
| 507 | MCFG_RAM_ADD( | |
| 507 | MCFG_RAM_ADD(RAM_TAG | |
| 508 | 508 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 509 | 509 | MCFG_RAM_EXTRA_OPTIONS("16K,32K") |
| 510 | 510 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 551 | 551 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 552 | 552 | |
| 553 | 553 | /* internal ram */ |
| 554 | MCFG_RAM_MODIFY( | |
| 554 | MCFG_RAM_MODIFY(RAM_TAG | |
| 555 | 555 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 556 | 556 | MACHINE_CONFIG_END |
| 557 | 557 | |
| r9922 | r9923 | |
| 598 | 598 | |
| 599 | 599 | static MACHINE_CONFIG_DERIVED( c264, c16 ) |
| 600 | 600 | /* internal ram */ |
| 601 | MCFG_RAM_MODIFY( | |
| 601 | MCFG_RAM_MODIFY(RAM_TAG | |
| 602 | 602 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 603 | 603 | MACHINE_CONFIG_END |
| 604 | 604 |
| r9922 | r9923 | |
|---|---|---|
| 103 | 103 | #include "includes/pcw.h" |
| 104 | 104 | // pcw/pcw16 beeper |
| 105 | 105 | #include "sound/beep.h" |
| 106 | #include " | |
| 106 | #include "ma | |
| 107 | 107 | |
| 108 | 108 | #include "pcw.lh" |
| 109 | 109 | |
| r9922 | r9923 | |
| 254 | 254 | memory_install_read_bank(space,block * 0x04000 + 0x0000, block * 0x04000 + 0x3fff, 0, 0,block_name); |
| 255 | 255 | // LOG(("MEM: read block %i -> bank %i\n",block,bank)); |
| 256 | 256 | } |
| 257 | memory_set_bankptr(machine, block_name, | |
| 257 | memory_set_bankptr(machine, block_name, | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| r9922 | r9923 | |
| 264 | 264 | char block_name[10]; |
| 265 | 265 | |
| 266 | 266 | sprintf(block_name,"bank%d",block+5); |
| 267 | memory_set_bankptr(machine, block_name, | |
| 267 | memory_set_bankptr(machine, block_name, | |
| 268 | 268 | // LOG(("MEM: write block %i -> bank %i\n",block,bank)); |
| 269 | 269 | } |
| 270 | 270 | |
| r9922 | r9923 | |
| 1089 | 1089 | state->boot = 0; // System starts up in bootstrap mode, disabled until it's possible to emulate it. |
| 1090 | 1090 | |
| 1091 | 1091 | /* copy boot code into RAM - yes, it's skipping a step */ |
| 1092 | memset( | |
| 1092 | memset( | |
| 1093 | 1093 | for(x=0;x<256;x++) |
| 1094 | | |
| 1094 | | |
| 1095 | 1095 | |
| 1096 | 1096 | /* and hack our way past the MCU side of the boot process */ |
| 1097 | 1097 | code[0x01] = 0x40; |
| r9922 | r9923 | |
| 1373 | 1373 | MCFG_FLOPPY_2_DRIVES_ADD(pcw_floppy_config) |
| 1374 | 1374 | |
| 1375 | 1375 | /* internal ram */ |
| 1376 | MCFG_RAM_ADD( | |
| 1376 | MCFG_RAM_ADD(RAM_TAG | |
| 1377 | 1377 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 1378 | 1378 | MACHINE_CONFIG_END |
| 1379 | 1379 | |
| r9922 | r9923 | |
| 1398 | 1398 | MCFG_DEFAULT_LAYOUT( layout_pcw ) |
| 1399 | 1399 | |
| 1400 | 1400 | /* internal ram */ |
| 1401 | MCFG_RAM_MODIFY( | |
| 1401 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1402 | 1402 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 1403 | 1403 | MACHINE_CONFIG_END |
| 1404 | 1404 | |
| r9922 | r9923 | |
| 1408 | 1408 | MCFG_CPU_IO_MAP(pcw9512_io) |
| 1409 | 1409 | |
| 1410 | 1410 | /* internal ram */ |
| 1411 | MCFG_RAM_MODIFY( | |
| 1411 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1412 | 1412 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 1413 | 1413 | MACHINE_CONFIG_END |
| 1414 | 1414 |
| r9922 | r9923 | |
|---|---|---|
| 186 | 186 | #include "devices/flopdrv.h" |
| 187 | 187 | #include "formats/basicdsk.h" |
| 188 | 188 | #include "devices/cassette.h" |
| 189 | #include " | |
| 189 | #include "ma | |
| 190 | 190 | |
| 191 | 191 | /* Sound */ |
| 192 | 192 | |
| r9922 | r9923 | |
| 676 | 676 | memory_configure_bank(machine, "bank1", 0, 1, machine->region(M6502_TAG)->base(), 0); |
| 677 | 677 | memory_set_bank(machine, "bank1", 0); |
| 678 | 678 | |
| 679 | switch ( | |
| 679 | switch ( | |
| 680 | 680 | { |
| 681 | 681 | case 4*1024: |
| 682 | 682 | memory_install_readwrite_bank(program, 0x0000, 0x0fff, 0, 0, "bank1"); |
| r9922 | r9923 | |
| 706 | 706 | memory_configure_bank(machine, "bank1", 0, 1, machine->region(M6502_TAG)->base(), 0); |
| 707 | 707 | memory_set_bank(machine, "bank1", 0); |
| 708 | 708 | |
| 709 | switch ( | |
| 709 | switch ( | |
| 710 | 710 | { |
| 711 | 711 | case 8*1024: |
| 712 | 712 | memory_install_readwrite_bank(program, 0x0000, 0x1fff, 0, 0, "bank1"); |
| r9922 | r9923 | |
| 801 | 801 | MCFG_CASSETTE_ADD("cassette", default_cassette_config) |
| 802 | 802 | |
| 803 | 803 | /* internal ram */ |
| 804 | MCFG_RAM_ADD( | |
| 804 | MCFG_RAM_ADD(RAM_TAG | |
| 805 | 805 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 806 | 806 | MCFG_RAM_EXTRA_OPTIONS("8K") |
| 807 | 807 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 825 | 825 | MCFG_CASSETTE_ADD("cassette", default_cassette_config) |
| 826 | 826 | |
| 827 | 827 | /* internal ram */ |
| 828 | MCFG_RAM_ADD( | |
| 828 | MCFG_RAM_ADD(RAM_TAG | |
| 829 | 829 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 830 | 830 | MCFG_RAM_EXTRA_OPTIONS("8K") |
| 831 | 831 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 861 | 861 | MCFG_CASSETTE_ADD("cassette", default_cassette_config) |
| 862 | 862 | |
| 863 | 863 | /* internal ram */ |
| 864 | MCFG_RAM_ADD( | |
| 864 | MCFG_RAM_ADD(RAM_TAG | |
| 865 | 865 | MCFG_RAM_DEFAULT_SIZE("8K") |
| 866 | 866 | MCFG_RAM_EXTRA_OPTIONS("20K") |
| 867 | 867 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 881 | 881 | MCFG_FLOPPY_DRIVE_ADD(FLOPPY_0, osi_floppy_config) |
| 882 | 882 | |
| 883 | 883 | /* internal ram */ |
| 884 | MCFG_RAM_MODIFY( | |
| 884 | MCFG_RAM_MODIFY(RAM_TAG | |
| 885 | 885 | MCFG_RAM_DEFAULT_SIZE("20K") |
| 886 | 886 | MACHINE_CONFIG_END |
| 887 | 887 |
| r9922 | r9923 | |
|---|---|---|
| 18 | 18 | #include "machine/z80sio.h" |
| 19 | 19 | #include "machine/z80pio.h" |
| 20 | 20 | #include "machine/z80dma.h" |
| 21 | #include " | |
| 21 | #include "ma | |
| 22 | 22 | #include "video/i8275.h" |
| 23 | 23 | |
| 24 | 24 | |
| r9922 | r9923 | |
| 100 | 100 | |
| 101 | 101 | static MACHINE_START( rt1715 ) |
| 102 | 102 | { |
| 103 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x0800); | |
| 104 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram"))); | |
| 103 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x0800); | |
| 104 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG))); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | static MACHINE_RESET( rt1715 ) |
| r9922 | r9923 | |
| 115 | 115 | logerror("%s: rt1715_set_bank %02x\n", cpuexec_describe_context(space->machine), data); |
| 116 | 116 | |
| 117 | 117 | /* disable ROM, enable RAM */ |
| 118 | memory_set_bankptr(space->machine, "bank1", | |
| 118 | memory_set_bankptr(space->machine, "bank1", | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| r9922 | r9923 | |
| 348 | 348 | MCFG_Z80PIO_ADD("a72", XTAL_10MHz/4 /* ? */, rt1715_pio_control_intf) |
| 349 | 349 | |
| 350 | 350 | /* internal ram */ |
| 351 | MCFG_RAM_ADD( | |
| 351 | MCFG_RAM_ADD(RAM_TAG | |
| 352 | 352 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 353 | 353 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 354 | 354 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 55 | 55 | #include "sound/dac.h" |
| 56 | 56 | #include "sound/speaker.h" |
| 57 | 57 | #include "sound/saa1099.h" |
| 58 | #include " | |
| 58 | #include "ma | |
| 59 | 59 | |
| 60 | 60 | #include "memconv.h" |
| 61 | 61 | |
| r9922 | r9923 | |
| 549 | 549 | MCFG_FLOPPY_2_DRIVES_ADD(ibmat_floppy_config) |
| 550 | 550 | |
| 551 | 551 | /* internal ram */ |
| 552 | MCFG_RAM_ADD( | |
| 552 | MCFG_RAM_ADD(RAM_TAG | |
| 553 | 553 | MCFG_RAM_DEFAULT_SIZE("1664K") |
| 554 | 554 | MACHINE_CONFIG_END |
| 555 | 555 | |
| r9922 | r9923 | |
| 622 | 622 | MCFG_FLOPPY_2_DRIVES_ADD(ibmat_floppy_config) |
| 623 | 623 | |
| 624 | 624 | /* internal ram */ |
| 625 | MCFG_RAM_ADD( | |
| 625 | MCFG_RAM_ADD(RAM_TAG | |
| 626 | 626 | MCFG_RAM_DEFAULT_SIZE("1664K") |
| 627 | 627 | MACHINE_CONFIG_END |
| 628 | 628 | |
| r9922 | r9923 | |
| 693 | 693 | MCFG_FLOPPY_2_DRIVES_ADD(ibmat_floppy_config) |
| 694 | 694 | |
| 695 | 695 | /* internal ram */ |
| 696 | MCFG_RAM_ADD( | |
| 696 | MCFG_RAM_ADD(RAM_TAG | |
| 697 | 697 | MCFG_RAM_DEFAULT_SIZE("1664K") |
| 698 | 698 | MACHINE_CONFIG_END |
| 699 | 699 | |
| r9922 | r9923 | |
| 766 | 766 | MCFG_FLOPPY_2_DRIVES_ADD(ibmat_floppy_config) |
| 767 | 767 | |
| 768 | 768 | /* internal ram */ |
| 769 | MCFG_RAM_ADD( | |
| 769 | MCFG_RAM_ADD(RAM_TAG | |
| 770 | 770 | MCFG_RAM_DEFAULT_SIZE("1664K") |
| 771 | 771 | MACHINE_CONFIG_END |
| 772 | 772 | |
| r9922 | r9923 | |
| 841 | 841 | MCFG_FLOPPY_2_DRIVES_ADD(ibmat_floppy_config) |
| 842 | 842 | |
| 843 | 843 | /* internal ram */ |
| 844 | MCFG_RAM_ADD( | |
| 844 | MCFG_RAM_ADD(RAM_TAG | |
| 845 | 845 | MCFG_RAM_DEFAULT_SIZE("1664K") |
| 846 | 846 | MACHINE_CONFIG_END |
| 847 | 847 |
| r9922 | r9923 | |
|---|---|---|
| 18 | 18 | #include "devices/flopdrv.h" |
| 19 | 19 | #include "formats/basicdsk.h" |
| 20 | 20 | #include "includes/vector06.h" |
| 21 | #include " | |
| 21 | #include "ma | |
| 22 | 22 | |
| 23 | 23 | /* Address maps */ |
| 24 | 24 | static ADDRESS_MAP_START(vector06_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r9922 | r9923 | |
| 210 | 210 | MCFG_CARTSLOT_NOT_MANDATORY |
| 211 | 211 | |
| 212 | 212 | /* internal ram */ |
| 213 | MCFG_RAM_ADD( | |
| 213 | MCFG_RAM_ADD(RAM_TAG | |
| 214 | 214 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 215 | 215 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 216 | 216 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 110 | 110 | #include "cpu/m6502/m6502.h" |
| 111 | 111 | #include "cpu/mcs48/mcs48.h" |
| 112 | 112 | #include "devices/flopdrv.h" |
| 113 | #include " | |
| 113 | #include "ma | |
| 114 | 114 | #include "formats/basicdsk.h" |
| 115 | 115 | #include "machine/ctronics.h" |
| 116 | 116 | #include "machine/i8214.h" |
| r9922 | r9923 | |
| 1124 | 1124 | cpu_set_irq_callback(m_maincpu, v1050_int_ack); |
| 1125 | 1125 | |
| 1126 | 1126 | /* setup memory banking */ |
| 1127 | UINT8 *ram = | |
| 1127 | UINT8 *ram = | |
| 1128 | 1128 | |
| 1129 | 1129 | memory_configure_bank(machine, "bank1", 0, 2, ram, 0x10000); |
| 1130 | 1130 | memory_configure_bank(machine, "bank1", 2, 1, ram + 0x1c000, 0); |
| r9922 | r9923 | |
| 1215 | 1215 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics) |
| 1216 | 1216 | |
| 1217 | 1217 | /* internal ram */ |
| 1218 | MCFG_RAM_ADD( | |
| 1218 | MCFG_RAM_ADD(RAM_TAG | |
| 1219 | 1219 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 1220 | 1220 | MACHINE_CONFIG_END |
| 1221 | 1221 |
| r9922 | r9923 | |
|---|---|---|
| 38 | 38 | #include "cpu/m68000/m68000.h" |
| 39 | 39 | #include "cpu/mcs48/mcs48.h" |
| 40 | 40 | #include "formats/basicdsk.h" |
| 41 | #include " | |
| 41 | #include "ma | |
| 42 | 42 | #include "machine/msm8251.h" |
| 43 | 43 | #include "sound/ay8910.h" |
| 44 | 44 |
| r9922 | r9923 | |
|---|---|---|
| 47 | 47 | #include "cpu/mcs51/mcs51.h" |
| 48 | 48 | #include "devices/cartslot.h" |
| 49 | 49 | #include "devices/flopdrv.h" |
| 50 | #include " | |
| 50 | #include "ma | |
| 51 | 51 | #include "devices/microdrv.h" |
| 52 | 52 | #include "formats/basicdsk.h" |
| 53 | 53 | #include "machine/zx8302.h" |
| r9922 | r9923 | |
| 746 | 746 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 747 | 747 | |
| 748 | 748 | // configure RAM |
| 749 | switch ( | |
| 749 | switch ( | |
| 750 | 750 | { |
| 751 | 751 | case 128*1024: |
| 752 | 752 | memory_unmap_readwrite(program, 0x040000, 0x0fffff, 0, 0); |
| r9922 | r9923 | |
| 829 | 829 | MCFG_SOFTWARE_LIST_ADD("cart_list", "ql") |
| 830 | 830 | |
| 831 | 831 | // internal ram |
| 832 | MCFG_RAM_ADD( | |
| 832 | MCFG_RAM_ADD(RAM_TAG | |
| 833 | 833 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 834 | 834 | MCFG_RAM_EXTRA_OPTIONS("192K,256K,384K,640K,896K") |
| 835 | 835 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 854 | 854 | |
| 855 | 855 | static MACHINE_CONFIG_DERIVED( opd, ql ) |
| 856 | 856 | // internal ram |
| 857 | MCFG_RAM_MODIFY( | |
| 857 | MCFG_RAM_MODIFY(RAM_TAG | |
| 858 | 858 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 859 | 859 | MCFG_RAM_EXTRA_OPTIONS("256K") |
| 860 | 860 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 867 | 867 | |
| 868 | 868 | static MACHINE_CONFIG_DERIVED( megaopd, ql ) |
| 869 | 869 | // internal ram |
| 870 | MCFG_RAM_MODIFY( | |
| 870 | MCFG_RAM_MODIFY(RAM_TAG | |
| 871 | 871 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 872 | 872 | MACHINE_CONFIG_END |
| 873 | 873 | */ |
| r9922 | r9923 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "cpu/mcs51/mcs51.h" |
| 11 | #include " | |
| 11 | #include "ma | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | class vt220_state : public driver_device |
| r9922 | r9923 | |
| 33 | 33 | |
| 34 | 34 | static MACHINE_RESET(vt220) |
| 35 | 35 | { |
| 36 | memset( | |
| 36 | memset( | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | static VIDEO_START( vt220 ) |
| r9922 | r9923 | |
| 68 | 68 | MCFG_VIDEO_UPDATE(vt220) |
| 69 | 69 | |
| 70 | 70 | /* internal ram */ |
| 71 | MCFG_RAM_ADD( | |
| 71 | MCFG_RAM_ADD(RAM_TAG | |
| 72 | 72 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 73 | 73 | MACHINE_CONFIG_END |
| 74 | 74 |
| r9922 | r9923 | |
|---|---|---|
| 242 | 242 | #include "cpu/mcs48/mcs48.h" |
| 243 | 243 | #include "devices/cassette.h" |
| 244 | 244 | #include "devices/printer.h" |
| 245 | #include " | |
| 245 | #include "ma | |
| 246 | 246 | #include "machine/z80ctc.h" |
| 247 | 247 | #include "machine/z80dart.h" |
| 248 | 248 | #include "machine/abcbus.h" |
| r9922 | r9923 | |
| 535 | 535 | else |
| 536 | 536 | { |
| 537 | 537 | // low RAM selected |
| 538 | memory_install_ram(program, 0x0000, 0x7fff, 0, 0, | |
| 538 | memory_install_ram(program, 0x0000, 0x7fff, 0, 0, | |
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | |
| r9922 | r9923 | |
| 547 | 547 | void abc806_state::bankswitch() |
| 548 | 548 | { |
| 549 | 549 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 550 | UINT32 videoram_mask = | |
| 550 | UINT32 videoram_mask = | |
| 551 | 551 | int bank; |
| 552 | 552 | char bank_name[10]; |
| 553 | 553 | |
| r9922 | r9923 | |
| 1560 | 1560 | void abc806_state::machine_start() |
| 1561 | 1561 | { |
| 1562 | 1562 | UINT8 *mem = machine->region(Z80_TAG)->base(); |
| 1563 | UINT32 videoram_size = | |
| 1563 | UINT32 videoram_size = | |
| 1564 | 1564 | int bank; |
| 1565 | 1565 | char bank_name[10]; |
| 1566 | 1566 | |
| r9922 | r9923 | |
| 1659 | 1659 | MCFG_ABC830_ADD("luxor_55_21046", ABCBUS_TAG, DRIVE_BASF_6106_08) |
| 1660 | 1660 | |
| 1661 | 1661 | // internal ram |
| 1662 | MCFG_RAM_ADD( | |
| 1662 | MCFG_RAM_ADD(RAM_TAG | |
| 1663 | 1663 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1664 | 1664 | MCFG_RAM_EXTRA_OPTIONS("32K") |
| 1665 | 1665 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1702 | 1702 | MCFG_ABC830_ADD("luxor_55_21046", ABCBUS_TAG, DRIVE_BASF_6106_08) |
| 1703 | 1703 | |
| 1704 | 1704 | // internal ram |
| 1705 | MCFG_RAM_ADD( | |
| 1705 | MCFG_RAM_ADD(RAM_TAG | |
| 1706 | 1706 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1707 | 1707 | MCFG_RAM_EXTRA_OPTIONS("32K") |
| 1708 | 1708 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1745 | 1745 | MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500)) |
| 1746 | 1746 | |
| 1747 | 1747 | // internal ram |
| 1748 | MCFG_RAM_ADD( | |
| 1748 | MCFG_RAM_ADD(RAM_TAG | |
| 1749 | 1749 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1750 | 1750 | MACHINE_CONFIG_END |
| 1751 | 1751 | |
| r9922 | r9923 | |
| 1785 | 1785 | MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500)) |
| 1786 | 1786 | |
| 1787 | 1787 | // internal ram |
| 1788 | MCFG_RAM_ADD( | |
| 1788 | MCFG_RAM_ADD(RAM_TAG | |
| 1789 | 1789 | MCFG_RAM_DEFAULT_SIZE("160K") // 32KB + 128KB |
| 1790 | 1790 | MCFG_RAM_EXTRA_OPTIONS("544K") // 32KB + 512KB |
| 1791 | 1791 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 22 | 22 | #include "devices/cartslot.h" |
| 23 | 23 | #include "formats/rk_cas.h" |
| 24 | 24 | #include "includes/orion.h" |
| 25 | #include " | |
| 25 | #include "ma | |
| 26 | 26 | |
| 27 | 27 | /* Address maps */ |
| 28 | 28 | |
| r9922 | r9923 | |
| 162 | 162 | MCFG_CARTSLOT_ADD("cart") |
| 163 | 163 | |
| 164 | 164 | /* internal ram */ |
| 165 | MCFG_RAM_ADD( | |
| 165 | MCFG_RAM_ADD(RAM_TAG | |
| 166 | 166 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 167 | 167 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 168 | 168 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 226 | 226 | MCFG_CARTSLOT_ADD("cart") |
| 227 | 227 | |
| 228 | 228 | /* internal ram */ |
| 229 | MCFG_RAM_ADD( | |
| 229 | MCFG_RAM_ADD(RAM_TAG | |
| 230 | 230 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 231 | 231 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 232 | 232 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 280 | 280 | MCFG_CARTSLOT_ADD("cart") |
| 281 | 281 | |
| 282 | 282 | /* internal ram */ |
| 283 | MCFG_RAM_ADD( | |
| 283 | MCFG_RAM_ADD(RAM_TAG | |
| 284 | 284 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 285 | 285 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 286 | 286 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 25 | 25 | #include "machine/8237dma.h" |
| 26 | 26 | #include "video/i82720.h" |
| 27 | 27 | #include "machine/upd765.h" |
| 28 | #include " | |
| 28 | #include "ma | |
| 29 | 29 | |
| 30 | 30 | #define MAIN_CLK 15974400 |
| 31 | 31 | |
| r9922 | r9923 | |
| 90 | 90 | } |
| 91 | 91 | else |
| 92 | 92 | { |
| 93 | memory_set_bankptr(machine, "bank1", | |
| 93 | memory_set_bankptr(machine, "bank1", | |
| 94 | 94 | } |
| 95 | 95 | if (state->memcmos) |
| 96 | 96 | { |
| r9922 | r9923 | |
| 98 | 98 | } |
| 99 | 99 | else |
| 100 | 100 | { |
| 101 | memory_set_bankptr(machine, "bank2", | |
| 101 | memory_set_bankptr(machine, "bank2", | |
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| r9922 | r9923 | |
| 535 | 535 | MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) |
| 536 | 536 | |
| 537 | 537 | /* internal ram */ |
| 538 | MCFG_RAM_ADD( | |
| 538 | MCFG_RAM_ADD(RAM_TAG | |
| 539 | 539 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 540 | 540 | MACHINE_CONFIG_END |
| 541 | 541 |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "cpu/z80/z80.h" |
| 11 | 11 | #include "video/mc6845.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | 15 | class tvc_state : public driver_device |
| r9922 | r9923 | |
| 42 | 42 | break; |
| 43 | 43 | case 0x10 : // RAM selected |
| 44 | 44 | memory_install_readwrite_bank(space, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 45 | memory_set_bankptr(space->machine, "bank1", | |
| 45 | memory_set_bankptr(space->machine, "bank1", | |
| 46 | 46 | break; |
| 47 | 47 | } |
| 48 | 48 | // Bank 2 is always RAM |
| 49 | memory_set_bankptr(space->machine, "bank2", | |
| 49 | memory_set_bankptr(space->machine, "bank2", | |
| 50 | 50 | if ((data & 0x20)==0) { |
| 51 | 51 | // Video RAM |
| 52 | memory_set_bankptr(space->machine, "bank3", | |
| 52 | memory_set_bankptr(space->machine, "bank3", | |
| 53 | 53 | } else { |
| 54 | 54 | // System RAM page 3 |
| 55 | memory_set_bankptr(space->machine, "bank3", | |
| 55 | memory_set_bankptr(space->machine, "bank3", | |
| 56 | 56 | } |
| 57 | 57 | switch(data & 0xc0) { |
| 58 | 58 | case 0x00 : // Cart ROM selected |
| r9922 | r9923 | |
| 67 | 67 | break; |
| 68 | 68 | case 0x80 : // RAM selected |
| 69 | 69 | memory_install_readwrite_bank(space, 0xc000, 0xffff, 0, 0, "bank4"); |
| 70 | memory_set_bankptr(space->machine, "bank4", | |
| 70 | memory_set_bankptr(space->machine, "bank4", | |
| 71 | 71 | break; |
| 72 | 72 | case 0xc0 : // External ROM selected |
| 73 | 73 | memory_install_read_bank(space, 0xc000, 0xffff, 0, 0, "bank4"); |
| r9922 | r9923 | |
| 265 | 265 | static MACHINE_RESET(tvc) |
| 266 | 266 | { |
| 267 | 267 | tvc_state *state = machine->driver_data<tvc_state>(); |
| 268 | memset( | |
| 268 | memset( | |
| 269 | 269 | tvc_set_mem_page(machine, 0); |
| 270 | 270 | state->video_mode = 0; |
| 271 | 271 | } |
| r9922 | r9923 | |
| 292 | 292 | for ( i = 0; i < x_count; i++ ) |
| 293 | 293 | { |
| 294 | 294 | UINT16 offset = i + (y * 64); |
| 295 | UINT8 data = | |
| 295 | UINT8 data = | |
| 296 | 296 | *p++ = state->col[(data >> 7)]; |
| 297 | 297 | *p++ = state->col[(data >> 6)]; |
| 298 | 298 | *p++ = state->col[(data >> 5)]; |
| r9922 | r9923 | |
| 307 | 307 | for ( i = 0; i < x_count; i++ ) |
| 308 | 308 | { |
| 309 | 309 | UINT16 offset = i + (y * 64); |
| 310 | UINT8 data = | |
| 310 | UINT8 data = | |
| 311 | 311 | *p++ = state->col[BIT(data,7)*2 + BIT(data,3)]; |
| 312 | 312 | *p++ = state->col[BIT(data,7)*2 + BIT(data,3)]; |
| 313 | 313 | *p++ = state->col[BIT(data,6)*2 + BIT(data,2)]; |
| r9922 | r9923 | |
| 322 | 322 | for ( i = 0; i < x_count; i++ ) |
| 323 | 323 | { |
| 324 | 324 | UINT16 offset = i + (y * 64); |
| 325 | UINT8 data = | |
| 325 | UINT8 data = | |
| 326 | 326 | *p++ = state->col[(data >> 4) & 0xf]; |
| 327 | 327 | *p++ = state->col[(data >> 4) & 0xf]; |
| 328 | 328 | *p++ = state->col[(data >> 4) & 0xf]; |
| r9922 | r9923 | |
| 412 | 412 | MCFG_VIDEO_UPDATE(tvc) |
| 413 | 413 | |
| 414 | 414 | /* internal ram */ |
| 415 | MCFG_RAM_ADD( | |
| 415 | MCFG_RAM_ADD(RAM_TAG | |
| 416 | 416 | MCFG_RAM_DEFAULT_SIZE("80K") |
| 417 | 417 | MACHINE_CONFIG_END |
| 418 | 418 |
| r9922 | r9923 | |
|---|---|---|
| 120 | 120 | #include "devices/snapquik.h" |
| 121 | 121 | #include "machine/rescap.h" |
| 122 | 122 | #include "sound/beep.h" |
| 123 | #include " | |
| 123 | #include "ma | |
| 124 | 124 | |
| 125 | 125 | #define TMC2000_BANK_RAM 0 |
| 126 | 126 | #define TMC2000_BANK_ROM 1 |
| r9922 | r9923 | |
| 198 | 198 | |
| 199 | 199 | memory_set_bank(device->machine, "bank1", TMC2000_BANK_RAM); |
| 200 | 200 | |
| 201 | switch ( | |
| 201 | switch ( | |
| 202 | 202 | { |
| 203 | 203 | case 4 * 1024: |
| 204 | 204 | memory_install_readwrite_bank(cputag_get_address_space(device->machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x0fff, 0, 0x7000, "bank1"); |
| r9922 | r9923 | |
| 787 | 787 | MCFG_CASSETTE_ADD( "cassette", tmc1800_cassette_config ) |
| 788 | 788 | |
| 789 | 789 | // internal ram |
| 790 | MCFG_RAM_ADD( | |
| 790 | MCFG_RAM_ADD(RAM_TAG | |
| 791 | 791 | MCFG_RAM_DEFAULT_SIZE("2K") |
| 792 | 792 | MCFG_RAM_EXTRA_OPTIONS("4K") |
| 793 | 793 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 816 | 816 | MCFG_CASSETTE_ADD( "cassette", tmc1800_cassette_config ) |
| 817 | 817 | |
| 818 | 818 | /* internal ram */ |
| 819 | MCFG_RAM_ADD( | |
| 819 | MCFG_RAM_ADD(RAM_TAG | |
| 820 | 820 | MCFG_RAM_DEFAULT_SIZE("2K") |
| 821 | 821 | MCFG_RAM_EXTRA_OPTIONS("4K") |
| 822 | 822 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 839 | 839 | MCFG_CASSETTE_ADD( "cassette", tmc1800_cassette_config ) |
| 840 | 840 | |
| 841 | 841 | /* internal ram */ |
| 842 | MCFG_RAM_ADD( | |
| 842 | MCFG_RAM_ADD(RAM_TAG | |
| 843 | 843 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 844 | 844 | MCFG_RAM_EXTRA_OPTIONS("16K,32K") |
| 845 | 845 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 862 | 862 | MCFG_CASSETTE_ADD( "cassette", tmc1800_cassette_config ) |
| 863 | 863 | |
| 864 | 864 | /* internal ram */ |
| 865 | MCFG_RAM_ADD( | |
| 865 | MCFG_RAM_ADD(RAM_TAG | |
| 866 | 866 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 867 | 867 | MACHINE_CONFIG_END |
| 868 | 868 | |
| r9922 | r9923 | |
| 904 | 904 | UINT8 *ptr = image.device().machine->region(CDP1802_TAG)->base(); |
| 905 | 905 | int size = image.length(); |
| 906 | 906 | |
| 907 | if (size > | |
| 907 | if (size > | |
| 908 | 908 | { |
| 909 | 909 | return IMAGE_INIT_FAIL; |
| 910 | 910 | } |
| r9922 | r9923 | |
|---|---|---|
| 137 | 137 | #include "sound/sn76496.h" |
| 138 | 138 | #include "sound/wave.h" |
| 139 | 139 | #include "video/tms9928a.h" |
| 140 | #include " | |
| 140 | #include "ma | |
| 141 | 141 | |
| 142 | 142 | /*************************************************************************** |
| 143 | 143 | READ/WRITE HANDLERS |
| r9922 | r9923 | |
| 1076 | 1076 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics) |
| 1077 | 1077 | |
| 1078 | 1078 | /* internal ram */ |
| 1079 | MCFG_RAM_ADD( | |
| 1079 | MCFG_RAM_ADD(RAM_TAG | |
| 1080 | 1080 | MCFG_RAM_DEFAULT_SIZE("1K") // MAIN RAM |
| 1081 | 1081 | MCFG_RAM_EXTRA_OPTIONS("15K") // 16K expansion (lower 14K available only, upper 2K shared with BIOS ROM) |
| 1082 | 1082 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1154 | 1154 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, lasr2001_centronics_intf) |
| 1155 | 1155 | |
| 1156 | 1156 | /* internal ram */ |
| 1157 | MCFG_RAM_ADD( | |
| 1157 | MCFG_RAM_ADD(RAM_TAG | |
| 1158 | 1158 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1159 | 1159 | MCFG_RAM_EXTRA_OPTIONS("32K") |
| 1160 | 1160 |
| r9922 | r9923 | |
|---|---|---|
| 123 | 123 | #include "machine/wd17xx.h" |
| 124 | 124 | #include "devices/flopdrv.h" |
| 125 | 125 | #include "machine/upd71071.h" |
| 126 | #include " | |
| 126 | #include "ma | |
| 127 | 127 | #include "includes/fmtowns.h" |
| 128 | 128 | #include "machine/nvram.h" |
| 129 | 129 | #include "devices/harddriv.h" |
| r9922 | r9923 | |
| 993 | 993 | { |
| 994 | 994 | towns_state* state = space->machine->driver_data<towns_state>(); |
| 995 | 995 | if(state->towns_mainmem_enable != 0) |
| 996 | return | |
| 996 | return | |
| 997 | 997 | |
| 998 | 998 | return state->m_nvram[offset]; |
| 999 | 999 | } |
| r9922 | r9923 | |
| 1002 | 1002 | { |
| 1003 | 1003 | towns_state* state = space->machine->driver_data<towns_state>(); |
| 1004 | 1004 | if(state->towns_mainmem_enable != 0) |
| 1005 | | |
| 1005 | | |
| 1006 | 1006 | else |
| 1007 | 1007 | state->m_nvram[offset] = data; |
| 1008 | 1008 | } |
| r9922 | r9923 | |
| 1028 | 1028 | { |
| 1029 | 1029 | ROM = space->machine->region("user")->base(); |
| 1030 | 1030 | |
| 1031 | // memory_set_bankptr(space->machine,1,messram_get_ptr(state->messram)+0xc0000); | |
| 1032 | // memory_set_bankptr(space->machine,2,messram_get_ptr(state->messram)+0xc8000); | |
| 1033 | // memory_set_bankptr(space->machine,3,messram_get_ptr(state->messram)+0xc9000); | |
| 1034 | // memory_set_bankptr(space->machine,4,messram_get_ptr(state->messram)+0xca000); | |
| 1035 | // memory_set_bankptr(space->machine,5,messram_get_ptr(state->messram)+0xca000); | |
| 1036 | // memory_set_bankptr(space->machine,10,messram_get_ptr(state->messram)+0xca800); | |
| 1037 | memory_set_bankptr(space->machine,"bank6",messram_get_ptr(state->messram)+0xcb000); | |
| 1038 | memory_set_bankptr(space->machine,"bank7",messram_get_ptr(state->messram)+0xcb000); | |
| 1031 | // memory_set_bankptr(space->machine,1,ram_get_ptr(state->messram)+0xc0000); | |
| 1032 | // memory_set_bankptr(space->machine,2,ram_get_ptr(state->messram)+0xc8000); | |
| 1033 | // memory_set_bankptr(space->machine,3,ram_get_ptr(state->messram)+0xc9000); | |
| 1034 | // memory_set_bankptr(space->machine,4,ram_get_ptr(state->messram)+0xca000); | |
| 1035 | // memory_set_bankptr(space->machine,5,ram_get_ptr(state->messram)+0xca000); | |
| 1036 | // memory_set_bankptr(space->machine,10,ram_get_ptr(state->messram)+0xca800); | |
| 1037 | memory_set_bankptr(space->machine,"bank6",ram_get_ptr(state->messram)+0xcb000); | |
| 1038 | memory_set_bankptr(space->machine,"bank7",ram_get_ptr(state->messram)+0xcb000); | |
| 1039 | 1039 | if(state->towns_system_port & 0x02) |
| 1040 | memory_set_bankptr(space->machine,"bank11", | |
| 1040 | memory_set_bankptr(space->machine,"bank11", | |
| 1041 | 1041 | else |
| 1042 | 1042 | memory_set_bankptr(space->machine,"bank11",ROM+0x238000); |
| 1043 | memory_set_bankptr(space->machine,"bank12", | |
| 1043 | memory_set_bankptr(space->machine,"bank12", | |
| 1044 | 1044 | return; |
| 1045 | 1045 | } |
| 1046 | 1046 | else // enable I/O ports and VRAM |
| r9922 | r9923 | |
| 1049 | 1049 | |
| 1050 | 1050 | // memory_set_bankptr(space->machine,1,towns_gfxvram+(towns_vram_rplane*0x8000)); |
| 1051 | 1051 | // memory_set_bankptr(space->machine,2,towns_txtvram); |
| 1052 | // memory_set_bankptr(space->machine,3, | |
| 1052 | // memory_set_bankptr(space->machine,3, | |
| 1053 | 1053 | // if(towns_ankcg_enable != 0) |
| 1054 | 1054 | // memory_set_bankptr(space->machine,4,ROM+0x180000+0x3d000); // ANK CG 8x8 |
| 1055 | 1055 | // else |
| 1056 | 1056 | // memory_set_bankptr(space->machine,4,towns_txtvram+0x2000); |
| 1057 | 1057 | // memory_set_bankptr(space->machine,5,towns_txtvram+0x2000); |
| 1058 | // memory_set_bankptr(space->machine,10, | |
| 1058 | // memory_set_bankptr(space->machine,10, | |
| 1059 | 1059 | if(state->towns_ankcg_enable != 0) |
| 1060 | 1060 | memory_set_bankptr(space->machine,"bank6",ROM+0x180000+0x3d800); // ANK CG 8x16 |
| 1061 | 1061 | else |
| 1062 | memory_set_bankptr(space->machine,"bank6",messram_get_ptr(state->messram)+0xcb000); | |
| 1063 | memory_set_bankptr(space->machine,"bank7",messram_get_ptr(state->messram)+0xcb000); | |
| 1062 | memory_set_bankptr(space->machine,"bank6",ram_get_ptr(state->messram)+0xcb000); | |
| 1063 | memory_set_bankptr(space->machine,"bank7",ram_get_ptr(state->messram)+0xcb000); | |
| 1064 | 1064 | if(state->towns_system_port & 0x02) |
| 1065 | memory_set_bankptr(space->machine,"bank11", | |
| 1065 | memory_set_bankptr(space->machine,"bank11", | |
| 1066 | 1066 | else |
| 1067 | 1067 | memory_set_bankptr(space->machine,"bank11",ROM+0x238000); |
| 1068 | memory_set_bankptr(space->machine,"bank12", | |
| 1068 | memory_set_bankptr(space->machine,"bank12", | |
| 1069 | 1069 | return; |
| 1070 | 1070 | } |
| 1071 | 1071 | } |
| r9922 | r9923 | |
| 2298 | 2298 | state->pic_master = machine->device("pic8259_master"); |
| 2299 | 2299 | state->pic_slave = machine->device("pic8259_slave"); |
| 2300 | 2300 | state->pit = machine->device("pit"); |
| 2301 | state->messram = machine->device( | |
| 2301 | state->messram = machine->device(RAM_TAG | |
| 2302 | 2302 | state->cdrom = machine->device("cdrom"); |
| 2303 | 2303 | state->cdda = machine->device("cdda"); |
| 2304 | 2304 | state->scsi = machine->device<fmscsi_device>("scsi"); |
| r9922 | r9923 | |
| 2509 | 2509 | MCFG_VIDEO_UPDATE(towns) |
| 2510 | 2510 | |
| 2511 | 2511 | /* internal ram */ |
| 2512 | MCFG_RAM_ADD( | |
| 2512 | MCFG_RAM_ADD(RAM_TAG | |
| 2513 | 2513 | MCFG_RAM_DEFAULT_SIZE("6M") |
| 2514 | 2514 | MACHINE_CONFIG_END |
| 2515 | 2515 |
| r9922 | r9923 | |
|---|---|---|
| 63 | 63 | #include "formats/basicdsk.h" |
| 64 | 64 | #include "devices/cartslot.h" |
| 65 | 65 | #include "devices/cassette.h" |
| 66 | #include " | |
| 66 | #include "ma | |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | /************************************* |
| r9922 | r9923 | |
| 306 | 306 | MCFG_CASSETTE_ADD( "cassette", default_cassette_config ) |
| 307 | 307 | |
| 308 | 308 | /* internal ram */ |
| 309 | MCFG_RAM_ADD( | |
| 309 | MCFG_RAM_ADD(RAM_TAG | |
| 310 | 310 | MCFG_RAM_DEFAULT_SIZE("40K") |
| 311 | 311 | MCFG_RAM_EXTRA_OPTIONS("1K,16K,32K") |
| 312 | 312 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "formats/basicdsk.h" |
| 14 | 14 | #include "devices/cassette.h" |
| 15 | 15 | #include "machine/rescap.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | #include "newbrain.lh" |
| 18 | 18 | |
| 19 | 19 | /* |
| r9922 | r9923 | |
| 1575 | 1575 | MCFG_CASSETTE_ADD("cassette2", newbrain_cassette_config) |
| 1576 | 1576 | |
| 1577 | 1577 | /* internal ram */ |
| 1578 | MCFG_RAM_ADD( | |
| 1578 | MCFG_RAM_ADD(RAM_TAG | |
| 1579 | 1579 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 1580 | 1580 | |
| 1581 | 1581 | MCFG_NEWBRAIN_SERIAL_ADD("serial") |
| r9922 | r9923 | |
| 1625 | 1625 | MCFG_FLOPPY_2_DRIVES_ADD(newbrain_floppy_config) |
| 1626 | 1626 | |
| 1627 | 1627 | /* internal ram */ |
| 1628 | MCFG_RAM_MODIFY( | |
| 1628 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1629 | 1629 | MCFG_RAM_DEFAULT_SIZE("96K") |
| 1630 | 1630 | MACHINE_CONFIG_END |
| 1631 | 1631 |
| r9922 | r9923 | |
|---|---|---|
| 18 | 18 | #include "cpu/i8085/i8085.h" |
| 19 | 19 | #include "cpu/z80/z80.h" |
| 20 | 20 | #include "includes/sapi1.h" |
| 21 | #include " | |
| 21 | #include "ma | |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /* switch out the rom shadow */ |
| r9922 | r9923 | |
| 155 | 155 | MCFG_VIDEO_UPDATE(sapi1) |
| 156 | 156 | |
| 157 | 157 | /* internal ram */ |
| 158 | MCFG_RAM_ADD( | |
| 158 | MCFG_RAM_ADD(RAM_TAG | |
| 159 | 159 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 160 | 160 | MACHINE_CONFIG_END |
| 161 | 161 | |
| r9922 | r9923 | |
| 183 | 183 | MCFG_VIDEO_UPDATE(sapizps3) |
| 184 | 184 | |
| 185 | 185 | /* internal ram */ |
| 186 | MCFG_RAM_ADD( | |
| 186 | MCFG_RAM_ADD(RAM_TAG | |
| 187 | 187 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 188 | 188 | MACHINE_CONFIG_END |
| 189 | 189 |
| r9922 | r9923 | |
|---|---|---|
| 61 | 61 | #include "sound/ay8910.h" |
| 62 | 62 | #include "video/mc6845.h" |
| 63 | 63 | #include "rendlay.h" |
| 64 | #include " | |
| 64 | #include "ma | |
| 65 | 65 | #include "includes/einstein.h" |
| 66 | 66 | |
| 67 | 67 | /*************************************************************************** |
| r9922 | r9923 | |
| 270 | 270 | static void einstein_page_rom(running_machine *machine) |
| 271 | 271 | { |
| 272 | 272 | einstein_state *einstein = machine->driver_data<einstein_state>(); |
| 273 | memory_set_bankptr(machine, "bank1", einstein->rom_enabled ? machine->region("bios")->base() : | |
| 273 | memory_set_bankptr(machine, "bank1", einstein->rom_enabled ? machine->region("bios")->base() : | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /* writing to this port is a simple trigger, and switches between RAM and ROM */ |
| r9922 | r9923 | |
| 399 | 399 | einstein->ctc = machine->device(IC_I058); |
| 400 | 400 | |
| 401 | 401 | /* initialize memory mapping */ |
| 402 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram"))); | |
| 403 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 402 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG))); | |
| 403 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 404 | 404 | einstein->rom_enabled = 1; |
| 405 | 405 | einstein_page_rom(machine); |
| 406 | 406 | |
| r9922 | r9923 | |
| 775 | 775 | |
| 776 | 776 | /* RAM is provided by 8k DRAM ICs i009, i010, i011, i012, i013, i014, i015 and i016 */ |
| 777 | 777 | /* internal ram */ |
| 778 | MCFG_RAM_ADD( | |
| 778 | MCFG_RAM_ADD(RAM_TAG | |
| 779 | 779 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 780 | 780 | MACHINE_CONFIG_END |
| 781 | 781 |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "machine/i8255a.h" |
| 12 | 12 | #include "machine/pit8253.h" |
| 13 | 13 | #include "machine/msm8251.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | |
| 16 | 16 | class fk1_state : public driver_device |
| 17 | 17 | { |
| r9922 | r9923 | |
| 255 | 255 | { |
| 256 | 256 | address_space *space_mem = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 257 | 257 | memory_install_write_bank(space_mem, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 258 | memory_set_bankptr(space->machine, "bank1", messram_get_ptr(space->machine->device("messram"))); | |
| 259 | memory_set_bankptr(space->machine, "bank2", messram_get_ptr(space->machine->device("messram")) + 0x4000); | |
| 258 | memory_set_bankptr(space->machine, "bank1", ram_get_ptr(space->machine->device(RAM_TAG))); | |
| 259 | memory_set_bankptr(space->machine, "bank2", ram_get_ptr(space->machine->device(RAM_TAG)) + 0x4000); | |
| 260 | 260 | return 0; |
| 261 | 261 | } |
| 262 | 262 | |
| r9922 | r9923 | |
| 265 | 265 | address_space *space_mem = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 266 | 266 | memory_unmap_write(space_mem, 0x0000, 0x3fff, 0, 0); |
| 267 | 267 | memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base()); |
| 268 | memory_set_bankptr(space->machine, "bank2", | |
| 268 | memory_set_bankptr(space->machine, "bank2", | |
| 269 | 269 | return 0; |
| 270 | 270 | } |
| 271 | 271 | |
| r9922 | r9923 | |
| 381 | 381 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 382 | 382 | memory_unmap_write(space, 0x0000, 0x3fff, 0, 0); |
| 383 | 383 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base()); // ROM |
| 384 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x10000); // VRAM | |
| 385 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 386 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 384 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x10000); // VRAM | |
| 385 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 386 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 387 | 387 | |
| 388 | 388 | cpu_set_irq_callback(machine->device("maincpu"), fk1_irq_callback); |
| 389 | 389 | } |
| r9922 | r9923 | |
| 399 | 399 | fk1_state *state = screen->machine->driver_data<fk1_state>(); |
| 400 | 400 | UINT8 code; |
| 401 | 401 | int y, x, b; |
| 402 | UINT8 *ram = | |
| 402 | UINT8 *ram = | |
| 403 | 403 | |
| 404 | 404 | for (x = 0; x < 64; x++) |
| 405 | 405 | { |
| r9922 | r9923 | |
| 445 | 445 | MCFG_MSM8251_ADD("uart", default_msm8251_interface) |
| 446 | 446 | |
| 447 | 447 | /* internal ram */ |
| 448 | MCFG_RAM_ADD( | |
| 448 | MCFG_RAM_ADD(RAM_TAG | |
| 449 | 449 | MCFG_RAM_DEFAULT_SIZE("80K") // 64 + 16 |
| 450 | 450 | MACHINE_CONFIG_END |
| 451 | 451 |
| r9922 | r9923 | |
|---|---|---|
| 61 | 61 | #include "emu.h" |
| 62 | 62 | #include "cpu/z80/z80.h" |
| 63 | 63 | #include "devices/flopdrv.h" |
| 64 | #include " | |
| 64 | #include "ma | |
| 65 | 65 | #include "machine/ctronics.h" |
| 66 | 66 | #include "machine/terminal.h" |
| 67 | 67 | #include "machine/wd17xx.h" |
| r9922 | r9923 | |
| 513 | 513 | offset |= 0x10000; |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | UINT8 *ram = | |
| 516 | UINT8 *ram = | |
| 517 | 517 | UINT8 data = ram[offset]; |
| 518 | 518 | |
| 519 | 519 | switch (m_exdma >> 3) |
| r9922 | r9923 | |
| 534 | 534 | offset |= 0x10000; |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | UINT8 *ram = | |
| 537 | UINT8 *ram = | |
| 538 | 538 | ram[offset] = data; |
| 539 | 539 | |
| 540 | 540 | switch (m_exdma >> 3) |
| r9922 | r9923 | |
| 678 | 678 | void bullet_state::machine_start() |
| 679 | 679 | { |
| 680 | 680 | // setup memory banking |
| 681 | UINT8 *ram = | |
| 681 | UINT8 *ram = | |
| 682 | 682 | |
| 683 | 683 | memory_configure_bank(machine, "bank1", 0, 2, ram, 0x10000); |
| 684 | 684 | memory_configure_bank(machine, "bank1", 2, 1, machine->region(Z80_TAG)->base(), 0); |
| r9922 | r9923 | |
| 748 | 748 | MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf) |
| 749 | 749 | |
| 750 | 750 | // internal ram |
| 751 | MCFG_RAM_ADD( | |
| 751 | MCFG_RAM_ADD(RAM_TAG | |
| 752 | 752 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 753 | 753 | MACHINE_CONFIG_END |
| 754 | 754 |
| r9922 | r9923 | |
|---|---|---|
| 42 | 42 | #include "formats/basicdsk.h" |
| 43 | 43 | #include "machine/wd17xx.h" |
| 44 | 44 | #include "machine/6821pia.h" |
| 45 | #include " | |
| 45 | #include "ma | |
| 46 | 46 | #include "includes/osborne1.h" |
| 47 | 47 | |
| 48 | 48 | |
| r9922 | r9923 | |
| 269 | 269 | MCFG_FLOPPY_2_DRIVES_ADD(osborne1_floppy_config) |
| 270 | 270 | |
| 271 | 271 | /* internal ram */ |
| 272 | MCFG_RAM_ADD( | |
| 272 | MCFG_RAM_ADD(RAM_TAG | |
| 273 | 273 | MCFG_RAM_DEFAULT_SIZE("68K") /* 64KB Main RAM and 4Kbit video attribute RAM */ |
| 274 | 274 | MACHINE_CONFIG_END |
| 275 | 275 |
| r9922 | r9923 | |
|---|---|---|
| 123 | 123 | #include "devices/snapquik.h" |
| 124 | 124 | #include "devices/cassette.h" |
| 125 | 125 | #include "devices/z80bin.h" |
| 126 | #include " | |
| 126 | #include "ma | |
| 127 | 127 | #include "formats/vt_cas.h" |
| 128 | 128 | |
| 129 | 129 | |
| r9922 | r9923 | |
| 696 | 696 | vtech1->printer = machine->device("printer"); |
| 697 | 697 | |
| 698 | 698 | /* ram */ |
| 699 | vtech1->ram = messram_get_ptr(machine->device("messram")); | |
| 700 | vtech1->ram_size = messram_get_size(machine->device("messram")); | |
| 699 | vtech1->ram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 700 | vtech1->ram_size = ram_get_size(machine->device(RAM_TAG)); | |
| 701 | 701 | |
| 702 | 702 | /* setup memory banking */ |
| 703 | 703 | memory_set_bankptr(machine, "bank1", vtech1->ram); |
| r9922 | r9923 | |
| 1047 | 1047 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 1048 | 1048 | |
| 1049 | 1049 | /* internal ram */ |
| 1050 | MCFG_RAM_ADD( | |
| 1050 | MCFG_RAM_ADD(RAM_TAG | |
| 1051 | 1051 | MCFG_RAM_DEFAULT_SIZE("66K") |
| 1052 | 1052 | MCFG_RAM_EXTRA_OPTIONS("2K,18K,4098K") |
| 1053 | 1053 | |
| r9922 | r9923 | |
| 1065 | 1065 | MCFG_CPU_PROGRAM_MAP(laser210_mem) |
| 1066 | 1066 | |
| 1067 | 1067 | /* internal ram */ |
| 1068 | MCFG_RAM_MODIFY( | |
| 1068 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1069 | 1069 | MCFG_RAM_DEFAULT_SIZE("66K") |
| 1070 | 1070 | MCFG_RAM_EXTRA_OPTIONS("6K,22K,4098K") |
| 1071 | 1071 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1075 | 1075 | MCFG_CPU_PROGRAM_MAP(laser310_mem) |
| 1076 | 1076 | |
| 1077 | 1077 | /* internal ram */ |
| 1078 | MCFG_RAM_MODIFY( | |
| 1078 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1079 | 1079 | MCFG_RAM_DEFAULT_SIZE("66K") |
| 1080 | 1080 | MCFG_RAM_EXTRA_OPTIONS("16K,32K,4098K") |
| 1081 | 1081 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 106 | 106 | #include "devices/cassette.h" |
| 107 | 107 | #include "formats/tzx_cas.h" |
| 108 | 108 | |
| 109 | #include " | |
| 109 | #include "ma | |
| 110 | 110 | |
| 111 | 111 | #define MANUFACTURER_NAME 0x07 |
| 112 | 112 | #define TV_REFRESH_RATE 0x10 |
| r9922 | r9923 | |
| 918 | 918 | MCFG_FLOPPY_2_DRIVES_ADD(cpc6128_floppy_config) |
| 919 | 919 | |
| 920 | 920 | /* internal ram */ |
| 921 | MCFG_RAM_ADD( | |
| 921 | MCFG_RAM_ADD(RAM_TAG | |
| 922 | 922 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 923 | 923 | MACHINE_CONFIG_END |
| 924 | 924 | |
| r9922 | r9923 | |
| 982 | 982 | MCFG_FLOPPY_2_DRIVES_ADD(cpc6128_floppy_config) |
| 983 | 983 | |
| 984 | 984 | /* internal ram */ |
| 985 | MCFG_RAM_ADD( | |
| 985 | MCFG_RAM_ADD(RAM_TAG | |
| 986 | 986 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 987 | 987 | MACHINE_CONFIG_END |
| 988 | 988 | |
| r9922 | r9923 | |
| 1024 | 1024 | MCFG_FRAGMENT_ADD(cpcplus_cartslot) |
| 1025 | 1025 | |
| 1026 | 1026 | /* internal ram */ |
| 1027 | MCFG_RAM_ADD( | |
| 1027 | MCFG_RAM_ADD(RAM_TAG | |
| 1028 | 1028 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1029 | 1029 | MACHINE_CONFIG_END |
| 1030 | 1030 | |
| r9922 | r9923 | |
| 1044 | 1044 | MCFG_FLOPPY_2_DRIVES_MODIFY(aleste_floppy_config) |
| 1045 | 1045 | |
| 1046 | 1046 | /* internal ram */ |
| 1047 | MCFG_RAM_MODIFY( | |
| 1047 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1048 | 1048 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 1049 | 1049 | MACHINE_CONFIG_END |
| 1050 | 1050 |
| r9922 | r9923 | |
|---|---|---|
| 67 | 67 | #include "cpu/i8085/i8085.h" |
| 68 | 68 | #include "devices/cartslot.h" |
| 69 | 69 | #include "devices/cassette.h" |
| 70 | #include " | |
| 70 | #include "ma | |
| 71 | 71 | #include "machine/ctronics.h" |
| 72 | 72 | #include "machine/upd1990a.h" |
| 73 | 73 | #include "machine/i8155.h" |
| r9922 | r9923 | |
| 142 | 142 | switch (ram_bank) |
| 143 | 143 | { |
| 144 | 144 | case 0: |
| 145 | if ( | |
| 145 | if ( | |
| 146 | 146 | { |
| 147 | 147 | memory_install_readwrite_bank(program, 0x8000, 0xffff, 0, 0, "bank2"); |
| 148 | 148 | } |
| r9922 | r9923 | |
| 158 | 158 | break; |
| 159 | 159 | |
| 160 | 160 | case 2: |
| 161 | if ( | |
| 161 | if ( | |
| 162 | 162 | memory_install_readwrite_bank(program, 0x8000, 0xffff, 0, 0, "bank2"); |
| 163 | 163 | else |
| 164 | 164 | memory_unmap_readwrite(program, 0x8000, 0xffff, 0, 0); |
| 165 | 165 | break; |
| 166 | 166 | |
| 167 | 167 | case 3: |
| 168 | if ( | |
| 168 | if ( | |
| 169 | 169 | memory_install_readwrite_bank(program, 0x8000, 0xffff, 0, 0, "bank2"); |
| 170 | 170 | else |
| 171 | 171 | memory_unmap_readwrite(program, 0x8000, 0xffff, 0, 0); |
| r9922 | r9923 | |
| 488 | 488 | memory_set_bank(machine, "bank1", rom_bank); |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | if ( | |
| 491 | if ( | |
| 492 | 492 | { |
| 493 | 493 | /* invalid RAM bank */ |
| 494 | 494 | memory_unmap_readwrite(program, 0xa000, 0xffff, 0, 0); |
| r9922 | r9923 | |
| 1140 | 1140 | memory_set_bank(machine, "bank1", 0); |
| 1141 | 1141 | |
| 1142 | 1142 | /* configure RAM banking */ |
| 1143 | switch ( | |
| 1143 | switch ( | |
| 1144 | 1144 | { |
| 1145 | 1145 | case 16 * 1024: |
| 1146 | 1146 | memory_unmap_readwrite(program, 0x8000, 0xbfff, 0, 0); |
| r9922 | r9923 | |
| 1152 | 1152 | break; |
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | memory_configure_bank(machine, "bank2", 0, 1, | |
| 1155 | memory_configure_bank(machine, "bank2", 0, 1, | |
| 1156 | 1156 | memory_set_bank(machine, "bank2", 0); |
| 1157 | 1157 | |
| 1158 | 1158 | /* register for state saving */ |
| r9922 | r9923 | |
| 1164 | 1164 | |
| 1165 | 1165 | void pc8201_state::machine_start() |
| 1166 | 1166 | { |
| 1167 | UINT8 *ram = | |
| 1167 | UINT8 *ram = | |
| 1168 | 1168 | |
| 1169 | 1169 | /* initialize RTC */ |
| 1170 | 1170 | upd1990a_cs_w(m_rtc, 1); |
| r9922 | r9923 | |
| 1207 | 1207 | memory_set_bank(machine, "bank1", 0); |
| 1208 | 1208 | |
| 1209 | 1209 | /* configure RAM banking */ |
| 1210 | switch ( | |
| 1210 | switch ( | |
| 1211 | 1211 | { |
| 1212 | 1212 | case 8 * 1024: |
| 1213 | 1213 | memory_unmap_readwrite(program, 0x8000, 0xcfff, 0, 0); |
| r9922 | r9923 | |
| 1229 | 1229 | break; |
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | memory_configure_bank(machine, "bank2", 0, 1, | |
| 1232 | memory_configure_bank(machine, "bank2", 0, 1, | |
| 1233 | 1233 | memory_set_bank(machine, "bank2", 0); |
| 1234 | 1234 | |
| 1235 | 1235 | /* register for state saving */ |
| r9922 | r9923 | |
| 1248 | 1248 | memory_set_bank(machine, "bank1", 0); |
| 1249 | 1249 | |
| 1250 | 1250 | /* configure RAM banking */ |
| 1251 | memory_configure_bank(machine, "bank2", 0, 3, | |
| 1251 | memory_configure_bank(machine, "bank2", 0, 3, | |
| 1252 | 1252 | memory_set_bank(machine, "bank2", 0); |
| 1253 | 1253 | |
| 1254 | 1254 | /* register for state saving */ |
| r9922 | r9923 | |
| 1325 | 1325 | MCFG_SOFTWARE_LIST_ADD("cart_list", "trsm100") |
| 1326 | 1326 | |
| 1327 | 1327 | /* internal ram */ |
| 1328 | MCFG_RAM_ADD( | |
| 1328 | MCFG_RAM_ADD(RAM_TAG | |
| 1329 | 1329 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1330 | 1330 | MCFG_RAM_EXTRA_OPTIONS("32K") |
| 1331 | 1331 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1367 | 1367 | MCFG_SOFTWARE_LIST_ADD("cart_list", "pc8201") |
| 1368 | 1368 | |
| 1369 | 1369 | /* internal ram */ |
| 1370 | MCFG_RAM_ADD( | |
| 1370 | MCFG_RAM_ADD(RAM_TAG | |
| 1371 | 1371 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1372 | 1372 | MCFG_RAM_EXTRA_OPTIONS("32K,64K,96K") |
| 1373 | 1373 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1404 | 1404 | MCFG_SOFTWARE_LIST_ADD("cart_list", "trsm100") |
| 1405 | 1405 | |
| 1406 | 1406 | /* internal ram */ |
| 1407 | MCFG_RAM_ADD( | |
| 1407 | MCFG_RAM_ADD(RAM_TAG | |
| 1408 | 1408 | MCFG_RAM_DEFAULT_SIZE("8K") |
| 1409 | 1409 | MCFG_RAM_EXTRA_OPTIONS("16K,24K,32K") |
| 1410 | 1410 | MACHINE_CONFIG_END |
| 1411 | 1411 | |
| 1412 | 1412 | static MACHINE_CONFIG_DERIVED( tandy102, trsm100 ) |
| 1413 | MCFG_RAM_MODIFY( | |
| 1413 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1414 | 1414 | MCFG_RAM_DEFAULT_SIZE("24K") |
| 1415 | 1415 | MCFG_RAM_EXTRA_OPTIONS("32K") |
| 1416 | 1416 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1452 | 1452 | MCFG_SOFTWARE_LIST_ADD("cart_list", "tandy200") |
| 1453 | 1453 | |
| 1454 | 1454 | /* internal ram */ |
| 1455 | MCFG_RAM_ADD( | |
| 1455 | MCFG_RAM_ADD(RAM_TAG | |
| 1456 | 1456 | MCFG_RAM_DEFAULT_SIZE("24K") |
| 1457 | 1457 | MCFG_RAM_EXTRA_OPTIONS("48K,72K") |
| 1458 | 1458 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "cpu/z80/z80daisy.h" |
| 13 | 13 | #include "machine/z80pio.h" |
| 14 | 14 | #include "machine/z80ctc.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | #include "includes/llc.h" |
| 17 | 17 | |
| 18 | 18 | /* Address maps */ |
| r9922 | r9923 | |
| 368 | 368 | MCFG_Z80CTC_ADD( "z80ctc", XTAL_3MHz, llc2_ctc_intf ) |
| 369 | 369 | |
| 370 | 370 | /* internal ram */ |
| 371 | MCFG_RAM_ADD( | |
| 371 | MCFG_RAM_ADD(RAM_TAG | |
| 372 | 372 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 373 | 373 | MACHINE_CONFIG_END |
| 374 | 374 | /* ROM definition */ |
| r9922 | r9923 | |
|---|---|---|
| 45 | 45 | #include "formats/tzx_cas.h" |
| 46 | 46 | #include "devices/flopdrv.h" |
| 47 | 47 | #include "formats/coupedsk.h" |
| 48 | #include " | |
| 48 | #include "ma | |
| 49 | 49 | |
| 50 | 50 | /*************************************************************************** |
| 51 | 51 | CONSTANTS |
| r9922 | r9923 | |
| 591 | 591 | MCFG_FLOPPY_2_DRIVES_ADD(samcoupe_floppy_config) |
| 592 | 592 | |
| 593 | 593 | /* internal ram */ |
| 594 | MCFG_RAM_ADD( | |
| 594 | MCFG_RAM_ADD(RAM_TAG | |
| 595 | 595 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 596 | 596 | MCFG_RAM_EXTRA_OPTIONS("256K,1280K,1536K,2304K,2560K,3328K,3584K,4352K,4608K") |
| 597 | 597 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 25 | 25 | #include "devices/snapquik.h" |
| 26 | 26 | #include "machine/cdp1871.h" |
| 27 | 27 | #include "machine/wd17xx.h" |
| 28 | #include " | |
| 28 | #include "ma | |
| 29 | 29 | #include "video/mc6845.h" |
| 30 | 30 | |
| 31 | 31 | /* Memory Maps */ |
| r9922 | r9923 | |
| 375 | 375 | MCFG_FLOPPY_2_DRIVES_ADD(comx35_floppy_config) |
| 376 | 376 | |
| 377 | 377 | /* internal ram */ |
| 378 | MCFG_RAM_ADD( | |
| 378 | MCFG_RAM_ADD(RAM_TAG | |
| 379 | 379 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 380 | 380 | MACHINE_CONFIG_END |
| 381 | 381 | |
| r9922 | r9923 | |
| 399 | 399 | MCFG_FLOPPY_2_DRIVES_ADD(comx35_floppy_config) |
| 400 | 400 | |
| 401 | 401 | /* internal ram */ |
| 402 | MCFG_RAM_ADD( | |
| 402 | MCFG_RAM_ADD(RAM_TAG | |
| 403 | 403 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 404 | 404 | MACHINE_CONFIG_END |
| 405 | 405 |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "machine/ctronics.h" |
| 14 | 14 | #include "sound/speaker.h" |
| 15 | 15 | #include "sound/wave.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | |
| 18 | 18 | /* Read/Write Handlers */ |
| 19 | 19 | |
| r9922 | r9923 | |
| 707 | 707 | MCFG_VIDEO_UPDATE(jtc) |
| 708 | 708 | |
| 709 | 709 | /* internal ram */ |
| 710 | MCFG_RAM_ADD( | |
| 710 | MCFG_RAM_ADD(RAM_TAG | |
| 711 | 711 | MCFG_RAM_DEFAULT_SIZE("2K") |
| 712 | 712 | MACHINE_CONFIG_END |
| 713 | 713 | |
| r9922 | r9923 | |
| 718 | 718 | MCFG_CPU_PROGRAM_MAP(jtc_es1988_mem) |
| 719 | 719 | |
| 720 | 720 | /* internal ram */ |
| 721 | MCFG_RAM_MODIFY( | |
| 721 | MCFG_RAM_MODIFY(RAM_TAG | |
| 722 | 722 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 723 | 723 | MACHINE_CONFIG_END |
| 724 | 724 | |
| r9922 | r9923 | |
| 743 | 743 | MCFG_VIDEO_UPDATE(jtc_es23) |
| 744 | 744 | |
| 745 | 745 | /* internal ram */ |
| 746 | MCFG_RAM_ADD( | |
| 746 | MCFG_RAM_ADD(RAM_TAG | |
| 747 | 747 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 748 | 748 | MACHINE_CONFIG_END |
| 749 | 749 | |
| r9922 | r9923 | |
| 768 | 768 | MCFG_VIDEO_UPDATE(jtc_es40) |
| 769 | 769 | |
| 770 | 770 | /* internal ram */ |
| 771 | MCFG_RAM_ADD( | |
| 771 | MCFG_RAM_ADD(RAM_TAG | |
| 772 | 772 | MCFG_RAM_DEFAULT_SIZE("8K") |
| 773 | 773 | MCFG_RAM_EXTRA_OPTIONS("16K,32K") |
| 774 | 774 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 34 | 34 | #include "machine/z80pio.h" |
| 35 | 35 | #include "machine/wd17xx.h" |
| 36 | 36 | #include "sound/ay8910.h" |
| 37 | #include " | |
| 37 | #include "ma | |
| 38 | 38 | |
| 39 | 39 | INLINE device_t *get_floppy_image(running_machine *machine, int drive) |
| 40 | 40 | { |
| r9922 | r9923 | |
| 593 | 593 | |
| 594 | 594 | /* setup memory banking */ |
| 595 | 595 | memory_configure_bank(machine, "bank1", BANK_ROM, 1, machine->region(Z80_TAG)->base(), 0); |
| 596 | memory_configure_bank(machine, "bank1", BANK_RAM, 1, | |
| 596 | memory_configure_bank(machine, "bank1", BANK_RAM, 1, | |
| 597 | 597 | memory_configure_bank(machine, "bank1", BANK_VIDEO_RAM, 1, state->video_ram, 0); |
| 598 | 598 | |
| 599 | memory_configure_bank(machine, "bank2", BANK_RAM, 1, | |
| 599 | memory_configure_bank(machine, "bank2", BANK_RAM, 1, | |
| 600 | 600 | memory_configure_bank(machine, "bank2", BANK_VIDEO_RAM, 1, state->video_ram + 0x4000, 0); |
| 601 | 601 | |
| 602 | memory_configure_bank(machine, "bank3", BANK_RAM, 1, | |
| 602 | memory_configure_bank(machine, "bank3", BANK_RAM, 1, | |
| 603 | 603 | |
| 604 | 604 | tiki100_bankswitch(machine); |
| 605 | 605 | |
| r9922 | r9923 | |
| 691 | 691 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 692 | 692 | |
| 693 | 693 | /* internal ram */ |
| 694 | MCFG_RAM_ADD( | |
| 694 | MCFG_RAM_ADD(RAM_TAG | |
| 695 | 695 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 696 | 696 | MACHINE_CONFIG_END |
| 697 | 697 |
| r9922 | r9923 | |
|---|---|---|
| 7 | 7 | #include "sound/speaker.h" |
| 8 | 8 | #include "machine/wd17xx.h" |
| 9 | 9 | #include "machine/beta.h" |
| 10 | #include " | |
| 10 | #include "ma | |
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | class atm_state : public driver_device |
| r9922 | r9923 | |
| 62 | 62 | { |
| 63 | 63 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 64 | 64 | device_t *beta = machine->device(BETA_DISK_TAG); |
| 65 | UINT8 *messram = | |
| 65 | UINT8 *messram = | |
| 66 | 66 | |
| 67 | 67 | state->screen_location = messram + ((state->port_7ffd_data & 8) ? (7<<14) : (5<<14)); |
| 68 | 68 | |
| r9922 | r9923 | |
| 111 | 111 | static MACHINE_RESET( atm ) |
| 112 | 112 | { |
| 113 | 113 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 114 | UINT8 *messram = | |
| 114 | UINT8 *messram = | |
| 115 | 115 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 116 | 116 | device_t *beta = machine->device(BETA_DISK_TAG); |
| 117 | 117 |
| r9922 | r9923 | |
|---|---|---|
| 29 | 29 | #include "emu.h" |
| 30 | 30 | #include "cpu/m68000/m68000.h" |
| 31 | 31 | #include "devices/flopdrv.h" |
| 32 | #include " | |
| 32 | #include "ma | |
| 33 | 33 | #include "machine/8530scc.h" |
| 34 | 34 | #include "machine/abc99.h" |
| 35 | 35 | #include "machine/s1410.h" |
| r9922 | r9923 | |
| 292 | 292 | MCFG_S1410_ADD() |
| 293 | 293 | |
| 294 | 294 | // internal ram |
| 295 | MCFG_RAM_ADD( | |
| 295 | MCFG_RAM_ADD(RAM_TAG | |
| 296 | 296 | MCFG_RAM_DEFAULT_SIZE("1M") |
| 297 | 297 | MACHINE_CONFIG_END |
| 298 | 298 |
| r9922 | r9923 | |
|---|---|---|
| 25 | 25 | #include "formats/svi_cas.h" |
| 26 | 26 | #include "sound/dac.h" |
| 27 | 27 | #include "sound/ay8910.h" |
| 28 | #include " | |
| 28 | #include "ma | |
| 29 | 29 | #include "rendlay.h" |
| 30 | 30 | |
| 31 | 31 | static ADDRESS_MAP_START( svi318_mem, ADDRESS_SPACE_PROGRAM, 8 ) |
| r9922 | r9923 | |
| 342 | 342 | MCFG_FRAGMENT_ADD( svi318_cartslot ) |
| 343 | 343 | |
| 344 | 344 | /* internal ram */ |
| 345 | MCFG_RAM_ADD( | |
| 345 | MCFG_RAM_ADD(RAM_TAG | |
| 346 | 346 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 347 | 347 | MCFG_RAM_EXTRA_OPTIONS("32K,96K,160K") |
| 348 | 348 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 359 | 359 | static MACHINE_CONFIG_DERIVED( svi328, svi318 ) |
| 360 | 360 | |
| 361 | 361 | /* internal ram */ |
| 362 | MCFG_RAM_MODIFY( | |
| 362 | MCFG_RAM_MODIFY(RAM_TAG | |
| 363 | 363 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 364 | 364 | MCFG_RAM_EXTRA_OPTIONS("96K,160K") |
| 365 | 365 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 367 | 367 | static MACHINE_CONFIG_DERIVED( svi328n, svi318n ) |
| 368 | 368 | |
| 369 | 369 | /* internal ram */ |
| 370 | MCFG_RAM_MODIFY( | |
| 370 | MCFG_RAM_MODIFY(RAM_TAG | |
| 371 | 371 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 372 | 372 | MCFG_RAM_EXTRA_OPTIONS("96K,160K") |
| 373 | 373 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 464 | 464 | MCFG_FRAGMENT_ADD( svi318_cartslot ) |
| 465 | 465 | |
| 466 | 466 | /* internal ram */ |
| 467 | MCFG_RAM_ADD( | |
| 467 | MCFG_RAM_ADD(RAM_TAG | |
| 468 | 468 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 469 | 469 | MCFG_RAM_EXTRA_OPTIONS("96K,160K") |
| 470 | 470 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "cpu/z80/z80.h" |
| 14 | 14 | #include "cpu/z80/z80daisy.h" |
| 15 | 15 | #include "machine/z80pio.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | #include "vcs80.lh" |
| 18 | 18 | |
| 19 | 19 | /* Read/Write Handlers */ |
| r9922 | r9923 | |
| 226 | 226 | MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_5MHz/2, pio_intf) |
| 227 | 227 | |
| 228 | 228 | /* internal ram */ |
| 229 | MCFG_RAM_ADD( | |
| 229 | MCFG_RAM_ADD(RAM_TAG | |
| 230 | 230 | MCFG_RAM_DEFAULT_SIZE("1K") |
| 231 | 231 | MACHINE_CONFIG_END |
| 232 | 232 |
| r9922 | r9923 | |
|---|---|---|
| 62 | 62 | |
| 63 | 63 | #include "emu.h" |
| 64 | 64 | #include "cpu/m68000/m68000.h" |
| 65 | #include " | |
| 65 | #include "ma | |
| 66 | 66 | #include "machine/6821pia.h" |
| 67 | 67 | #include "machine/6840ptm.h" |
| 68 | 68 | #include "machine/6850acia.h" |
| r9922 | r9923 | |
| 286 | 286 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 287 | 287 | |
| 288 | 288 | // configure RAM |
| 289 | switch ( | |
| 289 | switch ( | |
| 290 | 290 | { |
| 291 | 291 | case 32*1024: |
| 292 | 292 | memory_unmap_readwrite(program, 0x008000, 0x01ffff, 0, 0); |
| r9922 | r9923 | |
| 342 | 342 | MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf) |
| 343 | 343 | |
| 344 | 344 | // internal ram |
| 345 | MCFG_RAM_ADD( | |
| 345 | MCFG_RAM_ADD(RAM_TAG | |
| 346 | 346 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 347 | 347 | MCFG_RAM_EXTRA_OPTIONS("128K") |
| 348 | 348 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 30 | 30 | #include "cpu/i86/i86.h" |
| 31 | 31 | #include "cpu/mcs48/mcs48.h" |
| 32 | 32 | #include "devices/flopdrv.h" |
| 33 | #include " | |
| 33 | #include "ma | |
| 34 | 34 | #include "machine/ctronics.h" |
| 35 | 35 | #include "machine/i8255a.h" |
| 36 | 36 | #include "machine/msm8251.h" |
| r9922 | r9923 | |
| 842 | 842 | { |
| 843 | 843 | /* memory banking */ |
| 844 | 844 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 845 | UINT8 *ram = messram_get_ptr(m_ram); | |
| 846 | int ram_size = messram_get_size(m_ram); | |
| 845 | UINT8 *ram = ram_get_ptr(m_ram); | |
| 846 | int ram_size = ram_get_size(m_ram); | |
| 847 | 847 | |
| 848 | 848 | memory_install_ram(program, 0x00000, ram_size - 1, 0, 0, ram); |
| 849 | 849 | |
| r9922 | r9923 | |
| 911 | 911 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics) |
| 912 | 912 | |
| 913 | 913 | /* internal ram */ |
| 914 | MCFG_RAM_ADD( | |
| 914 | MCFG_RAM_ADD(RAM_TAG | |
| 915 | 915 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 916 | 916 | MCFG_RAM_EXTRA_OPTIONS("256K,384K,512K,640K,768K,896K") |
| 917 | 917 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 15 | 15 | #include "machine/upd765.h" |
| 16 | 16 | #include "devices/flopdrv.h" |
| 17 | 17 | #include "formats/basicdsk.h" |
| 18 | #include " | |
| 18 | #include "ma | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | class nanos_state : public driver_device |
| r9922 | r9923 | |
| 263 | 263 | { |
| 264 | 264 | if (ra < 8) |
| 265 | 265 | { |
| 266 | chr = | |
| 266 | chr = | |
| 267 | 267 | |
| 268 | 268 | /* get pattern of pixels for that character scanline */ |
| 269 | 269 | gfx = state->FNT[(chr<<3) | ra ]; |
| r9922 | r9923 | |
| 313 | 313 | if (BIT(data,7)) { |
| 314 | 314 | memory_set_bankptr(device->machine, "bank1", device->machine->region("maincpu")->base()); |
| 315 | 315 | } else { |
| 316 | memory_set_bankptr(device->machine, "bank1", | |
| 316 | memory_set_bankptr(device->machine, "bank1", | |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | static UINT8 row_number(UINT8 code) { |
| r9922 | r9923 | |
| 427 | 427 | memory_install_write_bank(space, 0x1000, 0xffff, 0, 0, "bank2"); |
| 428 | 428 | |
| 429 | 429 | memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base()); |
| 430 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x1000); | |
| 431 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram"))); | |
| 430 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x1000); | |
| 431 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG))); | |
| 432 | 432 | |
| 433 | 433 | floppy_mon_w(floppy_get_device(space->machine, 0), CLEAR_LINE); |
| 434 | 434 | floppy_drive_set_ready_state(floppy_get_device(space->machine, 0), 1,1); |
| r9922 | r9923 | |
| 532 | 532 | MCFG_FLOPPY_4_DRIVES_ADD(nanos_floppy_config) |
| 533 | 533 | |
| 534 | 534 | /* internal ram */ |
| 535 | MCFG_RAM_ADD( | |
| 535 | MCFG_RAM_ADD(RAM_TAG | |
| 536 | 536 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 537 | 537 | MACHINE_CONFIG_END |
| 538 | 538 |
| r9922 | r9923 | |
|---|---|---|
| 29 | 29 | #include "devices/cassette.h" |
| 30 | 30 | #include "sound/ay8910.h" |
| 31 | 31 | #include "formats/gtp_cas.h" |
| 32 | #include " | |
| 32 | #include "ma | |
| 33 | 33 | |
| 34 | 34 | static ADDRESS_MAP_START (galaxyp_io, ADDRESS_SPACE_IO, 8) |
| 35 | 35 | ADDRESS_MAP_GLOBAL_MASK(0x01) |
| r9922 | r9923 | |
| 213 | 213 | MCFG_CASSETTE_ADD( "cassette", galaxy_cassette_config ) |
| 214 | 214 | |
| 215 | 215 | /* internal ram */ |
| 216 | MCFG_RAM_ADD( | |
| 216 | MCFG_RAM_ADD(RAM_TAG | |
| 217 | 217 | MCFG_RAM_DEFAULT_SIZE("6K") |
| 218 | 218 | MCFG_RAM_EXTRA_OPTIONS("2K,22K,38K,54K") |
| 219 | 219 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 252 | 252 | MCFG_CASSETTE_ADD( "cassette", galaxy_cassette_config ) |
| 253 | 253 | |
| 254 | 254 | /* internal ram */ |
| 255 | MCFG_RAM_ADD( | |
| 255 | MCFG_RAM_ADD(RAM_TAG | |
| 256 | 256 | MCFG_RAM_DEFAULT_SIZE("38K") |
| 257 | 257 | MACHINE_CONFIG_END |
| 258 | 258 |
| r9922 | r9923 | |
|---|---|---|
| 28 | 28 | #include "machine/z80pio.h" |
| 29 | 29 | #include "machine/z80dart.h" |
| 30 | 30 | #include "machine/z80ctc.h" |
| 31 | #include " | |
| 31 | #include "ma | |
| 32 | 32 | |
| 33 | 33 | /* Keyboard */ |
| 34 | 34 | |
| r9922 | r9923 | |
| 416 | 416 | MCFG_CASSETTE_ADD(CASSETTE_TAG, amu880_cassette_config) |
| 417 | 417 | |
| 418 | 418 | /* internal ram */ |
| 419 | MCFG_RAM_ADD( | |
| 419 | MCFG_RAM_ADD(RAM_TAG | |
| 420 | 420 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 421 | 421 | MACHINE_CONFIG_END |
| 422 | 422 |
| r9922 | r9923 | |
|---|---|---|
| 31 | 31 | #include "cpu/f8/f8.h" |
| 32 | 32 | #include "devices/cartslot.h" |
| 33 | 33 | #include "devices/cassette.h" |
| 34 | #include " | |
| 34 | #include "ma | |
| 35 | 35 | #include "sound/discrete.h" |
| 36 | 36 | |
| 37 | 37 | |
| r9922 | r9923 | |
| 504 | 504 | MCFG_SOFTWARE_LIST_ADD("cart_list", "vidbrain") |
| 505 | 505 | |
| 506 | 506 | // internal ram |
| 507 | MCFG_RAM_ADD( | |
| 507 | MCFG_RAM_ADD(RAM_TAG | |
| 508 | 508 | MCFG_RAM_DEFAULT_SIZE("1K") |
| 509 | 509 | MACHINE_CONFIG_END |
| 510 | 510 |
| r9922 | r9923 | |
|---|---|---|
| 45 | 45 | #include "includes/zx.h" |
| 46 | 46 | #include "devices/cassette.h" |
| 47 | 47 | #include "formats/zx81_p.h" |
| 48 | #include " | |
| 48 | #include "ma | |
| 49 | 49 | |
| 50 | 50 | /* Memory Maps */ |
| 51 | 51 | |
| r9922 | r9923 | |
| 417 | 417 | MCFG_CASSETTE_ADD( "cassette", zx80_cassette_config ) |
| 418 | 418 | |
| 419 | 419 | /* internal ram */ |
| 420 | MCFG_RAM_ADD( | |
| 420 | MCFG_RAM_ADD(RAM_TAG | |
| 421 | 421 | MCFG_RAM_DEFAULT_SIZE("1K") |
| 422 | 422 | MCFG_RAM_EXTRA_OPTIONS("16K") |
| 423 | 423 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 440 | 440 | static MACHINE_CONFIG_DERIVED( ts1500, ts1000 ) |
| 441 | 441 | |
| 442 | 442 | /* internal ram */ |
| 443 | MCFG_RAM_MODIFY( | |
| 443 | MCFG_RAM_MODIFY(RAM_TAG | |
| 444 | 444 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 445 | 445 | MACHINE_CONFIG_END |
| 446 | 446 | |
| r9922 | r9923 | |
| 460 | 460 | MCFG_PALETTE_INIT(zx80) |
| 461 | 461 | |
| 462 | 462 | /* internal ram */ |
| 463 | MCFG_RAM_MODIFY( | |
| 463 | MCFG_RAM_MODIFY(RAM_TAG | |
| 464 | 464 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 465 | 465 | MACHINE_CONFIG_END |
| 466 | 466 | |
| r9922 | r9923 | |
| 475 | 475 | MCFG_PALETTE_INIT(zx80) |
| 476 | 476 | |
| 477 | 477 | /* internal ram */ |
| 478 | MCFG_RAM_MODIFY( | |
| 478 | MCFG_RAM_MODIFY(RAM_TAG | |
| 479 | 479 | MCFG_RAM_DEFAULT_SIZE("2K") |
| 480 | 480 | MCFG_RAM_EXTRA_OPTIONS("16K") |
| 481 | 481 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 95 | 95 | #include "devices/flopdrv.h" |
| 96 | 96 | #include "devices/cassette.h" |
| 97 | 97 | #include "formats/z80ne_dsk.h" |
| 98 | #include " | |
| 98 | #include "ma | |
| 99 | 99 | |
| 100 | 100 | /* peripheral chips */ |
| 101 | 101 | #include "machine/ay31015.h" |
| r9922 | r9923 | |
| 482 | 482 | MCFG_DEFAULT_LAYOUT(layout_z80ne) |
| 483 | 483 | |
| 484 | 484 | /* internal ram */ |
| 485 | MCFG_RAM_ADD( | |
| 485 | MCFG_RAM_ADD(RAM_TAG | |
| 486 | 486 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 487 | 487 | MACHINE_CONFIG_END |
| 488 | 488 | |
| r9922 | r9923 | |
| 513 | 513 | MCFG_DEFAULT_LAYOUT(layout_z80net) |
| 514 | 514 | |
| 515 | 515 | /* internal ram */ |
| 516 | MCFG_RAM_MODIFY( | |
| 516 | MCFG_RAM_MODIFY(RAM_TAG | |
| 517 | 517 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 518 | 518 | MCFG_RAM_EXTRA_OPTIONS("1K") |
| 519 | 519 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 549 | 549 | MCFG_MC6847_PALETTE(lx388palette) |
| 550 | 550 | |
| 551 | 551 | /* internal ram */ |
| 552 | MCFG_RAM_ADD( | |
| 552 | MCFG_RAM_ADD(RAM_TAG | |
| 553 | 553 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 554 | 554 | MCFG_RAM_EXTRA_OPTIONS("1K") |
| 555 | 555 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 589 | 589 | MCFG_DEFAULT_LAYOUT(layout_z80netf) |
| 590 | 590 | |
| 591 | 591 | /* internal ram */ |
| 592 | MCFG_RAM_ADD( | |
| 592 | MCFG_RAM_ADD(RAM_TAG | |
| 593 | 593 | MCFG_RAM_DEFAULT_SIZE("56K") |
| 594 | 594 | MACHINE_CONFIG_END |
| 595 | 595 |
| r9922 | r9923 | |
|---|---|---|
| 24 | 24 | #include "machine/i8155.h" |
| 25 | 25 | #include "machine/i8355.h" |
| 26 | 26 | #include "sound/speaker.h" |
| 27 | #include " | |
| 27 | #include "ma | |
| 28 | 28 | |
| 29 | 29 | /* Memory Maps */ |
| 30 | 30 | |
| r9922 | r9923 | |
| 236 | 236 | MCFG_CASSETTE_ADD(CASSETTE_TAG, exp85_cassette_config) |
| 237 | 237 | |
| 238 | 238 | /* internal ram */ |
| 239 | MCFG_RAM_ADD( | |
| 239 | MCFG_RAM_ADD(RAM_TAG | |
| 240 | 240 | MCFG_RAM_DEFAULT_SIZE("256") |
| 241 | 241 | MCFG_RAM_EXTRA_OPTIONS("4K") |
| 242 | 242 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 59 | 59 | #include "sound/ay8910.h" |
| 60 | 60 | #include "sound/speaker.h" |
| 61 | 61 | #include "devices/cassette.h" |
| 62 | #include " | |
| 62 | #include "ma | |
| 63 | 63 | #include "deprecat.h" |
| 64 | 64 | |
| 65 | 65 | static const gfx_layout apple2gs_text_layout = |
| r9922 | r9923 | |
| 298 | 298 | MCFG_CASSETTE_ADD( "cassette", apple2gs_cassette_config ) |
| 299 | 299 | |
| 300 | 300 | /* internal ram */ |
| 301 | MCFG_RAM_ADD( | |
| 301 | MCFG_RAM_ADD(RAM_TAG | |
| 302 | 302 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 303 | 303 | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 304 | 304 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| r9922 | r9923 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "cpu/mcs51/mcs51.h" |
| 11 | #include " | |
| 11 | #include "ma | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | class vt320_state : public driver_device |
| r9922 | r9923 | |
| 59 | 59 | |
| 60 | 60 | static MACHINE_RESET(vt320) |
| 61 | 61 | { |
| 62 | memset( | |
| 62 | memset( | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static VIDEO_START( vt320 ) |
| r9922 | r9923 | |
| 94 | 94 | MCFG_VIDEO_UPDATE(vt320) |
| 95 | 95 | |
| 96 | 96 | /* internal ram */ |
| 97 | MCFG_RAM_ADD( | |
| 97 | MCFG_RAM_ADD(RAM_TAG | |
| 98 | 98 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 99 | 99 | MACHINE_CONFIG_END |
| 100 | 100 |
| r9922 | r9923 | |
|---|---|---|
| 22 | 22 | #include "cpu/mcs48/mcs48.h" |
| 23 | 23 | #include "cpu/m68000/m68000.h" |
| 24 | 24 | #include "devices/flopdrv.h" |
| 25 | #include " | |
| 25 | #include "ma | |
| 26 | 26 | #include "machine/ctronics.h" |
| 27 | 27 | #include "machine/wd17xx.h" |
| 28 | 28 | #include "machine/z80ctc.h" |
| r9922 | r9923 | |
| 160 | 160 | trs80m2_state *state = machine->driver_data<trs80m2_state>(); |
| 161 | 161 | |
| 162 | 162 | address_space *program = cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM); |
| 163 | device_t *messram = machine->device( | |
| 163 | device_t *messram = machine->device(RAM_TAG | |
| 164 | 164 | UINT8 *rom = machine->region(Z80_TAG)->base(); |
| 165 | UINT8 *ram = messram_get_ptr(messram); | |
| 166 | int last_page = (messram_get_size(messram) / 0x8000) - 1; | |
| 165 | UINT8 *ram = ram_get_ptr(messram); | |
| 166 | int last_page = (ram_get_size(messram) / 0x8000) - 1; | |
| 167 | 167 | |
| 168 | 168 | if (state->boot_rom) |
| 169 | 169 | { |
| r9922 | r9923 | |
| 1047 | 1047 | MCFG_TIMER_ADD_PERIODIC("keyboard", trs80m2_keyboard_tick, HZ(60)) |
| 1048 | 1048 | |
| 1049 | 1049 | /* internal RAM */ |
| 1050 | MCFG_RAM_ADD( | |
| 1050 | MCFG_RAM_ADD(RAM_TAG | |
| 1051 | 1051 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 1052 | 1052 | MCFG_RAM_EXTRA_OPTIONS("64K,96K,128K,160K,192K,224K,256K,288K,320K,352K,384K,416K,448K,480K,512K") |
| 1053 | 1053 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1062 | 1062 | MCFG_PALETTE_INIT(monochrome_green) |
| 1063 | 1063 | |
| 1064 | 1064 | /* internal RAM */ |
| 1065 | MCFG_RAM_MODIFY( | |
| 1065 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1066 | 1066 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 1067 | 1067 | MCFG_RAM_EXTRA_OPTIONS("512K,768K,1M") |
| 1068 | 1068 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 39 | 39 | #include "machine/6821pia.h" |
| 40 | 40 | #include "video/gtia.h" |
| 41 | 41 | #include "sound/dac.h" |
| 42 | #include " | |
| 42 | #include "ma | |
| 43 | 43 | |
| 44 | 44 | /****************************************************************************** |
| 45 | 45 | Atari 800 memory map (preliminary) |
| r9922 | r9923 | |
| 1061 | 1061 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 1062 | 1062 | |
| 1063 | 1063 | /* internal ram */ |
| 1064 | MCFG_RAM_ADD( | |
| 1064 | MCFG_RAM_ADD(RAM_TAG | |
| 1065 | 1065 | MCFG_RAM_DEFAULT_SIZE("40K") |
| 1066 | 1066 | |
| 1067 | 1067 | MCFG_ATARI_FDC_ADD("fdc") |
| r9922 | r9923 | |
| 1155 | 1155 | MCFG_FRAGMENT_ADD(a400_cartslot) |
| 1156 | 1156 | |
| 1157 | 1157 | /* internal ram */ |
| 1158 | MCFG_RAM_MODIFY( | |
| 1158 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1159 | 1159 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1160 | 1160 | MACHINE_CONFIG_END |
| 1161 | 1161 | |
| r9922 | r9923 | |
| 1241 | 1241 | MCFG_SOFTWARE_LIST_ADD("cart_list","a5200") |
| 1242 | 1242 | |
| 1243 | 1243 | /* internal ram */ |
| 1244 | MCFG_RAM_MODIFY( | |
| 1244 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1245 | 1245 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 1246 | 1246 | MACHINE_CONFIG_END |
| 1247 | 1247 |
| r9922 | r9923 | |
|---|---|---|
| 48 | 48 | #include "devices/sonydriv.h" |
| 49 | 49 | #include "devices/harddriv.h" |
| 50 | 50 | #include "formats/ap_dsk35.h" |
| 51 | #include " | |
| 51 | #include "ma | |
| 52 | 52 | #include "devices/chd_cd.h" |
| 53 | 53 | #include "sound/asc.h" |
| 54 | 54 | #include "sound/cdda.h" |
| r9922 | r9923 | |
| 633 | 633 | MCFG_VIA6522_ADD("via6522_0", 1000000, mac_via6522_intf) |
| 634 | 634 | |
| 635 | 635 | /* internal ram */ |
| 636 | MCFG_RAM_ADD( | |
| 636 | MCFG_RAM_ADD(RAM_TAG | |
| 637 | 637 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 638 | 638 | MACHINE_CONFIG_END |
| 639 | 639 | |
| 640 | 640 | static MACHINE_CONFIG_DERIVED( mac128k, mac512ke ) |
| 641 | 641 | |
| 642 | 642 | /* internal ram */ |
| 643 | MCFG_RAM_MODIFY( | |
| 643 | MCFG_RAM_MODIFY(RAM_TAG | |
| 644 | 644 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 645 | 645 | MACHINE_CONFIG_END |
| 646 | 646 | |
| r9922 | r9923 | |
| 656 | 656 | MCFG_FLOPPY_SONY_2_DRIVES_MODIFY(mac_floppy_config) |
| 657 | 657 | |
| 658 | 658 | /* internal ram */ |
| 659 | MCFG_RAM_MODIFY( | |
| 659 | MCFG_RAM_MODIFY(RAM_TAG | |
| 660 | 660 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 661 | 661 | MCFG_RAM_EXTRA_OPTIONS("1M,2M,2560K,4M") |
| 662 | 662 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 667 | 667 | MCFG_VIA6522_ADD("via6522_0", 1000000, mac_via6522_adb_intf) |
| 668 | 668 | |
| 669 | 669 | /* internal ram */ |
| 670 | MCFG_RAM_MODIFY( | |
| 670 | MCFG_RAM_MODIFY(RAM_TAG | |
| 671 | 671 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 672 | 672 | MCFG_RAM_EXTRA_OPTIONS("2M,2560K,4M") |
| 673 | 673 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 716 | 716 | MCFG_HARDDISK_ADD( "harddisk2" ) |
| 717 | 717 | |
| 718 | 718 | /* internal ram */ |
| 719 | MCFG_RAM_ADD( | |
| 719 | MCFG_RAM_ADD(RAM_TAG | |
| 720 | 720 | MCFG_RAM_DEFAULT_SIZE("1M") |
| 721 | 721 | MCFG_RAM_EXTRA_OPTIONS("1M,3M,5M,7M,9M") |
| 722 | 722 | |
| r9922 | r9923 | |
| 768 | 768 | MCFG_HARDDISK_ADD( "harddisk2" ) |
| 769 | 769 | |
| 770 | 770 | /* internal ram */ |
| 771 | MCFG_RAM_ADD( | |
| 771 | MCFG_RAM_ADD(RAM_TAG | |
| 772 | 772 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 773 | 773 | MCFG_RAM_EXTRA_OPTIONS("8M,32M,64M,96M,128M") |
| 774 | 774 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 785 | 785 | MCFG_VIDEO_RESET(macrbv) |
| 786 | 786 | MCFG_VIDEO_UPDATE(macrbvvram) |
| 787 | 787 | |
| 788 | MCFG_RAM_MODIFY( | |
| 788 | MCFG_RAM_MODIFY(RAM_TAG | |
| 789 | 789 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 790 | 790 | MCFG_RAM_EXTRA_OPTIONS("4M,6M,8M,10M") |
| 791 | 791 | |
| r9922 | r9923 | |
| 800 | 800 | MCFG_CPU_PROGRAM_MAP(maclc_map) |
| 801 | 801 | MCFG_CPU_VBLANK_INT("screen", mac_rbv_vbl) |
| 802 | 802 | |
| 803 | MCFG_RAM_MODIFY( | |
| 803 | MCFG_RAM_MODIFY(RAM_TAG | |
| 804 | 804 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 805 | 805 | MCFG_RAM_EXTRA_OPTIONS("6M,8M,10M") |
| 806 | 806 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 815 | 815 | MCFG_VIDEO_RESET(macrbv) |
| 816 | 816 | MCFG_VIDEO_UPDATE(macrbvvram) |
| 817 | 817 | |
| 818 | MCFG_RAM_MODIFY( | |
| 818 | MCFG_RAM_MODIFY(RAM_TAG | |
| 819 | 819 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 820 | 820 | MCFG_RAM_EXTRA_OPTIONS("8M,12M,16M,20M,24M,28M,32M,36M") |
| 821 | 821 | |
| r9922 | r9923 | |
| 830 | 830 | MCFG_CPU_PROGRAM_MAP(macii_map) |
| 831 | 831 | MCFG_CPU_VBLANK_INT("screen", mac_cb264_vbl) |
| 832 | 832 | |
| 833 | MCFG_RAM_MODIFY( | |
| 833 | MCFG_RAM_MODIFY(RAM_TAG | |
| 834 | 834 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 835 | 835 | MCFG_RAM_EXTRA_OPTIONS("8M,32M,64M,96M,128M") |
| 836 | 836 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 881 | 881 | MCFG_HARDDISK_ADD( "harddisk2" ) |
| 882 | 882 | |
| 883 | 883 | /* internal ram */ |
| 884 | MCFG_RAM_ADD( | |
| 884 | MCFG_RAM_ADD(RAM_TAG | |
| 885 | 885 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 886 | 886 | MCFG_RAM_EXTRA_OPTIONS("8M,16M,32M,48M,64M,96M,128M") |
| 887 | 887 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 903 | 903 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 904 | 904 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 905 | 905 | |
| 906 | MCFG_RAM_MODIFY( | |
| 906 | MCFG_RAM_MODIFY(RAM_TAG | |
| 907 | 907 | MCFG_RAM_DEFAULT_SIZE("10M") |
| 908 | 908 | MCFG_RAM_EXTRA_OPTIONS("2M,4M,6M,8M,10M") |
| 909 | 909 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 925 | 925 | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 926 | 926 | |
| 927 | 927 | /* internal ram */ |
| 928 | MCFG_RAM_MODIFY( | |
| 928 | MCFG_RAM_MODIFY(RAM_TAG | |
| 929 | 929 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 930 | 930 | MCFG_RAM_EXTRA_OPTIONS("4M,8M,16M,32M,48M,64M") |
| 931 | 931 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 947 | 947 | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 948 | 948 | |
| 949 | 949 | /* internal ram */ |
| 950 | MCFG_RAM_MODIFY( | |
| 950 | MCFG_RAM_MODIFY(RAM_TAG | |
| 951 | 951 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 952 | 952 | MCFG_RAM_EXTRA_OPTIONS("4M,8M,16M,32M,48M,64M") |
| 953 | 953 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 995 | 995 | MCFG_HARDDISK_ADD( "harddisk2" ) |
| 996 | 996 | |
| 997 | 997 | /* internal ram */ |
| 998 | MCFG_RAM_ADD( | |
| 998 | MCFG_RAM_ADD(RAM_TAG | |
| 999 | 999 | MCFG_RAM_DEFAULT_SIZE("8M") |
| 1000 | 1000 | MCFG_RAM_EXTRA_OPTIONS("16M,32M,64M,128M") |
| 1001 | 1001 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 107 | 107 | #include "formats/pc_dsk.h" /* for NC200 disk image */ |
| 108 | 108 | #include "devices/cartslot.h" |
| 109 | 109 | #include "sound/beep.h" |
| 110 | #include " | |
| 110 | #include "ma | |
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | #define VERBOSE 0 |
| r9922 | r9923 | |
| 366 | 366 | |
| 367 | 367 | mem_bank = mem_bank & state->membank_internal_ram_mask; |
| 368 | 368 | |
| 369 | addr = | |
| 369 | addr = | |
| 370 | 370 | |
| 371 | 371 | memory_set_bankptr(machine, bank1, addr); |
| 372 | 372 | memory_set_bankptr(machine, bank5, addr); |
| r9922 | r9923 | |
| 439 | 439 | /* get size of memory data stored */ |
| 440 | 440 | mame_fread(state->file, &stored_size, sizeof(unsigned long)); |
| 441 | 441 | |
| 442 | if (stored_size > messram_get_size(machine->device("messram"))) | |
| 443 | restore_size = messram_get_size(machine->device("messram")); | |
| 442 | if (stored_size > ram_get_size(machine->device(RAM_TAG))) | |
| 443 | restore_size = ram_get_size(machine->device(RAM_TAG)); | |
| 444 | 444 | else |
| 445 | 445 | restore_size = stored_size; |
| 446 | 446 | |
| 447 | 447 | /* read as much as will fit into memory */ |
| 448 | mame_fread(state->file, | |
| 448 | mame_fread(state->file, | |
| 449 | 449 | /* seek over remaining data */ |
| 450 | 450 | mame_fseek(state->file, SEEK_CUR,stored_size - restore_size); |
| 451 | 451 | } |
| r9922 | r9923 | |
| 454 | 454 | static void nc_common_store_memory_to_stream(running_machine *machine) |
| 455 | 455 | { |
| 456 | 456 | nc_state *state = machine->driver_data<nc_state>(); |
| 457 | UINT32 size = | |
| 457 | UINT32 size = | |
| 458 | 458 | if (!state->file) |
| 459 | 459 | return; |
| 460 | 460 | |
| r9922 | r9923 | |
| 463 | 463 | mame_fwrite(state->file, &size, sizeof(UINT32)); |
| 464 | 464 | |
| 465 | 465 | /* write data block */ |
| 466 | mame_fwrite(state->file, | |
| 466 | mame_fwrite(state->file, | |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | static void nc_common_open_stream_for_reading(running_machine *machine) |
| r9922 | r9923 | |
| 1746 | 1746 | MCFG_CARTSLOT_UNLOAD(nc_pcmcia_card) |
| 1747 | 1747 | |
| 1748 | 1748 | /* internal ram */ |
| 1749 | MCFG_RAM_ADD( | |
| 1749 | MCFG_RAM_ADD(RAM_TAG | |
| 1750 | 1750 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 1751 | 1751 | |
| 1752 | 1752 | MCFG_NC_SERIAL_ADD("serial") |
| r9922 | r9923 | |
| 1796 | 1796 | MCFG_MC146818_ADD( "mc", MC146818_STANDARD ) |
| 1797 | 1797 | |
| 1798 | 1798 | /* internal ram */ |
| 1799 | MCFG_RAM_MODIFY( | |
| 1799 | MCFG_RAM_MODIFY(RAM_TAG | |
| 1800 | 1800 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 1801 | 1801 | MACHINE_CONFIG_END |
| 1802 | 1802 |
| r9922 | r9923 | |
|---|---|---|
| 7 | 7 | #include "sound/speaker.h" |
| 8 | 8 | #include "formats/tzx_cas.h" |
| 9 | 9 | #include "machine/beta.h" |
| 10 | #include " | |
| 10 | #include "ma | |
| 11 | 11 | |
| 12 | 12 | DIRECT_UPDATE_HANDLER( pentagon_direct ) |
| 13 | 13 | { |
| r9922 | r9923 | |
| 53 | 53 | { |
| 54 | 54 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 55 | 55 | device_t *beta = machine->device(BETA_DISK_TAG); |
| 56 | UINT8 *messram = | |
| 56 | UINT8 *messram = | |
| 57 | 57 | state->screen_location = messram + ((state->port_7ffd_data & 8) ? (7<<14) : (5<<14)); |
| 58 | 58 | |
| 59 | 59 | memory_set_bankptr(machine, "bank4", messram + ((state->port_7ffd_data & 0x07) * 0x4000)); |
| r9922 | r9923 | |
| 106 | 106 | static MACHINE_RESET( pentagon ) |
| 107 | 107 | { |
| 108 | 108 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 109 | UINT8 *messram = | |
| 109 | UINT8 *messram = | |
| 110 | 110 | device_t *beta = machine->device(BETA_DISK_TAG); |
| 111 | 111 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 112 | 112 | |
| r9922 | r9923 | |
| 162 | 162 | |
| 163 | 163 | static MACHINE_CONFIG_DERIVED( pent1024, pentagon ) |
| 164 | 164 | /* internal ram */ |
| 165 | MCFG_RAM_MODIFY( | |
| 165 | MCFG_RAM_MODIFY(RAM_TAG | |
| 166 | 166 | MCFG_RAM_DEFAULT_SIZE("1024K") |
| 167 | 167 | MACHINE_CONFIG_END |
| 168 | 168 |
| r9922 | r9923 | |
|---|---|---|
| 28 | 28 | #include "emu.h" |
| 29 | 29 | #include "cpu/z80/z80.h" |
| 30 | 30 | #include "devices/flopdrv.h" |
| 31 | #include " | |
| 31 | #include "ma | |
| 32 | 32 | #include "formats/basicdsk.h" |
| 33 | 33 | #include "machine/6821pia.h" |
| 34 | 34 | #include "machine/ctronics.h" |
| r9922 | r9923 | |
| 67 | 67 | |
| 68 | 68 | case 2: /* BK1 */ |
| 69 | 69 | case 3: /* BK2 */ |
| 70 | if ( | |
| 70 | if ( | |
| 71 | 71 | { |
| 72 | 72 | memory_install_readwrite_bank(program, 0x0000, 0x7fff, 0, 0, "bank1"); |
| 73 | 73 | } |
| r9922 | r9923 | |
| 655 | 655 | { |
| 656 | 656 | /* setup memory banking */ |
| 657 | 657 | memory_configure_bank(machine, "bank1", 0, 1, machine->region(Z80_TAG)->base(), 0); |
| 658 | memory_configure_bank(machine, "bank1", 1, 1, messram_get_ptr(m_ram), 0); | |
| 659 | memory_configure_bank(machine, "bank1", 2, 2, messram_get_ptr(m_ram) + 0x10000, 0x8000); | |
| 658 | memory_configure_bank(machine, "bank1", 1, 1, ram_get_ptr(m_ram), 0); | |
| 659 | memory_configure_bank(machine, "bank1", 2, 2, ram_get_ptr(m_ram) + 0x10000, 0x8000); | |
| 660 | 660 | |
| 661 | 661 | /* register for state saving */ |
| 662 | 662 | state_save_register_global(machine, m_bank); |
| r9922 | r9923 | |
| 823 | 823 | MCFG_FLOPPY_2_DRIVES_ADD(bw12_floppy_config) |
| 824 | 824 | |
| 825 | 825 | /* internal ram */ |
| 826 | MCFG_RAM_ADD( | |
| 826 | MCFG_RAM_ADD(RAM_TAG | |
| 827 | 827 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 828 | 828 | MACHINE_CONFIG_END |
| 829 | 829 | |
| r9922 | r9923 | |
| 832 | 832 | MCFG_FLOPPY_2_DRIVES_ADD(bw14_floppy_config) |
| 833 | 833 | |
| 834 | 834 | /* internal ram */ |
| 835 | MCFG_RAM_ADD( | |
| 835 | MCFG_RAM_ADD(RAM_TAG | |
| 836 | 836 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 837 | 837 | MACHINE_CONFIG_END |
| 838 | 838 |
| r9922 | r9923 | |
|---|---|---|
| 15 | 15 | #include "sound/speaker.h" |
| 16 | 16 | #include "sound/wave.h" |
| 17 | 17 | #include "includes/pk8000.h" |
| 18 | #include " | |
| 18 | #include "ma | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | class pk8000_state : public driver_device |
| r9922 | r9923 | |
| 45 | 45 | switch(block1) { |
| 46 | 46 | case 0: |
| 47 | 47 | memory_set_bankptr(machine, "bank1", rom + 0x10000); |
| 48 | memory_set_bankptr(machine, "bank5", | |
| 48 | memory_set_bankptr(machine, "bank5", | |
| 49 | 49 | break; |
| 50 | 50 | case 1: break; |
| 51 | 51 | case 2: break; |
| 52 | 52 | case 3: |
| 53 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 54 | memory_set_bankptr(machine, "bank5", messram_get_ptr(machine->device("messram"))); | |
| 53 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 54 | memory_set_bankptr(machine, "bank5", ram_get_ptr(machine->device(RAM_TAG))); | |
| 55 | 55 | break; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | switch(block2) { |
| 59 | 59 | case 0: |
| 60 | 60 | memory_set_bankptr(machine, "bank2", rom + 0x14000); |
| 61 | memory_set_bankptr(machine, "bank6", | |
| 61 | memory_set_bankptr(machine, "bank6", | |
| 62 | 62 | break; |
| 63 | 63 | case 1: break; |
| 64 | 64 | case 2: break; |
| 65 | 65 | case 3: |
| 66 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 67 | memory_set_bankptr(machine, "bank6", messram_get_ptr(machine->device("messram")) + 0x4000); | |
| 66 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 67 | memory_set_bankptr(machine, "bank6", ram_get_ptr(machine->device(RAM_TAG)) + 0x4000); | |
| 68 | 68 | break; |
| 69 | 69 | } |
| 70 | 70 | switch(block3) { |
| 71 | 71 | case 0: |
| 72 | 72 | memory_set_bankptr(machine, "bank3", rom + 0x18000); |
| 73 | memory_set_bankptr(machine, "bank7", | |
| 73 | memory_set_bankptr(machine, "bank7", | |
| 74 | 74 | break; |
| 75 | 75 | case 1: break; |
| 76 | 76 | case 2: break; |
| 77 | 77 | case 3: |
| 78 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 79 | memory_set_bankptr(machine, "bank7", messram_get_ptr(machine->device("messram")) + 0x8000); | |
| 78 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 79 | memory_set_bankptr(machine, "bank7", ram_get_ptr(machine->device(RAM_TAG)) + 0x8000); | |
| 80 | 80 | break; |
| 81 | 81 | } |
| 82 | 82 | switch(block4) { |
| 83 | 83 | case 0: |
| 84 | 84 | memory_set_bankptr(machine, "bank4", rom + 0x1c000); |
| 85 | memory_set_bankptr(machine, "bank8", | |
| 85 | memory_set_bankptr(machine, "bank8", | |
| 86 | 86 | break; |
| 87 | 87 | case 1: break; |
| 88 | 88 | case 2: break; |
| 89 | 89 | case 3: |
| 90 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 91 | memory_set_bankptr(machine, "bank8", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 90 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 91 | memory_set_bankptr(machine, "bank8", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 92 | 92 | break; |
| 93 | 93 | } |
| 94 | 94 | } |
| r9922 | r9923 | |
| 324 | 324 | |
| 325 | 325 | static VIDEO_UPDATE( pk8000 ) |
| 326 | 326 | { |
| 327 | return pk8000_video_update(screen, bitmap, cliprect, | |
| 327 | return pk8000_video_update(screen, bitmap, cliprect, | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | /* Machine driver */ |
| r9922 | r9923 | |
| 371 | 371 | MCFG_CASSETTE_ADD( "cassette", pk8000_cassette_config ) |
| 372 | 372 | |
| 373 | 373 | /* internal ram */ |
| 374 | MCFG_RAM_ADD( | |
| 374 | MCFG_RAM_ADD(RAM_TAG | |
| 375 | 375 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 376 | 376 | MACHINE_CONFIG_END |
| 377 | 377 |
| r9922 | r9923 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | #include "emu.h" |
| 78 | 78 | #include "cpu/z80/z80.h" |
| 79 | #include " | |
| 79 | #include "ma | |
| 80 | 80 | #include "devices/cartslot.h" |
| 81 | 81 | |
| 82 | 82 | |
| r9922 | r9923 | |
| 166 | 166 | |
| 167 | 167 | static MACHINE_START(prestige) |
| 168 | 168 | { |
| 169 | UINT8 *ram = | |
| 169 | UINT8 *ram = | |
| 170 | 170 | |
| 171 | 171 | memory_configure_bank(machine, "bank1", 0, 64, machine->region("maincpu")->base(), 0x4000); |
| 172 | 172 | memory_configure_bank(machine, "bank2", 0, 64, machine->region("maincpu")->base(), 0x4000); |
| r9922 | r9923 | |
| 252 | 252 | MCFG_CARTSLOT_LOAD(prestige_cart) |
| 253 | 253 | |
| 254 | 254 | /* internal ram */ |
| 255 | MCFG_RAM_ADD( | |
| 255 | MCFG_RAM_ADD(RAM_TAG | |
| 256 | 256 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 257 | 257 | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 258 | 258 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 17 | 17 | #include "cpu/z80/z80.h" |
| 18 | 18 | #include "includes/z88.h" |
| 19 | 19 | #include "sound/speaker.h" |
| 20 | #include "devices/messram.h" | |
| 21 | #include "devices/messram.h" | |
| 20 | #include "machine/ram.h" | |
| 21 | #include "machine/ram.h" | |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | static void blink_reset(running_machine *machine) |
| r9922 | r9923 | |
| 252 | 252 | } |
| 253 | 253 | else |
| 254 | 254 | { |
| 255 | read_addr = write_addr = | |
| 255 | read_addr = write_addr = | |
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | else |
| r9922 | r9923 | |
| 289 | 289 | else |
| 290 | 290 | { |
| 291 | 291 | /* ram bank 20 */ |
| 292 | read_addr = messram_get_ptr(machine->device("messram")); | |
| 293 | write_addr = messram_get_ptr(machine->device("messram")); | |
| 292 | read_addr = ram_get_ptr(machine->device(RAM_TAG)); | |
| 293 | write_addr = ram_get_ptr(machine->device(RAM_TAG)); | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | z88_install_memory_handler_pair(machine, 0x0000, 0x2000, 9, read_addr, write_addr); |
| r9922 | r9923 | |
| 304 | 304 | |
| 305 | 305 | static MACHINE_RESET( z88 ) |
| 306 | 306 | { |
| 307 | memset( | |
| 307 | memset( | |
| 308 | 308 | |
| 309 | 309 | blink_reset(machine); |
| 310 | 310 | |
| r9922 | r9923 | |
| 773 | 773 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 774 | 774 | |
| 775 | 775 | /* internal ram */ |
| 776 | MCFG_RAM_ADD( | |
| 776 | MCFG_RAM_ADD(RAM_TAG | |
| 777 | 777 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 778 | 778 | MACHINE_CONFIG_END |
| 779 | 779 |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | #include "emu.h" |
| 14 | 14 | #include "cpu/z80/z80.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | class pce220_state : public driver_device |
| r9922 | r9923 | |
| 112 | 112 | UINT8 bank = BIT(data,2); |
| 113 | 113 | memory_install_write_bank(space_prg, 0x0000, 0x3fff, 0, 0, "bank1"); |
| 114 | 114 | |
| 115 | memory_set_bankptr(space->machine, "bank1", messram_get_ptr(space->machine->device("messram"))+0x0000+bank*0x8000); | |
| 116 | memory_set_bankptr(space->machine, "bank2", messram_get_ptr(space->machine->device("messram"))+0x4000+bank*0x8000); | |
| 115 | memory_set_bankptr(space->machine, "bank1", ram_get_ptr(space->machine->device(RAM_TAG))+0x0000+bank*0x8000); | |
| 116 | memory_set_bankptr(space->machine, "bank2", ram_get_ptr(space->machine->device(RAM_TAG))+0x4000+bank*0x8000); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | static ADDRESS_MAP_START(pce220_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r9922 | r9923 | |
| 248 | 248 | MCFG_VIDEO_UPDATE(pce220) |
| 249 | 249 | |
| 250 | 250 | /* internal ram */ |
| 251 | MCFG_RAM_ADD( | |
| 251 | MCFG_RAM_ADD(RAM_TAG | |
| 252 | 252 | MCFG_RAM_DEFAULT_SIZE("64K") // 32K internal + 32K external card |
| 253 | 253 | MACHINE_CONFIG_END |
| 254 | 254 |
| r9922 | r9923 | |
|---|---|---|
| 104 | 104 | /* Devices */ |
| 105 | 105 | #include "formats/pc_dsk.h" /* pc disk images */ |
| 106 | 106 | #include "devices/flopdrv.h" |
| 107 | #include " | |
| 107 | #include "ma | |
| 108 | 108 | |
| 109 | 109 | // interrupt counter |
| 110 | 110 | /* controls which bank of 2mb address space is paged into memory */ |
| r9922 | r9923 | |
| 408 | 408 | static void pcw16_update_bank(running_machine *machine, int bank) |
| 409 | 409 | { |
| 410 | 410 | pcw16_state *state = machine->driver_data<pcw16_state>(); |
| 411 | unsigned char *mem_ptr = | |
| 411 | unsigned char *mem_ptr = | |
| 412 | 412 | int bank_id = 0; |
| 413 | 413 | int bank_offs = 0; |
| 414 | 414 | char bank1[10]; |
| r9922 | r9923 | |
| 450 | 450 | { |
| 451 | 451 | bank_offs = 128; |
| 452 | 452 | /* dram */ |
| 453 | mem_ptr = | |
| 453 | mem_ptr = | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | mem_ptr = mem_ptr + ((bank_id - bank_offs)<<14); |
| r9922 | r9923 | |
| 1453 | 1453 | MCFG_FLOPPY_2_DRIVES_ADD(pcw16_floppy_config) |
| 1454 | 1454 | |
| 1455 | 1455 | /* internal ram */ |
| 1456 | MCFG_RAM_ADD( | |
| 1456 | MCFG_RAM_ADD(RAM_TAG | |
| 1457 | 1457 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 1458 | 1458 | MCFG_INTEL_E28F008SA_ADD("flash0") |
| 1459 | 1459 | MCFG_INTEL_E28F008SA_ADD("flash1") |
| r9922 | r9923 | |
|---|---|---|
| 75 | 75 | #include "sound/speaker.h" |
| 76 | 76 | #include "sound/wave.h" |
| 77 | 77 | #include "devices/cassette.h" |
| 78 | #include " | |
| 78 | #include "ma | |
| 79 | 79 | #include "formats/mz_cas.h" |
| 80 | 80 | |
| 81 | 81 | |
| r9922 | r9923 | |
| 367 | 367 | MCFG_CASSETTE_ADD( "cassette", mz700_cassette_config ) |
| 368 | 368 | |
| 369 | 369 | /* internal ram */ |
| 370 | MCFG_RAM_ADD( | |
| 370 | MCFG_RAM_ADD(RAM_TAG | |
| 371 | 371 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 372 | 372 | MACHINE_CONFIG_END |
| 373 | 373 |
| r9922 | r9923 | |
|---|---|---|
| 33 | 33 | #include "video/mc6845.h" |
| 34 | 34 | #include "formats/basicdsk.h" |
| 35 | 35 | #include "devices/flopdrv.h" |
| 36 | #include " | |
| 36 | #include "ma | |
| 37 | 37 | #include "machine/i8255a.h" |
| 38 | 38 | #include "machine/upd765.h" |
| 39 | 39 | #include "machine/upd1990a.h" |
| r9922 | r9923 | |
| 153 | 153 | { |
| 154 | 154 | prof80_state *state = machine->driver_data<prof80_state>(); |
| 155 | 155 | address_space *program = cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM); |
| 156 | UINT8 *ram = | |
| 156 | UINT8 *ram = | |
| 157 | 157 | UINT8 *rom = machine->region(Z80_TAG)->base(); |
| 158 | 158 | int bank; |
| 159 | 159 | |
| r9922 | r9923 | |
| 1305 | 1305 | MCFG_FLOPPY_4_DRIVES_ADD(prof80_floppy_config) |
| 1306 | 1306 | |
| 1307 | 1307 | /* internal ram */ |
| 1308 | MCFG_RAM_ADD( | |
| 1308 | MCFG_RAM_ADD(RAM_TAG | |
| 1309 | 1309 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 1310 | 1310 | MACHINE_CONFIG_END |
| 1311 | 1311 |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "emu.h" |
| 13 | 13 | #include "cpu/i8085/i8085.h" |
| 14 | 14 | #include "cpu/t11/t11.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | class vt240_state : public driver_device |
| r9922 | r9923 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | #include "emu.h" |
| 26 | 26 | #include "cpu/z80/z80.h" |
| 27 | #include " | |
| 27 | #include "ma | |
| 28 | 28 | #include "machine/ctronics.h" |
| 29 | 29 | #include "machine/upd765.h" |
| 30 | 30 | #include "includes/prof180x.h" |
| r9922 | r9923 | |
| 248 | 248 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics) |
| 249 | 249 | |
| 250 | 250 | /* internal ram */ |
| 251 | MCFG_RAM_ADD( | |
| 251 | MCFG_RAM_ADD(RAM_TAG | |
| 252 | 252 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 253 | 253 | MCFG_RAM_EXTRA_OPTIONS("256K,512K") |
| 254 | 254 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 20 | 20 | /* Layout */ |
| 21 | 21 | #include "sym1.lh" |
| 22 | 22 | |
| 23 | #include " | |
| 23 | #include "ma | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | /* pointers to memory locations */ |
| r9922 | r9923 | |
| 138 | 138 | MCFG_VIA6522_ADD("via6522_2", 0, sym1_via2) |
| 139 | 139 | |
| 140 | 140 | /* internal ram */ |
| 141 | MCFG_RAM_ADD( | |
| 141 | MCFG_RAM_ADD(RAM_TAG | |
| 142 | 142 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 143 | 143 | MCFG_RAM_EXTRA_OPTIONS("1K,2K,3K") |
| 144 | 144 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 28 | 28 | #include "devices/cartslot.h" |
| 29 | 29 | #include "devices/cassette.h" |
| 30 | 30 | #include "devices/printer.h" |
| 31 | #include " | |
| 31 | #include "ma | |
| 32 | 32 | |
| 33 | 33 | /*************************************************************************** |
| 34 | 34 | CONSTANTS |
| r9922 | r9923 | |
| 216 | 216 | static DRIVER_INIT( aquarius ) |
| 217 | 217 | { |
| 218 | 218 | /* install expansion memory if available */ |
| 219 | if ( | |
| 219 | if ( | |
| 220 | 220 | { |
| 221 | 221 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 222 | 222 | |
| 223 | memory_install_readwrite_bank(space, 0x4000, 0x4000 + messram_get_size(machine->device("messram")) - 0x1000 - 1, 0, 0, "bank1"); | |
| 224 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram"))); | |
| 223 | memory_install_readwrite_bank(space, 0x4000, 0x4000 + ram_get_size(machine->device(RAM_TAG)) - 0x1000 - 1, 0, 0, "bank1"); | |
| 224 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG))); | |
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | |
| r9922 | r9923 | |
| 435 | 435 | MCFG_CARTSLOT_NOT_MANDATORY |
| 436 | 436 | |
| 437 | 437 | /* internal ram */ |
| 438 | MCFG_RAM_ADD( | |
| 438 | MCFG_RAM_ADD(RAM_TAG | |
| 439 | 439 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 440 | 440 | MCFG_RAM_EXTRA_OPTIONS("8K,20K,36K") |
| 441 | 441 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 36 | 36 | #include "sound/ay8910.h" |
| 37 | 37 | #include "sound/dac.h" |
| 38 | 38 | #include "formats/cgen_cas.h" |
| 39 | #include " | |
| 39 | #include "ma | |
| 40 | 40 | |
| 41 | 41 | static ADDRESS_MAP_START (cgenie_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 42 | 42 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
| r9922 | r9923 | |
| 561 | 561 | MCFG_CARTSLOT_NOT_MANDATORY |
| 562 | 562 | |
| 563 | 563 | /* internal ram */ |
| 564 | MCFG_RAM_ADD( | |
| 564 | MCFG_RAM_ADD(RAM_TAG | |
| 565 | 565 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 566 | 566 | MCFG_RAM_EXTRA_OPTIONS("32K") |
| 567 | 567 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 156 | 156 | /* +3 hardware */ |
| 157 | 157 | #include "machine/upd765.h" |
| 158 | 158 | #include "devices/flopdrv.h" |
| 159 | #include " | |
| 159 | #include "ma | |
| 160 | 160 | |
| 161 | 161 | /****************************************************************************************************/ |
| 162 | 162 | /* Spectrum + 3 specific functions */ |
| r9922 | r9923 | |
| 212 | 212 | { |
| 213 | 213 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 214 | 214 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 215 | UINT8 *messram = | |
| 215 | UINT8 *messram = | |
| 216 | 216 | |
| 217 | 217 | if (state->port_7ffd_data & 8) |
| 218 | 218 | { |
| r9922 | r9923 | |
| 355 | 355 | static MACHINE_RESET( spectrum_plus3 ) |
| 356 | 356 | { |
| 357 | 357 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 358 | UINT8 *messram = | |
| 358 | UINT8 *messram = | |
| 359 | 359 | memset(messram,0,128*1024); |
| 360 | 360 | |
| 361 | 361 | MACHINE_RESET_CALL(spectrum); |
| r9922 | r9923 | |
|---|---|---|
| 134 | 134 | #include "devices/harddriv.h" |
| 135 | 135 | #include "machine/x68k_hdc.h" |
| 136 | 136 | #include "includes/x68k.h" |
| 137 | #include " | |
| 137 | #include "ma | |
| 138 | 138 | #include "machine/nvram.h" |
| 139 | 139 | #include "x68000.lh" |
| 140 | 140 | |
| r9922 | r9923 | |
| 1537 | 1537 | // if(offset == 0x5a/2) // 0x5a should be 0 if no SASI HDs are present. |
| 1538 | 1538 | // return 0x0000; |
| 1539 | 1539 | if(offset == 0x08/2) |
| 1540 | return | |
| 1540 | return | |
| 1541 | 1541 | #if 0 |
| 1542 | 1542 | if(offset == 0x46/2) |
| 1543 | 1543 | return 0x0024; |
| r9922 | r9923 | |
| 1553 | 1553 | { |
| 1554 | 1554 | x68k_state *state = space->machine->driver_data<x68k_state>(); |
| 1555 | 1555 | if(offset == 0x08/4) |
| 1556 | return ( | |
| 1556 | return ( | |
| 1557 | 1557 | #if 0 |
| 1558 | 1558 | if(offset == 0x46/2) |
| 1559 | 1559 | return 0x0024; |
| r9922 | r9923 | |
| 1682 | 1682 | v = 0x09; |
| 1683 | 1683 | |
| 1684 | 1684 | // rather hacky, but this generally works for programs that check for MIDI hardware |
| 1685 | if( | |
| 1685 | if( | |
| 1686 | 1686 | { |
| 1687 | int addr = ( | |
| 1687 | int addr = ( | |
| 1688 | 1688 | int sp = cpu_get_reg(machine->device("maincpu"), STATE_GENSP); |
| 1689 | 1689 | int pc = cpu_get_reg(machine->device("maincpu"), STATE_GENPC); |
| 1690 | 1690 | int sr = cpu_get_reg(machine->device("maincpu"), M68K_SR); |
| 1691 | 1691 | //int pda = cpu_get_reg(machine->device("maincpu"), M68K_PREF_DATA); |
| 1692 | 1692 | if(strcmp(machine->gamedrv->name,"x68030") == 0) |
| 1693 | 1693 | { // byte order varies on the 68030 |
| 1694 | addr = ( | |
| 1694 | addr = ( | |
| 1695 | 1695 | } |
| 1696 | 1696 | cpu_set_reg(machine->device("maincpu"), STATE_GENSP, sp - 14); |
| 1697 | messram_get_ptr(machine->device("messram"))[sp-11] = (val & 0xff000000) >> 24; | |
| 1698 | messram_get_ptr(machine->device("messram"))[sp-12] = (val & 0x00ff0000) >> 16; | |
| 1699 | messram_get_ptr(machine->device("messram"))[sp-9] = (val & 0x0000ff00) >> 8; | |
| 1700 | messram_get_ptr(machine->device("messram"))[sp-10] = (val & 0x000000ff); // place address onto the stack | |
| 1701 | messram_get_ptr(machine->device("messram"))[sp-3] = (pc & 0xff000000) >> 24; | |
| 1702 | messram_get_ptr(machine->device("messram"))[sp-4] = (pc & 0x00ff0000) >> 16; | |
| 1703 | messram_get_ptr(machine->device("messram"))[sp-1] = (pc & 0x0000ff00) >> 8; | |
| 1704 | messram_get_ptr(machine->device("messram"))[sp-2] = (pc & 0x000000ff); // place PC onto the stack | |
| 1705 | messram_get_ptr(machine->device("messram"))[sp-5] = (sr & 0xff00) >> 8; | |
| 1706 | messram_get_ptr(machine->device("messram"))[sp-6] = (sr & 0x00ff); // place SR onto the stack | |
| 1697 | ram_get_ptr(machine->device(RAM_TAG))[sp-11] = (val & 0xff000000) >> 24; | |
| 1698 | ram_get_ptr(machine->device(RAM_TAG))[sp-12] = (val & 0x00ff0000) >> 16; | |
| 1699 | ram_get_ptr(machine->device(RAM_TAG))[sp-9] = (val & 0x0000ff00) >> 8; | |
| 1700 | ram_get_ptr(machine->device(RAM_TAG))[sp-10] = (val & 0x000000ff); // place address onto the stack | |
| 1701 | ram_get_ptr(machine->device(RAM_TAG))[sp-3] = (pc & 0xff000000) >> 24; | |
| 1702 | ram_get_ptr(machine->device(RAM_TAG))[sp-4] = (pc & 0x00ff0000) >> 16; | |
| 1703 | ram_get_ptr(machine->device(RAM_TAG))[sp-1] = (pc & 0x0000ff00) >> 8; | |
| 1704 | ram_get_ptr(machine->device(RAM_TAG))[sp-2] = (pc & 0x000000ff); // place PC onto the stack | |
| 1705 | ram_get_ptr(machine->device(RAM_TAG))[sp-5] = (sr & 0xff00) >> 8; | |
| 1706 | ram_get_ptr(machine->device(RAM_TAG))[sp-6] = (sr & 0x00ff); // place SR onto the stack | |
| 1707 | 1707 | cpu_set_reg(machine->device("maincpu"), STATE_GENPC, addr); // real exceptions seem to take too long to be acknowledged |
| 1708 | 1708 | popmessage("Expansion access [%08x]: PC jump to %08x", val, addr); |
| 1709 | 1709 | } |
| r9922 | r9923 | |
| 2456 | 2456 | UINT8* romdata = machine->region("user2")->base(); |
| 2457 | 2457 | attotime irq_time; |
| 2458 | 2458 | |
| 2459 | memset(messram_get_ptr(machine->device("messram")),0,messram_get_size(machine->device("messram"))); | |
| 2460 | memcpy(messram_get_ptr(machine->device("messram")),romdata,8); | |
| 2459 | memset(ram_get_ptr(machine->device(RAM_TAG)),0,ram_get_size(machine->device(RAM_TAG))); | |
| 2460 | memcpy(ram_get_ptr(machine->device(RAM_TAG)),romdata,8); | |
| 2461 | 2461 | |
| 2462 | 2462 | // init keyboard |
| 2463 | 2463 | state->keyboard.delay = 500; // 3*100+200 |
| r9922 | r9923 | |
| 2527 | 2527 | state->spriteram = (UINT16*)machine->region("user1")->base(); |
| 2528 | 2528 | memory_install_read16_handler(space,0x000000,0xbffffb,0xffffffff,0,(read16_space_func)x68k_emptyram_r); |
| 2529 | 2529 | memory_install_write16_handler(space,0x000000,0xbffffb,0xffffffff,0,(write16_space_func)x68k_emptyram_w); |
| 2530 | memory_install_readwrite_bank(space,0x000000,messram_get_size(machine->device("messram"))-1,0xffffffff,0,"bank1"); | |
| 2531 | memory_set_bankptr(machine, "bank1",messram_get_ptr(machine->device("messram"))); | |
| 2530 | memory_install_readwrite_bank(space,0x000000,ram_get_size(machine->device(RAM_TAG))-1,0xffffffff,0,"bank1"); | |
| 2531 | memory_set_bankptr(machine, "bank1",ram_get_ptr(machine->device(RAM_TAG))); | |
| 2532 | 2532 | memory_install_read16_handler(space,0xc00000,0xdfffff,0xffffffff,0,x68k_gvram_r); |
| 2533 | 2533 | memory_install_write16_handler(space,0xc00000,0xdfffff,0xffffffff,0,x68k_gvram_w); |
| 2534 | 2534 | memory_set_bankptr(machine, "bank2",state->gvram); // so that code in VRAM is executable - needed for Terra Cresta |
| r9922 | r9923 | |
| 2558 | 2558 | state->spriteram = (UINT16*)machine->region("user1")->base(); |
| 2559 | 2559 | memory_install_read32_handler(space,0x000000,0xbffffb,0xffffffff,0,(read32_space_func)x68k_rom0_r); |
| 2560 | 2560 | memory_install_write32_handler(space,0x000000,0xbffffb,0xffffffff,0,(write32_space_func)x68k_rom0_w); |
| 2561 | memory_install_readwrite_bank(space,0x000000, | |
| 2561 | memory_install_readwrite_bank(space,0x000000, | |
| 2562 | 2562 | // mirror? Human68k 3.02 explicitly adds 0x3000000 to some pointers |
| 2563 | memory_install_readwrite_bank(space,0x3000000,0x3000000+messram_get_size(machine->device("messram"))-1,0xffffffff,0,"bank5"); | |
| 2564 | memory_set_bankptr(machine, "bank1",messram_get_ptr(machine->device("messram"))); | |
| 2565 | memory_set_bankptr(machine, "bank5",messram_get_ptr(machine->device("messram"))); | |
| 2563 | memory_install_readwrite_bank(space,0x3000000,0x3000000+ram_get_size(machine->device(RAM_TAG))-1,0xffffffff,0,"bank5"); | |
| 2564 | memory_set_bankptr(machine, "bank1",ram_get_ptr(machine->device(RAM_TAG))); | |
| 2565 | memory_set_bankptr(machine, "bank5",ram_get_ptr(machine->device(RAM_TAG))); | |
| 2566 | 2566 | memory_install_read32_handler(space,0xc00000,0xdfffff,0xffffffff,0,x68k_gvram32_r); |
| 2567 | 2567 | memory_install_write32_handler(space,0xc00000,0xdfffff,0xffffffff,0,x68k_gvram32_w); |
| 2568 | 2568 | memory_set_bankptr(machine, "bank2",state->gvram); // so that code in VRAM is executable - needed for Terra Cresta |
| r9922 | r9923 | |
| 2695 | 2695 | MCFG_FLOPPY_4_DRIVES_ADD(x68k_floppy_config) |
| 2696 | 2696 | |
| 2697 | 2697 | /* internal ram */ |
| 2698 | MCFG_RAM_ADD( | |
| 2698 | MCFG_RAM_ADD(RAM_TAG | |
| 2699 | 2699 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 2700 | 2700 | MCFG_RAM_EXTRA_OPTIONS("1M,2M,3M,5M,6M,7M,8M,9M,10M,11M,12M") |
| 2701 | 2701 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | 12 | #include "sound/wave.h" |
| 13 | 13 | #include "devices/cassette.h" |
| 14 | #include " | |
| 14 | #include "ma | |
| 15 | 15 | #include "includes/ondra.h" |
| 16 | 16 | |
| 17 | 17 | /* Address maps */ |
| r9922 | r9923 | |
| 150 | 150 | MCFG_CASSETTE_ADD( "cassette", ondra_cassette_config ) |
| 151 | 151 | |
| 152 | 152 | /* internal ram */ |
| 153 | MCFG_RAM_ADD( | |
| 153 | MCFG_RAM_ADD(RAM_TAG | |
| 154 | 154 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 155 | 155 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 156 | 156 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 29 | 29 | #include "cpu/i86/i86.h" |
| 30 | 30 | #include "cpu/mcs48/mcs48.h" |
| 31 | 31 | #include "devices/flopdrv.h" |
| 32 | #include " | |
| 32 | #include "ma | |
| 33 | 33 | #include "machine/ctronics.h" |
| 34 | 34 | #include "machine/6522via.h" |
| 35 | 35 | #include "machine/ieee488.h" |
| r9922 | r9923 | |
| 879 | 879 | |
| 880 | 880 | /* memory banking */ |
| 881 | 881 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 882 | UINT8 *ram = messram_get_ptr(m_ram); | |
| 883 | int ram_size = messram_get_size(m_ram); | |
| 882 | UINT8 *ram = ram_get_ptr(m_ram); | |
| 883 | int ram_size = ram_get_size(m_ram); | |
| 884 | 884 | |
| 885 | 885 | memory_install_ram(program, 0x00000, ram_size - 1, 0, 0, ram); |
| 886 | 886 | } |
| r9922 | r9923 | |
| 932 | 932 | MCFG_FLOPPY_2_DRIVES_ADD(victor9k_floppy_config) |
| 933 | 933 | |
| 934 | 934 | /* internal ram */ |
| 935 | MCFG_RAM_ADD( | |
| 935 | MCFG_RAM_ADD(RAM_TAG | |
| 936 | 936 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 937 | 937 | MCFG_RAM_EXTRA_OPTIONS("256K,384K,512K,640K,768K,896K") |
| 938 | 938 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 26 | 26 | #include "includes/pc8001.h" |
| 27 | 27 | #include "cpu/z80/z80.h" |
| 28 | 28 | #include "devices/cassette.h" |
| 29 | #include " | |
| 29 | #include "ma | |
| 30 | 30 | #include "machine/i8257.h" |
| 31 | 31 | #include "machine/ctronics.h" |
| 32 | 32 | #include "machine/i8214.h" |
| r9922 | r9923 | |
| 441 | 441 | { |
| 442 | 442 | pc8001_state *state = machine->driver_data<pc8001_state>(); |
| 443 | 443 | address_space *program = cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM); |
| 444 | device_t *messram = machine->device( | |
| 444 | device_t *messram = machine->device(RAM_TAG | |
| 445 | 445 | |
| 446 | 446 | /* look up devices */ |
| 447 | 447 | state->i8257 = machine->device(I8257_TAG); |
| r9922 | r9923 | |
| 463 | 463 | memory_install_read_bank(program, 0x0000, 0x5fff, 0, 0, "bank1"); |
| 464 | 464 | memory_unmap_write(program, 0x0000, 0x5fff, 0, 0); |
| 465 | 465 | |
| 466 | switch ( | |
| 466 | switch ( | |
| 467 | 467 | { |
| 468 | 468 | case 16*1024: |
| 469 | memory_configure_bank(machine, "bank3", 0, 1, | |
| 469 | memory_configure_bank(machine, "bank3", 0, 1, | |
| 470 | 470 | memory_unmap_readwrite(program, 0x6000, 0xbfff, 0, 0); |
| 471 | 471 | memory_unmap_readwrite(program, 0x8000, 0xbfff, 0, 0); |
| 472 | 472 | memory_install_readwrite_bank(program, 0xc000, 0xffff, 0, 0, "bank3"); |
| 473 | 473 | break; |
| 474 | 474 | |
| 475 | 475 | case 32*1024: |
| 476 | memory_configure_bank(machine, "bank3", 0, 1, | |
| 476 | memory_configure_bank(machine, "bank3", 0, 1, | |
| 477 | 477 | memory_unmap_readwrite(program, 0x6000, 0xbfff, 0, 0); |
| 478 | 478 | memory_install_readwrite_bank(program, 0x8000, 0xffff, 0, 0, "bank3"); |
| 479 | 479 | break; |
| 480 | 480 | |
| 481 | 481 | case 64*1024: |
| 482 | memory_configure_bank(machine, "bank1", 0, 1, messram_get_ptr(messram), 0); | |
| 483 | memory_configure_bank(machine, "bank2", 0, 1, messram_get_ptr(messram) + 0x6000, 0); | |
| 484 | memory_configure_bank(machine, "bank3", 0, 1, messram_get_ptr(messram) + 0x8000, 0); | |
| 482 | memory_configure_bank(machine, "bank1", 0, 1, ram_get_ptr(messram), 0); | |
| 483 | memory_configure_bank(machine, "bank2", 0, 1, ram_get_ptr(messram) + 0x6000, 0); | |
| 484 | memory_configure_bank(machine, "bank3", 0, 1, ram_get_ptr(messram) + 0x8000, 0); | |
| 485 | 485 | memory_install_readwrite_bank(program, 0x0000, 0x5fff, 0, 0, "bank1"); |
| 486 | 486 | memory_install_readwrite_bank(program, 0x6000, 0xbfff, 0, 0, "bank2"); |
| 487 | 487 | memory_install_readwrite_bank(program, 0x8000, 0xffff, 0, 0, "bank3"); |
| r9922 | r9923 | |
| 550 | 550 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics) |
| 551 | 551 | MCFG_CASSETTE_ADD(CASSETTE_TAG, pc8001_cassette_config) |
| 552 | 552 | |
| 553 | MCFG_RAM_ADD( | |
| 553 | MCFG_RAM_ADD(RAM_TAG | |
| 554 | 554 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 555 | 555 | MCFG_RAM_EXTRA_OPTIONS("32K,64K") |
| 556 | 556 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 562 | 562 | MCFG_CPU_IO_MAP(pc8001mk2_io) |
| 563 | 563 | MCFG_MACHINE_START(pc8001mk2) |
| 564 | 564 | |
| 565 | MCFG_RAM_MODIFY( | |
| 565 | MCFG_RAM_MODIFY(RAM_TAG | |
| 566 | 566 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 567 | 567 | MACHINE_CONFIG_END |
| 568 | 568 |
| r9922 | r9923 | |
|---|---|---|
| 20 | 20 | #include "devices/cartslot.h" |
| 21 | 21 | #include "machine/6532riot.h" |
| 22 | 22 | #include "sound/speaker.h" |
| 23 | #include " | |
| 23 | #include "ma | |
| 24 | 24 | #include "beta.lh" |
| 25 | 25 | |
| 26 | 26 | /* Memory Maps */ |
| r9922 | r9923 | |
| 282 | 282 | MCFG_CARTSLOT_UNLOAD(beta_eprom) |
| 283 | 283 | |
| 284 | 284 | /* internal ram */ |
| 285 | MCFG_RAM_ADD( | |
| 285 | MCFG_RAM_ADD(RAM_TAG | |
| 286 | 286 | MCFG_RAM_DEFAULT_SIZE("256") |
| 287 | 287 | MACHINE_CONFIG_END |
| 288 | 288 |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | #include "machine/ctronics.h" |
| 14 | 14 | #include "devices/cartslot.h" |
| 15 | 15 | #include "devices/cassette.h" |
| 16 | 16 | #include "machine/tf20.h" |
| 17 | #include " | |
| 17 | #include "ma | |
| 18 | 18 | #include "px4.lh" |
| 19 | 19 | |
| 20 | 20 | |
| r9922 | r9923 | |
| 475 | 475 | |
| 476 | 476 | /* ram, part 1 */ |
| 477 | 477 | memory_install_readwrite_bank(space, 0x0000, 0xdfff - size, 0, 0, "bank1"); |
| 478 | memory_set_bankptr(space->machine, "bank1", | |
| 478 | memory_set_bankptr(space->machine, "bank1", | |
| 479 | 479 | |
| 480 | 480 | /* actual rom data, part 1 */ |
| 481 | 481 | memory_install_read_bank(space, 0xe000 - size, 0xffff - size, 0, 0, "bank2"); |
| r9922 | r9923 | |
| 492 | 492 | |
| 493 | 493 | /* ram, continued */ |
| 494 | 494 | memory_install_readwrite_bank(space, 0xe000, 0xffff, 0, 0, "bank4"); |
| 495 | memory_set_bankptr(space->machine, "bank4", | |
| 495 | memory_set_bankptr(space->machine, "bank4", | |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | /* bank register */ |
| r9922 | r9923 | |
| 515 | 515 | memory_nop_write(space_program, 0x0000, 0x7fff, 0, 0); |
| 516 | 516 | memory_set_bankptr(space->machine, "bank1", space->machine->region("os")->base()); |
| 517 | 517 | memory_install_readwrite_bank(space_program, 0x8000, 0xffff, 0, 0, "bank2"); |
| 518 | memory_set_bankptr(space->machine, "bank2", | |
| 518 | memory_set_bankptr(space->machine, "bank2", | |
| 519 | 519 | break; |
| 520 | 520 | |
| 521 | 521 | case 0x04: |
| 522 | 522 | /* memory */ |
| 523 | 523 | memory_install_readwrite_bank(space_program, 0x0000, 0xffff, 0, 0, "bank1"); |
| 524 | memory_set_bankptr(space->machine, "bank1", | |
| 524 | memory_set_bankptr(space->machine, "bank1", | |
| 525 | 525 | break; |
| 526 | 526 | |
| 527 | 527 | case 0x08: install_rom_capsule(space_program, 0x2000, "capsule1"); break; |
| r9922 | r9923 | |
| 1036 | 1036 | int y, x; |
| 1037 | 1037 | |
| 1038 | 1038 | /* get vram start address */ |
| 1039 | UINT8 *vram = & | |
| 1039 | UINT8 *vram = & | |
| 1040 | 1040 | |
| 1041 | 1041 | for (y = 0; y < 64; y++) |
| 1042 | 1042 | { |
| r9922 | r9923 | |
| 1080 | 1080 | px4_state *px4 = machine->driver_data<px4_state>(); |
| 1081 | 1081 | |
| 1082 | 1082 | /* find devices */ |
| 1083 | px4->ram = machine->device( | |
| 1083 | px4->ram = machine->device(RAM_TAG | |
| 1084 | 1084 | |
| 1085 | 1085 | /* init 7508 */ |
| 1086 | 1086 | px4->one_sec_int_enabled = TRUE; |
| r9922 | r9923 | |
| 1105 | 1105 | |
| 1106 | 1106 | /* map os rom and last half of memory */ |
| 1107 | 1107 | memory_set_bankptr(machine, "bank1", machine->region("os")->base()); |
| 1108 | memory_set_bankptr(machine, "bank2", | |
| 1108 | memory_set_bankptr(machine, "bank2", | |
| 1109 | 1109 | } |
| 1110 | 1110 | |
| 1111 | 1111 | static DRIVER_INIT( px4p ) |
| r9922 | r9923 | |
| 1382 | 1382 | MCFG_TIMER_ADD_PERIODIC("frc", frc_tick, HZ(XTAL_7_3728MHz / 2 / 6)) |
| 1383 | 1383 | |
| 1384 | 1384 | /* internal ram */ |
| 1385 | MCFG_RAM_ADD( | |
| 1385 | MCFG_RAM_ADD(RAM_TAG | |
| 1386 | 1386 | MCFG_RAM_DEFAULT_SIZE("64k") |
| 1387 | 1387 | |
| 1388 | 1388 | /* centronics printer */ |
| r9922 | r9923 | |
|---|---|---|
| 289 | 289 | #include "devices/snapquik.h" |
| 290 | 290 | #include "devices/cassette.h" |
| 291 | 291 | #include "formats/lviv_lvt.h" |
| 292 | #include " | |
| 292 | #include "ma | |
| 293 | 293 | |
| 294 | 294 | /* I/O ports */ |
| 295 | 295 | |
| r9922 | r9923 | |
| 465 | 465 | MCFG_CASSETTE_ADD( "cassette", lviv_cassette_config ) |
| 466 | 466 | |
| 467 | 467 | /* internal ram */ |
| 468 | MCFG_RAM_ADD( | |
| 468 | MCFG_RAM_ADD(RAM_TAG | |
| 469 | 469 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 470 | 470 | MACHINE_CONFIG_END |
| 471 | 471 |
| r9922 | r9923 | |
|---|---|---|
| 15 | 15 | #include "devices/cassette.h" |
| 16 | 16 | #include "machine/z80pio.h" |
| 17 | 17 | #include "machine/z80ctc.h" |
| 18 | #include " | |
| 18 | #include "ma | |
| 19 | 19 | #include "poly880.lh" |
| 20 | 20 | |
| 21 | 21 | /* |
| r9922 | r9923 | |
| 305 | 305 | MCFG_CASSETTE_ADD(CASSETTE_TAG, poly880_cassette_config) |
| 306 | 306 | |
| 307 | 307 | /* internal ram */ |
| 308 | MCFG_RAM_ADD( | |
| 308 | MCFG_RAM_ADD(RAM_TAG | |
| 309 | 309 | MCFG_RAM_DEFAULT_SIZE("1K") |
| 310 | 310 | MACHINE_CONFIG_END |
| 311 | 311 |
| r9922 | r9923 | |
|---|---|---|
| 156 | 156 | #include "formats/spec_snqk.h" |
| 157 | 157 | #include "formats/timex_dck.h" |
| 158 | 158 | #include "machine/beta.h" |
| 159 | #include " | |
| 159 | #include "ma | |
| 160 | 160 | |
| 161 | 161 | static const ay8910_interface spectrum_ay_interface = |
| 162 | 162 | { |
| r9922 | r9923 | |
| 227 | 227 | void ts2068_update_memory(running_machine *machine) |
| 228 | 228 | { |
| 229 | 229 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 230 | UINT8 *messram = | |
| 230 | UINT8 *messram = | |
| 231 | 231 | address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 232 | 232 | unsigned char *ChosenROM, *ExROM, *DOCK; |
| 233 | 233 | |
| r9922 | r9923 | |
| 599 | 599 | static MACHINE_RESET( tc2048 ) |
| 600 | 600 | { |
| 601 | 601 | spectrum_state *state = machine->driver_data<spectrum_state>(); |
| 602 | UINT8 *messram = | |
| 602 | UINT8 *messram = | |
| 603 | 603 | |
| 604 | 604 | memory_set_bankptr(machine, "bank1", messram); |
| 605 | 605 | memory_set_bankptr(machine, "bank2", messram); |
| r9922 | r9923 | |
| 658 | 658 | MCFG_CARTSLOT_UNLOAD(timex_cart) |
| 659 | 659 | |
| 660 | 660 | /* internal ram */ |
| 661 | MCFG_RAM_MODIFY( | |
| 661 | MCFG_RAM_MODIFY(RAM_TAG | |
| 662 | 662 | MCFG_RAM_DEFAULT_SIZE("48K") |
| 663 | 663 | MACHINE_CONFIG_END |
| 664 | 664 | |
| r9922 | r9923 | |
| 688 | 688 | MCFG_VIDEO_UPDATE( tc2048 ) |
| 689 | 689 | |
| 690 | 690 | /* internal ram */ |
| 691 | MCFG_RAM_MODIFY( | |
| 691 | MCFG_RAM_MODIFY(RAM_TAG | |
| 692 | 692 | MCFG_RAM_DEFAULT_SIZE("48K") |
| 693 | 693 | MACHINE_CONFIG_END |
| 694 | 694 |
| r9922 | r9923 | |
|---|---|---|
| 32 | 32 | #include "emu.h" |
| 33 | 33 | #include "cpu/z80/z80.h" |
| 34 | 34 | #include "devices/flopdrv.h" |
| 35 | #include " | |
| 35 | #include "ma | |
| 36 | 36 | #include "formats/basicdsk.h" |
| 37 | 37 | #include "machine/serial.h" |
| 38 | 38 | #include "machine/i8255a.h" |
| r9922 | r9923 | |
| 71 | 71 | |
| 72 | 72 | m_bank = data & 0x07; |
| 73 | 73 | |
| 74 | switch ( | |
| 74 | switch ( | |
| 75 | 75 | { |
| 76 | 76 | case 64 * 1024: |
| 77 | 77 | max_ram_bank = BANK_RAM1; |
| r9922 | r9923 | |
| 153 | 153 | |
| 154 | 154 | m_bank = data & 0x07; |
| 155 | 155 | |
| 156 | switch ( | |
| 156 | switch ( | |
| 157 | 157 | { |
| 158 | 158 | case 64 * 1024: |
| 159 | 159 | case 96 * 1024: |
| r9922 | r9923 | |
| 734 | 734 | void bw2_state::machine_start() |
| 735 | 735 | { |
| 736 | 736 | /* allocate memory */ |
| 737 | m_work_ram = auto_alloc_array(machine, UINT8, | |
| 737 | m_work_ram = auto_alloc_array(machine, UINT8, | |
| 738 | 738 | m_video_ram = auto_alloc_array(machine, UINT8, BW2_VIDEORAM_SIZE); |
| 739 | 739 | m_ramcard_ram = auto_alloc_array(machine, UINT8, BW2_RAMCARD_SIZE); |
| 740 | 740 | |
| r9922 | r9923 | |
| 745 | 745 | |
| 746 | 746 | /* register for state saving */ |
| 747 | 747 | state_save_register_global(machine, m_kb_row); |
| 748 | state_save_register_global_pointer(machine, m_work_ram, | |
| 748 | state_save_register_global_pointer(machine, m_work_ram, | |
| 749 | 749 | state_save_register_global_pointer(machine, m_ramcard_ram, BW2_RAMCARD_SIZE); |
| 750 | 750 | state_save_register_global(machine, m_bank); |
| 751 | 751 | state_save_register_global(machine, m_drive); |
| r9922 | r9923 | |
| 818 | 818 | MCFG_SOFTWARE_LIST_ADD("flop_list","bw2") |
| 819 | 819 | |
| 820 | 820 | /* internal ram */ |
| 821 | MCFG_RAM_ADD( | |
| 821 | MCFG_RAM_ADD(RAM_TAG | |
| 822 | 822 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 823 | 823 | MCFG_RAM_EXTRA_OPTIONS("96K,128K,160K,192K,224K") |
| 824 | 824 |
| r9922 | r9923 | |
|---|---|---|
| 21 | 21 | #include "machine/wd17xx.h" |
| 22 | 22 | #include "devices/flopdrv.h" |
| 23 | 23 | #include "formats/basicdsk.h" |
| 24 | #include " | |
| 24 | #include "ma | |
| 25 | 25 | #include "includes/enterp.h" |
| 26 | 26 | |
| 27 | 27 | #define ENTERPRISE_XTAL_X1 XTAL_8MHz |
| r9922 | r9923 | |
| 70 | 70 | case 0xfa: |
| 71 | 71 | case 0xfb: |
| 72 | 72 | /* additional 64k ram */ |
| 73 | if ( | |
| 73 | if ( | |
| 74 | 74 | { |
| 75 | 75 | memory_install_readwrite_bank(space, start, end, 0, 0, page_num); |
| 76 | memory_set_bankptr(space->machine, page_num, | |
| 76 | memory_set_bankptr(space->machine, page_num, | |
| 77 | 77 | } |
| 78 | 78 | else |
| 79 | 79 | { |
| r9922 | r9923 | |
| 87 | 87 | case 0xff: |
| 88 | 88 | /* basic 64k ram */ |
| 89 | 89 | memory_install_readwrite_bank(space, start, end, 0, 0, page_num); |
| 90 | memory_set_bankptr(space->machine, page_num, | |
| 90 | memory_set_bankptr(space->machine, page_num, | |
| 91 | 91 | break; |
| 92 | 92 | |
| 93 | 93 | default: |
| r9922 | r9923 | |
| 476 | 476 | MCFG_FLOPPY_4_DRIVES_ADD(enterprise_floppy_config) |
| 477 | 477 | |
| 478 | 478 | /* internal ram */ |
| 479 | MCFG_RAM_ADD( | |
| 479 | MCFG_RAM_ADD(RAM_TAG | |
| 480 | 480 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 481 | 481 | MACHINE_CONFIG_END |
| 482 | 482 | |
| 483 | 483 | static MACHINE_CONFIG_DERIVED( ep128, ep64 ) |
| 484 | 484 | /* internal ram */ |
| 485 | MCFG_RAM_MODIFY( | |
| 485 | MCFG_RAM_MODIFY(RAM_TAG | |
| 486 | 486 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 487 | 487 | MACHINE_CONFIG_END |
| 488 | 488 |
| r9922 | r9923 | |
|---|---|---|
| 81 | 81 | #include "includes/portfoli.h" |
| 82 | 82 | #include "cpu/i86/i86.h" |
| 83 | 83 | #include "devices/cartslot.h" |
| 84 | #include " | |
| 84 | #include "ma | |
| 85 | 85 | #include "devices/printer.h" |
| 86 | 86 | #include "machine/ctronics.h" |
| 87 | 87 | #include "machine/i8255a.h" |
| r9922 | r9923 | |
| 783 | 783 | cpu_set_irq_callback(m_maincpu, portfolio_int_ack); |
| 784 | 784 | |
| 785 | 785 | /* memory expansions */ |
| 786 | switch ( | |
| 786 | switch ( | |
| 787 | 787 | { |
| 788 | 788 | case 128 * 1024: |
| 789 | 789 | memory_unmap_readwrite(program, 0x1f000, 0x9efff, 0, 0); |
| r9922 | r9923 | |
| 901 | 901 | // MCFG_SOFTWARE_LIST_ADD("cart_list", "pofo") |
| 902 | 902 | |
| 903 | 903 | /* internal ram */ |
| 904 | MCFG_RAM_ADD( | |
| 904 | MCFG_RAM_ADD(RAM_TAG | |
| 905 | 905 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 906 | 906 | MCFG_RAM_EXTRA_OPTIONS("384K,640K") |
| 907 | 907 |
| r9922 | r9923 | |
|---|---|---|
| 15 | 15 | #include "video/ef9345.h" |
| 16 | 16 | #include "devices/cassette.h" |
| 17 | 17 | #include "formats/coco_cas.h" |
| 18 | #include " | |
| 18 | #include "ma | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | /*************************************************************************** |
| r9922 | r9923 | |
| 205 | 205 | mc10->cassette = machine->device("cassette"); |
| 206 | 206 | |
| 207 | 207 | /* initialize memory */ |
| 208 | mc10->ram = messram_get_ptr(machine->device("messram")); | |
| 209 | mc10->ram_size = messram_get_size(machine->device("messram")); | |
| 208 | mc10->ram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 209 | mc10->ram_size = ram_get_size(machine->device(RAM_TAG)); | |
| 210 | 210 | |
| 211 | 211 | memory_set_bankptr(machine, "bank1", mc10->ram); |
| 212 | 212 | |
| r9922 | r9923 | |
| 234 | 234 | mc10->cassette = machine->device("cassette"); |
| 235 | 235 | |
| 236 | 236 | /* initialize memory */ |
| 237 | mc10->ram = messram_get_ptr(machine->device("messram")); | |
| 238 | mc10->ram_size = messram_get_size(machine->device("messram")); | |
| 237 | mc10->ram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 238 | mc10->ram_size = ram_get_size(machine->device(RAM_TAG)); | |
| 239 | 239 | |
| 240 | 240 | memory_set_bankptr(machine, "bank1", mc10->ram); |
| 241 | 241 | |
| r9922 | r9923 | |
| 510 | 510 | MCFG_CASSETTE_ADD("cassette", mc10_cassette_config) |
| 511 | 511 | |
| 512 | 512 | /* internal ram */ |
| 513 | MCFG_RAM_ADD( | |
| 513 | MCFG_RAM_ADD(RAM_TAG | |
| 514 | 514 | MCFG_RAM_DEFAULT_SIZE("20K") |
| 515 | 515 | MCFG_RAM_EXTRA_OPTIONS("4K") |
| 516 | 516 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 547 | 547 | MCFG_CASSETTE_ADD("cassette", mc10_cassette_config) |
| 548 | 548 | |
| 549 | 549 | /* internal ram */ |
| 550 | MCFG_RAM_ADD( | |
| 550 | MCFG_RAM_ADD(RAM_TAG | |
| 551 | 551 | MCFG_RAM_DEFAULT_SIZE("24K") |
| 552 | 552 | MCFG_RAM_EXTRA_OPTIONS("8K") |
| 553 | 553 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 113 | 113 | #include "devices/cartslot.h" |
| 114 | 114 | #include "devices/cassette.h" |
| 115 | 115 | #include "devices/flopdrv.h" |
| 116 | #include " | |
| 116 | #include "ma | |
| 117 | 117 | #include "devices/snapquik.h" |
| 118 | 118 | #include "formats/atom_atm.h" |
| 119 | 119 | #include "formats/atom_tap.h" |
| r9922 | r9923 | |
| 867 | 867 | MCFG_ATOM_CARTSLOT_ADD("cart") |
| 868 | 868 | |
| 869 | 869 | /* internal ram */ |
| 870 | MCFG_RAM_ADD( | |
| 870 | MCFG_RAM_ADD(RAM_TAG | |
| 871 | 871 | MCFG_RAM_DEFAULT_SIZE("2K") |
| 872 | 872 | MCFG_RAM_EXTRA_OPTIONS("4K,6K,8K,10K,12K") |
| 873 | 873 |
| r9922 | r9923 | |
|---|---|---|
| 16 | 16 | #include "machine/wd17xx.h" |
| 17 | 17 | #include "sound/sn76496.h" |
| 18 | 18 | #include "video/mc6845.h" |
| 19 | #include " | |
| 19 | #include "ma | |
| 20 | 20 | #include "devices/flopdrv.h" |
| 21 | 21 | #include "formats/apridisk.h" |
| 22 | 22 | |
| r9922 | r9923 | |
| 176 | 176 | static MC6845_UPDATE_ROW( apricot_update_row ) |
| 177 | 177 | { |
| 178 | 178 | apricot_state *apricot = device->machine->driver_data<apricot_state>(); |
| 179 | UINT8 *ram = | |
| 179 | UINT8 *ram = | |
| 180 | 180 | int i, x; |
| 181 | 181 | |
| 182 | 182 | if (apricot->video_mode) |
| r9922 | r9923 | |
| 239 | 239 | device_t *maincpu = machine->device("maincpu"); |
| 240 | 240 | address_space *prg = cpu_get_address_space(maincpu, ADDRESS_SPACE_PROGRAM); |
| 241 | 241 | |
| 242 | UINT8 *ram = messram_get_ptr(machine->device("messram")); | |
| 243 | UINT32 ram_size = messram_get_size(machine->device("messram")); | |
| 242 | UINT8 *ram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 243 | UINT32 ram_size = ram_get_size(machine->device(RAM_TAG)); | |
| 244 | 244 | |
| 245 | 245 | memory_unmap_readwrite(prg, 0x40000, 0xeffff, 0, 0); |
| 246 | 246 | memory_install_ram(prg, 0x00000, ram_size - 1, 0, 0, ram); |
| r9922 | r9923 | |
| 359 | 359 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 360 | 360 | |
| 361 | 361 | /* internal ram */ |
| 362 | MCFG_RAM_ADD( | |
| 362 | MCFG_RAM_ADD(RAM_TAG | |
| 363 | 363 | MCFG_RAM_DEFAULT_SIZE("256k") |
| 364 | 364 | MCFG_RAM_EXTRA_OPTIONS("384k,512k") /* with 1 or 2 128k expansion boards */ |
| 365 | 365 |
| r9922 | r9923 | |
|---|---|---|
| 26 | 26 | #include "machine/z80pio.h" |
| 27 | 27 | #include "machine/z80ctc.h" |
| 28 | 28 | #include "sound/speaker.h" |
| 29 | #include " | |
| 29 | #include "ma | |
| 30 | 30 | #include "lc80.lh" |
| 31 | 31 | |
| 32 | 32 | /* Memory Maps */ |
| r9922 | r9923 | |
| 319 | 319 | memory_install_readwrite_bank(program, 0x0800, 0x0fff, 0, 0, "bank2"); |
| 320 | 320 | memory_install_readwrite_bank(program, 0x1000, 0x17ff, 0, 0, "bank3"); |
| 321 | 321 | |
| 322 | switch ( | |
| 322 | switch ( | |
| 323 | 323 | { |
| 324 | 324 | case 1*1024: |
| 325 | 325 | memory_install_readwrite_bank(program, 0x2000, 0x23ff, 0, 0, "bank4"); |
| r9922 | r9923 | |
| 380 | 380 | |
| 381 | 381 | MCFG_CASSETTE_ADD(CASSETTE_TAG, lc80_cassette_config) |
| 382 | 382 | |
| 383 | MCFG_RAM_ADD( | |
| 383 | MCFG_RAM_ADD(RAM_TAG | |
| 384 | 384 | MCFG_RAM_DEFAULT_SIZE("1K") |
| 385 | 385 | MCFG_RAM_EXTRA_OPTIONS("2K,3K,4K") |
| 386 | 386 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 410 | 410 | MCFG_CASSETTE_ADD(CASSETTE_TAG, lc80_cassette_config) |
| 411 | 411 | |
| 412 | 412 | /* internal ram */ |
| 413 | MCFG_RAM_ADD( | |
| 413 | MCFG_RAM_ADD(RAM_TAG | |
| 414 | 414 | MCFG_RAM_DEFAULT_SIZE("4K") |
| 415 | 415 | MACHINE_CONFIG_END |
| 416 | 416 |
| r9922 | r9923 | |
|---|---|---|
| 46 | 46 | #include "devices/cartslot.h" |
| 47 | 47 | #include "devices/cassette.h" |
| 48 | 48 | #include "sound/wave.h" |
| 49 | #include " | |
| 49 | #include "ma | |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | class rx78_state : public driver_device |
| r9922 | r9923 | |
| 479 | 479 | MCFG_CARTSLOT_LOAD(rx78_cart) |
| 480 | 480 | MCFG_CARTSLOT_INTERFACE("rx78_cart") |
| 481 | 481 | |
| 482 | MCFG_RAM_ADD( | |
| 482 | MCFG_RAM_ADD(RAM_TAG | |
| 483 | 483 | MCFG_RAM_DEFAULT_SIZE("32k") |
| 484 | 484 | MCFG_RAM_EXTRA_OPTIONS("16k") |
| 485 | 485 | |
| r9922 | r9923 | |
| 510 | 510 | |
| 511 | 511 | static DRIVER_INIT( rx78 ) |
| 512 | 512 | { |
| 513 | UINT32 ram_size = | |
| 513 | UINT32 ram_size = | |
| 514 | 514 | address_space *prg = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 515 | 515 | |
| 516 | 516 | if(ram_size == 0x4000) |
| r9922 | r9923 | |
|---|---|---|
| 19 | 19 | #include "formats/basicdsk.h" |
| 20 | 20 | #include "formats/rk_cas.h" |
| 21 | 21 | #include "includes/radio86.h" |
| 22 | #include " | |
| 22 | #include "ma | |
| 23 | 23 | #include "includes/partner.h" |
| 24 | 24 | |
| 25 | 25 | /* Address maps */ |
| r9922 | r9923 | |
| 224 | 224 | MCFG_FLOPPY_2_DRIVES_ADD(partner_floppy_config) |
| 225 | 225 | |
| 226 | 226 | /* internal ram */ |
| 227 | MCFG_RAM_ADD( | |
| 227 | MCFG_RAM_ADD(RAM_TAG | |
| 228 | 228 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 229 | 229 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 230 | 230 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 73 | 73 | #include "includes/apple1.h" |
| 74 | 74 | #include "devices/snapquik.h" |
| 75 | 75 | #include "devices/cassette.h" |
| 76 | #include " | |
| 76 | #include "ma | |
| 77 | 77 | |
| 78 | 78 | /* port i/o functions */ |
| 79 | 79 | |
| r9922 | r9923 | |
| 259 | 259 | the RAM amounts listed here will be 4K below the actual RAM |
| 260 | 260 | total. */ |
| 261 | 261 | /* internal ram */ |
| 262 | MCFG_RAM_ADD( | |
| 262 | MCFG_RAM_ADD(RAM_TAG | |
| 263 | 263 | MCFG_RAM_DEFAULT_SIZE("48K") |
| 264 | 264 | MCFG_RAM_EXTRA_OPTIONS("4K,8K,12K,16K,20K,24K,28K,32K,36K,40K,44K") |
| 265 | 265 |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "cpu/z80/z80daisy.h" |
| 13 | 13 | #include "machine/z80pio.h" |
| 14 | 14 | #include "devices/cassette.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | #include "c80.lh" |
| 17 | 17 | |
| 18 | 18 | /* Memory Maps */ |
| r9922 | r9923 | |
| 267 | 267 | MCFG_CASSETTE_ADD(CASSETTE_TAG, c80_cassette_config) |
| 268 | 268 | |
| 269 | 269 | /* internal ram */ |
| 270 | MCFG_RAM_ADD( | |
| 270 | MCFG_RAM_ADD(RAM_TAG | |
| 271 | 271 | MCFG_RAM_DEFAULT_SIZE("1K") |
| 272 | 272 | MACHINE_CONFIG_END |
| 273 | 273 |
| r9922 | r9923 | |
|---|---|---|
| 38 | 38 | #include "devices/cassette.h" |
| 39 | 39 | #include "sound/cdp1864.h" |
| 40 | 40 | #include "machine/rescap.h" |
| 41 | #include " | |
| 41 | #include "ma | |
| 42 | 42 | |
| 43 | 43 | /* Read/Write Handlers */ |
| 44 | 44 | |
| r9922 | r9923 | |
| 317 | 317 | MCFG_FLOPPY_2_DRIVES_ADD(tmc2000e_floppy_config) |
| 318 | 318 | |
| 319 | 319 | /* internal ram */ |
| 320 | MCFG_RAM_ADD( | |
| 320 | MCFG_RAM_ADD(RAM_TAG | |
| 321 | 321 | MCFG_RAM_DEFAULT_SIZE("8K") |
| 322 | 322 | MCFG_RAM_EXTRA_OPTIONS("40K") |
| 323 | 323 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 35 | 35 | #include "devices/chd_cd.h" |
| 36 | 36 | #include "devices/harddriv.h" |
| 37 | 37 | #include "formats/pc_dsk.h" |
| 38 | #include " | |
| 38 | #include "ma | |
| 39 | 39 | |
| 40 | 40 | static READ8_HANDLER(at_dma8237_1_r) { return i8237_r(space->machine->device("dma8237_2"), offset / 2); } |
| 41 | 41 | static WRITE8_HANDLER(at_dma8237_1_w) { i8237_w(space->machine->device("dma8237_2"), offset / 2, data); } |
| r9922 | r9923 | |
| 174 | 174 | MCFG_MC146818_ADD( "rtc", MC146818_STANDARD ) |
| 175 | 175 | |
| 176 | 176 | /* internal ram */ |
| 177 | MCFG_RAM_ADD( | |
| 177 | MCFG_RAM_ADD(RAM_TAG | |
| 178 | 178 | MCFG_RAM_DEFAULT_SIZE("32M") |
| 179 | 179 | MCFG_RAM_EXTRA_OPTIONS("8M,16M") |
| 180 | 180 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 26 | 26 | |
| 27 | 27 | #include "emu.h" |
| 28 | 28 | #include "cpu/m6800/m6800.h" |
| 29 | #include " | |
| 29 | #include "ma | |
| 30 | 30 | #include "machine/6821pia.h" |
| 31 | 31 | #include "machine/6850acia.h" |
| 32 | 32 | #include "machine/ieee488.h" |
| r9922 | r9923 | |
| 1168 | 1168 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 1169 | 1169 | |
| 1170 | 1170 | // configure RAM |
| 1171 | switch ( | |
| 1171 | switch ( | |
| 1172 | 1172 | { |
| 1173 | 1173 | case 8*1024: |
| 1174 | 1174 | memory_unmap_readwrite(program, 0x2000, 0x7fff, 0, 0); |
| r9922 | r9923 | |
| 1241 | 1241 | //MCFG_RS232_ADD(RS232_TAG, rs232_intf) |
| 1242 | 1242 | |
| 1243 | 1243 | // internal ram |
| 1244 | MCFG_RAM_ADD( | |
| 1244 | MCFG_RAM_ADD(RAM_TAG | |
| 1245 | 1245 | MCFG_RAM_DEFAULT_SIZE("8K") |
| 1246 | 1246 | MCFG_RAM_EXTRA_OPTIONS("16K,24K,32K") |
| 1247 | 1247 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 1274 | 1274 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1275 | 1275 | |
| 1276 | 1276 | // internal ram |
| 1277 | MCFG_RAM_ADD( | |
| 1277 | MCFG_RAM_ADD(RAM_TAG | |
| 1278 | 1278 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 1279 | 1279 | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 1280 | 1280 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 26 | 26 | #include "cpu/z80/z80.h" |
| 27 | 27 | #include "cpu/z80/z80daisy.h" |
| 28 | 28 | #include "devices/cassette.h" |
| 29 | #include " | |
| 29 | #include "ma | |
| 30 | 30 | #include "devices/snapquik.h" |
| 31 | 31 | #include "machine/ctronics.h" |
| 32 | 32 | #include "machine/z80ctc.h" |
| r9922 | r9923 | |
| 358 | 358 | MCFG_TIMER_ADD_PERIODIC("cassette_timer", cassette_tick, HZ(44100)) |
| 359 | 359 | |
| 360 | 360 | /* internal ram */ |
| 361 | MCFG_RAM_ADD( | |
| 361 | MCFG_RAM_ADD(RAM_TAG | |
| 362 | 362 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 363 | 363 | MCFG_RAM_EXTRA_OPTIONS("96K,128K,160K,192K,224K,256K,288K,320K,352K,384K,416K,448K,480K,512K") |
| 364 | 364 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 370 | 370 | static MACHINE_CONFIG_DERIVED( mtx500, mtx512 ) |
| 371 | 371 | |
| 372 | 372 | /* internal ram */ |
| 373 | MCFG_RAM_MODIFY( | |
| 373 | MCFG_RAM_MODIFY(RAM_TAG | |
| 374 | 374 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 375 | 375 | MCFG_RAM_EXTRA_OPTIONS("64K,96K,128K,160K,192K,224K,256K,288K,320K,352K,384K,416K,448K,480K,512K") |
| 376 | 376 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 390 | 390 | MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_4MHz, dart_intf) |
| 391 | 391 | |
| 392 | 392 | /* internal ram */ |
| 393 | MCFG_RAM_MODIFY( | |
| 393 | MCFG_RAM_MODIFY(RAM_TAG | |
| 394 | 394 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 395 | 395 | MCFG_RAM_EXTRA_OPTIONS("160K,192K,224K,256K,288K,320K,352K,384K,416K,448K,480K,512K") |
| 396 | 396 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | #include "emu.h" |
| 43 | 43 | #include "cpu/z80/z80.h" |
| 44 | #include " | |
| 44 | #include "ma | |
| 45 | 45 | #include "devices/printer.h" |
| 46 | 46 | #include "video/ef9345.h" |
| 47 | 47 | #include "sound/dac.h" |
| r9922 | r9923 | |
| 362 | 362 | |
| 363 | 363 | /* install expansion memory*/ |
| 364 | 364 | address_space *program = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 365 | UINT8 *ram = messram_get_ptr(machine->device("messram")); | |
| 366 | UINT16 ram_size = messram_get_size(machine->device("messram")); | |
| 365 | UINT8 *ram = ram_get_ptr(machine->device(RAM_TAG)); | |
| 366 | UINT16 ram_size = ram_get_size(machine->device(RAM_TAG)); | |
| 367 | 367 | |
| 368 | 368 | if (ram_size > 0x4000) |
| 369 | 369 | memory_install_ram(program, 0x8000, 0x3fff + ram_size, 0, 0, ram); |
| r9922 | r9923 | |
| 434 | 434 | MCFG_PRINTER_ADD("printer") |
| 435 | 435 | |
| 436 | 436 | /* internal ram */ |
| 437 | MCFG_RAM_ADD( | |
| 437 | MCFG_RAM_ADD(RAM_TAG | |
| 438 | 438 | MCFG_RAM_DEFAULT_SIZE("16K") |
| 439 | 439 | MCFG_RAM_EXTRA_OPTIONS("32K,48k") |
| 440 | 440 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 28 | 28 | #include "devices/flopdrv.h" |
| 29 | 29 | #include "devices/cassette.h" |
| 30 | 30 | #include "formats/tzx_cas.h" |
| 31 | #include " | |
| 31 | #include "ma | |
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | class elwro800_state : public spectrum_state |
| r9922 | r9923 | |
| 103 | 103 | static void elwro800jr_mmu_w(running_machine *machine, UINT8 data) |
| 104 | 104 | { |
| 105 | 105 | UINT8 *prom = machine->region("proms")->base() + 0x200; |
| 106 | UINT8 *messram = | |
| 106 | UINT8 *messram = | |
| 107 | 107 | UINT8 cs; |
| 108 | 108 | UINT8 ls175; |
| 109 | 109 | elwro800_state *state = machine->driver_data<elwro800_state>(); |
| r9922 | r9923 | |
| 508 | 508 | static MACHINE_RESET(elwro800) |
| 509 | 509 | { |
| 510 | 510 | elwro800_state *state = machine->driver_data<elwro800_state>(); |
| 511 | UINT8 *messram = | |
| 511 | UINT8 *messram = | |
| 512 | 512 | |
| 513 | 513 | state->df_on_databus = 0xdf; |
| 514 | 514 | memset(messram, 0, 64*1024); |
| r9922 | r9923 | |
| 613 | 613 | MCFG_FLOPPY_2_DRIVES_ADD(elwro800jr_floppy_config) |
| 614 | 614 | |
| 615 | 615 | /* internal ram */ |
| 616 | MCFG_RAM_ADD( | |
| 616 | MCFG_RAM_ADD(RAM_TAG | |
| 617 | 617 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 618 | 618 | MACHINE_CONFIG_END |
| 619 | 619 |
| r9922 | r9923 | |
|---|---|---|
| 22 | 22 | #include "formats/rk_cas.h" |
| 23 | 23 | #include "formats/smx_dsk.h" |
| 24 | 24 | #include "machine/wd17xx.h" |
| 25 | #include " | |
| 25 | #include "ma | |
| 26 | 26 | |
| 27 | 27 | /* Address maps */ |
| 28 | 28 | static ADDRESS_MAP_START(specialist_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r9922 | r9923 | |
| 481 | 481 | MCFG_FLOPPY_2_DRIVES_ADD(specimx_floppy_config) |
| 482 | 482 | |
| 483 | 483 | /* internal ram */ |
| 484 | MCFG_RAM_ADD( | |
| 484 | MCFG_RAM_ADD(RAM_TAG | |
| 485 | 485 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 486 | 486 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 487 | 487 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 522 | 522 | MCFG_FLOPPY_2_DRIVES_ADD(specimx_floppy_config) |
| 523 | 523 | |
| 524 | 524 | /* internal ram */ |
| 525 | MCFG_RAM_ADD( | |
| 525 | MCFG_RAM_ADD(RAM_TAG | |
| 526 | 526 | MCFG_RAM_DEFAULT_SIZE("192K") |
| 527 | 527 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 528 | 528 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "devices/flopdrv.h" |
| 13 | 13 | #include "formats/basicdsk.h" |
| 14 | 14 | #include "machine/upd765.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | class pyl601_state : public driver_device |
| r9922 | r9923 | |
| 50 | 50 | } |
| 51 | 51 | else |
| 52 | 52 | { |
| 53 | memory_set_bankptr(space->machine, "bank2", | |
| 53 | memory_set_bankptr(space->machine, "bank2", | |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| r9922 | r9923 | |
| 76 | 76 | static WRITE8_HANDLER (vdisk_data_w) |
| 77 | 77 | { |
| 78 | 78 | pyl601_state *state = space->machine->driver_data<pyl601_state>(); |
| 79 | | |
| 79 | | |
| 80 | 80 | state->vdisk_addr++; |
| 81 | 81 | state->vdisk_addr&=0x7ffff; |
| 82 | 82 | } |
| r9922 | r9923 | |
| 84 | 84 | static READ8_HANDLER (vdisk_data_r) |
| 85 | 85 | { |
| 86 | 86 | pyl601_state *state = space->machine->driver_data<pyl601_state>(); |
| 87 | UINT8 retVal = | |
| 87 | UINT8 retVal = | |
| 88 | 88 | state->vdisk_addr++; |
| 89 | 89 | state->vdisk_addr &= 0x7ffff; |
| 90 | 90 | return retVal; |
| r9922 | r9923 | |
| 344 | 344 | { |
| 345 | 345 | pyl601_state *state = machine->driver_data<pyl601_state>(); |
| 346 | 346 | state->key_code = 0xff; |
| 347 | memory_set_bankptr(machine, "bank1", messram_get_ptr(machine->device("messram")) + 0x0000); | |
| 348 | memory_set_bankptr(machine, "bank2", messram_get_ptr(machine->device("messram")) + 0xc000); | |
| 349 | memory_set_bankptr(machine, "bank3", messram_get_ptr(machine->device("messram")) + 0xe000); | |
| 350 | memory_set_bankptr(machine, "bank4", messram_get_ptr(machine->device("messram")) + 0xe700); | |
| 347 | memory_set_bankptr(machine, "bank1", ram_get_ptr(machine->device(RAM_TAG)) + 0x0000); | |
| 348 | memory_set_bankptr(machine, "bank2", ram_get_ptr(machine->device(RAM_TAG)) + 0xc000); | |
| 349 | memory_set_bankptr(machine, "bank3", ram_get_ptr(machine->device(RAM_TAG)) + 0xe000); | |
| 350 | memory_set_bankptr(machine, "bank4", ram_get_ptr(machine->device(RAM_TAG)) + 0xe700); | |
| 351 | 351 | memory_set_bankptr(machine, "bank5", machine->region("maincpu")->base() + 0xf000); |
| 352 | memory_set_bankptr(machine, "bank6", | |
| 352 | memory_set_bankptr(machine, "bank6", | |
| 353 | 353 | |
| 354 | 354 | machine->device("maincpu")->reset(); |
| 355 | 355 | } |
| r9922 | r9923 | |
| 376 | 376 | { |
| 377 | 377 | for (column = 0; column < x_count; column++) |
| 378 | 378 | { |
| 379 | UINT8 code = | |
| 379 | UINT8 code = | |
| 380 | 380 | code = ((code << 1) | (code >> 7)) & 0xff; |
| 381 | 381 | if (column == cursor_x-2) |
| 382 | 382 | { |
| r9922 | r9923 | |
| 401 | 401 | { |
| 402 | 402 | for (i = 0; i < x_count; i++) |
| 403 | 403 | { |
| 404 | data = | |
| 404 | data = | |
| 405 | 405 | for (bit = 0; bit < 8; bit++) |
| 406 | 406 | { |
| 407 | 407 | *BITMAP_ADDR16(bitmap, y, (i * 8) + bit) = BIT(data, 7) ? 1 : 0; |
| r9922 | r9923 | |
| 422 | 422 | { |
| 423 | 423 | for (column = 0; column < x_count; column++) |
| 424 | 424 | { |
| 425 | UINT8 code = | |
| 425 | UINT8 code = | |
| 426 | 426 | data = charrom[((code << 4) | (ra & 0x07)) & 0xfff]; |
| 427 | 427 | if (column == cursor_x) |
| 428 | 428 | { |
| r9922 | r9923 | |
| 444 | 444 | { |
| 445 | 445 | for (i = 0; i < x_count; i++) |
| 446 | 446 | { |
| 447 | data = | |
| 447 | data = | |
| 448 | 448 | for (bit = 0; bit < 8; bit++) |
| 449 | 449 | { |
| 450 | 450 | *BITMAP_ADDR16(bitmap, y, (i * 8) + bit) = BIT(data, 7) ? 1 : 0; |
| r9922 | r9923 | |
| 485 | 485 | |
| 486 | 486 | static DRIVER_INIT(pyl601) |
| 487 | 487 | { |
| 488 | memset( | |
| 488 | memset( | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | static INTERRUPT_GEN( pyl601_interrupt ) |
| r9922 | r9923 | |
| 580 | 580 | MCFG_FLOPPY_2_DRIVES_ADD(pyldin_floppy_config) |
| 581 | 581 | |
| 582 | 582 | /* internal ram */ |
| 583 | MCFG_RAM_ADD( | |
| 583 | MCFG_RAM_ADD(RAM_TAG | |
| 584 | 584 | MCFG_RAM_DEFAULT_SIZE("576K") // 64 + 512 |
| 585 | 585 | MACHINE_CONFIG_END |
| 586 | 586 |
| r9922 | r9923 | |
|---|---|---|
| 13 | 13 | #include "cpu/mcs51/mcs51.h" |
| 14 | 14 | #include "devices/flopdrv.h" |
| 15 | 15 | #include "devices/harddriv.h" |
| 16 | #include " | |
| 16 | #include "ma | |
| 17 | 17 | #include "formats/flopimg.h" |
| 18 | 18 | #include "formats/pc_dsk.h" |
| 19 | 19 | #include "includes/rmnimbus.h" |
| r9922 | r9923 | |
| 330 | 330 | MCFG_HARDDISK_ADD(HARDDISK3_TAG) |
| 331 | 331 | MCFG_SCSIBUS_ADD(SCSIBUS_TAG, scsibus_config) |
| 332 | 332 | |
| 333 | MCFG_RAM_ADD( | |
| 333 | MCFG_RAM_ADD(RAM_TAG | |
| 334 | 334 | MCFG_RAM_DEFAULT_SIZE("1536K") |
| 335 | 335 | MCFG_RAM_EXTRA_OPTIONS("128K,256K,384K,512K,640K,1024K") |
| 336 | 336 |
| r9922 | r9923 | |
|---|---|---|
| 62 | 62 | #include "sound/dac.h" |
| 63 | 63 | #include "includes/archimds.h" |
| 64 | 64 | #include "machine/i2cmem.h" |
| 65 | #include " | |
| 65 | #include "ma | |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | class a310_state : public driver_device |
| r9922 | r9923 | |
| 103 | 103 | |
| 104 | 104 | static DRIVER_INIT(a310) |
| 105 | 105 | { |
| 106 | UINT32 ram_size = | |
| 106 | UINT32 ram_size = | |
| 107 | 107 | |
| 108 | 108 | archimedes_memc_physmem = auto_alloc_array(machine, UINT32, 0x01000000); |
| 109 | 109 | |
| r9922 | r9923 | |
| 281 | 281 | MCFG_VIDEO_START(archimds_vidc) |
| 282 | 282 | MCFG_VIDEO_UPDATE(archimds_vidc) |
| 283 | 283 | |
| 284 | MCFG_RAM_ADD( | |
| 284 | MCFG_RAM_ADD(RAM_TAG | |
| 285 | 285 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 286 | 286 | MCFG_RAM_EXTRA_OPTIONS("512K, 1M, 4M, 8M, 16M") |
| 287 | 287 |
| r9922 | r9923 | |
|---|---|---|
| 44 | 44 | #include "machine/tc8521.h" |
| 45 | 45 | #include "machine/ins8250.h" |
| 46 | 46 | #include "sound/speaker.h" |
| 47 | #include " | |
| 47 | #include "ma | |
| 48 | 48 | |
| 49 | 49 | /* |
| 50 | 50 | bit 7: ?? high priority. When it occurs, clear this bit. |
| r9922 | r9923 | |
| 323 | 323 | /* %001 */ |
| 324 | 324 | /* ram */ |
| 325 | 325 | case 0x01: |
| 326 | addr = | |
| 326 | addr = | |
| 327 | 327 | memory_set_bankptr(machine, "bank3", addr); |
| 328 | 328 | memory_set_bankptr(machine, "bank7", addr); |
| 329 | 329 | state->banked_opbase[2] = ((UINT8 *) addr) - (2 * 0x4000); |
| r9922 | r9923 | |
| 419 | 419 | state->flash_at_0x8000 = 0; |
| 420 | 420 | |
| 421 | 421 | /* clear */ |
| 422 | memset( | |
| 422 | memset( | |
| 423 | 423 | |
| 424 | 424 | addr = (unsigned char *)state->flashes[0]->space()->get_read_ptr(0); |
| 425 | 425 | avigo_setbank(machine, 0, addr, avigo_flash_0x0000_read_handler, avigo_flash_0x0000_write_handler); |
| 426 | 426 | |
| 427 | avigo_setbank(machine, 3, | |
| 427 | avigo_setbank(machine, 3, | |
| 428 | 428 | |
| 429 | 429 | /* 0x08000 is specially banked! */ |
| 430 | 430 | avigo_refresh_memory(machine); |
| r9922 | r9923 | |
| 983 | 983 | MCFG_INTEL_E28F008SA_ADD("flash2") |
| 984 | 984 | |
| 985 | 985 | /* internal ram */ |
| 986 | MCFG_RAM_ADD( | |
| 986 | MCFG_RAM_ADD(RAM_TAG | |
| 987 | 987 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 988 | 988 | MACHINE_CONFIG_END |
| 989 | 989 |
| r9922 | r9923 | |
|---|---|---|
| 21 | 21 | #include "machine/pcf8593.h" |
| 22 | 22 | #include "machine/at45dbxx.h" |
| 23 | 23 | #include "machine/sst39vfx.h" |
| 24 | #include " | |
| 24 | #include "ma | |
| 25 | 25 | |
| 26 | 26 | /* Until support for the H8Sxxxx variants used by cybiko is added, we use H8_3002 (even if opcodes differ) */ |
| 27 | 27 | #define H8S2241 H83002 |
| r9922 | r9923 | |
| 265 | 265 | MCFG_AT45DB041_ADD("flash1") |
| 266 | 266 | |
| 267 | 267 | /* internal ram */ |
| 268 | MCFG_RAM_ADD( | |
| 268 | MCFG_RAM_ADD(RAM_TAG | |
| 269 | 269 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 270 | 270 | MCFG_RAM_EXTRA_OPTIONS("1M") |
| 271 | 271 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 283 | 283 | MCFG_SST39VF020_ADD("flash2", 16, ENDIANNESS_BIG) |
| 284 | 284 | |
| 285 | 285 | /* internal ram */ |
| 286 | MCFG_RAM_MODIFY( | |
| 286 | MCFG_RAM_MODIFY(RAM_TAG | |
| 287 | 287 | MCFG_RAM_DEFAULT_SIZE("256K") |
| 288 | 288 | MCFG_RAM_EXTRA_OPTIONS("512K,1M") |
| 289 | 289 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
| 305 | 305 | MCFG_SST39VF020_ADD("flash2", 16, ENDIANNESS_BIG) |
| 306 | 306 | |
| 307 | 307 | /* internal ram */ |
| 308 | MCFG_RAM_MODIFY( | |
| 308 | MCFG_RAM_MODIFY(RAM_TAG | |
| 309 | 309 | MCFG_RAM_DEFAULT_SIZE("2M") |
| 310 | 310 | MACHINE_CONFIG_END |
| 311 | 311 |
| r9922 | r9923 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "cpu/i8085/i8085.h" |
| 12 | #include " | |
| 12 | #include "ma | |
| 13 | 13 | #include "includes/pp01.h" |
| 14 | 14 | |
| 15 | 15 | |
| r9922 | r9923 | |
| 222 | 222 | MCFG_I8255A_ADD( "ppi8255", pp01_ppi8255_interface ) |
| 223 | 223 | |
| 224 | 224 | /* internal ram */ |
| 225 | MCFG_RAM_ADD( | |
| 225 | MCFG_RAM_ADD(RAM_TAG | |
| 226 | 226 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 227 | 227 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 228 | 228 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 197 | 197 | //#include "machine/a2z80.h" |
| 198 | 198 | #include "sound/ay8910.h" |
| 199 | 199 | #include "sound/speaker.h" |
| 200 | #include " | |
| 200 | #include "ma | |
| 201 | 201 | #include "machine/a2cffa.h" |
| 202 | 202 | #include "machine/idectrl.h" |
| 203 | 203 | #include "devices/harddriv.h" |
| r9922 | r9923 | |
| 650 | 650 | |
| 651 | 651 | static MACHINE_CONFIG_DERIVED( apple2, apple2_common ) |
| 652 | 652 | /* internal ram */ |
| 653 | MCFG_RAM_ADD( | |
| 653 | MCFG_RAM_ADD(RAM_TAG | |
| 654 | 654 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 655 | 655 | MCFG_RAM_EXTRA_OPTIONS("4K,8K,12K,16K,20K,24K,32K,36K,48K") |
| 656 | 656 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| r9922 | r9923 | |
| 664 | 664 | MCFG_VIDEO_START(apple2p) |
| 665 | 665 | |
| 666 | 666 | /* internal ram */ |
| 667 | MCFG_RAM_ADD( | |
| 667 | MCFG_RAM_ADD(RAM_TAG | |
| 668 | 668 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 669 | 669 | MCFG_RAM_EXTRA_OPTIONS("16K,32K,48K") |
| 670 | 670 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| r9922 | r9923 | |
| 686 | 686 | static MACHINE_CONFIG_DERIVED( apple2e, apple2_common ) |
| 687 | 687 | MCFG_VIDEO_START(apple2e) |
| 688 | 688 | /* internal ram */ |
| 689 | MCFG_RAM_ADD( | |
| 689 | MCFG_RAM_ADD(RAM_TAG | |
| 690 | 690 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 691 | 691 | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 692 | 692 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| r9922 | r9923 | |
| 705 | 705 | MCFG_QUANTUM_PERFECT_CPU("maincpu") |
| 706 | 706 | |
| 707 | 707 | /* internal ram */ |
| 708 | MCFG_RAM_ADD( | |
| 708 | MCFG_RAM_ADD(RAM_TAG | |
| 709 | 709 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 710 | 710 | MCFG_RAM_EXTRA_OPTIONS("64K") |
| 711 | 711 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| r9922 | r9923 | |
| 714 | 714 | static MACHINE_CONFIG_DERIVED( mprof3, apple2e ) |
| 715 | 715 | |
| 716 | 716 | /* internal ram */ |
| 717 | MCFG_RAM_MODIFY( | |
| 717 | MCFG_RAM_MODIFY(RAM_TAG | |
| 718 | 718 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 719 | 719 | MACHINE_CONFIG_END |
| 720 | 720 |
| r9922 | r9923 | |
|---|---|---|
| 50 | 50 | #include "includes/e01.h" |
| 51 | 51 | #include "cpu/m6502/m6502.h" |
| 52 | 52 | #include "devices/flopdrv.h" |
| 53 | #include " | |
| 53 | #include "ma | |
| 54 | 54 | #include "machine/ctronics.h" |
| 55 | 55 | #include "machine/6522via.h" |
| 56 | 56 | #include "machine/mc146818.h" |
| r9922 | r9923 | |
| 386 | 386 | { |
| 387 | 387 | e01_state *state = machine->driver_data<e01_state>(); |
| 388 | 388 | |
| 389 | UINT8 *ram = | |
| 389 | UINT8 *ram = | |
| 390 | 390 | UINT8 *rom = machine->region(R65C102_TAG)->base(); |
| 391 | 391 | |
| 392 | 392 | /* setup memory banking */ |
| r9922 | r9923 | |
| 455 | 455 | // MCFG_CENTRONICS_ADD(CENTRONICS_TAG, e01_centronics_config) |
| 456 | 456 | |
| 457 | 457 | /* internal ram */ |
| 458 | MCFG_RAM_ADD( | |
| 458 | MCFG_RAM_ADD(RAM_TAG | |
| 459 | 459 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 460 | 460 | MACHINE_CONFIG_END |
| 461 | 461 |
| r9922 | r9923 | |
|---|---|---|
| 32 | 32 | #include "cpu/i86/i86.h" |
| 33 | 33 | #include "formats/basicdsk.h" |
| 34 | 34 | #include "devices/flopdrv.h" |
| 35 | #include " | |
| 35 | #include "ma | |
| 36 | 36 | #include "machine/z80pio.h" |
| 37 | 37 | #include "machine/z80ctc.h" |
| 38 | 38 | #include "machine/z80dart.h" |
| r9922 | r9923 | |
| 140 | 140 | void xerox820_state::bankswitch(int bank) |
| 141 | 141 | { |
| 142 | 142 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 143 | UINT8 *ram = | |
| 143 | UINT8 *ram = | |
| 144 | 144 | |
| 145 | 145 | if (bank) |
| 146 | 146 | { |
| r9922 | r9923 | |
| 160 | 160 | void xerox820ii_state::bankswitch(int bank) |
| 161 | 161 | { |
| 162 | 162 | address_space *program = cpu_get_address_space(m_maincpu, ADDRESS_SPACE_PROGRAM); |
| 163 | UINT8 *ram = | |
| 163 | UINT8 *ram = | |
| 164 | 164 | |
| 165 | 165 | if (bank) |
| 166 | 166 | { |
| r9922 | r9923 | |
| 834 | 834 | MCFG_COM8116_ADD(COM8116_TAG, XTAL_5_0688MHz, com8116_intf) |
| 835 | 835 | |
| 836 | 836 | /* internal ram */ |
| 837 | MCFG_RAM_ADD( | |
| 837 | MCFG_RAM_ADD(RAM_TAG | |
| 838 | 838 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 839 | 839 | MACHINE_CONFIG_END |
| 840 | 840 | |
| r9922 | r9923 | |
| 868 | 868 | MCFG_COM8116_ADD(COM8116_TAG, XTAL_5_0688MHz, com8116_intf) |
| 869 | 869 | |
| 870 | 870 | /* internal ram */ |
| 871 | MCFG_RAM_ADD( | |
| 871 | MCFG_RAM_ADD(RAM_TAG | |
| 872 | 872 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 873 | 873 | MACHINE_CONFIG_END |
| 874 | 874 | |
| r9922 | r9923 | |
| 877 | 877 | MCFG_CPU_PROGRAM_MAP(xerox168_mem) |
| 878 | 878 | |
| 879 | 879 | /* internal ram */ |
| 880 | MCFG_RAM_MODIFY( | |
| 880 | MCFG_RAM_MODIFY(RAM_TAG | |
| 881 | 881 | MCFG_RAM_DEFAULT_SIZE("192K") |
| 882 | 882 | MCFG_RAM_EXTRA_OPTIONS("320K") |
| 883 | 883 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 158 | 158 | #include "sound/3812intf.h" |
| 159 | 159 | |
| 160 | 160 | #include "machine/kb_keytro.h" |
| 161 | #include " | |
| 161 | #include "ma | |
| 162 | 162 | |
| 163 | 163 | #define ym3812_StdClock 3579545 |
| 164 | 164 | |
| r9922 | r9923 | |
| 1603 | 1603 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 1604 | 1604 | |
| 1605 | 1605 | /* internal ram */ |
| 1606 | MCFG_RAM_ADD( | |
| 1606 | MCFG_RAM_ADD(RAM_TAG | |
| 1607 | 1607 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 1608 | 1608 | MACHINE_CONFIG_END |
| 1609 | 1609 | |
| r9922 | r9923 | |
| 1671 | 1671 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 1672 | 1672 | |
| 1673 | 1673 | /* internal ram */ |
| 1674 | MCFG_RAM_ADD( | |
| 1674 | MCFG_RAM_ADD(RAM_TAG | |
| 1675 | 1675 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 1676 | 1676 | MACHINE_CONFIG_END |
| 1677 | 1677 | |
| r9922 | r9923 | |
| 1752 | 1752 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 1753 | 1753 | |
| 1754 | 1754 | /* internal ram */ |
| 1755 | MCFG_RAM_ADD( | |
| 1755 | MCFG_RAM_ADD(RAM_TAG | |
| 1756 | 1756 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 1757 | 1757 | MACHINE_CONFIG_END |
| 1758 | 1758 | |
| r9922 | r9923 | |
| 1815 | 1815 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 1816 | 1816 | |
| 1817 | 1817 | /* internal ram */ |
| 1818 | MCFG_RAM_ADD( | |
| 1818 | MCFG_RAM_ADD(RAM_TAG | |
| 1819 | 1819 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 1820 | 1820 | MACHINE_CONFIG_END |
| 1821 | 1821 | |
| r9922 | r9923 | |
| 1900 | 1900 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 1901 | 1901 | |
| 1902 | 1902 | /* internal ram */ |
| 1903 | MCFG_RAM_ADD( | |
| 1903 | MCFG_RAM_ADD(RAM_TAG | |
| 1904 | 1904 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 1905 | 1905 | MACHINE_CONFIG_END |
| 1906 | 1906 | |
| r9922 | r9923 | |
| 1961 | 1961 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 1962 | 1962 | |
| 1963 | 1963 | /* internal ram */ |
| 1964 | MCFG_RAM_ADD( | |
| 1964 | MCFG_RAM_ADD(RAM_TAG | |
| 1965 | 1965 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 1966 | 1966 | MACHINE_CONFIG_END |
| 1967 | 1967 | |
| r9922 | r9923 | |
| 2025 | 2025 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2026 | 2026 | |
| 2027 | 2027 | /* internal ram */ |
| 2028 | MCFG_RAM_ADD( | |
| 2028 | MCFG_RAM_ADD(RAM_TAG | |
| 2029 | 2029 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2030 | 2030 | MACHINE_CONFIG_END |
| 2031 | 2031 | |
| r9922 | r9923 | |
| 2097 | 2097 | MCFG_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY ) |
| 2098 | 2098 | |
| 2099 | 2099 | /* internal ram */ |
| 2100 | MCFG_RAM_ADD( | |
| 2100 | MCFG_RAM_ADD(RAM_TAG | |
| 2101 | 2101 | MCFG_RAM_DEFAULT_SIZE("512K") |
| 2102 | 2102 | MACHINE_CONFIG_END |
| 2103 | 2103 | |
| r9922 | r9923 | |
| 2106 | 2106 | MCFG_CPU_PROGRAM_MAP(ppc640_map) |
| 2107 | 2107 | |
| 2108 | 2108 | /* internal ram */ |
| 2109 | MCFG_RAM_MODIFY( | |
| 2109 | MCFG_RAM_MODIFY(RAM_TAG | |
| 2110 | 2110 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2111 | 2111 | MACHINE_CONFIG_END |
| 2112 | 2112 | |
| r9922 | r9923 | |
| 2154 | 2154 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2155 | 2155 | |
| 2156 | 2156 | /* internal ram */ |
| 2157 | MCFG_RAM_ADD( | |
| 2157 | MCFG_RAM_ADD(RAM_TAG | |
| 2158 | 2158 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2159 | 2159 | MACHINE_CONFIG_END |
| 2160 | 2160 | |
| r9922 | r9923 | |
| 2203 | 2203 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2204 | 2204 | |
| 2205 | 2205 | /* internal ram */ |
| 2206 | MCFG_RAM_ADD( | |
| 2206 | MCFG_RAM_ADD(RAM_TAG | |
| 2207 | 2207 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2208 | 2208 | MACHINE_CONFIG_END |
| 2209 | 2209 | |
| r9922 | r9923 | |
| 2263 | 2263 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2264 | 2264 | |
| 2265 | 2265 | /* internal ram */ |
| 2266 | MCFG_RAM_ADD( | |
| 2266 | MCFG_RAM_ADD(RAM_TAG | |
| 2267 | 2267 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2268 | 2268 | MACHINE_CONFIG_END |
| 2269 | 2269 | |
| r9922 | r9923 | |
| 2312 | 2312 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2313 | 2313 | |
| 2314 | 2314 | /* internal ram */ |
| 2315 | MCFG_RAM_ADD( | |
| 2315 | MCFG_RAM_ADD(RAM_TAG | |
| 2316 | 2316 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2317 | 2317 | MACHINE_CONFIG_END |
| 2318 | 2318 | |
| r9922 | r9923 | |
| 2361 | 2361 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2362 | 2362 | |
| 2363 | 2363 | /* internal ram */ |
| 2364 | MCFG_RAM_ADD( | |
| 2364 | MCFG_RAM_ADD(RAM_TAG | |
| 2365 | 2365 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2366 | 2366 | MACHINE_CONFIG_END |
| 2367 | 2367 | |
| r9922 | r9923 | |
| 2410 | 2410 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2411 | 2411 | |
| 2412 | 2412 | /* internal ram */ |
| 2413 | MCFG_RAM_ADD( | |
| 2413 | MCFG_RAM_ADD(RAM_TAG | |
| 2414 | 2414 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2415 | 2415 | MACHINE_CONFIG_END |
| 2416 | 2416 | |
| r9922 | r9923 | |
| 2473 | 2473 | MCFG_CARTSLOT_LOAD(pcjr_cartridge) |
| 2474 | 2474 | |
| 2475 | 2475 | /* internal ram */ |
| 2476 | MCFG_RAM_ADD( | |
| 2476 | MCFG_RAM_ADD(RAM_TAG | |
| 2477 | 2477 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2478 | 2478 | |
| 2479 | 2479 | /* Software lists */ |
| r9922 | r9923 | |
| 2538 | 2538 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2539 | 2539 | |
| 2540 | 2540 | /* internal ram */ |
| 2541 | MCFG_RAM_ADD( | |
| 2541 | MCFG_RAM_ADD(RAM_TAG | |
| 2542 | 2542 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2543 | 2543 | MACHINE_CONFIG_END |
| 2544 | 2544 | |
| r9922 | r9923 | |
| 2601 | 2601 | MCFG_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_config) |
| 2602 | 2602 | |
| 2603 | 2603 | /* internal ram */ |
| 2604 | MCFG_RAM_ADD( | |
| 2604 | MCFG_RAM_ADD(RAM_TAG | |
| 2605 | 2605 | MCFG_RAM_DEFAULT_SIZE("640K") |
| 2606 | 2606 | MACHINE_CONFIG_END |
| 2607 | 2607 |
| r9922 | r9923 | |
|---|---|---|
| 119 | 119 | #include "cpu/z80/z80.h" |
| 120 | 120 | #include "video/hd61830.h" |
| 121 | 121 | #include "machine/mc146818.h" |
| 122 | #include " | |
| 122 | #include "ma | |
| 123 | 123 | #include "sound/beep.h" |
| 124 | 124 | |
| 125 | 125 | static UINT8 keypad_r (running_machine *machine) |
| r9922 | r9923 | |
| 403 | 403 | if (read_or_write) |
| 404 | 404 | { |
| 405 | 405 | mame_fwrite(file, state->ram, 0x8000); |
| 406 | mame_fwrite(file, | |
| 406 | mame_fwrite(file, | |
| 407 | 407 | } |
| 408 | 408 | else |
| 409 | 409 | { |
| 410 | 410 | if (file) |
| 411 | 411 | { |
| 412 | 412 | mame_fread(file, state->ram, 0x8000); |
| 413 | mame_fread(file, | |
| 413 | mame_fread(file, | |
| 414 | 414 | |
| 415 | 415 | /* reload register A and B for restore the periodic irq state */ |
| 416 | 416 | mame_fseek(file, 0x4000a, SEEK_SET); |
| r9922 | r9923 | |
| 463 | 463 | memory_configure_bank(machine, "bank1", 0x00, 0x02, machine->region(Z80_TAG)->base(), 0x10000); |
| 464 | 464 | |
| 465 | 465 | /* RAM banks */ |
| 466 | memory_configure_bank(machine, "bank1", 0x02, 0x07, | |
| 466 | memory_configure_bank(machine, "bank1", 0x02, 0x07, | |
| 467 | 467 | |
| 468 | 468 | state->rtc_periodic_irq = timer_alloc(machine, rtc_periodic_irq, 0); |
| 469 | 469 | /* register for state saving */ |
| r9922 | r9923 | |
| 508 | 508 | MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 509 | 509 | |
| 510 | 510 | /* ram banks */ |
| 511 | MCFG_RAM_ADD( | |
| 511 | MCFG_RAM_ADD(RAM_TAG | |
| 512 | 512 | MCFG_RAM_DEFAULT_SIZE("224K") |
| 513 | 513 | |
| 514 | 514 | MCFG_NVRAM_HANDLER(micronic) |
| r9922 | r9923 | |
|---|---|---|
| 12 | 12 | #include "sound/wave.h" |
| 13 | 13 | #include "devices/cassette.h" |
| 14 | 14 | #include "includes/pecom.h" |
| 15 | #include " | |
| 15 | #include "ma | |
| 16 | 16 | |
| 17 | 17 | /* Address maps */ |
| 18 | 18 | static ADDRESS_MAP_START(pecom64_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r9922 | r9923 | |
| 192 | 192 | MCFG_CASSETTE_ADD( "cassette", pecom_cassette_config ) |
| 193 | 193 | |
| 194 | 194 | /* internal ram */ |
| 195 | MCFG_RAM_ADD( | |
| 195 | MCFG_RAM_ADD(RAM_TAG | |
| 196 | 196 | MCFG_RAM_DEFAULT_SIZE("32K") |
| 197 | 197 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 198 | 198 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 27 | 27 | #include "emu.h" |
| 28 | 28 | #include "cpu/i8085/i8085.h" |
| 29 | 29 | #include "machine/terminal.h" |
| 30 | #include " | |
| 30 | #include "ma | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | class ptcsol_state : public driver_device |
| r9922 | r9923 | |
| 196 | 196 | MCFG_VIDEO_UPDATE(sol20) |
| 197 | 197 | |
| 198 | 198 | /* internal ram */ |
| 199 | // MCFG_RAM_ADD( | |
| 199 | // MCFG_RAM_ADD(RAM_TAG | |
| 200 | 200 | // MCFG_RAM_DEFAULT_SIZE("8K") |
| 201 | 201 | // MCFG_RAM_EXTRA_OPTIONS("16K,32K") |
| 202 | 202 | MCFG_GENERIC_TERMINAL_ADD("terminal", sol20_terminal_intf) |
| r9922 | r9923 | |
|---|---|---|
| 36 | 36 | #include "includes/cosmicos.h" |
| 37 | 37 | #include "cpu/cosmac/cosmac.h" |
| 38 | 38 | #include "devices/cassette.h" |
| 39 | #include " | |
| 39 | #include "ma | |
| 40 | 40 | #include "devices/snapquik.h" |
| 41 | 41 | #include "machine/rescap.h" |
| 42 | 42 | #include "sound/cdp1864.h" |
| r9922 | r9923 | |
| 284 | 284 | { |
| 285 | 285 | cosmicos_state *state = machine->driver_data<cosmicos_state>(); |
| 286 | 286 | address_space *program = cputag_get_address_space(machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM); |
| 287 | UINT8 *ram = | |
| 287 | UINT8 *ram = | |
| 288 | 288 | |
| 289 | 289 | if (state->ram_disable) |
| 290 | 290 | { |
| r9922 | r9923 | |
| 552 | 552 | dm9368_rbi_w(state->dm9368, 1); |
| 553 | 553 | |
| 554 | 554 | /* setup memory banking */ |
| 555 | switch ( | |
| 555 | switch ( | |
| 556 | 556 | { |
| 557 | 557 | case 256: |
| 558 | 558 | memory_unmap_readwrite(program, 0x0000, 0xbfff, 0, 0); |
| r9922 | r9923 | |
| 646 | 646 | MCFG_CASSETTE_ADD(CASSETTE_TAG, cosmicos_cassette_config) |
| 647 | 647 | |
| 648 | 648 | /* internal ram */ |
| 649 | MCFG_RAM_ADD( | |
| 649 | MCFG_RAM_ADD(RAM_TAG | |
| 650 | 650 | MCFG_RAM_DEFAULT_SIZE("256") |
| 651 | 651 | MCFG_RAM_EXTRA_OPTIONS("4K,48K") |
| 652 | 652 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 14 | 14 | #include "devices/flopdrv.h" |
| 15 | 15 | #include "formats/basicdsk.h" |
| 16 | 16 | #include "includes/pk8020.h" |
| 17 | #include " | |
| 17 | #include "ma | |
| 18 | 18 | |
| 19 | 19 | /* Address maps */ |
| 20 | 20 | static ADDRESS_MAP_START(pk8020_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r9922 | r9923 | |
| 242 | 242 | MCFG_FLOPPY_4_DRIVES_ADD(pk8020_floppy_config) |
| 243 | 243 | |
| 244 | 244 | /* internal ram */ |
| 245 | MCFG_RAM_ADD( | |
| 245 | MCFG_RAM_ADD(RAM_TAG | |
| 246 | 246 | MCFG_RAM_DEFAULT_SIZE("258K") //64 + 4*48 + 2 |
| 247 | 247 | MCFG_RAM_DEFAULT_VALUE(0x00) |
| 248 | 248 | MACHINE_CONFIG_END |
| r9922 | r9923 | |
|---|---|---|
| 59 | 59 | #include "emu.h" |
| 60 | 60 | #include "cpu/z80/z80.h" |
| 61 | 61 | #include "devices/flopdrv.h" |
| 62 | #include " | |
| 62 | #include "ma | |
| 63 | 63 | #include "machine/i8155.h" |
| 64 | 64 | #include "machine/ieee488.h" |
| 65 | 65 | #include "machine/msm8251.h" |
| r9922 | r9923 | |
| 726 | 726 | void vixen_state::machine_start() |
| 727 | 727 | { |
| 728 | 728 | // configure memory banking |
| 729 | UINT8 *ram = | |
| 729 | UINT8 *ram = | |
| 730 | 730 | |
| 731 | 731 | memory_configure_bank(machine, "bank1", 0, 1, ram, 0); |
| 732 | 732 | memory_configure_bank(machine, "bank1", 1, 1, machine->region(Z8400A_TAG)->base(), 0); |
| r9922 | r9923 | |
| 810 | 810 | MCFG_IEEE488_ADD(IEEE488_TAG, ieee488_daisy) |
| 811 | 811 | |
| 812 | 812 | // internal ram |
| 813 | MCFG_RAM_ADD( | |
| 813 | MCFG_RAM_ADD(RAM_TAG | |
| 814 | 814 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 815 | 815 | MACHINE_CONFIG_END |
| 816 | 816 |
| r9922 | r9923 | |
|---|---|---|
| 29 | 29 | #include "devices/cassette.h" |
| 30 | 30 | #include "devices/flopdrv.h" |
| 31 | 31 | #include "formats/basicdsk.h" |
| 32 | #include " | |
| 32 | #include "ma | |
| 33 | 33 | |
| 34 | 34 | static READ8_HANDLER(kc85_4_port_r) |
| 35 | 35 | { |
| r9922 | r9923 | |
| 419 | 419 | MCFG_CASSETTE_ADD( "cassette", default_cassette_config ) |
| 420 | 420 | |
| 421 | 421 | /* internal ram */ |
| 422 | MCFG_RAM_ADD( | |
| 422 | MCFG_RAM_ADD(RAM_TAG | |
| 423 | 423 | MCFG_RAM_DEFAULT_SIZE("64K") |
| 424 | 424 | MACHINE_CONFIG_END |
| 425 | 425 |
| Previous | 15994 Revisions | Next |