> Well, since you're offering, could you give me some insight on how to handle the > BCD storage of numbers? :-)
BCD=binary coded decimal. It is used in many games to show a score larger than 9 on screen. eg. if the value is 123, store it into memory like this (pseudo code):
ram[i+0]=1 (um, don't mind the +0, it's there so wwwthreads won't intepret it as italic) ram[i+1]=2 ram[i+3]=3
use base 10 modulo and integer divisions to get a specific decimal digit out of the value. if you don't understand, re-ask, and i'll paste my source of that.
> I'd also be curious to see your schip8 scrolling functions. I've made a couple > and they're really slow (although that's Flash's fault mostly, incapable of > taking 128x64).
because chip8 only uses 2 colours, i'm using a 1-bit bitmap here, so every bitmap byte is 8 pixels wide.
OPV4=opcode masked with 0xf VRAM_SIZE=0x400 (1KB)
scroll left is the same as right, except for reverse shifts/x count.
static void scrld(void) { /* 0x0?cN - scroll_down */ /* scroll N lines down, no wrap (s-chip function) */
memmove(vram 16*OPV4,vram,VRAM_SIZE-16*OPV4); /* move yres-N rows down */ memset(vram,0,16*OPV4); /* empty N rows at the top */ update=SCREEN_UPDATE; }
static void scrlr(void) { /* 0x0?fb - scroll_right */ /* scroll 4 pixels right, no wrap (s-chip function) */ int y; /* y count */ int x; /* x count */ for (y=0;y { for (x=15;x>0;x--) { vram[x+y]=(vram[x+y]>>4)|(vram[x-1+y]<<4); } vram[y]<<=4; /* last 4 bits */ }
update=SCREEN_UPDATE; }
> Finally do you know if the "save/load to/from Hp48 flags" command is used? Is it > needed for game logic or is it just to keep high scores and stuff? (this is to > know if I have to store the info as a cookie or just keep it in memory).
No clue. I'm just keeping it in temp. memory.
Thanks for the ROMs! .. umm, RAMs ;p nice chip8 emu development discussion there i'm 'hap' on that board.
|