Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
  You are not logged in - nap
Hedge of Disgrace - Only Sprites Compo Edition   [2020]

Hedge of Disgrace - Only Sprites Compo Edition Released by :
Genesis Project [web]

Release Date :
26 November 2020

Type :
C64 One-File Demo

AKA :
Duff Design

Released At :
Only Sprites Compo

User rating:*********_  8.8/10 (16 votes)   See votestatistics

Credits :
Code .... Raistlin of C64GFX Staff, Genesis Project
Music .... Dane of Booze Design
Graphics .... Raistlin of C64GFX Staff, Genesis Project
Idea .... hedning of Genesis Project, Propaganda Magazine Staff
  Pad of Genesis Project


SIDs used in this release :
Disgrace(/MUSICIANS/M/Mitch_and_Dane/Dane/Disgrace.sid)

Download :

Look for downloads on external sites:
 Pokefinder.org


Production Info
Submitted by Raistlin on 26 November 2020
Mostly coded in C++ .. with a little bit of 6510 "support".

Using my support libraries, it's probably ~500 lines of C++ in total and another 500 lines of ASM. Additionally, the C++ generates another memory-wasting 3905 lines of ASM ;-)

void HEDGE_OutputRasterASM(LPTSTR OutRasterASM)
{
CodeGen code(OutRasterASM);

code.OutputFunctionLine(fmt::format("DoScreen"));
code.OutputBlankLine();

static const int SpriteStartY = 54;
int SpriteYPos = SpriteStartY;
code.OutputCodeLine(LDA_IMM, fmt::format("#${:02x}", SpriteYPos));
for (int i = 0; i < 8; i++)
{
code.OutputCodeLine(STA_ABS, fmt::format("VIC_Sprite{:d}Y", i));
}

int SetSprite0Col = -1;
int SetSprite1Col = -1;
int SetSprite2Col = -1;

bool bUpdateSpriteY = false;
for (int Line = 0; Line < 198; Line++)
{
int RasterLine = Line + 46;

int NumCyclesToUse = 63;
if (RasterLine >= SpriteStartY)
NumCyclesToUse -= 17;

NumCyclesToUse -= code.OutputCodeLine(DEC_ABS, fmt::format("VIC_D016"));
NumCyclesToUse -= code.OutputCodeLine(STY_ABS, fmt::format("VIC_D016"));

if (RasterLine == SpriteStartY)
{
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#SpriteTextColour"));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("VIC_Sprite3Colour"));
}

if (RasterLine == (SpriteStartY + 42))
{
SetSprite1Col = 8;
SetSprite2Col = 9;
}
if (RasterLine == (SpriteStartY + 74))
{
SetSprite1Col = 12;
}
if (RasterLine == (SpriteStartY + 144))
{
SetSprite0Col = 14;
SetSprite1Col = 6;
}

if (RasterLine >= (SpriteStartY + 21))
{
int SubLine = RasterLine - (SpriteStartY + 21);
if ((SubLine % 21) == 0)
{
int iRow = SubLine / 21 + 1;

code.OutputFunctionLine(fmt::format("ScrollerSpriteX_{:d}", iRow));
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#$ab"));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("VIC_Sprite3X"));

code.OutputFunctionLine(fmt::format("ScrollerSpriteXMSB_{:d}", iRow));
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#$ab"));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("VIC_SpriteXMSB"));

code.OutputFunctionLine(fmt::format("ScrollerSpriteVal_{:d}", iRow));
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#$ab"));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("SpriteVals + 3"));
}
}

if ((RasterLine == SpriteYPos - 1) && (SpriteYPos > SpriteStartY))
{
static int iSpriteRow = 1;
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#Sprites0StartIndex + ({:02d} * 4) + 1", iSpriteRow));
NumCyclesToUse -= code.OutputCodeLine(SAX_ABS, fmt::format("SpriteVals + 4"));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("SpriteVals + 5"));
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#Sprites0StartIndex + ({:02d} * 4) + 3", iSpriteRow));
NumCyclesToUse -= code.OutputCodeLine(SAX_ABS, fmt::format("SpriteVals + 6"));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("SpriteVals + 7"));
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#Sprites1StartIndex + ({:02d} * 4) + 1", iSpriteRow));
NumCyclesToUse -= code.OutputCodeLine(SAX_ABS, fmt::format("SpriteVals + 0"));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("SpriteVals + 1"));
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#Sprites1StartIndex + ({:02d} * 4) + 3", iSpriteRow));
NumCyclesToUse -= code.OutputCodeLine(SAX_ABS, fmt::format("SpriteVals + 2"));
iSpriteRow++;
}

if (RasterLine > SpriteYPos + 4)
{
bUpdateSpriteY = true;
}

if ((SetSprite0Col != -1) && EnoughFreeCycles(NumCyclesToUse, 6))
{
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#${:02x}", SetSprite0Col));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("VIC_Sprite0Colour"));
SetSprite0Col = -1;
}
if ((SetSprite1Col != -1) && EnoughFreeCycles(NumCyclesToUse, 6))
{
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#${:02x}", SetSprite1Col));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("VIC_Sprite1Colour"));
SetSprite1Col = -1;
}
if ((SetSprite2Col != -1) && EnoughFreeCycles(NumCyclesToUse, 6))
{
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#${:02x}", SetSprite2Col));
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("VIC_Sprite2Colour"));
SetSprite2Col = -1;
}

if ((bUpdateSpriteY) && EnoughFreeCycles(NumCyclesToUse, 2 + 4 * 8))
{
SpriteYPos += 21;
if (SpriteYPos < (250 - 21))
{
NumCyclesToUse -= code.OutputCodeLine(LDA_IMM, fmt::format("#${:02x}", SpriteYPos));
for (int i = 0; i < 8; i++)
{
NumCyclesToUse -= code.OutputCodeLine(STA_ABS, fmt::format("VIC_Sprite{:d}Y", i));
}
}
bUpdateSpriteY = false;
}

code.WasteCycles(NumCyclesToUse);
}

code.OutputCodeLine(RTS);
}
Search CSDb
Advanced
Navigate
Prev - Random - Next
Detailed Info
· Summaries (1)
· User Comments (22)
· Production Notes (1)
Fun Stuff
· Goofs
· Hidden Parts
· Trivia
Forum
· Discuss this release
Support CSDb
Help keep CSDb running:



Funding status:




About this site:
CSDb (Commodore 64 Scene Database) is a website which goal is to gather as much information and material about the scene around the commodore 64 computer - the worlds most popular home computer throughout time. Here you can find almost anything which was ever made for the commodore 64, and more is being added every day. As this website is scene related, you can mostly find demos, music and graphics made by the people who made the scene (the sceners), but you can also find a lot of the old classic games here. Try out the search box in the top right corner, or check out the CSDb main page for the latest additions.
Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.103 sec.