5Fermer7
Mega ShockedLe 18/05/2021 à 04:55
I will apologize in advance as I will probably butcher this...

I'm really excited to see if I can get 8x time more P memory built into my current coding rig!!!!!!!!!!!
My goal is to see if based on what I am describing the NgDataLinker 1.0 can fit into my setup?

To my knowledge I am using Banking via DATLib at the moment.

I can access 4 banks of GFX data but my limitation is I cannot combine gfx from these banks in the same scene.
I also believe 8x more P means the ability to build more GFX!!!!!!! rotfl

Ok I am going to try and describe how it is all setup now.
It has been a very long time since I have reviewed this stuff and I am not great at the technical stuff.

I have 4 .xml files that build the GFX data. Each file has a setup at the top of it.
"fillmode" changes in each file.
I think each Bank is set to be 8mb's in size

EX:

//Bank 0 <setup> <starting_tile fillmode="dummy">256</starting_tile> <charfile>out\bk0Char.bin</charfile> <mapfile>out\bk0Maps.s</mapfile> <palfile>out\bk0Pals.s</palfile> <incfile>out\bk0Include.h</incfile> </setup> //Bank 1 <setup> <starting_tile fillmode="none">65536</starting_tile> <charfile>out\bk1Char.bin</charfile> <mapfile>out\bk1Maps.s</mapfile> <palfile>out\bk1Pals.s</palfile> <incfile>out\bk1Include.h</incfile> </setup> //Bank2 <setup> <starting_tile fillmode="none">131072</starting_tile> <charfile>out\bk2Char.bin</charfile> <mapfile>out\bk2Maps.s</mapfile> <palfile>out\bk2Pals.s</palfile> <incfile>out\bk2Include.h</incfile> </setup> //Bank 3 <setup> <starting_tile fillmode="none">196608</starting_tile> <charfile>out\bk3Char.bin</charfile> <mapfile>out\bk3Maps.s</mapfile> <palfile>out\bk3Pals.s</palfile> <incfile>out\bk3Include.h</incfile> </setup>
Then I get Bank0.h Bank1.h Bank2.h Bank3.h that I include in my project.

Here is an example of Bank0.h all the other Bank files are very similar.
*Edit - I think DATLib is doing what the NgDataLinker 1.0 is doing when generating the Bank0-3.h files in this step. (but I could be wrong)

#ifndef __BANK0GFX_H__ #define __BANK0GFX_H__ #define BoxOrange 0x0020458e #define Mission1 0x00200160 #define GD_Explosion_Palettes 0x002441fe #define BoxBrown 0x00204624 #define BoxPurple_Palettes 0x00243e8c #define BoxYellow 0x002045ac #define Bios_Palettes 0x00243dc0 #define GD_Explosion 0x00242f46 #define BoxPink 0x00204642 #define Bullet1_Palettes 0x002441bc #define TM_00177 0x0021d80a #define Bullet1 0x002425c8 #define BoxRed 0x00204660 #define Bios 0x00200000 #define BoxOrange_Palettes 0x00243e26 #define Rob 0x0023732a #define BoxGreen_Palettes 0x00243e04 #define BoxYellow_Palettes 0x00243e48 #define DebugBox0 0x0020467e #define Rob_Palettes 0x00243f9a #define BoxBlue_Palettes 0x00243e6a #define BoxTeal_Palettes 0x00243eae #define BoxRed_Palettes 0x00243f14 #define BoxGreen 0x00204570 #define BoxPink_Palettes 0x00243ef2 #define BoxBlue 0x002045ca #define TM_00177_Palettes 0x00243f58 #define BoxBrown_Palettes 0x00243ed0 #define BoxPurple 0x002045e8 #define BoxTeal 0x00204606 #define Mission1_Palettes 0x00243de2 #define DebugBox0_Palettes 0x00243f36 #endif
To access my the Banks via code I use this command then I call the GFX I want to display.

//Bank 0 volMEMWORD(0x2ffff0)=0; //Display GFX //Bank 1 volMEMWORD(0x2ffff0)=1; //Display GFX //Bank 2 volMEMWORD(0x2ffff0)=2; //Display GFX //Bank 3 volMEMWORD(0x2ffff0)=3; //Display GFX
The makefile I use is never altered it looks like this.
(I do all my coding in .h files...I realize it is probably bad form but it helps me be versatile and jump to other projects without changing the makefile)

# $Id: Makefile,v 1.4 2001/05/03 13:43:42 fma Exp $ ####################################### # Base dir of your m68k gcc toolchain # ####################################### BASEDIR = $(NEODEV) AS = as LD = gcc CC = gcc AR = ar OBJC = objcopy BIN2O = bin2elf GFXCC = gfxcc FIXCNV = fixcnv ####################################### # Path to libraries and include files # ####################################### INCDIR = $(BASEDIR)/m68k/include LIBDIR = $(BASEDIR)/m68k/lib TMPDIR = tmp ################################### # Output: {cart, cd} *lower case* # ################################### OUTPUT = cart #OUTPUT = cd ############################ # Settings for cart output # ############################ ROMSIZE = 0x20000 PADBYTE = 0xFF ############################## # Object Files and Libraries # ############################## OBJS = $(TMPDIR)/crt0_$(OUTPUT).o $(TMPDIR)/main.o LIBS = -lDATlib -lprocess -lc -lgcc ##################### # Compilation Flags # ##################### ASFLAGS = -m68000 --register-prefix-optional LDFLAGS = -Wl,-T$(BASEDIR)/src/system/neo$(OUTPUT).x -Xlinker -Map=output.map CCFLAGS = -m68000 -O3 -Wall -fomit-frame-pointer -ffast-math -fno-builtin -nostartfiles -nodefaultlibs -D__$(OUTPUT)__ ARFLAGS = cr DEBUG = -g ################## # FIX Definition # ################## FIXFILES = $(BASEDIR)/src/shared/fix_font.bmp ############## # Make rules # ############## ifeq ($(OUTPUT),cart) Build/dev_p1.bin : Build/test.o # $(OBJC) --gap-fill=$(PADBYTE) --pad-to=$(ROMSIZE) -R .data -O binary $< $@ $(OBJC) --gap-fill=$(PADBYTE) -R .data -O binary $< $@ # copy dev_p1.rom c:\mame\roms\dev.bin /y else Build/test.prg : Build/test.o $(OBJC) -O binary $< $@ endif #test.o : test.fix $(OBJS) Build/test.o : $(OBJS) $(LD) -L$(LIBDIR) $(CCFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ $(TMPDIR)/%.o: %.c $(CC) -I$(INCDIR) $(CCFLAGS) -c $< -o $@ $(TMPDIR)/%.o: %.s $(AS) $(ASFLAGS) $< -o $@ clean: rm -f $(TMPDIR)/*.* rm -f palettes.pal rm -f test.o rm -f test.prg rm -f test.fix rm -f test.spr rm -f dev_p1.rom ############ # FIX Rule # ############ #test.fix : $(FIXFILES) # $(FIXCNV) $(FIXFILES) -o $@ -pal palettes.pal # #$(TMPDIR)/palettes.o: palettes.pal # $(BIN2O) $< palettes $@
Any tips or suggestions to on if it is possible to build this into the existing rig would be amazing. Thanks again for this great enhancement!!!!!