Jump to content

PacManPlus

Members
  • Content Count

    5,644
  • Joined

  • Days Won

    28

Posts posted by PacManPlus


  1. Hey Guys!

     

    18 minutes ago, Pat Brady said:

    Sounds good. Out of curiosity, is the new way an unrolled version of the old one? If so, some of my suggestions (especially #3 and #5) could still save a couple hundred bytes (8 per zone) and nearly as many cycles.

     

     

     

    13 minutes ago, tep392 said:

    Just to expand on this suggestion, doing indexed addressing across page boundries also adds a cycle, so try to position frequently accessed tables so they don't cross pages.

     

    It was a complete rewrite of 'DOSTARS'.  I was able to remove X and Y, and the 'STARS' array I held in RAM.  To answer your earlier question, there are 27 zones of 8 scanlines each:

     

    'LOADSTARS' gets called once just after all of the initialization at the beginning, and 'DOSTARS' gets called at the end of every frame, the last thing before the interrupt at the bottom of the screen:

    ;	LOADSTARS - INITIALIZES THE STARS ON THE SCREEN
    LOADSTARS
    	LDA #$80+$1F								;MAKE EVERY OTHER ZONE A DIFFERENT COLOR FOR THE STARS
    	STA DLIST01+$01
    	STA DLIST03+$01
    	STA DLIST05+$01
    	STA DLIST07+$01
    	STA DLIST09+$01
    	STA DLIST11+$01
    	STA DLIST13+$01
    	STA DLIST15+$01
    	STA DLIST17+$01
    	STA DLIST19+$01
    	STA DLIST21+$01
    	STA DLIST23+$01
    	STA DLIST25+$01
    	
    	LDA #$05									;EVERY TWO ZONES ARE DIFFERENT PALETTES FOR THE STARS
    	STA DLIST02+$00
    	STA DLIST03+$00
    	STA DLIST06+$00
    	STA DLIST07+$00
    	STA DLIST10+$00
    	STA DLIST11+$00
    	STA DLIST14+$00
    	STA DLIST15+$00
    	STA DLIST18+$00
    	STA DLIST19+$00
    	STA DLIST22+$00
    	STA DLIST23+$00
    	STA DLIST26+$00
    
    	LDX #$00									;STARTING ZONE
    LOSLOOP
    	LDA DLLO,X
    	STA TEMP0
    	LDA DLHI,X
    	STA TEMP1
    	LDY #$02
    	LDA #>(STAMPS)+$00
    	STA (TEMP0),Y
    	INY
    	JSR RAND
    	AND #$7F									;RANGE 0-127
    	CLC
    	ADC #LEFTSIDE - 8							;NOW IT'S 16-144
    	STA (TEMP0),Y
    	INX
    	CPX #LASTZONE
    	BMI LOSLOOP
    	RTS
    
    ;	DOSTARS - PROCESS THE BACKGROUND STARS ONCE EVERY OTHER FRAME
    DOSTARS
    	LDA RTLOCAL+1
    	AND #$01
    	BNE DOSTARS_VERTICAL
    	RTS
    DOSTARS_VERTICAL
    	CLC
    	LDA DLIST00+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST00+$02
    	LDA DLIST01+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST01+$02
    	LDA DLIST02+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST02+$02
    	LDA DLIST03+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST03+$02
    	LDA DLIST04+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST04+$02
    	LDA DLIST05+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST05+$02
    	LDA DLIST06+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST06+$02
    	LDA DLIST07+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST07+$02
    	LDA DLIST08+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST08+$02
    	LDA DLIST09+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST09+$02
    	LDA DLIST10+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST10+$02
    	LDA DLIST11+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST11+$02
    	LDA DLIST12+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST12+$02
    	LDA DLIST13+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST13+$02
    	LDA DLIST14+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST14+$02
    	LDA DLIST15+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST15+$02
    	LDA DLIST16+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST16+$02
    	LDA DLIST17+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST17+$02
    	LDA DLIST18+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST18+$02
    	LDA DLIST19+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST19+$02
    	LDA DLIST20+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST20+$02
    	LDA DLIST21+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST21+$02
    	LDA DLIST22+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST22+$02
    	LDA DLIST23+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST23+$02
    	LDA DLIST24+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST24+$02
    	LDA DLIST25+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST25+$02
    	LDA DLIST26+$02
    	ADC #$01
    	AND #$F7
    	STA DLIST26+$02
    DOSTARS_HORIZONTAL
    	LDA DLIST00+$02
    	CMP #>(STAMPS)+$00
    	BEQ DOSTARS_MOVE
    	RTS
    DOSTARS_MOVE
    	LDA DLIST25+$03
    	STA DLIST26+$03
    	LDA DLIST24+$03
    	STA DLIST25+$03
    	LDA DLIST23+$03
    	STA DLIST24+$03
    	LDA DLIST22+$03
    	STA DLIST23+$03
    	LDA DLIST21+$03
    	STA DLIST22+$03
    	LDA DLIST20+$03
    	STA DLIST21+$03
    	LDA DLIST19+$03
    	STA DLIST20+$03
    	LDA DLIST18+$03
    	STA DLIST19+$03
    	LDA DLIST17+$03
    	STA DLIST18+$03
    	LDA DLIST16+$03
    	STA DLIST17+$03
    	LDA DLIST15+$03
    	STA DLIST16+$03
    	LDA DLIST14+$03
    	STA DLIST15+$03
    	LDA DLIST13+$03
    	STA DLIST14+$03
    	LDA DLIST12+$03
    	STA DLIST13+$03
    	LDA DLIST11+$03
    	STA DLIST12+$03
    	LDA DLIST10+$03
    	STA DLIST11+$03
    	LDA DLIST09+$03
    	STA DLIST10+$03
    	LDA DLIST08+$03
    	STA DLIST09+$03
    	LDA DLIST07+$03
    	STA DLIST08+$03
    	LDA DLIST06+$03
    	STA DLIST07+$03
    	LDA DLIST05+$03
    	STA DLIST06+$03
    	LDA DLIST04+$03
    	STA DLIST05+$03
    	LDA DLIST03+$03
    	STA DLIST04+$03
    	LDA DLIST02+$03
    	STA DLIST03+$03
    	LDA DLIST01+$03
    	STA DLIST02+$03
    	LDA DLIST00+$03
    	STA DLIST01+$03
    	JSR RAND
    	AND #$7F									;RANGE 0-127
    	CLC
    	ADC #LEFTSIDE - 8							;NOW IT'S 16-144
    	STA DLIST00+$03
    	RTS

     

    • Like 1

  2. Ok, I think I have a handle on the difficulty and the other modes (easy, hard)...  But let me tell you, 'hard' difficulty is going to be *INSANE* :evil:

     

    EDIT - Wow, Namco was brutal.  Not only are there no difficulty dip switches, but the 'lives' dip switch allows between '2' and '3' lives! (i.e. no '5' lives setting)... Ouch!

     

    EDIT2 - Apparently the Japanese version allowed for 5 lives.

    • Like 1
    • Haha 1

  3. Good Morning!

     

    Thank you all for the replies, and thank you @Pat Brady for the nice details on how to save cycles.

     

    What I ended up doing overnight was completely rewriting the 'dostars' routine.  It's about as bare essentials as you can get, no loops, doesn't use X or Y.  It takes up quite a bit more code space, but as long as it is more efficient, that's what I need.  I also found out during this that the INC I was using, uses 3 times the cycles (6 total) as an ADC (2 total) which I now use.  All this time I thought it was the other way around.

     

    Regarding the RAND routine I'm using, it's changed over the years of me doing this, can't remember where I got this one:

    RAND
        LDA NEWRAND
        LSR
        ROL NEWRAND+1
        BCC RANDNOEOR
        EOR #$B4
    RANDNOEOR
        ADC RTLOCAL+1
        CLC
        STA NEWRAND
        EOR NEWRAND+1
        LDA NEWRAND
        RTS

     

    Anyway, with all that, here is the next update.  VERY little slowdown, if any.

    So after this, my 'todo' list hasn't changed:

    • Try to free some cycle time (although not as imperative now)
    • Finish sounds
    • Adjust 'normal' (i.e. Arcade) difficulty
    • Implement 'easy' and 'hard' difficulty 
    • Implement Game Demo during attract mode
    • Somehow indicate level number (don't have space for flags, so I'll find some other option).  I may actually use the flags in the middle of the top line and just switch them out per player.

    Thanks guys!

    Galaxian.A78 Galaxian.BIN

    • Like 11
    • Thanks 3

  4. What's interesting is that the next routine that uses the most cycles is the background star movement.  I'm using a single-byte sprite for the star (one per zone) and adjusting the high address and horizontal position of each one in each zone every frame.

     

    I tried *not* calling the star movement routine, and there is no slowdown.  I don't really want to get rid of the starfield, so if anyone knows some tricks for this I'm all ears:

    ;	DOSTARS - PROCESS THE BACKGROUND STARS ONCE EVERY OTHER FRAME
    ;	INPUT: NONE
    ;	USES: A, X (GETS SAVED), Y (GETS SAVED), TEMP0, TEMP1, TEMP2
    DOSTARS
    	LDA RTLOCAL+1
    	AND #$01
    	BNE DOSSTART
    	RTS
    DOSSTART
    	TXA											;SAVE REGISTERS
    	PHA
    	TYA
    	PHA
    	LDX #$00									;START FROM THE TOP ZONE
    	LDA #OFFSCRN
    	STA TEMP2									;THIS FLAGS TO PUT THE STAR IN THE NEXT LOWER ZONE
    DOSLOOP
    	LDA DLLO,X									;GET THE ADDRESS OF THE FIRST DISPLAY LIST IN THAT ZONE
    	STA TEMP0
    	LDA DLHI,X									;(THAT IS THE ONE FOR THE STARS)
    	STA TEMP1
    	LDA TEMP2									;SEE IF WE ARE CARRYING DOWN A STAR FROM THE ABOVE ZONE
    	CMP #OFFSCRN
    	BEQ DOSLNORMAL								;NOPE, JUST MOVE THIS STAR
    	LDY #$03
    	STA (TEMP0),Y								;HORIZONTAL POSITION OF STAR ON LOWER ZONE
    	LDA #OFFSCRN
    	STA TEMP2									;TURN OFF FLAG
    	LDA #$00
    	STA STARS,X									;START AT THE TOP OF THE ZONE
    	JMP DOSLWRITESTAR
    DOSLNORMAL
    	LDY #$03
    	LDA (TEMP0),Y								;SEE IF IT'S ACTIVE
    	CMP #OFFSCRN
    	BEQ DOSNEXT									;NOPE - GO ON TO THE NEXT ONE
    	LDA STARS,X									;GET THE CURRENT SCANLINE WITHIN THE CURRENT ZONE
    	CLC
    	ADC #$01									;ADD ONE TO THE CURRENT SCANLINE
    	AND #$07									;MAKE SURE IT'S BETWEEN $00 AND $07
    	STA STARS,X
    	BNE DOSLWRITESTAR
    DOSLDOWNZONE
    	LDA (TEMP0),Y								;WRAPPED AROUND TO ZERO - MOVE THE STAR DOWN ONE ZONE
    	STA TEMP2
    	LDA #OFFSCRN 
    	STA (TEMP0),Y
    	LDA #$00
    DOSLWRITESTAR
    	CLC
    	ADC #>(STAMPS+$0000)
    	LDY #$02
    	STA (TEMP0),Y
    DOSNEXT
    	INX
    	CPX #LASTZONE
    	BMI DOSLOOP
    
    	;NOW CHECK TO SEE IF THE FIRST ZONE NEEDS A NEW STAR
    	LDA DLLO
    	STA TEMP0
    	LDA DLHI
    	STA TEMP1
    	LDY #$03
    	LDA (TEMP0),Y
    	CMP #OFFSCRN								;DO WE NEED A NEW STAR?
    	BNE DOSEXIT									;NO, JUST EXIT
    	INC STARS									;YES, BUT WE NEED TO DELAY FOR 1 FRAME
    	LDA STARS
    	CMP #$01
    	BEQ DOSEXIT
    	JSR RAND									;YES!
    	AND #$7F									;RANGE 0-127
    	;CMP #$70									;OUTSIDE THE RANGE OF THE PLAYFIELD?
    	;BCS DOSEXIT
    	CLC
    	ADC #LEFTSIDE - 8							;NOW IT'S 16-144
    	STA (TEMP0),Y
    	LDA #$00
    	STA STARS
    DOSEXIT
    	PLA
    	TAY
    	PLA
    	TAX
    	RTS
    

    Thanks, guys

     


  5. Hi Guys

     

    - Ok, I found and fixed the 'end of wave' issue...  It turns out a routine wasn't being called that updated the stats on the alien swarm. :(  This means I'm adding cycles to something already maxed out.  I've made the call to the routine, but now you can see moments of noticeable slowdown, especially when the flagship with two escorts are attacking. :( 

     

    I will try to work on that, but I might need help from someone who is good at reducing cycles to give this a look-see.

     

    Also, the stray bullet that appeared stationary at the top left of the screen has been removed.  Finally, I have removed all Pokey calls from the game.

     

    So now what I have left is:

    • Try to free some cycle time
    • Finish sounds
    • Adjust 'normal' (i.e. Arcade) difficulty
    • Implement 'easy' and 'hard' difficulty 
    • Implement Game Demo during attract mode
    • Somehow indicate level number (don't have space for flags, so I'll find some other option)

    This one should work better...

     

    EDIT - 9:15 PM  Replaced binaries, got a compiler error.

     

    Galaxian.A78 Galaxian.BIN

    • Like 5

  6. Ok...  Here is what I have so far!

     

    I have finished 'porting' over the Z80 code to 6502, and while I had to make adjustments to fit with the way I lay out my games, I think it turned out pretty good!  However, it seems VERY difficult, so there may be some 'adjusting' I may need to do.

    So, what I think I have left:

     

    - Possibly adjust 'normal' (i.e. arcade) difficulty

    - Implement 'easy' and 'hard' difficulty

    - Fix up sounds

    - Implement 'game demo' mode during attract mode

     

    Once I fix up the sounds, I think I may actually remove the Pokey section, (please forgive me @Synthpopalooza - I will need you for other things I plan on working on, if it's ok) ... I don't think this game needs it too much and I believe I can get closer with the shot, drone, and dive sounds.  Also I can use the few cycles that check every time it plays a sound.

     

    Here you go, please enjoy and let me know what you think:

     

     

     

    Galaxian.A78 Galaxian.BIN

    • Like 9
    • Thanks 1

  7. 3 hours ago, RevEng said:

    The main issue is it's written in 7800basic. While it compiles to assembly, it's machine-generated assembly which isn't as nice to work with. On top of that, it uses all of the flexible utility functions to draw the screen for convenience, but they make the assembly a bit more complicated than it needs to be for a bios. i.e. plotbanner commands that can move the fuji or text around. 

     

    I'll have a look at unwinding it into a simpler assembly program.

     

    So are we talking full encryption signature checking? Seems like a lot of stuff to port, and honestly the reason for the goofy NTSC Atari display is the check. It would be easier to just do a quick PAL style check for the cart type, display the screen a few seconds, and then launch the game. That way you could entirely avoid using Atari's signature check routines, and keep this thing open.

    You know what?  That sounds like a great idea!  Start with the PAL BIOS check, display the screen for a few seconds (or maybe add a check for the PAUSE button to skip for people who don't want to wait).  Include a 'default' game when nothing is in the cart port.  I think the max was a 16K game?

     

    I LIKE THIS!

    • Like 4

  8. On 3/21/2021 at 10:57 AM, Trebor said:

    Are you wondering if it will fit?  Do you think you are crossing a line that should not be crossed?  Fear not.  Now there's Screen Safe.  Screen Safe provides the boundaries you need to know, when you are pushing things beyond safe places. 

     

    image.thumb.png.4ed6506e805bba7d0c86860dbe48da28.png

     

    As Shown On TV, it comes completed with zoned scanline measurements!

     

    Availability:
    - Right here - Screen Safe (20210312).a78
    - Latest 7800basic release 'samples' folder
    - Coming Soon to Trebors 7800 ROM PROPack

     

    As an additional bonus, to be set as the default ROM of the magnificent MiSTer 7800 core, you can obtain your very own standalone copy of a verified screen safe compliant, 7800 Non-Interactive Title Screen...

     

      

    Grab your copy today...   7800 Non-Interactive Title Screen (20210320).a78 32.13 kB · 8 downloads

     

    Thanks to @RevEng for both provisions! 

    I would love to have that title screen in the BIOS, instead of:

    PacManPlus

     

    • Like 6

  9. Hi guys:

     

    Ok, bad news: The '2 player simultaneous' selection has to go.  I am at the max cycles, and even using a 7800heat utility (made by @RevEng) I can't seem to reduce the number of cycles needed per frame.  Something has to go, so the extra code that handles 2 player simultaneous selection is on the chopping block.

     

    I understand that there may be some bloat due to this being my first time converting Z80 to 6502, but I cant help that.

     

    • Like 3

  10. Hi guys!

     

    Ok, thanks to @tep392 and @RevEng, I have used their detection code and made one version of PMC-40th.  It detects the Yamaha in A7800, the XM, and the Dragonfly, but correctly does not in ProSystem and the CCII (no Yamaha) - it defaults to TIA.

     

    However, during the detection routine just before the initial main screen, there are 1-2 frames of garbage that I can't seem to get rid of, even by turning off the screen. 

     

    It bugs me, but between having two versions of the cart and having a quick glitch just before the first time the title screen comes up, I'll take the latter.

     

    Last (Hopefully) version.

     

    PMC_XM.A78 PMC_XM.BIN

    • Like 13
    • Thanks 1

  11. 29 minutes ago, DrVenkman said:

    Neither one of these use POKEY at all, as I understand it. One uses a YM synth, as contained in either an XM or a Dragonfly Cart. The other uses stock 7800 TIA audio. 

    This is true.  There never was a Pokey in this version.  It was always TIA or Yamaha.

    • Like 5

  12. Does anyone know the actual footprint of the Yamaha?  Is there really no series of bytes (doesn't have to be contiguous) to check that are a specific value if the YM is there or not?

     

    At this point I'm tempted to just make two separate versions, one Yamaha and one TIA.

     

     

    I just did a series of experiments with the Yamaha from the XM, the Dragonfly, and TIA.  I get different values for all three.  I was expecting the XM and Dragonfly to match at least somewhere, being they are both using the same YM chip.

    • Like 1
×
×
  • Create New...