Jump to content
IGNORED

Segment Help


Turbo Laser Lynx

Recommended Posts

Hi! I'm trying to add another segment to my new demo-cart built upon pegsolitaire from here: http://atariage.com/forums/topic/256571-learning-lynx-coding-by-hacking-pegsolitaire/

 

Any help or pointer in the right direction appreciated. Let me know if you need more files 'n' stuff

 

Ok so I made a new folder named maija where my other game demo will recide. At this point I just want to show one 160x102 image. I mimiced everything from pegsolitaire (except pegsolitaire.h), put up all the new stuff in the make files and added maija to lynxcart.cfg directory.s etc.

 

the original segments work, intro and pegsolitaire, but when I try to load in my new segment handy crashes. Again I've tried to mimic everything perfectly. Could the problem be that I get a whole bunch of warnings of duplicate external identifiers? e.g.

ld65: Warning: Duplicate external identifier: `_stop_music'

ld65: Warning: Duplicate external identifier: `_start_music'

etc...

 

I don't think I see anything wrong with the segments here: (I attached cart.map)

Segment list:
-------------
Name                   Start     End    Size  Align
----------------------------------------------------
DIRECTORY             000000  000017  000018  00001
EXEHDR                000000  00003F  000040  00001
ZEROPAGE              000000  000019  00001A  00001
EXTZP                 00001A  000032  000019  00001
APPZP                 000033  000039  000007  00001
BOOTLDR               000200  0002CA  0000CB  00001
INTRO_CODE            000200  0003B8  0001B9  00001
MAIJA_CODE            000200  000373  000174  00001
PEGSOLITAIRE_CODE     000200  0008C8  0006C9  00001
MAIJA_RODATA          000374  00096E  0005FB  00001
INTRO_RODATA          0003B9  001108  000D50  00001
PEGSOLITAIRE_RODATA   0008C9  00308C  0027C4  00001
MAIJA_DATA            00096F  0009AF  000041  00001
MAIJA_BSS             0009B0  0009CD  00001E  00001
INTRO_DATA            001109  001142  00003A  00001
INTRO_BSS             001143  001148  000006  00001
PEGSOLITAIRE_DATA     00308D  00330D  000281  00001
PEGSOLITAIRE_BSS      00330E  00332B  00001E  00001
STARTUP               005C40  005CBC  00007D  00001
INIT                  005CBD  005CEB  00002F  00001
CODE                  005CEC  007A2D  001D42  00001
RODATA                007A2E  00845D  000A30  00001
DATA                  00845E  008576  000119  00001
BSS                   008577  0086D5  00015F  00001

In the cart makefile:

cart.lnx : \
	directory.o \
	../resident/resident.o \
	../resident/soundbs.o \
	../resident/fadein.o \
	../resident/fadeout.o \
	../intro/intro.o \
	../intro/bg.o \
	../intro/title.o \
	../maija/maija.o \
	../maija/bgm.o \
	../maija/track2.o \
	../pegsolitaire/pegsolitaire.o \
	../pegsolitaire/bga.o \
	../pegsolitaire/track2.o \
	../pegsolitaire/square.o \
	../pegsolitaire/bgb.o 
	
	$(MAKE) -C ../resident
	$(MAKE) -C ../intro
	$(MAKE) -C ../maija
	$(MAKE) -C ../pegsolitaire

In lynxcart.cfg

__BANK1SIZE__: type = weak, value = $3A40;
__BANK7SIZE__: type = weak, value = $5A40;
__BANK8SIZE__: type = weak, value = $5A40;

...

# Peg solitaire code
PEGSOLITAIRE_CODE: load = BANK7, type = ro, define = yes;
PEGSOLITAIRE_RODATA: load = BANK7, type = ro, define = yes;
PEGSOLITAIRE_DATA: load = BANK7, type = rw, define = yes;
PEGSOLITAIRE_BSS: load = BANK7, type = bss, optional = yes;
	
#Maijas data diskette
MAIJA_CODE: load = BANK8, type = ro, define = yes;
MAIJA_RODATA: load = BANK8, type = ro, define = yes;
MAIJA_DATA: load = BANK8, type = rw, define = yes;
MAIJA_BSS: load = BANK8, type = bss, optional = yes;

...

.import __PEGSOLITAIRE_CODE_LOAD__
.import __PEGSOLITAIRE_CODE_SIZE__
.import __PEGSOLITAIRE_DATA_SIZE__
.import __PEGSOLITAIRE_RODATA_SIZE__
.import __MAIJA_CODE_LOAD__
.import __MAIJA_CODE_SIZE__
.import __MAIJA_DATA_SIZE__
.import __MAIJA_RODATA_SIZE__

...

; The 2nd entry is the entertainment module that we run at startup
entry off0, len0, off1, block1, len1,__INTRO_CODE_SIZE__+__INTRO_RODATA_SIZE__+__INTRO_DATA_SIZE__, __INTRO_CODE_LOAD__

; The 3rd entry is the 1st game level we want to run.
entry off1, len1, off2, block2, len2, __PEGSOLITAIRE_CODE_SIZE__+__PEGSOLITAIRE_RODATA_SIZE__+__PEGSOLITAIRE_DATA_SIZE__, __PEGSOLITAIRE_CODE_LOAD__

; The 4th entry should come here. It could be the 2nd level to run or data...
entry off2, len2, off3, block3, len3, 
__MAIJA_CODE_SIZE__+__MAIJA_RODATA_SIZE__+__MAIJA_DATA_SIZE__, __MAIJA_CODE_LOAD__

post-2915-0-76727500-1473625605_thumb.png

cart.map.txt

Edited by Turbo Laser Lynx
Link to comment
Share on other sites

If you want to share start_music() and stop_music() then they should go to the resident directory.

 

If these codes are local you should mark them local:

 

Instead of

void stop_music() {

write

static void stop_music() {

then the routine is not exported outside this file and you get no error warnings.

Link to comment
Share on other sites

Heureka! I finally made it, it only took me 12 years. The whole cart is mine, muhahaha! I'm so going to celebrate this with a Pommac tomorrow! I should send you a bottle too. :) At least You'll get a free copy of my first released Lynx game-mix when that time comes.

 

Karri allow me to write you a program:

10 Print "THANK YOU!"
20 Goto 10
RUN
Edited by Turbo Laser Lynx
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...