Mercurial > repos > blastem
comparison blastcpm.c @ 1748:48a43dff4dc0
Added init functions to z80_util.c so new Z80 core is closer to a drop in replacement for the old one
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 07 Feb 2019 09:43:25 -0800 |
parents | ca2336469397 |
children | 95e36a227c9d |
comparison
equal
deleted
inserted
replaced
1747:89ddf41a50bb | 1748:48a43dff4dc0 |
---|---|
105 ram[6] = OS_START & 0xFF; | 105 ram[6] = OS_START & 0xFF; |
106 ram[7] = OS_START >> 8; | 106 ram[7] = OS_START >> 8; |
107 | 107 |
108 z80_options opts; | 108 z80_options opts; |
109 z80_context *context; | 109 z80_context *context; |
110 #ifdef NEW_CORE | |
111 memset(&opts, 0, sizeof(opts)); | |
112 opts.gen.memmap = z80_map; | |
113 opts.gen.memmap_chunks = 1; | |
114 opts.gen.address_mask = 0xFFFF; | |
115 opts.gen.max_address = 0xFFFF; | |
116 opts.gen.clock_divider = 1; | |
117 context = calloc(1, sizeof(z80_context)); | |
118 context->opts = &opts; | |
119 context->io_map = io_map; | |
120 context->io_chunks = 3; | |
121 context->io_mask = 0xFF; | |
122 #else | |
123 init_z80_opts(&opts, z80_map, 1, io_map, 3, 1, 0xFF); | 110 init_z80_opts(&opts, z80_map, 1, io_map, 3, 1, 0xFF); |
124 context = init_z80_context(&opts); | 111 context = init_z80_context(&opts); |
125 #endif | |
126 for(;;) | 112 for(;;) |
127 { | 113 { |
128 #ifdef NEW_CORE | 114 #ifdef NEW_CORE |
129 z80_execute(context, 1000000); | 115 z80_execute(context, 1000000); |
130 context->cycles = 0; | 116 context->cycles = 0; |