Basic Questions and Answers Thread
#1207
Posted 20 August 2012 - 10:26 PM
#1208
Posted 20 August 2012 - 10:49 PM
If that wan't enough then could you please help me with my issue, sir Selbi?What would be my best option?
Edited by Mike B Berry, 20 August 2012 - 10:53 PM.
#1209
Posted 20 August 2012 - 11:25 PM
#1210
Posted 20 August 2012 - 11:32 PM
#1211
Posted 21 August 2012 - 12:47 AM
Well, you really shouldn't use a completely new object and rather go with a level specific version of Obj5C. Generally, all you need to do is to change the tile offset to the new location. As a basic example of how that works:
move.w #$83CC,2(a0) ; set offest for SLZ
tst.b ($FFFFFE10).w ; is level GHZ?
bne.s Obj5C_NotGHZ ; if not, branch
move.w #$8555,2(a0) ; set offset for GHZ
Obj5C_NotGHZ:
You obviously need to change the tile offset to whatever VRAM address you've assigned your new art to.
#1212
Posted 21 August 2012 - 03:07 AM
#1213
Posted 21 August 2012 - 08:04 PM
It's actually quite special. Sonic 1 loads art when the level loads through the use of the Pattern Load Cue system. Open the file in "_inc/Pattern load cues.asm" Since you want to add something to Green Hill, find the label called "PLC_GHZ" You should see something as below (I might've edited this):Alright, I have the new VRAM adress set, now I need to implement the art into GHZ it'sself... bombard me with negative reputation, I can take it. Could you possibly guide me through this bit as well?
; ---------------------------------------------------------------------------
; Pattern load cues - Green Hill
; ---------------------------------------------------------------------------
PLC_GHZ: dc.w $A
dc.l Nem_GHZ_1st ; GHZ main patterns
dc.w 0
dc.l Nem_Stalk ; flower stalk
dc.w $6B00
dc.l Nem_PplRock ; purple rock
dc.w $7A00
dc.l Nem_Crabmeat ; crabmeat enemy
dc.w $8000
dc.l Nem_Buzz ; buzz bomber enemy
dc.w $8880
dc.l Nem_Chopper ; chopper enemy
dc.w $8F60
dc.l Nem_Newtron ; newtron enemy
dc.w $9360
dc.l Nem_Motobug ; motobug enemy
dc.w $9E00
dc.l Nem_Spikes ; spikes
dc.w $A360
dc.l Nem_HSpring ; horizontal spring
dc.w $A460
dc.l Nem_VSpring ; vertical spring
dc.w $A660
PLC_GHZ2: dc.w 5
dc.l Nem_Swing ; swinging platform
dc.w $7000
dc.l Nem_Bridge ; bridge
dc.w $71C0
dc.l Nem_SpikePole ; spiked pole
dc.w $7300
dc.l Nem_Ball ; giant ball
dc.w $7540
dc.l Nem_GhzWall1 ; breakable wall
dc.w $A1E0
dc.l Nem_GhzWall2 ; normal wall
dc.w $6980
You'll notice there's two PLC's — one loads before the title card fades out, another while the level is faded in already.
Anyways, as you may notice, the first word of the PLC is the number of entries in the PLC, minus one. Followed by that is 6 bytes per pattern entry. The first is a longword pointing to the art, and the second is the word offset into VRAM where it will be loaded. Art must be Nemesis compressed. The rest should be obvious =P
#1214
Posted 21 August 2012 - 11:38 PM
#1215
Posted 22 August 2012 - 06:42 AM
So if your object code is using $3CC, like the above code, multiply it by $20 to get $7980 (using a hex calculator).
An easy way to see the VRAM is to make a savestate when your level is loaded, open the savestate in SonED1, read the 8x8 tiles from the savestate, go to the tile editor, then you can see where everything is loaded. This helps when trying to find some free VRAM space.
#1216
Posted 23 August 2012 - 02:52 AM
; --------------------------------------------------------------------------- ; Object 5C - metal girders in foreground (SLZ) ; --------------------------------------------------------------------------- Obj5C: ; XREF: Obj_Index moveq #0,d0 move.b $24(a0),d0 move.w Obj5C_Index(pc,d0.w),d1 jmp Obj5C_Index(pc,d1.w) ; =========================================================================== Obj5C_Index: dc.w Obj5C_Main-Obj5C_Index dc.w Obj5C_Display-Obj5C_Index ; =========================================================================== Obj5C_Main: ; XREF: Obj5C_Index move.w #$7980,2(a0) ; set offest for SLZ tst.b ($FFFFFE10).w ; is level GHZ? bne.s Obj5C_NotGHZ ; if not, branch move.w #$8555,2(a0) ; set offset for GHZ Obj5C_NotGHZ: addq.b #2,$24(a0) move.l #Map_obj5C,4(a0) move.w #$83CC,2(a0) move.b #$10,$19(a0) Obj5C_Display: ; XREF: Obj5C_Index move.l ($FFFFF700).w,d1 add.l d1,d1 swap d1 neg.w d1 move.w d1,8(a0) move.l ($FFFFF704).w,d1 add.l d1,d1 swap d1 andi.w #$3F,d1 neg.w d1 addi.w #$100,d1 move.w d1,$A(a0) bra.w DisplaySprite ; =========================================================================== ; --------------------------------------------------------------------------- ; Sprite mappings - metal girders in foreground (SLZ) ; --------------------------------------------------------------------------- Map_obj5C: include "_mapsobj5C.asm" Map_obj5Cghz: include "_mapsghztotem.asm" even Nem_OBJ5c: incbin "artnemghztotem.bin" ; large totem pole in GHZ even ...Is the code just incomplete or is it that nothing is leading to the projection of the art its'self?
Edited by Mike B Berry, 23 August 2012 - 02:52 AM.
#1217
Posted 23 August 2012 - 03:27 AM
Obj5C_Main: ; XREF: Obj5C_Index
move.w #$7980,2(a0) ; set offest for SLZ
tst.b ($FFFFFE10).w ; is level GHZ?
bne.s Obj5C_NotGHZ ; if not, branch
move.w #$8555,2(a0) ; set offset for GHZ
Obj5C_NotGHZ:
addq.b #2,$24(a0)
move.l #Map_obj5C,4(a0)
move.w #$83CC,2(a0)
move.b #$10,$19(a0)
If it's ghz it's going through the not ghz code too, you want
Obj5C_Main: ; XREF: Obj5C_Index
move.w #$7980,2(a0) ; set offest for SLZ
tst.b ($FFFFFE10).w ; is level GHZ?
bne.s Obj5C_NotGHZ ; if not, branch
move.w #$8555,2(a0) ; set offset for GHZ
addq.b #2,$24(a0)
move.w #$83CC,2(a0)
move.b #$10,$19(a0)
bra.s Obj5C_Display
Obj5C_NotGHZ:
addq.b #2,$24(a0)
move.l #Map_obj5C,4(a0)
or something
#1218
Posted 23 August 2012 - 03:49 AM
Edited by Mike B Berry, 23 August 2012 - 03:58 AM.
#1219
Posted 23 August 2012 - 05:19 AM
#1220
Posted 23 August 2012 - 06:14 AM
#1221
Posted 07 September 2012 - 06:02 AM
Where can I find a clearly visible rendition of the full 32 bit palette entry point list?
Edited by Mike B Berry, 07 September 2012 - 06:03 AM.
#1222
Posted 07 September 2012 - 08:39 PM
Are you talking about a pointer tableI suppose this would count either as a double post or bump, and sorry if it is; but I might need this for future purposes.
Where can I find a clearly visible rendition of the full 32 bit palette entry point list?
If so it looks like this
pointers: dc.l data1 dc.l data2 ;and so on
#1223
Posted 07 September 2012 - 11:21 PM
Edited by Mike B Berry, 07 September 2012 - 11:23 PM.
#1224
Posted 08 September 2012 - 02:32 PM
You're doing it again, leaving us out on information we need to know, in order to answer your question.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users









