Jump to content

Zapf Bandit

Members+
  • Posts

    13
  • Joined

  • Last visited

Zapf Bandit's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I am such an idiot... I just did a bit more post reading and found that I needed to change the IPC version to 2... It works beautifully now... Still got the graphics issue though... You're the man Mic
  2. I am using the newest "libnds" and "devkitARM" but I can't seem to get the stylus to work at all in Dualis. I use my own arm7 code which does the following with regards to pen control. This all works fine on the hardware but doesn't seem to have any effect in Dualis. Am I missing something obvious? #define TOUCH_CAL_X1 (*(vs16*)0x027FFCD8) #define TOUCH_CAL_Y1 (*(vs16*)0x027FFCDA) #define TOUCH_CAL_X2 (*(vs16*)0x027FFCDE) #define TOUCH_CAL_Y2 (*(vs16*)0x027FFCE0) #define SCREEN_WIDTH 256 #define SCREEN_HEIGHT 192 s32 TOUCH_WIDTH = TOUCH_CAL_X2 - TOUCH_CAL_X1; s32 TOUCH_HEIGHT = TOUCH_CAL_Y2 - TOUCH_CAL_Y1; s32 TOUCH_OFFSET_X = ( ((SCREEN_WIDTH -60) * TOUCH_CAL_X1) / TOUCH_WIDTH ) - 28; s32 TOUCH_OFFSET_Y = ( ((SCREEN_HEIGHT-60) * TOUCH_CAL_Y1) / TOUCH_HEIGHT ) - 28; ....... // Read the X/Y buttons and the /PENIRQ line but = XKEYS; if (!(but & 0x40)) { // Read the touch screen x = touchRead(TSC_MEASURE_X); y = touchRead(TSC_MEASURE_Y); xpx = ( ((SCREEN_WIDTH -60) * x) / TOUCH_WIDTH ) - TOUCH_OFFSET_X; ypx = ( ((SCREEN_HEIGHT-60) * y) / TOUCH_HEIGHT ) - TOUCH_OFFSET_Y; z1 = touchRead(TSC_MEASURE_Z1); z2 = touchRead(TSC_MEASURE_Z2); } IPC->buttons = but; IPC->touchX = x; IPC->touchY = y; IPC->touchXpx = xpx; IPC->touchYpx = ypx; IPC->touchZ1 = z1; IPC->touchZ2 = z2; Thanks, Zapf Bandit www.zapfbandit.com
  3. I am writting some 16 colour games in which I want to be able to draw colours directly to individual pixels. I wrote a little function to do this and it works fine on hardware. Unfortunately with dualis it totally stuffs up and ends up garbling the drawing. Here is the function in question. void setCol( uint16* bkg, int x, int y, u32 col ) { u32* bkg32 = (u32*)bkg; int tx = x/8; int px = x%8; int ty = y/8; int py = y%8; u32 row = bkg32[ 8*(32*ty + tx) + py ]; u32 mask = ~(0xf << (4*px)); col = col << (4*px); bkg32[ 8*(32*ty + tx) + py ] = (row & mask) | col; } I am mapping the graphics to 32 bit since this represents 8 pixels and makes the calculations much more straight forward. I'm not sure if it is this or the logical operations which are causing the issues. I might try a version that doesn't use the 32 bit version and see whether that fixes it. Zapf Bandit www.zapfbandit.com
  4. It seems to work OK for me... Have you enabled VBlank interupts? They need to be enabled for swiWaitForVBlank to work otherwise it will simply hangs. This behaviour occurs on the real hardware too. I hope this was the issue. Zapf Bandit www.zapfbandit.com
  5. You really need to see it on hardware to see the expected behaviour. I have just added sound effects which also work on the hardware (still needs a bit of fixing). I have updated my ndslib to the most recent version and I am still seeing the same behaviour. <a few moments later> OK... I changed all my bools to uint16 and it now works correctly. Mic, could you check how you are allocating memory for bools? I am pretty sure this is causing the woes... For completeness I will Now include both emu versions so they can be compared... http://www.zapfbandit.com/downloads/Oil_Panic_Bool_Err.zip
  6. I've been working on porting a classic Game-and-watch game to the DS. I'm damned close to finished but I'm noticing some wierd behaviour. I have got a passthrough now and have tested the following on hardware and it works exactly as it should. Using Dualis yeilds some interresting bahaviour. It appears that some of the boolean variables I am using don't seem to change from false. Two examples: (1) When oil is missed fire should appear (I set a flag called "fire") (2) When oil is poured over either side the character should pour (I set a flag called "pour"). Both of the above are ignored on Dualis but work fine on hardware. The main reason I think this might be happening is that I am using up all the global memory allocated by Dualis. I might be wrong though... Anyway, here is the link to the binaries: http://www.zapfbandit.com/downloads/Oil_Panic.zip As usual a work in progress (but very close ) Zapf
  7. Yep, that explains it. I tested with the sprite located near the middle and that works beautifully. It's just that the sprites are constantly moving offscreen. Rather than using the flip I'll just use 2 sprites for each car. It's not like I'm going to run out of video memory making frogger
  8. Okay... It still seems to be the problem... Last night I added all the cars and as I predicted I was able to add a lot more sprites above but at the same point (same number as visible on bottom) they stopped working... I am going to try using transparent sprites for those I'm not using and see whether the problem disappears. I suspect that it will... I'll keep you posted. Zapf <Some time slightly later> I'm a complete idiot... I just had a close look at my sprite movement code and it appears that I was using my old GBA code for some parts and thus using some of the main screen sprite chacteristics for the sub screen. The wierd frogs were due to the fact that the trucks were 32*16 sprites and this size was being used. All the others were fine since the other sprites are all 16*16. Many appologies for the false accusations. I'll be more careful next time. Mic you are indeed a legend having such a polished emulator so early in the show... I'm looking forward to your next release. Zapf
  9. Any time I try and set the x-flip bit on a 16*16 16 color sprite I get a standard "Dualis has crapped itself report request". I noticed another post with Y flipping. Is this the same error? It sounds like it could be. Zapf Bandit
  10. Ah ha... I've found the exact bug... I tried adding more sprites to the main (bottom) screen and found that the problem sprites started working. It appears that the number of sprites onscreen on the sub (top) screen cannot exceed those on the main screen. In order to hide sprites initially i do the following: for (uint16 i=0; i<128; i++) { OAM[4*i] = 192; OAM_SUB[4*i] = 192; } Then for each sprite I use I assign the correct OAM values. I don't know the Dualis code but pehaps you are setting the maximum number of sprites used based on only on the main display. Don't know... Thanks, Zapf Bandit
  11. Okay... http://www.zapfbandit.com/downloads/Frogger.zip There is an emu rom and a hardware rom. For a screenshot of how it looks for me: http://www.zapfbandit.com/gba.html and scroll to the bottom. The dodgy sprites are the last 2 turtles and the log bits. If I reduce the number of sprites down the log work perfectly. It seems that only the first 11 sprites work correctly on the sub display. There is no difference between the two dodgy turtles and the rest. Here is the code that sets the OAM record entries for the turtles. Note: not all the sprites have been added and thus don't move yet (they are part of the background). Also note: this is nowhere near finished yet. Thanks, Zapf Bandit
  12. Roger Wilco to you both, I am currently on holiday until Wed morn (Australian time). I will post the demo first thing for analysis. It could just be me but it seems painfully reproducable. The main screen seems fine regardless of the number of sprites it is only the top (sub) screen that is as issue. Anyway, I could forward to posting it first thing on Wednesday. Thanks for the interest, Zapf Bandit
  13. All, I am making Frogger for the DS. It is all working well so far except for the fact that when I have over 12 sprites on the sub (top) screen they start copying incorrectly in wierd and wonderful ways... I also have about 13 sprites on the main screen so it could be the total number. I'll do some more investigation and find the exact issue. Just a heads-up for now. Excellent work though to the author. This is a top notch emulator considering the time the ds has been out. I'm going to buy a DS and passthrough soon since I really want to get this working. Cheers, Zapf Bandit
×
×
  • Create New...