|
Post by jlf65 on Jun 6, 2011 0:21:25 GMT -5
Just speaking from my own experience. When I started with BEX I didn't know anything about Mega Drive programming, but now I'm fairy comfortable writing in ASM for several systems. BEX was great stepping stone towards that. ( C / C++ is my main language for "normal" development by the way ) Your already knowing C/C++ probably helped more than the BEX. C in particular is a VERY low-level language, being one step up from raw assembly. In fact, one of my favorite articles from Dr Dobb's was on PL68K - a C subset that mapped 1:1 to 68000 assembly. For example d0 = *(int *)a0++; becomes move.l (a0)++,d0
d0 += d1; becomes add.l d1,d0
Once you truly understand 680x0 assembly and C, you realize Motorola designed the ISA around C. It's why C compilers for the 68000 were so prevalent.
|
|
|
Post by jlf65 on Jun 3, 2011 21:05:33 GMT -5
@oompa - You probably meant "migrate to assembly" ( instead of C ) No, he probably meant C. BASIC to C is an easy transition compared to BASIC to assembly, and C if good enough for most things. theloon's first link has a link to a great SNES C compiler/SDK - it's what we use for the NeoFlash SNES Myth cart. C is also almost universal - it's available for very nearly every platform ever made. Even the SMS and NES are supported by a decent C compiler (sdcc). I use the latest gcc for the MD - I just wish gcc had support for more 8/16 bit CPUs.
|
|
|
Post by jlf65 on Jun 2, 2011 3:43:43 GMT -5
Sounds cool! Going to allow those of us with GOOD flash cards to make better use of them?
|
|
|
Post by jlf65 on Jun 2, 2011 3:41:59 GMT -5
I would suppose to make PAL 224, call the BEX function to setup the display, then use asm to set the vdp reg to set 224 lines.
|
|
|
Post by jlf65 on May 31, 2011 22:36:00 GMT -5
It shouldn't. Maybe it's just the emulator - try another. I use Gens/GS.
|
|
|
Post by jlf65 on May 31, 2011 15:38:44 GMT -5
We need to see more of the code. With what little you provide, there's no way to tell you where the error is. If you don't want to show the code, you'll be stuck debugging it yourself.
|
|
|
Post by jlf65 on May 31, 2011 3:52:21 GMT -5
Have you tried move.w #$8174, $C00004
Parenthesis normally only go around address register indirect modes like (a0) or 4(a0).
|
|
|
Post by jlf65 on May 30, 2011 20:58:53 GMT -5
Yes, setting V28 mode makes both PAL and NTSC 224 tall. It works fine on any PAL system. The problem is the value you are storing is wrong. The MSB of $81 means write register 1, so that's okay, but the LSB of $20 has only bit 5 set, which is NOT okay. Look at the bits for register 1:
You're only turning on the vertical blank interrupt, and NOTHING ELSE! The "typical" value for register 1 is $74, which enables the display (b6), enables the vblank int (b5), enables the DMA (b4), clears M2 (b3) which sets "NTSC" height (V28 mode), sets Genesis video mode (b2), and clears the two lsbs as needed.
|
|
|
Post by jlf65 on May 16, 2011 21:54:34 GMT -5
It was Sega's "bonus package" for early adopters.
|
|
|
Post by jlf65 on May 14, 2011 17:51:38 GMT -5
If VR works, I can't imagine the write line not being connected, but I don't know everything about the GG. Anyone aware of any schematics for it?
|
|
|
Post by jlf65 on May 14, 2011 3:23:55 GMT -5
It's not that it's not allowed to work, it has to do with how save memory works on the Genesis. SEGA's standard for save memory has the game write an enable/disable value to 0xA130F1; when enabled, the space above 0x200000 is now save ram, not rom. The GG has no way to deal with this, so it will interfere with writes to save memory if it's turned on. You CAN use the GG with those games you mentioned, they just won't save correctly if you use GG codes with them. The GG could have had a hardware update (GameGenie 2? ) so that when a game wrote to 0xA130F1, the GameGenie turned itself off/on with the save memory on/off to allow the save memory to work while using GG codes.
|
|
|
Post by jlf65 on May 12, 2011 22:01:36 GMT -5
Cool! Well, two years with no one doing anything left plenty of openings for spam.
|
|
|
Post by jlf65 on May 8, 2011 22:06:12 GMT -5
No bytes or longs? Weird...
I guess he'll have to use assembly to do ints other than unsigned short.
|
|
|
Post by jlf65 on May 8, 2011 13:13:43 GMT -5
An unsigned word is only capable of holding the values 0 to 65535. Subtract 1 from the lowest value and it wraps to the highest (0 becomes 65535). Similarly, if you add enough to exceed 65535, it wraps around to 0. This is generally called an unsigned short int on the 68000. You need a long int, and signed if you wish negative numbers. Not sure how bex handles variable types... look at the examples.
|
|
|
Post by jlf65 on May 5, 2011 22:08:45 GMT -5
Here's some code I did for the Team Player. It isn't fully tested yet, but it should give you something to start with. And use code tags for code, not quote tags. Here's a doc on the multi-taps. | get current team player pad values | entry: | exit: d0 = pad values portA(R L D U S A C B) portB(R L D U S A C B) portC(R L D U S A C B) portD(R L D U S A C B) get_team: move.l d3,-(sp) move.b #0x60,0xA10009 move.b #0x60,0xA10003 /* TH = 1, TR = 1 */ nop nop nop nop move.b #0x20,0xA10003 /* TH = 0, TR = 1 start transfer */ nop nop nop nop bsr.b get_byte cmpi.b #0xFF,d0 bne no_mtap bsr.b get_byte /* IDA IDB */ lsl.w #8,d0 bsr.b get_byte move.w d0,d3 /* IDA IDB IDC IDD */ | port A bsr.b get_byte lsl.w #8,d0 btst #12,d3 bne.b 1f /* 3 button pad */ bsr.b get_nibble /* 6 button pad - read extra nibble */ 1: | port B bsr.b get_byte lsl.l #8,d0 btst #8,d3 bne.b 2f /* 3 button pad */ bsr.b get_nibble /* 6 button pad - read extra nibble */ 2: | port C bsr.b get_byte lsl.l #8,d0 btst #4,d3 bne.b 3f /* 3 button pad */ bsr.b get_nibble /* 6 button pad - read extra nibble */ 3: | port D bsr.b get_byte lsl.l #8,d0 btst #0,d3 bne.b 4f /* 3 button pad */ bsr.b get_nibble /* 6 button pad - read extra nibble */ 4: move.l (sp)+,d3 move.b #0x60,0xA10009 move.b #0x60,0xA10003 /* TH = 1, TR = 1 */ rts
| get two nibbles from Team Player multi-tap
get_byte: bsr.b get_nibble lsl.b #4,d0
| fall into get_nibble for second nibble
get_nibble: move.w #99,d2 /* retries - 1 */ btst #5,0xA10003 /* check current state of TR */ bne.b 2f | TR currently 0 move.b #0x20,0xA10003 /* set TR = 1 */ 1: move.b 0xA10003,d1 btst #4,d1 /* check current state of TL */ dbne d2,1b /* wait for TL = 1 or timeout */ andi.b #0x0F,d1 /* mask off nibble */ or.b d1,d0 rts 2: | TR currently 1 move.b #0x00,0xA10003 /* set TR = 0 */ 3: move.b 0xA10003,d1 btst #4,d1 /* check current state of TL */ dbeq d2,3b /* wait for TL = 0 or timeout */ andi.b #0x0F,d1 /* mask off nibble */ or.b d1,d0 rts
no_mtap: move.l (sp)+,d3 moveq #-1,d0 move.b #0x40,0xA10009 move.b #0x40,0xA10003 rts
|
|