Forum Index | FAQ | New User | Login | Search

Make a New PostPrevious ThreadView All Threads*Show in Flat Mode*

SubjectRe: Flip8 v0.03 - Flash Chip8 emu Reply to this message
Posted byJonemaan
Posted on01/27/05 10:13 AM

> 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)

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 */

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 */


> 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.

Entire Thread
Subject  Posted byPosted On
*Flip8 v0.03 - Flash Chip8 emu  newsdee01/26/05 00:06 AM
.*Re: Flip8 v0.03 - Flash Chip8 emu  Jonemaan01/26/05 08:46 PM
..*Re: Flip8 v0.03 - Flash Chip8 emu  newsdee01/27/05 07:45 AM
....Re: Flip8 v0.03 - Flash Chip8 emu  Jonemaan01/27/05 10:13 AM
....*Re: Flip8 v0.03 - Flash Chip8 emu  Jonemaan01/27/05 10:18 AM
.....*Re: Flip8 v0.03 - Flash Chip8 emu  Jonemaan01/27/05 10:21 AM
......*--moving to emu programming--  newsdee01/28/05 00:16 AM