Jump to content

Photo

Games over 4K


29 replies to this topic

#26 BNE Jeff OFFLINE  

BNE Jeff

    Moonsweeper

  • Topic Starter
  • 364 posts
  • Location:$5787

Posted Thu Dec 20, 2018 4:46 PM

Done!  :)

 

Thanks Thomas.  I followed the link, but understood almost none of it even with the DASM manual by my side.  I'm sure it would have to be heavily commented for me to follow it better.



#27 BNE Jeff OFFLINE  

BNE Jeff

    Moonsweeper

  • Topic Starter
  • 364 posts
  • Location:$5787

Posted Thu Dec 20, 2018 5:44 PM

 

So of those EF could be made to work with my example.  As Thomas mentions, if you do it this way the overhead increases (as more of each 4K bank is dedicated to bank switching code) so finding a better way to do it would be in your best interesting.  

 

One side affect of my switching to ARM support for my games is they only use 1 bank of 6507 code, and the ARM sees everything without needing to bankswitch, so I've not looked into better ways to do it.

 

Thinking about this some more, I thought of a way to greatly reduce the overhead.  I'm curious to know if this will work. If I were to expand to 16 banks of 4K, 12 of these banks would be kernels and therefore, would always return to "Overscan" in the jump table.  Couldn't I move "Overscan to the top of JUMP_TABLE, then delete the remainder the jump table that follows "Overscan" in those 12 banks?  Further, couldn't I get rid of all but the last SelectBank in BANKS_AND_VECTORS in those 12 banks, always jumping to the last bank? (Which doesn't get me to "Overscan" right now but I suppose I could move Overscan to the last bank.)  These changes would probably also apply to the voice banks as well, leaving only one bank requiring the full JUMP_TABLE and BANKS_AND_VECTORS macros.  Does that work?

	MAC JUMP_TABLE ; start of every bank
	RORG $F000
SystemStart				; inititialize system
	nop SelectBank1
	jmp SystemStartCode
MCP						; game logic
	nop SelectBank1
	jmp MCPCode
Overscan
	nop SelectBank1
	jmp OverscanCode
IntroKernels				; kernels
	nop SelectBank2
	jmp IntroKernelsCode
Kernels3				; kernels
	nop SelectBank3
	jmp Kernels3Code
Kernels4			    ; kernels
	nop SelectBank4
	jmp Kernels4Code
Voice1    				; voice bank 1
	nop SelectBank5
	jmp Voice1Code
Voice2	    			; voice bank 2
	nop SelectBank6
	jmp Voice2Code
Voice3             		; voice bank 3
	nop SelectBank7
	jmp Voice3Code
Voice4 					; voice bank 4
	nop SelectBank8
	jmp Voice4Code
	ENDM
	
	MAC BANKS_AND_VECTORS ; end of every bank
	RORG $FFF4
	
SelectBank1 .byte $00 
SelectBank2 .byte $00 
SelectBank3 .byte $00 
SelectBank4 .byte $00
SelectBank5 .byte $00 
SelectBank6 .byte $00 
SelectBank7 .byte $00 
SelectBank8 .byte $00



#28 BNE Jeff OFFLINE  

BNE Jeff

    Moonsweeper

  • Topic Starter
  • 364 posts
  • Location:$5787

Posted Thu Dec 20, 2018 5:54 PM

Wait..  That doesn't work does it.  The program counter will be in the wrong place.



#29 SpiceWare OFFLINE  

SpiceWare

    Draconian

  • 12,616 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Dec 20, 2018 6:29 PM

BANKS_AND_VECTORS would need to be in every bank, so that wouldn't change.  

An easy way to split the jump table would be to have Overscan and Vertical Blank in different banks. Vertical Blank needs to call the kernels, so have Overscan handle the voice routines.
 
	MAC JUMP_TABLE_OS_V ; start of Overscan and Voice banks
	RORG $F000
SystemStart				; inititialize system
	nop SelectBank1
	jmp SystemStartCode
VerticalBlank				; game logic (Vertical Blank)
	nop SelectBank5
	jmp VBCode
Overscan
	nop SelectBank1
	jmp OverscanCode
Voice1    				; voice bank 1
	nop SelectBank2
	jmp Voice1Code
Voice2	    			        ; voice bank 2
	nop SelectBank3
	jmp Voice2Code
Voice3             		        ; voice bank 3
	nop SelectBank4
	jmp Voice3Code
	ENDM





	MAC JUMP_TABLE_VB_K ; start of Vertical Blank and Kernel banks
	RORG $F000
SystemStart				; inititialize system
	nop SelectBank1
	jmp SystemStartCode
VerticalBlank				; game logic (Vertical Blank)
	nop SelectBank5
	jmp VBCode
Overscan
	nop SelectBank1
	jmp OverscanCode
IntroKernels				; kernels
	nop SelectBank6
	jmp IntroKernelsCode
Kernels3				; kernels
	nop SelectBank7
	jmp Kernels3Code
Kernels4			        ; kernels
	nop SelectBank8
	jmp Kernels4Code
	ENDM
 

#30 BNE Jeff OFFLINE  

BNE Jeff

    Moonsweeper

  • Topic Starter
  • 364 posts
  • Location:$5787

Posted Fri Dec 21, 2018 8:25 AM

Hmm..  That would certainly help.  Thanks!

 

I went on a nice long run and thought this over again and partially reversed my conclusion.  It  seems to me that BANKS_AND_VECTORS is unchangeable- so I get that.  But, with JUMP_TABLE for example, if Bank 3 didn't use the JUMP_TABLE macro, and only had:

SystemStart				; inititialize system
	nop SelectBank1
	jmp SystemStartCode
MCP						; game logic
	nop SelectBank1
	jmp MCPCode
Overscan
	nop SelectBank1
	jmp OverscanCode
IntroKernels				; kernels
	nop SelectBank2
	jmp IntroKernelsCode
Kernels3				; kernels
	nop SelectBank3
	jmp Kernels3Code

and I left the rest of the banks off, then you could always jump to it.  And if that bank only needed to jump to bank one, its covered there too- right? 

 

Additionally, if I had 16 banks, then bank 16, for example, could have something like

     ORG $F000 ;?????
SUBROUTINE:
     ; insert any subroutine here
     rts ; 

     ORG $F0??  ; Wherever the macro has it
Bank16
     nop SelectBank16
     jmp SelectBank16Code

     ; a larger subroutine could jump to here then rts

I'm still a little weak on ORGs and RORGs nor do I know exactly what address Bank 16 is in the macro. 

 

Does this work?






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users