Jump to content
IGNORED

Sizecoding reaches Jaggy


42bs

Recommended Posts

Can't get the GPU one to run from .cof or .j64 on a Skunkboard. Tried 50Hz and 60Hz. The .j64 works fine on a Gamedrive (I.e., a regular full BIOS boot), but the .cof does not (Gamedrive just hangs on menu screen, presumably after loading the tiny file and trying  to run it).

 

How are you testing these? BJL?

Link to comment
Share on other sites

1 minute ago, cubanismo said:

Can't get the GPU one to run from .cof or .j64 on a Skunkboard. Tried 50Hz and 60Hz. The .j64 works fine on a Gamedrive (I.e., a regular full BIOS boot), but the .cof does not (Gamedrive just hangs on menu screen, presumably after loading the tiny file and trying  to run it).

 

How are you testing these? BJL?

This code relies on the BIOS setting up the video, therefore it does not run from SKUNK and likely not BJL.

Updated it, now it runs fullspeed in internal RAM.

Link to comment
Share on other sites

3 minutes ago, SlidellMan said:

Wow, that is an excellent use of the Jaguar's particle capabilities.

I am not sure what you mean, but this is pure old-school frame buffer manipulation:
 

for all x,y do
  plot x,y, MIX(color(x+1,y+1)+color(x,y+1))

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Prototype in Processing:

int [][] frame = new int[103][160];
int [] r = new int[256];
int [] g = new int[256];
int [] b = new int[256];


void plot(int x, int y, int col)
{
  int _r,_g,_b; 
  _r = r[col];
  _g = g[col];
  _b = b[col];
  _r*=6;
  _g*=6;
  _b*=6;
  fill(_r,_g,_b);
  stroke(_r,_g,_b);
  rect(x*4,y*4,4,4);
}


void setup() {
  size(640,408);
  noSmooth();
  rectMode(CORNER);
  surface.setLocation(1800,100);        
  frameRate(60);

  for(int y = 0; y < 102; ++y){
    for(int x = 0; x < 160; ++x){
      frame[y][x] = 0;
    }
  }
  int _r = 0;
  int _g = 0;
  int _b = 0;
  for(int col = 0; col < 256; ++col){
    r[col] = _r;
    g[col] = _g;
    b[col] = _b;
    if ( col < 16 ) {
      _b = col;
    } else {
      _b = 0;
    }
    if ( (col & 32) == 0 ){
      ++_r;
    } else {
      ++_g;
    } 
  }
}

void draw()
{
  int x,y,s;
  s = 0;
  for(y = 0; y < 102; ++y){
    for(x = 0; x < 160; ++x) {
      int rp;
      int lp;
      
      if ( x < 159 )
        rp = frame[y+1][x+1];
      else
        rp = frame[y+1][0];
      lp = frame[y+1][x];  
       
      s = (rp + lp) & 255;
      s = (s + lp) & 255;
      s ^= lp;
      s = (s+frame[y][x]) & 255;
      s ^= frame[y][x];
      s /= 4;
      frame[y][x] = s & 255;
      plot(x,y,s);
    }
  }
  for(x = 0; x < 160; x+=2){
    s = s+int(random(65536));
    frame[102][x] = s & 255;
    frame[102][x+1] = (s >> 8)& 255;
  }
}

 

Link to comment
Share on other sites

1 hour ago, 42bs said:

Nicely done!

 

In line 56 with a bit of re-jigging you should be able to move the 7ec8 part of the constant right before "brush" and load both high and low parts using a move.l (a1)+,d7. Then move that "move.w (a1)+,d7" below the inner loop so you can consume the next part of the seed then. This should save you a whopping 2 bytes :). More info about this madness (and more!) here http://beyondbrown.mooo.com/post/mona/

  • Thanks 1
Link to comment
Share on other sites

1 minute ago, ggn said:

Nicely done!

 

In line 56 with a bit of re-jigging you should be able to move the 7ec8 part of the constant right before "brush" and load both high and low parts using a move.l (a1)+,d7. Then move that "move.w (a1)+,d7" below the inner loop so you can consume the next part of the seed then. This should save you a whopping 2 bytes :). More info about this madness (and more!) here http://beyondbrown.mooo.com/post/mona/

Cool! Thanks. But I fear, the 256byte goal is still unreachable.

 

Link to comment
Share on other sites

6 minutes ago, ggn said:

Nicely done!

 

In line 56 with a bit of re-jigging you should be able to move the 7ec8 part of the constant right before "brush" and load both high and low parts using a move.l (a1)+,d7. Then move that "move.w (a1)+,d7" below the inner loop so you can consume the next part of the seed then. This should save you a whopping 2 bytes :). More info about this madness (and more!) here http://beyondbrown.mooo.com/post/mona/

Not sure, as I do

move.b (a1),d1

for the Y. But I need to think ...

Link to comment
Share on other sites

Yes, the two implementations have structured the code a bit differently. So it's quite possible that it's not feasible in your case - after all I just took a quick look. And sure, SMC is completely out of the question, I did notice that :).

 

I see from the .rom file that the binary size is 304 bytes. So who knows, maybe 256 is reachable with lots of rewrites and exploits, maybe not! But at least my -2 bytes is a start ;)

Link to comment
Share on other sites

1 hour ago, ggn said:

Yes, the two implementations have structured the code a bit differently. So it's quite possible that it's not feasible in your case - after all I just took a quick look. And sure, SMC is completely out of the question, I did notice that :).

 

I see from the .rom file that the binary size is 304 bytes. So who knows, maybe 256 is reachable with lots of rewrites and exploits, maybe not! But at least my -2 bytes is a start ;)

Actually it is 314 bytes. But I am already doing a lot of dirty stuff. Tried the trick, but adding the "lsr.w #8" will eat up the gain.

I have to try to get rid of the VBL interrupt and rather check the HBL counter to for the OBL reload.

*hmp* rmac/rln seem to align the output to 16bytes :(

Ok, found it: -rw => Word alignment.

Edited by 42bs
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...