The Main game screen is not working now

This example now demonstrates the Charpad map that is loaded (using SwitchCharSet) that has tiles shifted to the left for some strange reason. Updated 10-27-23.

Title Screen Vs. The Main Game Screen

Above is a tool you can use to view the title screen (on the left) and then the main game map (on the right) as it appears currently. The title screen loads great (using incbin), but I am lost as of why the main game screen is a jumbled mess.

Commodore 64 Game Project

This is an example screen of my title screen. It uses a separate character set from the game demo The goal is to have a character set for the title screen. Then when the fire button is pressed, the game will use a totally different character set.
I’m also hoping to learn how to import multiple maps using CBM Prg Studio include files as well, but so far this is not working.

Here is an example of two binary files I’d like to switch between them (as seen at the bottom of Main.asm)

TITLE_MAP_CHAR_MEM ; Character set for map screen
incbin "Parkour_Maps/Project16_TitleScreen_Chars1_perchar.bin"

*=$4800
MAP_CHAR_MEM ; Character set for map screen
;incbin"Parkour_Maps/Project14Anim1_Chars2.bin"

Yet when I’m trying to read them both like this, it doesn’t seem to work right (as found in CharSet_Memory.asm)

Note: This is a short snippet. See the full code using the Tabs below on the page.

I am using cpy #32 since there are 32 pixels in the individual character set tiles. Then after I’ve read all 32 bytes for one tile (out of 16 tiles) then I adc #32 to be stored in ZEROPAGE_POINTER_4 (which holds the character set data) and I do the same adc #32 for ZEROPAGE_POINTER_1 (which increases the memory by 32 bytes each time). This is necessary to read the next tile in a row. That’s my dilemma at least.


ldx #0
ldy #0

loop1
lda (ZEROPAGE_POINTER_4),y ; GAMECHSET1_MEM
lda ZEROPAGE_POINTER_1
adc ZEROPAGE_POINTER_1 ; inc $4800 (low/hi) bytes
sta ZEROPAGE_POINTER_1
lda ZEROPAGE_POINTER_1 + 1
adc #0
sta ZEROPAGE_POINTER_1 + 1
jsr ReadChset
iny ; x = x + 1
cpy #32 ; read all 32 pixels in Char Editor
bne loop1
rts

lda ZEROPAGE_POINTER_4 ; GAMECHSET1_MEM
clc
adc #32 ; Skip first(each) 32 pixels to read next chset data
sta ZEROPAGE_POINTER_4
lda ZEROPAGE_POINTER_4 + 1
adc #0
sta ZEROPAGE_POINTER_4 + 1

lda ZEROPAGE_POINTER_1 ; CHSET_LOC ($4800)
clc
adc #32 ; Skip first(each) 32 pixels to read next chset data
sta ZEROPAGE_POINTER_1
lda ZEROPAGE_POINTER_1 + 1
adc #0
sta ZEROPAGE_POINTER_1 + 1

ldy #0
inx
cpx #124 ; read down 15 lines
bne loop1
rts

CharPad Example

Here are the actual two different character sets I’m using:

  1. Title screen character set
  2. In game character set

Game in Progress

The actual game in uses it’s own character set (using 4×4 tiles). Everything should be obvious from the CharPad attachments.

I will add the code here later, but figured I’d post the question on Lemon 64 in the meantime.

The Assembly Language Game Code

The game project also includes scrolling screens horizontally and vertically. I’m hoping to eventually create more maps that will need to be switched to with either an include file or a reference to a byte table or something. I can currently show 1 character set and map only.

Remember the goal here is to access multiple character sets and maps eventually.

Clicking on the tabs reviews 4 source files

  • Main.asm
  • CharSet_Memory.asm
  • Game_Chset.asm
  • VIC_Registers.asm

There are many other assembly files as well, but the purpose of this page (for the lemon64.com post) is to highlight the areas of interest. In Main you can see the binary files I’m trying to read from using the assembly code in “CharSet_Memory.asm”. The “Game_Chset.asm” contains the byte data (although main uses the include, I figured it would be beneficial to show you the actual output from CharPad Pro).

Finally the VIC_Registers shows the VIC variable data and other constants.

I can also add more assembly language files tabs as needed per this discussion.

I hope this is helpful. Feel free to leave comments on this page if you want as well.