New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
anes.cpp - allow to boot, preliminary video and inputs [Luca Elia, David Haywood] #11324
Conversation
ghost
commented
Jun 8, 2023
•
edited by ghost
edited by ghost
- added preliminary support for the blitter
- added a workaround for delayed banking
- added preliminary inputs
- added palette handling
No, AS_OPCODES is m1 only. And the switch is probably on m1, otherwise
you'd have different pages for the jump opcode and the address to jump to.
…On Thu, Jun 8, 2023 at 1:09 PM hap ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/mame/misc/anes.cpp
<#11324 (comment)>:
> + logerror("reading non-banked rom area with bank delay %04x: %02x\n", offset, ret);
+ m_banktimer->adjust(attotime::from_usec(1));
+ }
+ }
+ return ret;
+}
+
+uint8_t anes_state::banked_rom_r(offs_t offset)
+{
+ uint8_t ret = m_maincpu->space(AS_PROGRAM).read_byte(offset + 0x2000);
+ if (!machine().side_effects_disabled())
+ {
+ if (m_bank_delay)
+ {
+ logerror("reading banked rom area with bank delay %04x: %02x\n", offset + 0x2000, ret);
+ m_banktimer->adjust(attotime::from_usec(1));
Ah, AS_OPCODES is for opcode arg too? Then yes I'm wrong and it means our
Z80 core doesn't emulate the M1 pin.
—
Reply to this email directly, view it on GitHub
<#11324 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSF4JBULQ6SQ53UGQFBBDXKGXHNANCNFSM6AAAAAAY7CEURE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
So you're rejecting this approach even if it could allow me to continue to figure out the video? or you're disagreeing with some of the suggestions above? I really need to know if there's any point in me continuing with this. |
And the multiple-m1-cycles is probably not handled by the hardware in the
first place :-)
…On Thu, Jun 8, 2023 at 2:47 PM hap ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/mame/misc/anes.cpp
<#11324 (comment)>:
> + logerror("reading non-banked rom area with bank delay %04x: %02x\n", offset, ret);
+ m_banktimer->adjust(attotime::from_usec(1));
+ }
+ }
+ return ret;
+}
+
+uint8_t anes_state::banked_rom_r(offs_t offset)
+{
+ uint8_t ret = m_maincpu->space(AS_PROGRAM).read_byte(offset + 0x2000);
+ if (!machine().side_effects_disabled())
+ {
+ if (m_bank_delay)
+ {
+ logerror("reading banked rom area with bank delay %04x: %02x\n", offset + 0x2000, ret);
+ m_banktimer->adjust(attotime::from_usec(1));
bankswitch opcode, delay=2;
read opcode space
delay--
read prg space for actual data
read opcode space
delay--, bankswitch
read prg space for actual data
It doesn't matter if it's a ret/jmp/call, all the same. It will only
differ when the opcode has multiple M1 cycles (prefixed opcodes like
CB,DD,ED,FD)
—
Reply to this email directly, view it on GitHub
<#11324 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSF4PY3JFV3AA55GIZLI3XKHCV5ANCNFSM6AAAAAAY7CEURE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I think there's enough here for this to be worth including as a progress checkpoint. It boots, and allows you to coin up / play, so should be a better base for anybody wanting to find a better way to handle the delayed bank |
If anybody is more familiar with Mahjong etc. and wants to verify inputs, that would also be appreciated. I'm sure I had it requiring a 2nd set of controls at some point, which aren't mapped. I can't find any way to get into a test mode. |
"a better way to handle the delayed bank", you don't accept the one I posted above? |
I'm not 100% convinced it's better, but I'll go with that then. |
The code won't work at all since every first byte of the opcodes will be
zero, cause reading an unmapped zone.
…On Thu, Jun 8, 2023 at 10:08 PM hap ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/mame/misc/anes.cpp
<#11324 (comment)>:
> + if (m_palette_enable != 0x01)
+ {
+ logerror("write to palette_data_msb_w when not enabled %02x\n", data);
+ }
+ else
+ {
+ int offs = (m_palette_offset + (m_palette_offset_msb << 8)) & 0x1fff;
+ m_palette_data_msb[offs] = data;
+ set_color(offs);
+ }
+}
+
+
+void anes_state::opcodes_map(address_map &map)
+{
+ map(0x0000, 0xefff).r(FUNC(anes_state::m1_rom_r));
Why limit to 0xefff? That wasn't in the one I gave you.
You see, if it happens to copy a function with bankswitch to RAM, and runs
it from there, the bankswitch won't work. That can't be right.
—
Reply to this email directly, view it on GitHub
<#11324 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSF4IHHAPPORYJ3IUDUB3XKIWM7ANCNFSM6AAAAAAY7CEURE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
That's because only bits 0-5 are connected to the key matrix, coins maps outside of it (and this can't possibly have 5 coin slots). |
payout and coin are on the same bit though, so must be multiplexed somehow, or it isn't a key matrix in the first place, but a mux. |
remaining video issues are mainly with how transparencies are handled, as sometimes data is being cleared when it shouldn't be / solid fills aren't being handled properly. |
…mamedev#11324) [Luca Elia, David Haywood] * Implemented ROM banking. * Added preliminary blitter and palette support. * Added preliminary inputs.
…mamedev#11324) [Luca Elia, David Haywood] * Implemented ROM banking. * Added preliminary blitter and palette support. * Added preliminary inputs.