Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
about to start something to pacman-namco (arcade machine)
#1
I were starting to create files with random or hex-edited content similar to pacman.zip (mame), and also using the information from - <!-- m --><a class="postlink" href="http://www.ascotti.org/programming/pie/hardware.htm">http://www.ascotti.org/programming/pie/hardware.htm</a><!-- m --> - and i'm starting to know how this machine works (but i didn't start to code anything yet on zxbasic-compiler for that)

(overally, pacman.6e , *.6f, *.6h and *.6j are 4 4kb files for the program (a 16kb limit splitted into 4), pacman.5e is the character set (4kb), pacman.5f is the sprite set (4kb), 82s123.7f the palette (32 bytes - it's from a colourspace similar used on msx2-screen8 or UzeBox ), and 82s126.4a the clut (how the palette is arranged in groups of 4 colours - 256 bytes) - and i think 82s126.1m and *.3m are related to sound (256 bytes each) )

This machine seems to be not that plenty of ram memory (it's an arcade machine from 1980), around 4kb at most, which 2k is for displaying patterns (and the bitmaps (background patterns (8x8 characters), sprites (16x16) ) are stored in 8kb of rom somewhere else)

So, it seems that almost 2k of free ram makes it difficult to deal with the stack point, isn't it? and anyway, must we set that into a specific area, like 0x07EF, before the code starts? how much ram much we count with like on a regular use of functions and routines, and which care must we have?
Reply
#2
The whole first experiment is in the attachment here in this message.
For some reason, i may be doing something wrong in this example01.zxb

Code:
'- i really don't know if there is some stack issue, and if we can solve this way
asm
  ld sp,$07EF
  end asm

dim i as uinteger at $4800
dim x as uinteger at $4802

'- this should put some characters on the pattern display area
for i=0 to 255
  poke $4040+i,i
  poke $4440+i,i
  next

'- this should move a sprite on the screen
loop01:
for i=0 to 63
  for x=0 to 255
    poke $4FF0,i*4 '- shape sprite 0
    poke $4FF1,i   '- clut? sprite 0
    poke $5060,x   '- x sprite 0
    poke $5061,128 '- y sprite 0
    '- waitvbl
    asm
      halt
      end asm
    next:next
goto loop01

the result of the character map, sprite sheet, clut and palette seems good enough (you can see when pressing 'f4' on mame (at least on old version of mame) - and browse them with cursor keys ), but the code itself seems to be not running at all...


Attached Files
.zip   example01_pacman_mame_zxbasic.zip (Size: 31.42 KB / Downloads: 665)
Reply
#3
1.u crazy

2.did you run the compiler with the right option to reduce the stack?

-H HEAP_SIZE, --heap-size=HEAP_SIZE
Sets heap size in bytes (default 4768 bytes)

e.h. -H 100
Reply
#4
slenkar Wrote:1.u crazy

thank you! \o/

Quote:2.did you run the compiler with the right option to reduce the stack?

-H HEAP_SIZE, --heap-size=HEAP_SIZE
Sets heap size in bytes (default 4768 bytes)

e.h. -H 100

nope... and i didn't know what that was at all - btw, i tried now with both '-H 100' and '--heap-size=100' - weird is the resulting asm file (for trying to see what is happening) says the heap size is 0 then?

and it is still not working anyway ( new attachment available here as well, for testing and seeing what may be happening)


Attached Files
.zip   example01_pacman_mame_zxbasic_02.zip (Size: 31.44 KB / Downloads: 658)
Reply
#5
updated - for-next loops seems to work fine, but i'm struggling on interrupts (halt for vblank delays), and delay from bc register decrement is not working as expected (interrupt issue as well?)


Attached Files
.zip   example04a_startingtowork.zip (Size: 104.12 KB / Downloads: 613)
Reply
#6
updated again, Jim Bagley helped me on recalling the Watchdogs issue - i still struggle on figuring out what it really does, but it is working fine now! thanks Jim! Smile (anyway, it's a mystery for me not needing halt for vblank delay there - how weird machine is this! Big Grin )


Attached Files
.zip   example04c_startingtowork.zip (Size: 109.42 KB / Downloads: 667)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)