rm spaceg.zip
rm example01.asm
rm spaceg/*
rmdir spaceg
mkdir spaceg



dd bs=$((0x20000)) count=1 if=/dev/zero of=dummy128k.bin





#- zxb.py example01.zxb --asm --org=$((0x0000))
#- zxb.py example01.zxb --org=$((0x0000))
zxb.py library/smsboot.bas --org=1024
dd ibs=1 count=$((0x0069)) skip=$((0x0000)) if=smsboot.bin of=smsboot2.bin
zxb.py example01.zxb --heap-size=128 --asm --org=$((0x0069))
zxb.py example01.zxb --heap-size=128 --org=$((0x0069))
cat example01.bin >> smsboot2.bin
rm example01.bin
mv smsboot2.bin example01.bin
cat dummy128k.bin >> example01.bin
dd ibs=1 count=$((0x400)) skip=$((0x0000)) if=example01.bin of=spaceg/1.9a
dd ibs=1 count=$((0x400)) skip=$((0x0400)) if=example01.bin of=spaceg/2.8a
dd ibs=1 count=$((0x400)) skip=$((0x0800)) if=example01.bin of=spaceg/3.9b
dd ibs=1 count=$((0x400)) skip=$((0x0c00)) if=example01.bin of=spaceg/4.8b
dd ibs=1 count=$((0x400)) skip=$((0x1000)) if=example01.bin of=spaceg/5.9c
dd ibs=1 count=$((0x400)) skip=$((0x1400)) if=example01.bin of=spaceg/6.8c
dd ibs=1 count=$((0x400)) skip=$((0x1800)) if=example01.bin of=spaceg/7.9d
dd ibs=1 count=$((0x400)) skip=$((0x1c00)) if=example01.bin of=spaceg/8.8d
dd ibs=1 count=$((0x400)) skip=$((0x3000)) if=example01.bin of=spaceg/13.9g
dd ibs=1 count=$((0x400)) skip=$((0x3400)) if=example01.bin of=spaceg/14.8g
dd ibs=1 count=$((0x400)) skip=$((0x3800)) if=example01.bin of=spaceg/15.9h
dd ibs=1 count=$((0x400)) skip=$((0x3c00)) if=example01.bin of=spaceg/16.8h



#- ROM_START( spaceg )
#- ROM_REGION( 0x10000, "maincpu", 0 )
#- ROM_LOAD( "1.9a",  0x0000, 0x0400, CRC(d6f80b0e) SHA1(503e832c065bb302ec60ed239c4d99a605cb931a) )
#- ROM_LOAD( "2.8a",  0x0400, 0x0400, CRC(708b8eec) SHA1(70f9b1506a653985d9d3eacba220f0a4eb241318) )
#- ROM_LOAD( "3.9b",  0x0800, 0x0400, CRC(7f0b5cb4) SHA1(97a7125d046e7191b5d3be8f203d1bbb6f988209) )
#- ROM_LOAD( "4.8b",  0x0c00, 0x0400, CRC(8b40a154) SHA1(f42bdd8e94090fc5eae58e833b8443300d3ce991) )
#- ROM_LOAD( "5.9c",  0x1000, 0x0400, CRC(5279241c) SHA1(7278b6b037322b2f75311ed247f2de3c4816681b) )
#- ROM_LOAD( "6.8c",  0x1400, 0x0400, CRC(9b84fe3a) SHA1(7ebeca10ee11d22f4af06be9f381f46864464ec2) )
#- ROM_LOAD( "7.9d",  0x1800, 0x0400, CRC(95279b25) SHA1(367d129d4dd2cfea2a2f4703f41f24cc49453715) )
#- ROM_LOAD( "8.8d",  0x1c00, 0x0400, CRC(6a824383) SHA1(7c43f2c7d1f070d93f6a8b5b4f7f97f3578bd91d) )
#- ROM_LOAD( "13.9g", 0x3000, 0x0400, CRC(dccc386f) SHA1(5d493da3e7b8269314dd54f0b3ba9f71829a14da) )
#- ROM_LOAD( "14.8g", 0x3400, 0x0400, CRC(dc9a10c2) SHA1(8fb2316d6e8aeef558d0da5029e2932abf47a6b4) )
#- ROM_LOAD( "15.9h", 0x3800, 0x0400, CRC(55e2950d) SHA1(2241c3620c9a6df8b8bd234ccee9af5d3d19a5d4) )
#- ROM_LOAD( "16.8h", 0x3c00, 0x0400, CRC(567259c4) SHA1(b2c3f7aaceabea075af6a43b89fb7331732278c8) )



















#zxb.py library/charmap01.zxi --org=$((0x0000))
#cat dummy128k.bin >> charmap01.bin
#dd ibs=1 count=$((0x10000)) skip=$((0x0010)) if=charmap01.bin of=spaceg/ic08.04
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic18.14
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic09.05
#dd bs=$((0x10000)) count=1 if=/dev/urandom of=spaceg/ic19.15
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic12.08
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic20.16
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic13.09
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic21.17
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic14.10
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic22.18
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic15.11
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic23.19
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic16.12
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic10.06
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic17.13
#dd bs=$((0x10000)) count=1 if=/dev/zero of=spaceg/ic11.07
#rm charmap01.bin










#zxb.py library/palette01.bas --org=$((0x0000))
#cat dummy128k.bin >> palette01.bin
#dd ibs=1 count=$((0x0020)) skip=$((0x0010)) if=palette01.bin of=spaceg/spaceg.3j
#rm palette01.bin
#dd bs=$((0x0020)) count=1 if=/dev/urandom of=spaceg/spaceg.3j


#- clut01.zxi might need to be different files
#zxb.py library/clut01.zxi --org=$((0x0000))
#cat dummy128k.bin >> clut01.bin
#dd ibs=1 count=$((0x0200)) skip=$((0x0010)) if=clut01.bin of=clut01b.bin
#rm clut01.bin
#dd ibs=1 count=$((0x0100)) skip=$((0x0000)) if=clut01b.bin of=spaceg/spaceg.5h
#dd ibs=1 count=$((0x0100)) skip=$((0x0100)) if=clut01b.bin of=spaceg/spaceg.11j
#rm clut01b.bin

#????
#dd bs=256 count=1 if=/dev/zero of=spaceg/82s126.1m
#dd bs=256 count=1 if=/dev/zero of=spaceg/82s126.3m



#- ROM_REGION( 0x40000, "samples", 0 ) /* samples */
#- ROM_LOAD( "ic02.02",      0x00000, 0x10000, CRC(92f0093d) SHA1(530b924aa991283045577d03524dfc7eacf1be49) )
#- ROM_LOAD( "ic03.03",      0x10000, 0x10000, CRC(116a049c) SHA1(656c0d1d7f945c5f5637892721a58421b682fd01) )
#- ROM_LOAD( "ic04.04",      0x20000, 0x10000, CRC(6840692b) SHA1(f6f7b063ecf7206e172843515be38376f8845b42) )
#- ROM_LOAD( "ic05.05",      0x30000, 0x10000, CRC(92ffe22a) SHA1(19dcaf6e25bb7498d4ab19fa0a63f3326b9bff8f) )










#proms
dd bs=$((0x20)) count=1 if=/dev/urandom of=spaceg/prom1
dd bs=$((0x20)) count=1 if=/dev/urandom of=spaceg/prom1

#- ROM_REGION( 0x40, "proms", 0 )
#- ROM_LOAD( "prom1", 0x0000, 0x0020, NO_DUMP )
#- ROM_LOAD( "prom2", 0x0020, 0x0020, NO_DUMP )










rm smsboot.bin dummy128k.bin example01.bin

zip -r spaceg spaceg
rm spaceg/*
rmdir spaceg

mame -w -video soft -resolution0 512x512 -rp ./ spaceg














