{"id":154,"date":"2012-09-06T23:25:25","date_gmt":"2012-09-07T05:25:25","guid":{"rendered":"http:\/\/rastersoft.net\/?p=154"},"modified":"2012-09-07T19:29:36","modified_gmt":"2012-09-08T01:29:36","slug":"sunplus-8000-worm-warrior-release-2","status":"publish","type":"post","link":"https:\/\/rastersoft.net\/?p=154","title":{"rendered":"Sunplus 8000 Worm Warrior Release 2"},"content":{"rendered":"<p>I changed to a 16 bit blitter which fixed the non-transparent issues. Sound effects are also implemented, but only one can be played at a time and starting a new sound effects stops the last one. Music is not implemented, as midi is the only supported music format. There also is no documented way of creating a sound buffer that can notify the game when more sound data is needed.<\/p>\n<p>The new version can be downloaded from the same location:<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/rastersoft.net\/wp-content\/uploads\/2012\/09\/WormSPMP8000.rar\">Sunplus 8000 Worm Warrior<\/a><\/p>\n<p style=\"text-align: left;\">Thanks to <a title=\"AleMaxx\" href=\"http:\/\/alemaxx.al.funpic.de\/spmp8000\/sp8hc.html\" target=\"_blank\">AleMaxx<\/a>\u00a0and <a title=\"Triple Oxygen\" href=\"https:\/\/github.com\/tripleoxygen\/libspmp8k\" target=\"_blank\">Triple Oxygen<\/a>\u00a0for their code. The Sunplus port was developed using libgame and based on the keydemo sources, and Triple Oxygen&#8217;s audio demo.<\/p>\n<p style=\"text-align: left;\">I added the following to the gfx_types.h header file to create a 16 bit bitmap:<\/p>\n<pre lang=\"C\">#define IMG_TYPE_16BPP 0<\/pre>\n<p style=\"text-align: left;\">&#8230; created the bitmap using:<\/p>\n<pre lang=\"C\">uint8_t bitmapID;\r\n\r\ngfx_loadimg_t \u00a0loadImg;\r\n\r\nuint16_t pImageBuffer = new uint16_t[SCREENWIDTH *\u00a0SCREENHEIGHT];\r\n\r\nloadImg.data = pImageBuffer;\r\nloadImg.width = SCREENWIDTH;\r\nloadImg.height = SCREENHEIGHT;\r\nloadImg.img_type = IMG_TYPE_16BPP;\r\nloadImg.unk2 = 0;\r\nloadImg.pal_data = NULL;\r\nloadImg.pal_size = 0;\r\nloadImg.unk3 = 0x80;\r\n\r\ngfx_load_image(&loadImg, &bitmapID);<\/pre>\n<p>&#8230; and blitted the bitmap to the screen using:<\/p>\n<pre lang=\"C\">gfx_point2d_t pos;\r\ngfx_rect_t rect;\r\n\r\npos.x = 0;\r\npos.y = 0;\r\nrect.x = 0;\r\nrect.y = 0;\r\nrect.width = SCREENWIDTH;\r\nrect.height = SCREENHEIGHT;\r\n\r\ngfx_set_colorrop(COLOR_ROP_TRANSP);\r\ngfx_bitblt(bitmapID, &rect, &pos);\r\n\r\ngfx_flush();\r\ngfx_paint();<\/pre>\n<p>The created 16 bit buffer is in RGB565 format, where:<\/p>\n<p>Full red is 0xF800<\/p>\n<p>Full green is 0x07E0<\/p>\n<p>Full blue is 0x001F<\/p>\n<p>And white is 0xFFFF<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I changed to a 16 bit blitter which fixed the non-transparent issues. Sound effects are also implemented, but only one can be played at a time and starting a new sound effects stops the last one. Music is not implemented, as midi is the only supported music format. There also is no documented way of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8,12],"tags":[],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-releases","category-sunplus"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2GnBK-2u","_links":{"self":[{"href":"https:\/\/rastersoft.net\/index.php?rest_route=\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rastersoft.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rastersoft.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rastersoft.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rastersoft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=154"}],"version-history":[{"count":10,"href":"https:\/\/rastersoft.net\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":158,"href":"https:\/\/rastersoft.net\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions\/158"}],"wp:attachment":[{"href":"https:\/\/rastersoft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rastersoft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rastersoft.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}