Search found 56 matches

by flamewing
Sun Feb 20, 2022 7:57 pm
Forum: Megadrive/Genesis
Topic: EXG instruction encoding
Replies: 4
Views: 7753

Re: EXG instruction encoding

A biut late, but: In an asm file (generated by Exodus' active disassembly) there's an EXG instruction at a particular address, like this: EXG D2, D0 Viewing the same location in several emulators (Exodus, Regen) shows the same instruction[1]. The raw value is 0xC540. Howevever, when I assemble my ve...
by flamewing
Tue Jul 13, 2021 7:47 pm
Forum: Megadrive/Genesis
Topic: VRAM write macro $3FFF mask
Replies: 3
Views: 5260

Re: VRAM write macro $3FFF mask

move.l #(vdp_cmd_vram_write)|((\addr)&$3FFF)<<16|(\addr)>>14, vdp_control add.l #vram_addr_plane_a, d1 ; Add VRAM address offset lsl.l #0x2, d1 ; Shift bits 14/15 of address to bits 16/17 lsr.w #0x2, d1 ; Shift lower word back swap d1 ; Swap address hi/lo ori.l #vdp_cmd_vram_write, d1 ; OR in VRAM ...
by flamewing
Tue Feb 02, 2021 1:36 pm
Forum: Megadrive/Genesis
Topic: I'm officially building a microcode-level 68000 core
Replies: 52
Views: 118274

Re: I'm officially building a microcode-level 68000 core

Posting here because it might be useful for the effort: Danorf resurfaced last year with an updated yacht and a full transcription of US4325121. Here is a mirror of yacht v1.1, and here is a mirror of his transcription. Here is the thread in Atari Forums where he posted the updates. Edit: fixed the ...
by flamewing
Tue Dec 11, 2018 11:21 am
Forum: Megadrive/Genesis
Topic: 68k patents
Replies: 5
Views: 11885

Re: 68k patents

Ah, so you have information from the actual chip instead of from patents. Fair enough, I eagerly await the corrections :D
by flamewing
Mon Dec 03, 2018 8:21 am
Forum: Megadrive/Genesis
Topic: 68k patents
Replies: 5
Views: 11885

Re: 68k patents

I'm no aware about any patents with the microcode updated with DBcc and the actual exception processing. Yes, which is what I wanted to prove for sure. I'm not exactly sure what you mean by "the address error triggers". If you mean before exception logic microcode starts, then yes, of course, there...
by flamewing
Wed Nov 14, 2018 8:36 pm
Forum: Hardware
Topic: Controllers and wrong I/O pin directions
Replies: 9
Views: 13058

Re: Controllers and wrong I/O pin directions

Miquel wrote:
Wed Nov 14, 2018 6:59 pm
Assuming TH means high:
It doesn't: TH, TL, and TR are the names of pins used for I/O in the Mega Drive which can be configured for either input or output.
by flamewing
Sat Oct 13, 2018 10:28 am
Forum: Megadrive/Genesis
Topic: 68k patents
Replies: 5
Views: 11885

68k patents

I have been taking a dive in the 68k patents recently, trying to find if there was a version with a more recent version of the microcode. Additionally, I was also looking to see if any other patents might have the microcode from page 164 of US4325121, which is cut off, or maybe some additional infor...
by flamewing
Sat Sep 29, 2018 9:29 am
Forum: Megadrive/Genesis
Topic: 68k edge case: btst dN,#immed
Replies: 12
Views: 16687

Re: 68k edge case: btst dN,#immed

Oooh, I didn't realize he had gotten that far with decoding the microcode. I'll definitely have to check that out when I get time. One other thing Galibert is doing which I think will be of interest to you and Nemesis is this simulator . It currently seems to simulate only microcode control flow, a...
by flamewing
Tue Sep 25, 2018 9:26 am
Forum: Megadrive/Genesis
Topic: 68k edge case: btst dN,#immed
Replies: 12
Views: 16687

Re: 68k edge case: btst dN,#immed

How many instructions accept immediate as destination? Admittedly I'm just as clueless, but I wouldn't be surprised if that turns out to play a factor into it. According to PRM, and restricted to original 68000, one (this one). In 68020 and descendants, you can also do tst.x #immed, but I have no i...
by flamewing
Sun Sep 23, 2018 7:38 am
Forum: Megadrive/Genesis
Topic: 68k edge case: btst dN,#immed
Replies: 12
Views: 16687

Re: 68k edge case: btst dN,#immed

Make me understand your dilemma, is your point that “btst. B d?, #immediate.b” uses the long mode instead of the byte mode? Meaning it performs like a “btst. L d?, #immediate.b” instead. No, the issuei found was that the timing for the instruction breaks the pattern of every other instruction: in t...
by flamewing
Fri Sep 21, 2018 5:20 pm
Forum: Megadrive/Genesis
Topic: 68k edge case: btst dN,#immed
Replies: 12
Views: 16687

68k edge case: btst dN,#immed

So, I was reviewing some code optimizations I wrote some time back, when I case across one I had forgotten: btst.b d0,#SetMask This allows for quick testing if an element belongs to a small set, which is represented by SetMask. Remembering that this form of btst is modulo 8, this can be used if you ...
by flamewing
Wed Sep 12, 2018 9:30 am
Forum: Exodus
Topic: Exodus 2.1 release soon (Now available!)
Replies: 44
Views: 110650

Re: Exodus 2.1 release soon (Now available!)

This is actually done properly already. The M68000 core in Exodus properly implements the TAS opcode, it's the VDP actually that breaks this. Ah, sorry, I was mixing up my emulators: it is actually higan which does it incorrectly by breaking the tas instruction on the 68k core. Also interesting is ...
by flamewing
Tue Sep 04, 2018 12:19 pm
Forum: Exodus
Topic: Exodus 2.1 release soon (Now available!)
Replies: 44
Views: 110650

Re: Exodus 2.1 release soon (Now available!)

In terms of the Mega CD and the 32x, I do want to reach those systems eventually, but note that those addons greatly increase the complexity of the Mega Drive system as a whole, and emulating them accurately absolutely depends on good timing accuracy in particular. When you do get around to that: t...
by flamewing
Wed Aug 29, 2018 10:49 am
Forum: Megadrive/Genesis
Topic: 68000 programming optimization tips? (for speed)
Replies: 28
Views: 37023

Re: 68000 programming optimization tips? (for speed)

I think it's meant to return -1, 0 or +1. At least that's what sign functions usually do. You guessed right. Still trying to get my head around it, mind you (mainly the NEGX). It's only purpose is to set X if d0 was nonzero. Note that subx d1,d1 preserves X, which is important for the next if d0 st...
by flamewing
Mon Aug 27, 2018 9:32 am
Forum: Megadrive/Genesis
Topic: 68000 programming optimization tips? (for speed)
Replies: 28
Views: 37023

Re: 68000 programming optimization tips? (for speed)

Speaking of X, there is a neat thing you can do with it: add.w d0,d0 subx.w d1,d1 negx.w d0 addx.w d1,d1 The result: d1 = sign(d0). You can also use subx and addx to compute the min, max, and minmax of 2 numbers, but it is slower than the branch versions (but might be useful if you need the function...